We now allow invoicing of finalized orders in an open session in this first iteration of order management in the pos frontend. Additionally, receipt reprinting is also introduced. With this feature, we can now reprint the receipt of old orders. closes odoo/odoo#51141 Task-id: 1981354 Related: odoo/enterprise#11690 Related: odoo/upgrade#1472 Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
66 lines
2.1 KiB
JavaScript
66 lines
2.1 KiB
JavaScript
odoo.define('pos_restaurant.tour.SplitBillScreenTourMethods', function (require) {
|
|
'use strict';
|
|
|
|
const { createTourMethods } = require('point_of_sale.tour.utils');
|
|
|
|
class Do {
|
|
clickOrderline(name, totalQuantity) {
|
|
let trigger = `li.orderline .product-name:contains("${name}")`;
|
|
if (totalQuantity) {
|
|
trigger += ` ~ .info-list .info:contains("${totalQuantity}")`;
|
|
}
|
|
return [
|
|
{
|
|
content: `click '${name}' orderline with total quantity of '${totalQuantity}'`,
|
|
trigger,
|
|
},
|
|
];
|
|
}
|
|
clickBack() {
|
|
return [
|
|
{
|
|
content: 'click back button',
|
|
trigger: `.splitbill-screen .button.back`,
|
|
},
|
|
];
|
|
}
|
|
clickPay() {
|
|
return [
|
|
{
|
|
content: 'click pay button',
|
|
trigger: `.splitbill-screen .pay-button .button`
|
|
}
|
|
]
|
|
}
|
|
}
|
|
|
|
class Check {
|
|
orderlineHas(name, totalQuantity, splitQuantity) {
|
|
return [
|
|
{
|
|
content: `'${name}' orderline has total quantity of '${totalQuantity}'`,
|
|
trigger: `li.orderline .product-name:contains("${name}") ~ .info-list .info:contains("${totalQuantity}")`,
|
|
run: () => {},
|
|
},
|
|
{
|
|
content: `'${name}' orderline has '${splitQuantity}' quantity to split`,
|
|
trigger: `li.orderline .product-name:contains("${name}") ~ .info-list .info em:contains("${splitQuantity}")`,
|
|
run: () => {},
|
|
},
|
|
];
|
|
}
|
|
subtotalIs(amount) {
|
|
return [
|
|
{
|
|
content: `total amount of split is '${amount}'`,
|
|
trigger: `.splitbill-screen .order-info .subtotal:contains("${amount}")`,
|
|
},
|
|
];
|
|
}
|
|
}
|
|
|
|
class Execute {}
|
|
|
|
return createTourMethods('SplitBillScreen', Do, Check, Execute);
|
|
});
|