Skip to content

Commit

Permalink
Merge pull request #38037 from frappe/mergify/bp/version-14/pr-38004
Browse files Browse the repository at this point in the history
fix: handling of exchange rate journals in AR/AP (backport #38004)
  • Loading branch information
ruthra-kumar authored Nov 10, 2023
2 parents 8969502 + 010ccf8 commit cb65522
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,18 @@ frappe.query_reports["Accounts Receivable"] = {
"label": __("Show Remarks"),
"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) {
Expand Down
17 changes: 13 additions & 4 deletions erpnext/accounts/report/accounts_receivable/accounts_receivable.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,20 @@ def build_data(self):

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:
Expand Down

0 comments on commit cb65522

Please sign in to comment.