From 67386e50dd6729b16127f0993f7838aac5859476 Mon Sep 17 00:00:00 2001 From: bansodegaurav8848 Date: Fri, 10 Jan 2025 18:21:29 +0530 Subject: [PATCH] test: test case for a purchase invoice to check status is paid after adding the advance payment --- .../purchase_invoice/test_purchase_invoice.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index b3cf02df039f..3505fe77e09d 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -2977,6 +2977,22 @@ def test_invoice_status_on_payment_entry_submit_TC_B_035_and_TC_B_037(self): pi_status_after_reconcile = frappe.db.get_value("Purchase Invoice", pi.name, "status") self.assertEqual(pi_status_after_reconcile, "Unpaid") + new_pi = make_purchase_invoice( + qty=1, + item_code="_Test Item", + supplier = "_Test Supplier", + company = "_Test Company", + rate = 30, + do_not_save =True, + ) + new_pi.save() + new_pi.set_advances() + new_pi.save() + new_pi.submit() + + pi_status_after_advances = frappe.db.get_value("Purchase Invoice", new_pi.name, "status") + self.assertEqual(pi_status_after_advances, "Paid") + def test_partly_paid_of_pi_to_pr_to_pe_TC_B_081(self): from erpnext.accounts.doctype.payment_entry.test_payment_entry import create_payment_entry pi = make_purchase_invoice(