mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-16 08:05:00 +00:00
fix: pos checking opened entry closed or not (#46726)
* fix: pos checking opened entry closed or not * fix: linter issue * fix: linter issue
This commit is contained in:
@@ -124,6 +124,11 @@ class POSClosingEntry(StatusUpdater):
|
||||
|
||||
def on_submit(self):
|
||||
consolidate_pos_invoices(closing_entry=self)
|
||||
frappe.publish_realtime(
|
||||
f"poe_{self.pos_opening_entry}_closed",
|
||||
self,
|
||||
docname=f"POS Opening Entry/{self.pos_opening_entry}",
|
||||
)
|
||||
|
||||
def on_cancel(self):
|
||||
unconsolidate_pos_invoices(closing_entry=self)
|
||||
|
||||
@@ -149,6 +149,25 @@ erpnext.PointOfSale.Controller = class {
|
||||
this.make_app();
|
||||
},
|
||||
});
|
||||
|
||||
frappe.realtime.on(`poe_${this.pos_opening}_closed`, (data) => {
|
||||
if (data) {
|
||||
frappe.dom.freeze();
|
||||
frappe.msgprint({
|
||||
title: __("POS Closed"),
|
||||
indicator: "orange",
|
||||
message: __("POS has been closed at {0}. Please refresh the page.", [
|
||||
frappe.datetime.str_to_user(data.creation).bold(),
|
||||
]),
|
||||
primary_action_label: __("Refresh"),
|
||||
primary_action: {
|
||||
action() {
|
||||
window.location.reload();
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
set_opening_entry_status() {
|
||||
|
||||
Reference in New Issue
Block a user