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:
Diptanil Saha
2025-04-01 12:40:47 +05:30
committed by GitHub
parent 63ef0a5a99
commit 5d5b6acc79
2 changed files with 24 additions and 0 deletions

View File

@@ -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)

View File

@@ -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() {