Merge pull request #35935 from s-aga-r/FIX-35898
feat: allow the partial return of components against SCO
diff --git a/erpnext/accounts/report/voucher_wise_balance/__init__.py b/erpnext/accounts/report/voucher_wise_balance/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/report/voucher_wise_balance/__init__.py
diff --git a/erpnext/accounts/report/voucher_wise_balance/voucher_wise_balance.js b/erpnext/accounts/report/voucher_wise_balance/voucher_wise_balance.js
new file mode 100644
index 0000000..0c148f8
--- /dev/null
+++ b/erpnext/accounts/report/voucher_wise_balance/voucher_wise_balance.js
@@ -0,0 +1,28 @@
+// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+/* eslint-disable */
+
+frappe.query_reports["Voucher-wise Balance"] = {
+ "filters": [
+ {
+ "fieldname": "company",
+ "label": __("Company"),
+ "fieldtype": "Link",
+ "options": "Company"
+ },
+ {
+ "fieldname":"from_date",
+ "label": __("From Date"),
+ "fieldtype": "Date",
+ "default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+ "width": "60px"
+ },
+ {
+ "fieldname":"to_date",
+ "label": __("To Date"),
+ "fieldtype": "Date",
+ "default": frappe.datetime.get_today(),
+ "width": "60px"
+ },
+ ]
+};
diff --git a/erpnext/accounts/report/voucher_wise_balance/voucher_wise_balance.json b/erpnext/accounts/report/voucher_wise_balance/voucher_wise_balance.json
new file mode 100644
index 0000000..434e5a3
--- /dev/null
+++ b/erpnext/accounts/report/voucher_wise_balance/voucher_wise_balance.json
@@ -0,0 +1,33 @@
+{
+ "add_total_row": 0,
+ "columns": [],
+ "creation": "2023-06-27 16:40:15.109554",
+ "disabled": 0,
+ "docstatus": 0,
+ "doctype": "Report",
+ "filters": [],
+ "idx": 0,
+ "is_standard": "Yes",
+ "json": "{}",
+ "letter_head": "LetterHead",
+ "modified": "2023-06-27 16:40:32.493725",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Voucher-wise Balance",
+ "owner": "Administrator",
+ "prepared_report": 0,
+ "ref_doctype": "GL Entry",
+ "report_name": "Voucher-wise Balance",
+ "report_type": "Script Report",
+ "roles": [
+ {
+ "role": "Accounts User"
+ },
+ {
+ "role": "Accounts Manager"
+ },
+ {
+ "role": "Auditor"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/voucher_wise_balance/voucher_wise_balance.py b/erpnext/accounts/report/voucher_wise_balance/voucher_wise_balance.py
new file mode 100644
index 0000000..5ab3611
--- /dev/null
+++ b/erpnext/accounts/report/voucher_wise_balance/voucher_wise_balance.py
@@ -0,0 +1,66 @@
+# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+import frappe
+from frappe import _
+from frappe.query_builder.functions import Sum
+
+
+def execute(filters=None):
+ columns = get_columns()
+ data = get_data(filters)
+ return columns, data
+
+
+def get_columns():
+ return [
+ {"label": _("Voucher Type"), "fieldname": "voucher_type", "width": 300},
+ {
+ "label": _("Voucher No"),
+ "fieldname": "voucher_no",
+ "fieldtype": "Dynamic Link",
+ "options": "voucher_type",
+ "width": 300,
+ },
+ {
+ "fieldname": "debit",
+ "label": _("Debit"),
+ "fieldtype": "Currency",
+ "options": "currency",
+ "width": 300,
+ },
+ {
+ "fieldname": "credit",
+ "label": _("Credit"),
+ "fieldtype": "Currency",
+ "options": "currency",
+ "width": 300,
+ },
+ ]
+
+
+def get_data(filters):
+ gle = frappe.qb.DocType("GL Entry")
+ query = (
+ frappe.qb.from_(gle)
+ .select(
+ gle.voucher_type, gle.voucher_no, Sum(gle.debit).as_("debit"), Sum(gle.credit).as_("credit")
+ )
+ .groupby(gle.voucher_no)
+ )
+ query = apply_filters(query, filters, gle)
+ gl_entries = query.run(as_dict=True)
+ unmatched = [entry for entry in gl_entries if entry.debit != entry.credit]
+ return unmatched
+
+
+def apply_filters(query, filters, gle):
+ if filters.get("company"):
+ query = query.where(gle.company == filters.company)
+ if filters.get("voucher_type"):
+ query = query.where(gle.voucher_type == filters.voucher_type)
+ if filters.get("from_date"):
+ query = query.where(gle.posting_date >= filters.from_date)
+ if filters.get("to_date"):
+ query = query.where(gle.posting_date <= filters.to_date)
+ return query
diff --git a/erpnext/translations/nl.csv b/erpnext/translations/nl.csv
index f2158b5..a13382c 100644
--- a/erpnext/translations/nl.csv
+++ b/erpnext/translations/nl.csv
@@ -875,7 +875,7 @@
Donor Type information.,Donor Type informatie.,
Donor information.,Donorinformatie.,
Download JSON,JSON downloaden,
-Draft,Droogte,
+Draft,Concept,
Drop Ship,Drop Ship,
Drug,drug,
Due / Reference Date cannot be after {0},Verval- / Referentiedatum kan niet na {0} zijn,
@@ -4279,7 +4279,7 @@
Row #{0}: Item {1} is not a Serialized/Batched Item. It cannot have a Serial No/Batch No against it.,Rij # {0}: artikel {1} is geen geserialiseerd / batch artikel. Het kan geen serienummer / batchnummer hebben.,
Please set {0},Stel {0} in,
Please set {0},Stel {0} in,supplier
-Draft,Droogte,"docstatus,=,0"
+Draft,Concept,"docstatus,=,0"
Cancelled,Geannuleerd,"docstatus,=,2"
Please setup Instructor Naming System in Education > Education Settings,Stel het instructeursysteem in onder onderwijs> onderwijsinstellingen,
Please set Naming Series for {0} via Setup > Settings > Naming Series,Stel Naming Series in op {0} via Instellingen> Instellingen> Naming Series,
@@ -8189,7 +8189,7 @@
Prevdoc DocType,Prevdoc DocType,
Parent Detail docname,Bovenliggende Detail docname,
"Generate packing slips for packages to be delivered. Used to notify package number, package contents and its weight.","Genereren van pakbonnen voor pakketten te leveren. Gebruikt voor pakket nummer, inhoud van de verpakking en het gewicht te melden.",
-Indicates that the package is a part of this delivery (Only Draft),Geeft aan dat het pakket een onderdeel is van deze levering (alleen ontwerp),
+Indicates that the package is a part of this delivery (Only Draft),Geeft aan dat het pakket een onderdeel is van deze levering (alleen concept),
MAT-PAC-.YYYY.-,MAT-PAC-.YYYY.-,
From Package No.,Van Pakket No,
Identification of the package for the delivery (for print),Identificatie van het pakket voor de levering (voor afdrukken),