diff --git a/pos/src/lib/print.ts b/pos/src/lib/print.ts index 2e555ee..feffd6b 100644 --- a/pos/src/lib/print.ts +++ b/pos/src/lib/print.ts @@ -33,8 +33,9 @@ export async function printOrder({ orderId, posProfile }: PrintOrderParams): Pro return 'network'; } else { // Redirect to printview page - const url=`/printview?doctype=POS Invoice&name=${orderId}&format=${print_format}&no_letterhead=1&settings={}&letterhead=No Letterhead&trigger_print=1&_lang=en`; + const url = `/printview?doctype=POS Invoice&name=${orderId}&format=${print_format}&no_letterhead=1&settings={}&letterhead=No Letterhead&trigger_print=1&_lang=en`; window.open(url, '_blank', 'noopener,noreferrer'); + await updatePrintStatus(orderId); return 'socket'; } } \ No newline at end of file diff --git a/urypos/src/stores/invoiceData.js b/urypos/src/stores/invoiceData.js index e784638..e522f2a 100644 --- a/urypos/src/stores/invoiceData.js +++ b/urypos/src/stores/invoiceData.js @@ -579,6 +579,13 @@ export const useInvoiceDataStore = defineStore("invoiceData", { // Socket printing using printview redirection const url = `/printview?doctype=POS Invoice&name=${invoiceNo}&format=${this.print_format}&no_letterhead=1&settings={}&letterhead=No Letterhead&trigger_print=1&_lang=en`; window.open(url, "_blank", "noopener,noreferrer"); + try { + await this.call.post("ury.ury.api.ury_print.qz_print_update", { + invoice: invoiceNo, + }); + } catch (err) { + console.error("Failed to update print status for socket print", err); + } this.notification.createNotification("Print triggered"); this.isPrinting = false; }