fix: new logic for handling revaluation journals
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
index 43ea532..b4bc887 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
@@ -180,13 +180,19 @@
"fieldname": "in_party_currency",
"label": __("In Party Currency"),
"fieldtype": "Check",
- },
- {
+ },
+ {
+ "fieldname": "for_revaluation_journals",
+ "label": __("Revaluation Journals"),
+ "fieldtype": "Check",
+ },
+ {
"fieldname": "ignore_accounts",
"label": __("Group by Voucher"),
"fieldtype": "Check",
}
+
],
"formatter": function(value, row, column, data, default_formatter) {
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
index 0540374..706d743 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
@@ -283,11 +283,20 @@
row.invoice_grand_total = row.invoiced
- if (abs(row.outstanding) > 1.0 / 10**self.currency_precision) and (
- (abs(row.outstanding_in_account_currency) > 1.0 / 10**self.currency_precision)
- or (row.voucher_no in self.err_journals)
- ):
+ must_consider = False
+ if self.filters.get("for_revaluation_journals"):
+ if (abs(row.outstanding) > 1.0 / 10**self.currency_precision) or (
+ (abs(row.outstanding_in_account_currency) > 1.0 / 10**self.currency_precision)
+ ):
+ must_consider = True
+ else:
+ if (abs(row.outstanding) > 1.0 / 10**self.currency_precision) and (
+ (abs(row.outstanding_in_account_currency) > 1.0 / 10**self.currency_precision)
+ or (row.voucher_no in self.err_journals)
+ ):
+ must_consider = True
+ if must_consider:
# non-zero oustanding, we must consider this row
if self.is_invoice(row) and self.filters.based_on_payment_terms: