fix(pos): mode of payments disappear on loading draft pos invoice (#24917)

This commit is contained in:
Saqib 2021-03-24 17:56:24 +05:30 committed by GitHub
parent 575f8f226b
commit dd39a6b47c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -376,6 +376,12 @@ class POSInvoice(SalesInvoice):
"campaign": profile.get("campaign"),
"allow_print_before_pay": profile.get("allow_print_before_pay")
}
def reset_mode_of_payments(self):
if self.pos_profile:
pos_profile = frappe.get_cached_doc('POS Profile', self.pos_profile)
update_multi_mode_option(self, pos_profile)
self.paid_amount = 0
def set_account_for_mode_of_payment(self):
self.payments = [d for d in self.payments if d.amount or d.base_amount or d.default]

View File

@ -397,6 +397,7 @@ erpnext.PointOfSale.Controller = class {
this.recent_order_list.toggle_component(false);
frappe.run_serially([
() => this.frm.refresh(name),
() => this.frm.call('reset_mode_of_payments'),
() => this.cart.load_invoice(),
() => this.item_selector.toggle_component(true)
]);