Allow print before pay in POS (#11590)

This commit is contained in:
augustinfotech 2017-11-16 15:28:42 +05:30 committed by Nabin Hait
parent eb3982044b
commit 135a54ca93
2 changed files with 35 additions and 1 deletions

View File

@ -286,6 +286,36 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "allow_print_before_pay",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Allow Print Before Pay",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,

View File

@ -1505,11 +1505,15 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
me.make_menu_list()
}, "fa fa-plus")
if (this.frm.doc.docstatus == 1) {
if (this.frm.doc.docstatus == 1 || this.pos_profile_data["allow_print_before_pay"]) {
this.page.set_secondary_action(__("Print"), function () {
me.create_invoice();
var html = frappe.render(me.print_template_data, me.frm.doc)
me.print_document(html)
})
}
if (this.frm.doc.docstatus == 1) {
this.page.add_menu_item(__("Email"), function () {
me.email_prompt()
})