fix: update kitchen printer quantity mapping and standardize return format for print status results
This commit is contained in:
parent
05253d1e4c
commit
0f725b94fa
@ -32,7 +32,7 @@ patch(PosStore.prototype, {
|
|||||||
// Build the data object to send to backend
|
// Build the data object to send to backend
|
||||||
const lines = changesData.map(c => ({
|
const lines = changesData.map(c => ({
|
||||||
name: c.name,
|
name: c.name,
|
||||||
qty: c.qty,
|
qty: c.quantity || c.qty || 1,
|
||||||
note: c.note || ''
|
note: c.note || ''
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@ -56,16 +56,16 @@ patch(PosStore.prototype, {
|
|||||||
result.message || "Network printer error",
|
result.message || "Network printer error",
|
||||||
{ type: "danger" }
|
{ type: "danger" }
|
||||||
);
|
);
|
||||||
return false;
|
return { successful: false, message: { body: result.message || "Network printer error" } };
|
||||||
}
|
}
|
||||||
return true;
|
return { successful: true };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error printing to network printer", error);
|
console.error("Error printing to network printer", error);
|
||||||
this.env.services.notification.add(
|
this.env.services.notification.add(
|
||||||
"Error printing to network printer",
|
"Error printing to network printer",
|
||||||
{ type: "danger" }
|
{ type: "danger" }
|
||||||
);
|
);
|
||||||
return false;
|
return { successful: false, message: { body: error.message || "Error printing to network printer" } };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user