From 6719bbeb10156f1c0d7b148e178cafaa3014e248 Mon Sep 17 00:00:00 2001 From: Sanket322 Date: Thu, 27 Feb 2025 17:14:29 +0530 Subject: [PATCH] fix: test case for debit note --- .../accounts_payable/test_accounts_payable.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/erpnext/accounts/report/accounts_payable/test_accounts_payable.py b/erpnext/accounts/report/accounts_payable/test_accounts_payable.py index d07b0aa43ad..27af4232374 100644 --- a/erpnext/accounts/report/accounts_payable/test_accounts_payable.py +++ b/erpnext/accounts/report/accounts_payable/test_accounts_payable.py @@ -38,6 +38,23 @@ class TestAccountsPayable(AccountsTestMixin, IntegrationTestCase): self.assertEqual(data[1][0].get("outstanding"), 300) self.assertEqual(data[1][0].get("currency"), "USD") + def test_account_payable_for_debit_note(self): + pi = self.create_purchase_invoice(do_not_submit=True) + pi.is_return = 1 + pi.items[0].qty = -1 + pi = pi.save().submit() + + filters = { + "company": self.company, + "party_type": "Supplier", + "party": [self.supplier], + "report_date": today(), + "range": "30, 60, 90, 120", + } + + data = execute(filters) + self.assertEqual(data[1][0].get("invoiced"), 300) + def create_purchase_invoice(self, do_not_submit=False): frappe.set_user("Administrator") pi = make_purchase_invoice(