From c11a31b39045e9d54a4e335cef92b0e11f5862a5 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Wed, 23 Nov 2022 20:29:12 +0530 Subject: [PATCH] fix: Debit and Credit not equal while submitting PI containing asset item (cherry picked from commit dc8d635120550b647e2d173ff4d101351c96aba9) --- .../accounts/doctype/purchase_invoice/purchase_invoice.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 9a31aafb79d3..161832216f82 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -606,7 +606,7 @@ def check_asset_cwip_enabled(self): def make_supplier_gl_entry(self, gl_entries): # Checked both rounding_adjustment and rounded_total - # because rounded_total had value even before introcution of posting GLE based on rounded total + # because rounded_total had value even before introduction of posting GLE based on rounded total grand_total = ( self.rounded_total if (self.rounding_adjustment and self.rounded_total) else self.grand_total ) @@ -809,10 +809,7 @@ def make_item_gl_entries(self, gl_entries): else item.deferred_expense_account ) - if not item.is_fixed_asset: - dummy, amount = self.get_amount_and_base_amount(item, None) - else: - amount = flt(item.base_net_amount + item.item_tax_amount, item.precision("base_net_amount")) + dummy, amount = self.get_amount_and_base_amount(item, None) if provisional_accounting_for_non_stock_items: if item.purchase_receipt: