Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions urypos/src/stores/invoiceData.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,10 @@ export const useInvoiceDataStore = defineStore("invoiceData", {
this.notification.createNotification(
"Print successful but failed to update status"
);
}else{
setTimeout(() => {
window.location.reload();
}, 1000);
}
}
} else if (this.print_type === "network") {
Expand All @@ -516,16 +520,14 @@ export const useInvoiceDataStore = defineStore("invoiceData", {
const sendObj = {
invoice: invoiceNo,
};
await this.call
.post("ury.ury.api.ury_print.qz_print_update", sendObj)
.then(() => {
await this.call.post("ury.ury.api.ury_print.qz_print_update", sendObj)
setTimeout(() => {
window.location.reload();
return 200;
});
}, 1000);
}
errorMessage = res;
i++;
} while (i < 1);
} while (i < 5);
throw {
alert: this.alert.createAlert(
"Message",
Expand Down Expand Up @@ -556,15 +558,15 @@ export const useInvoiceDataStore = defineStore("invoiceData", {
invoice: invoiceNo,
};
await this.call
.post("ury.ury.api.ury_print.qz_print_update", sendObj)
.post("ury.ury.api.ury_print.qz_print_updat", sendObj)
.then(() => {
window.location.reload();
return 200;
});
}
errorMessage = res;
i++;
} while (i < 1);
} while (i < 5);
throw {
alert: this.alert.createAlert(
"Message",
Expand All @@ -586,7 +588,6 @@ export const useInvoiceDataStore = defineStore("invoiceData", {
this.notification.createNotification("Print Successful");
this.isPrinting = false
window.location.reload();

return result.message;
})
.catch((error) => console.error(error));
Expand All @@ -604,17 +605,14 @@ export const useInvoiceDataStore = defineStore("invoiceData", {

const tryUpdate = async () => {
try {
const updatePrintTable = {
invoice: invoiceNo,
};

const response = await this.call.post(
"ury.ury.api.ury_print.qz_print_update",
updatePrintTable
"ury.ury.api.ury_print.qz_print_updat",
{
invoice: invoiceNo,
}
);
if (response.message.status === "Success") {
this.notification.createNotification("Print and Update Successful");
window.location.reload();
return true;
} else {
this.isPrinting = false
Expand Down
Loading
Loading