From dc8e80ea815d5684b56376330500f8dccdd38816 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Tue, 7 Jun 2022 11:35:03 +0530 Subject: [PATCH] test: Add test coverage for cancellation --- .../purchase_invoice/test_purchase_invoice.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index 30d26acf3a..9b7b88973f 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -1526,6 +1526,18 @@ class TestPurchaseInvoice(unittest.TestCase): check_gl_entries(self, pr.name, expected_gle_for_purchase_receipt, pr.posting_date) + # Cancel purchase invoice to check reverse provisional entry cancellation + pi.cancel() + + expected_gle_for_purchase_receipt_post_pi_cancel = [ + ["Provision Account - _TC", 0, 250, pi.posting_date], + ["_Test Account Cost for Goods Sold - _TC", 250, 0, pi.posting_date], + ] + + check_gl_entries( + self, pr.name, expected_gle_for_purchase_receipt_post_pi_cancel, pr.posting_date + ) + company.enable_provisional_accounting_for_non_stock_items = 0 company.save()