[Fix] Allow Print Before Pay in POS (#20151)

Print Button does not show even when Print Before Pay is enabled in the POS Profile.
This commit is contained in:
Javier Wong 2019-12-31 19:37:37 +08:00 committed by Nabin Hait
parent 71649fe141
commit 5cc7648e9c
2 changed files with 4 additions and 2 deletions

View File

@ -355,7 +355,8 @@ class SalesInvoice(SellingController):
"print_format": print_format,
"allow_edit_rate": pos.get("allow_user_to_edit_rate"),
"allow_edit_discount": pos.get("allow_user_to_edit_discount"),
"campaign": pos.get("campaign")
"campaign": pos.get("campaign"),
"allow_print_before_pay": pos.get("allow_print_before_pay")
}
def update_time_sheet(self, sales_invoice):

View File

@ -631,6 +631,7 @@ erpnext.pos.PointOfSale = class PointOfSale {
this.frm.allow_edit_rate = r.message.allow_edit_rate;
this.frm.allow_edit_discount = r.message.allow_edit_discount;
this.frm.doc.campaign = r.message.campaign;
this.frm.allow_print_before_pay = r.message.allow_print_before_pay;
}
}
@ -672,7 +673,7 @@ erpnext.pos.PointOfSale = class PointOfSale {
}
set_form_action() {
if(this.frm.doc.docstatus == 1 || (this.frm.doc.allow_print_before_pay == 1&&this.frm.doc.items.length>0)){
if(this.frm.doc.docstatus == 1 || (this.frm.allow_print_before_pay == 1 && this.frm.doc.items.length > 0)){
this.page.set_secondary_action(__("Print"), async() => {
if(this.frm.doc.docstatus != 1 ){
await this.frm.save();