mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-22 11:44:11 +00:00
feat: pos configuration for print receipt on complete order (#45392)
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
"hide_unavailable_items",
|
"hide_unavailable_items",
|
||||||
"auto_add_item_to_cart",
|
"auto_add_item_to_cart",
|
||||||
"validate_stock_on_save",
|
"validate_stock_on_save",
|
||||||
|
"print_receipt_on_order_complete",
|
||||||
"column_break_16",
|
"column_break_16",
|
||||||
"update_stock",
|
"update_stock",
|
||||||
"ignore_pricing_rule",
|
"ignore_pricing_rule",
|
||||||
@@ -375,6 +376,12 @@
|
|||||||
"fieldname": "disable_rounded_total",
|
"fieldname": "disable_rounded_total",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Disable Rounded Total"
|
"label": "Disable Rounded Total"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"fieldname": "print_receipt_on_order_complete",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Print Receipt on Order Complete"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "icon-cog",
|
"icon": "icon-cog",
|
||||||
@@ -402,7 +409,7 @@
|
|||||||
"link_fieldname": "pos_profile"
|
"link_fieldname": "pos_profile"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"modified": "2022-08-10 12:57:06.241439",
|
"modified": "2025-01-01 11:07:03.161950",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "POS Profile",
|
"name": "POS Profile",
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ class POSProfile(Document):
|
|||||||
letter_head: DF.Link | None
|
letter_head: DF.Link | None
|
||||||
payments: DF.Table[POSPaymentMethod]
|
payments: DF.Table[POSPaymentMethod]
|
||||||
print_format: DF.Link | None
|
print_format: DF.Link | None
|
||||||
|
print_receipt_on_order_complete: DF.Check
|
||||||
select_print_heading: DF.Link | None
|
select_print_heading: DF.Link | None
|
||||||
selling_price_list: DF.Link | None
|
selling_price_list: DF.Link | None
|
||||||
tax_category: DF.Link | None
|
tax_category: DF.Link | None
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
erpnext.PointOfSale.PastOrderSummary = class {
|
erpnext.PointOfSale.PastOrderSummary = class {
|
||||||
constructor({ wrapper, events }) {
|
constructor({ wrapper, events, pos_profile }) {
|
||||||
this.wrapper = wrapper;
|
this.wrapper = wrapper;
|
||||||
this.events = events;
|
this.events = events;
|
||||||
|
this.pos_profile = pos_profile;
|
||||||
|
|
||||||
this.init_component();
|
this.init_component();
|
||||||
}
|
}
|
||||||
@@ -355,6 +356,8 @@ erpnext.PointOfSale.PastOrderSummary = class {
|
|||||||
const condition_btns_map = this.get_condition_btn_map(after_submission);
|
const condition_btns_map = this.get_condition_btn_map(after_submission);
|
||||||
|
|
||||||
this.add_summary_btns(condition_btns_map);
|
this.add_summary_btns(condition_btns_map);
|
||||||
|
|
||||||
|
this.print_receipt_on_order_complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
attach_document_info(doc) {
|
attach_document_info(doc) {
|
||||||
@@ -421,4 +424,16 @@ erpnext.PointOfSale.PastOrderSummary = class {
|
|||||||
toggle_component(show) {
|
toggle_component(show) {
|
||||||
show ? this.$component.css("display", "flex") : this.$component.css("display", "none");
|
show ? this.$component.css("display", "flex") : this.$component.css("display", "none");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async print_receipt_on_order_complete() {
|
||||||
|
const res = await frappe.db.get_value(
|
||||||
|
"POS Profile",
|
||||||
|
this.pos_profile,
|
||||||
|
"print_receipt_on_order_complete"
|
||||||
|
);
|
||||||
|
|
||||||
|
if (res.message.print_receipt_on_order_complete) {
|
||||||
|
this.print_receipt();
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user