From 2936988cc6953ee4e969efedf5fa2f9bbd812c7e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 17 Jul 2024 21:23:56 +0530 Subject: [PATCH 1/3] fix: Show the rows in AR/AP report where outstanding equals to 0.01 (cherry picked from commit e1dedc5402896e07c8392e0ac3160b5b98a26222) # Conflicts: # erpnext/patches.txt --- .../report/accounts_receivable/accounts_receivable.py | 8 ++++---- erpnext/patches.txt | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index be42da8423f..f17cab8d112 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -288,13 +288,13 @@ class ReceivablePayableReport: must_consider = False if self.filters.get("for_revaluation_journals"): - if (abs(row.outstanding) > 0.0 / 10**self.currency_precision) or ( - abs(row.outstanding_in_account_currency) > 0.0 / 10**self.currency_precision + if (abs(row.outstanding) >= 0.0 / 10**self.currency_precision) or ( + abs(row.outstanding_in_account_currency) >= 0.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) + 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 diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 1f6363d56cb..bc5236d15fb 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -268,12 +268,18 @@ erpnext.patches.v13_0.show_india_localisation_deprecation_warning erpnext.patches.v13_0.show_hr_payroll_deprecation_warning erpnext.patches.v13_0.reset_corrupt_defaults erpnext.patches.v13_0.create_accounting_dimensions_for_asset_repair +<<<<<<< HEAD +======= +erpnext.patches.v15_0.delete_taxjar_doctypes +erpnext.patches.v15_0.delete_ecommerce_doctypes +>>>>>>> e1dedc5402 (fix: Show the rows in AR/AP report where outstanding equals to 0.01) erpnext.patches.v14_0.update_reference_due_date_in_journal_entry erpnext.patches.v14_0.france_depreciation_warning erpnext.patches.v14_0.clear_reconciliation_values_from_singles erpnext.patches.v14_0.update_proprietorship_to_individual [post_model_sync] +erpnext.patches.v15_0.create_asset_depreciation_schedules_from_assets execute:frappe.delete_doc_if_exists('Workspace', 'ERPNext Integrations Settings') erpnext.patches.v14_0.update_posting_datetime_and_dropped_indexes #22-02-2024 erpnext.patches.v14_0.rename_ongoing_status_in_sla_documents From 9b828b829a09801ee33432cf6538159b79c59c40 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 18 Jul 2024 12:58:09 +0530 Subject: [PATCH 2/3] test: AR/AP report on miniscule outstanding (cherry picked from commit bb9e42cce278c1ad6760f721cf8417c041c85b4a) --- .../test_accounts_receivable.py | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py index a65e424173c..5e2adc42d84 100644 --- a/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py @@ -955,3 +955,32 @@ class TestAccountsReceivable(AccountsTestMixin, FrappeTestCase): self.assertEqual( expected_data, [row.invoiced, row.outstanding, row.remaining_balance, row.future_amount] ) + + def test_accounts_receivable_output_for_minor_outstanding(self): + """ + AR/AP should report miniscule outstanding of 0.01. Or else there will be slight difference with General Ledger/Trial Balance + """ + filters = { + "company": self.company, + "report_date": today(), + "range1": 30, + "range2": 60, + "range3": 90, + "range4": 120, + } + + # check invoice grand total and invoiced column's value for 3 payment terms + si = self.create_sales_invoice(no_payment_schedule=True) + + pe = get_payment_entry("Sales Invoice", si.name, bank_account=self.cash, party_amount=99.99) + pe.paid_from = self.debit_to + pe.save().submit() + report = execute(filters) + + expected_data_after_payment = [100, 100, 99.99, 0.01] + self.assertEqual(len(report[1]), 1) + row = report[1][0] + self.assertEqual( + expected_data_after_payment, + [row.invoice_grand_total, row.invoiced, row.paid, row.outstanding], + ) From 4fa9626de00052b35c6a878ddcce1c2679257ccf Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 18 Jul 2024 14:40:26 +0530 Subject: [PATCH 3/3] chore: resolve conflict --- erpnext/patches.txt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index bc5236d15fb..1f6363d56cb 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -268,18 +268,12 @@ erpnext.patches.v13_0.show_india_localisation_deprecation_warning erpnext.patches.v13_0.show_hr_payroll_deprecation_warning erpnext.patches.v13_0.reset_corrupt_defaults erpnext.patches.v13_0.create_accounting_dimensions_for_asset_repair -<<<<<<< HEAD -======= -erpnext.patches.v15_0.delete_taxjar_doctypes -erpnext.patches.v15_0.delete_ecommerce_doctypes ->>>>>>> e1dedc5402 (fix: Show the rows in AR/AP report where outstanding equals to 0.01) erpnext.patches.v14_0.update_reference_due_date_in_journal_entry erpnext.patches.v14_0.france_depreciation_warning erpnext.patches.v14_0.clear_reconciliation_values_from_singles erpnext.patches.v14_0.update_proprietorship_to_individual [post_model_sync] -erpnext.patches.v15_0.create_asset_depreciation_schedules_from_assets execute:frappe.delete_doc_if_exists('Workspace', 'ERPNext Integrations Settings') erpnext.patches.v14_0.update_posting_datetime_and_dropped_indexes #22-02-2024 erpnext.patches.v14_0.rename_ongoing_status_in_sla_documents