mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-18 12:39:18 +00:00
refactor: using function to unset grand total to default mode of payment in pos (backport #46228) (#46229)
refactor: using function to unset grand total to default mode of payment in pos (#46228)
(cherry picked from commit 62c3915ecb)
Co-authored-by: Diptanil Saha <diptanil@frappe.io>
This commit is contained in:
@@ -340,19 +340,11 @@ erpnext.PointOfSale.Payment = class {
|
|||||||
// pass
|
// pass
|
||||||
}
|
}
|
||||||
|
|
||||||
async render_payment_section() {
|
render_payment_section() {
|
||||||
this.render_payment_mode_dom();
|
this.render_payment_mode_dom();
|
||||||
this.make_invoice_fields_control();
|
this.make_invoice_fields_control();
|
||||||
this.update_totals_section();
|
this.update_totals_section();
|
||||||
let r = await frappe.db.get_value(
|
this.unset_grand_total_to_default_mop();
|
||||||
"POS Profile",
|
|
||||||
this.frm.doc.pos_profile,
|
|
||||||
"disable_grand_total_to_default_mop"
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!r.message.disable_grand_total_to_default_mop) {
|
|
||||||
this.focus_on_default_mop();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
after_render() {
|
after_render() {
|
||||||
@@ -637,6 +629,19 @@ erpnext.PointOfSale.Payment = class {
|
|||||||
.toLowerCase();
|
.toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async unset_grand_total_to_default_mop() {
|
||||||
|
const doc = this.events.get_frm().doc;
|
||||||
|
let r = await frappe.db.get_value(
|
||||||
|
"POS Profile",
|
||||||
|
doc.pos_profile,
|
||||||
|
"disable_grand_total_to_default_mop"
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!r.message.disable_grand_total_to_default_mop) {
|
||||||
|
this.focus_on_default_mop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
validate_reqd_invoice_fields() {
|
validate_reqd_invoice_fields() {
|
||||||
const doc = this.events.get_frm().doc;
|
const doc = this.events.get_frm().doc;
|
||||||
let validation_flag = true;
|
let validation_flag = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user