fix: pos return payment mode issue (#26875)
This commit is contained in:
parent
1ba04fdfe5
commit
793063bf4e
@ -47,7 +47,10 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
|
||||
|
||||
if (in_list(["Sales Invoice", "POS Invoice"], this.frm.doc.doctype) && this.frm.doc.is_pos &&
|
||||
this.frm.doc.is_return) {
|
||||
this.update_paid_amount_for_return();
|
||||
if (this.frm.doc.doctype == "Sales Invoice") {
|
||||
this.set_total_amount_to_default_mop();
|
||||
}
|
||||
this.calculate_paid_amount();
|
||||
}
|
||||
|
||||
// Sales person's commission
|
||||
@ -730,7 +733,7 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
|
||||
}
|
||||
},
|
||||
|
||||
update_paid_amount_for_return: function() {
|
||||
set_total_amount_to_default_mop: function() {
|
||||
var grand_total = this.frm.doc.rounded_total || this.frm.doc.grand_total;
|
||||
|
||||
if(this.frm.doc.party_account_currency == this.frm.doc.currency) {
|
||||
@ -743,17 +746,14 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
|
||||
precision("base_grand_total")
|
||||
);
|
||||
}
|
||||
|
||||
this.frm.doc.payments.find(pay => {
|
||||
if (pay.default) {
|
||||
pay.amount = total_amount_to_pay;
|
||||
} else {
|
||||
pay.amount = 0.0
|
||||
pay.amount = 0.0;
|
||||
}
|
||||
});
|
||||
this.frm.refresh_fields();
|
||||
|
||||
this.calculate_paid_amount();
|
||||
},
|
||||
|
||||
set_default_payment: function(total_amount_to_pay, update_paid_amount) {
|
||||
|
Loading…
Reference in New Issue
Block a user