fix: unseting of payment if no pos profile found (#26884) (#26890)

(cherry picked from commit b614834efedbef572e0567828f0d9d82e81331ee)

Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
This commit is contained in:
Frappe PR Bot 2021-08-10 22:52:37 +05:30 committed by GitHub
parent 7ca1493655
commit b7b111c3ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 7 deletions

View File

@ -679,17 +679,13 @@ class calculate_taxes_and_totals(object):
default_mode_of_payment = frappe.db.get_value('POS Payment Method',
{'parent': self.doc.pos_profile, 'default': 1}, ['mode_of_payment'], as_dict=1)
self.doc.payments = []
if default_mode_of_payment:
self.doc.payments = []
self.doc.append('payments', {
'mode_of_payment': default_mode_of_payment.mode_of_payment,
'amount': total_amount_to_pay,
'default': 1
})
else:
self.doc.is_pos = 0
self.doc.pos_profile = ''
self.calculate_paid_amount()

View File

@ -747,8 +747,6 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
this.frm.doc.payments.find(pay => {
if (pay.default) {
pay.amount = total_amount_to_pay;
} else {
pay.amount = 0.0
}
});
this.frm.refresh_fields();