mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 16:04:46 +00:00
fix: pos return payment mode issue (#26872)
This commit is contained in:
@@ -595,7 +595,8 @@ class calculate_taxes_and_totals(object):
|
|||||||
self.doc.precision("outstanding_amount"))
|
self.doc.precision("outstanding_amount"))
|
||||||
|
|
||||||
if self.doc.doctype == 'Sales Invoice' and self.doc.get('is_pos') and self.doc.get('is_return'):
|
if self.doc.doctype == 'Sales Invoice' and self.doc.get('is_pos') and self.doc.get('is_return'):
|
||||||
self.update_paid_amount_for_return(total_amount_to_pay)
|
self.set_total_amount_to_default_mop(total_amount_to_pay)
|
||||||
|
self.calculate_paid_amount()
|
||||||
|
|
||||||
def calculate_paid_amount(self):
|
def calculate_paid_amount(self):
|
||||||
|
|
||||||
@@ -675,7 +676,7 @@ class calculate_taxes_and_totals(object):
|
|||||||
def set_item_wise_tax_breakup(self):
|
def set_item_wise_tax_breakup(self):
|
||||||
self.doc.other_charges_calculation = get_itemised_tax_breakup_html(self.doc)
|
self.doc.other_charges_calculation = get_itemised_tax_breakup_html(self.doc)
|
||||||
|
|
||||||
def update_paid_amount_for_return(self, total_amount_to_pay):
|
def set_total_amount_to_default_mop(self, total_amount_to_pay):
|
||||||
default_mode_of_payment = frappe.db.get_value('POS Payment Method',
|
default_mode_of_payment = frappe.db.get_value('POS Payment Method',
|
||||||
{'parent': self.doc.pos_profile, 'default': 1}, ['mode_of_payment'], as_dict=1)
|
{'parent': self.doc.pos_profile, 'default': 1}, ['mode_of_payment'], as_dict=1)
|
||||||
|
|
||||||
@@ -687,8 +688,6 @@ class calculate_taxes_and_totals(object):
|
|||||||
'default': 1
|
'default': 1
|
||||||
})
|
})
|
||||||
|
|
||||||
self.calculate_paid_amount()
|
|
||||||
|
|
||||||
def get_itemised_tax_breakup_html(doc):
|
def get_itemised_tax_breakup_html(doc):
|
||||||
if not doc.taxes:
|
if not doc.taxes:
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -754,8 +754,6 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.frm.refresh_fields();
|
this.frm.refresh_fields();
|
||||||
|
|
||||||
this.calculate_paid_amount();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
set_default_payment(total_amount_to_pay, update_paid_amount) {
|
set_default_payment(total_amount_to_pay, update_paid_amount) {
|
||||||
|
|||||||
Reference in New Issue
Block a user