feat: add support for transfer destination table tracking in PosStore to handle table assignment logic

This commit is contained in:
Suherdy Yacob 2026-05-21 19:46:52 +07:00
parent 2f01444db1
commit b0d52af074

View File

@ -7,7 +7,17 @@ import { NumberPopup } from "@point_of_sale/app/components/popups/number_popup/n
import { makeAwaitable } from "@point_of_sale/app/utils/make_awaitable_dialog";
patch(PosStore.prototype, {
async transferOrder(orderUuid, destinationTable = null, destinationOrder = null) {
this.transferDestinationTable = destinationTable;
return super.transferOrder(...arguments);
},
async setTableFromUi(table, orderUuid = null) {
if (this.transferDestinationTable && this.transferDestinationTable.id === table.id) {
this.transferDestinationTable = null;
return super.setTableFromUi(...arguments);
}
if (!this.config.module_pos_restaurant || this.isOrderTransferMode) {
return super.setTableFromUi(...arguments);
}
@ -18,7 +28,11 @@ patch(PosStore.prototype, {
}
this.setCashier(cashier);
try {
await super.setTableFromUi(...arguments);
} finally {
this.transferDestinationTable = null;
}
const order = this.getOrder();
if (order) {