mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-13 20:05:09 +00:00
* refactor: print receipt on order complete on pos (#46501)
(cherry picked from commit 0552209310)
# Conflicts:
# erpnext/selling/page/point_of_sale/pos_past_order_summary.js
* chore: resolve conflict
---------
Co-authored-by: Diptanil Saha <diptanil@frappe.io>
This commit is contained in:
@@ -449,6 +449,7 @@ erpnext.PointOfSale.Controller = class {
|
||||
init_order_summary() {
|
||||
this.order_summary = new erpnext.PointOfSale.PastOrderSummary({
|
||||
wrapper: this.$components_wrapper,
|
||||
settings: this.settings,
|
||||
events: {
|
||||
get_frm: () => this.frm,
|
||||
|
||||
@@ -485,7 +486,6 @@ erpnext.PointOfSale.Controller = class {
|
||||
]);
|
||||
},
|
||||
},
|
||||
pos_profile: this.pos_profile,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
erpnext.PointOfSale.PastOrderSummary = class {
|
||||
constructor({ wrapper, events, pos_profile }) {
|
||||
constructor({ wrapper, settings, events }) {
|
||||
this.wrapper = wrapper;
|
||||
this.events = events;
|
||||
this.pos_profile = pos_profile;
|
||||
this.print_receipt_on_order_complete = settings.print_receipt_on_order_complete;
|
||||
|
||||
this.init_component();
|
||||
}
|
||||
@@ -357,8 +357,8 @@ erpnext.PointOfSale.PastOrderSummary = class {
|
||||
|
||||
this.add_summary_btns(condition_btns_map);
|
||||
|
||||
if (after_submission) {
|
||||
this.print_receipt_on_order_complete();
|
||||
if (after_submission && this.print_receipt_on_order_complete) {
|
||||
this.print_receipt();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,16 +426,4 @@ erpnext.PointOfSale.PastOrderSummary = class {
|
||||
toggle_component(show) {
|
||||
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