[FIX] pos_restaurant: fix tips after payment flow

- Fixes tips ticket printing when there are tips after payment.
 - Makes the ReceiptScreen opened after TipScreen, to show the receipt screen even when there is a tip added after payment.

closes odoo/odoo#127548

Task-id: 3394214
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
This commit is contained in:
Theo VINCENT (thvi)
2023-07-06 17:52:19 +02:00
parent d3f31ca584
commit ef05b6ef55
3 changed files with 7 additions and 9 deletions
@@ -1786,12 +1786,12 @@ td {
.pos, .pos * {
position: static !important;
}
.pos .receipt-screen .pos-receipt-container {
.pos .pos-receipt-container {
position: absolute !important;
top: 0;
left: 0;
}
.pos .receipt-screen .pos-receipt-container, .pos .receipt-screen .pos-receipt-container * {
.pos .pos-receipt-container, .pos .pos-receipt-container * {
visibility: visible;
background: white !important;
color: black !important;
@@ -102,12 +102,7 @@ export class TipScreen extends Component {
this.pos.showScreen(name, props);
}
get nextScreen() {
if (this.pos.config.module_pos_restaurant) {
const table = this.pos.table;
return { name: "FloorScreen", props: { floor: table ? table.floor : null } };
} else {
return { name: "ProductScreen" };
}
return { name: "ReceiptScreen" };
}
async printTipReceipt() {
const receipts = [
@@ -143,7 +138,8 @@ export class TipScreen extends Component {
async _printWeb(receipt) {
try {
this.posReceiptContainer.el.innerHTML = receipt;
this.posReceiptContainer.el.textContent = "";
this.posReceiptContainer.el.appendChild(receipt);
window.print();
} catch {
await this.popup.add(ErrorPopup, {
@@ -141,6 +141,8 @@ PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.clickValidate();
TipScreen.check.isShown();
TipScreen.do.clickSettle();
ReceiptScreen.check.isShown();
ReceiptScreen.do.clickNextOrder();
FloorScreen.check.isShown();
registry