mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-29 13:58:37 +00:00
fix: clear stale payment rows on non-POS returns so they don't surface in bank reconciliation (backport #55903) (#56171)
fix: clear stale payment rows on non-POS returns so they don't surface in bank reconciliation (#55903)
(cherry picked from commit 322d4dff25)
# Conflicts:
# erpnext/accounts/doctype/sales_invoice/sales_invoice.py
# erpnext/accounts/doctype/sales_invoice/services/pos.py
Co-authored-by: Jatin3128 <jatinsarna8@gmail.com>
This commit is contained in:
@@ -460,8 +460,8 @@ class SalesInvoice(SellingController):
|
||||
validate_account_head(item.idx, item.income_account, self.company, _("Income"))
|
||||
|
||||
def before_save(self):
|
||||
self.set_account_for_mode_of_payment()
|
||||
self.set_paid_amount()
|
||||
self.set_account_for_mode_of_payment()
|
||||
|
||||
def before_submit(self):
|
||||
self.add_remarks()
|
||||
@@ -900,6 +900,13 @@ class SalesInvoice(SellingController):
|
||||
def set_paid_amount(self):
|
||||
paid_amount = 0.0
|
||||
base_paid_amount = 0.0
|
||||
|
||||
if not cint(self.is_pos) and self.is_return:
|
||||
self.set("payments", [])
|
||||
self.paid_amount = paid_amount
|
||||
self.base_paid_amount = base_paid_amount
|
||||
return
|
||||
|
||||
for data in self.payments:
|
||||
data.base_amount = flt(data.amount * self.conversion_rate, self.precision("base_paid_amount"))
|
||||
paid_amount += data.amount
|
||||
|
||||
Reference in New Issue
Block a user