From 5b1aa07ecb7e36e71cd61914b392fa0dffaf76b4 Mon Sep 17 00:00:00 2001 From: Ritvik Sardana Date: Thu, 3 Aug 2023 16:10:28 +0530 Subject: [PATCH] fix: fixed SABB error --- .../pos_invoice_merge_log.py | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py b/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py index da69e1b12bc..9978912ecca 100644 --- a/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py +++ b/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py @@ -171,21 +171,23 @@ class POSInvoiceMergeLog(Document): for item in doc.get("items"): found = False - for i in items: - if ( - i.item_code == item.item_code - and not i.serial_no - and not i.batch_no - and i.uom == item.uom - and i.net_rate == item.net_rate - and i.warehouse == item.warehouse - ): - found = True - i.qty = i.qty + item.qty - i.amount = i.amount + item.net_amount - i.net_amount = i.amount - i.base_amount = i.base_amount + item.base_net_amount - i.base_net_amount = i.base_amount + if not item.serial_and_batch_bundle: + for i in items: + + if ( + i.item_code == item.item_code + and not i.serial_no + and not i.batch_no + and i.uom == item.uom + and i.net_rate == item.net_rate + and i.warehouse == item.warehouse + ): + found = True + i.qty = i.qty + item.qty + i.amount = i.amount + item.net_amount + i.net_amount = i.amount + i.base_amount = i.base_amount + item.base_net_amount + i.base_net_amount = i.base_amount if not found: item.rate = item.net_rate