diff --git a/addons/point_of_sale/static/src/js/Screens/ProductScreen/ActionpadWidget.js b/addons/point_of_sale/static/src/js/Screens/ProductScreen/ActionpadWidget.js index f7da3c8e6ef..65fb9f200c9 100644 --- a/addons/point_of_sale/static/src/js/Screens/ProductScreen/ActionpadWidget.js +++ b/addons/point_of_sale/static/src/js/Screens/ProductScreen/ActionpadWidget.js @@ -22,7 +22,6 @@ export class ActionpadWidget extends Component { clickPay() { const order = this.pos.globalState.get_order(); - if (order.orderlines.length) { order.pay(); } diff --git a/addons/pos_restaurant/static/src/js/Screens/ProductScreen/ActionpadWidget.js b/addons/pos_restaurant/static/src/js/Screens/ProductScreen/ActionpadWidget.js index e52db8bea30..3b5e4e165d3 100644 --- a/addons/pos_restaurant/static/src/js/Screens/ProductScreen/ActionpadWidget.js +++ b/addons/pos_restaurant/static/src/js/Screens/ProductScreen/ActionpadWidget.js @@ -1,6 +1,7 @@ /** @odoo-module */ import { patch } from "@web/core/utils/patch"; import { ActionpadWidget } from "@point_of_sale/js/Screens/ProductScreen/ActionpadWidget"; +import { nbsp } from "@web/core/utils/strings"; /** * @props partner */ @@ -37,11 +38,34 @@ patch(ActionpadWidget.prototype, "point_of_sale.ActionpadWidget", { } } }, + hasQuantity(order) { + if (!order) { + return false; + } else { + return ( + order.orderlines.reduce((totalQty, line) => totalQty + line.get_quantity(), 0) > 0 + ); + } + }, get highlightPay() { return ( this._super(...arguments) && this.pos.globalState.printers_category_ids_set.size && - !this.currentOrder.hasChangesToPrint() + !this.currentOrder.hasChangesToPrint() && + this.hasQuantity(this.currentOrder) ); }, + get categoryCount() { + const categories = {}; + for (const orderline of this.currentOrder.printingChanges.new) { + const category = this.pos.globalState.db.get_product_by_id(orderline.product_id).pos_categ_id[1]; + const numProd = orderline.quantity; + categories[category] = categories[category] ? categories[category] + numProd : numProd; + } + let result = ""; + for (const key in categories) { + result = result + categories[key] + nbsp + key + " | "; + } + return result.slice(0, -2); + }, }); diff --git a/addons/pos_restaurant/static/src/scss/restaurant.scss b/addons/pos_restaurant/static/src/scss/restaurant.scss index a16f9b7c16e..af648f3212f 100644 --- a/addons/pos_restaurant/static/src/scss/restaurant.scss +++ b/addons/pos_restaurant/static/src/scss/restaurant.scss @@ -42,10 +42,41 @@ border-radius: 30px; margin-bottom: 10px; } + +.pos .submit-order .submit-circle-smaller { + display: block; + font-size: 13px; + line-height: var(--btn-height-size); + background: $gray-900; + color: white; + width: 25px; + text-align: center; + border-radius: 50%; + margin-bottom: 10px; + height: 25px; + top: 4px; + position: relative; +} .pos .submit-order .submit-circle .fa { position: relative; top: -1px; } +.pos .submit-order .submit-circle-smaller .fa { + position: relative; + top: -14px; +} +.pos .submit-order .smaller-display{ + gap: 10px; + display: flex; + align-items:center; +} +.break-line { + box-sizing: border-box; + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; +} .pos .order-button.floor-button { display: flex; align-items: center; diff --git a/addons/pos_restaurant/static/src/xml/Screens/ProductScreen/ActionpadWidget.xml b/addons/pos_restaurant/static/src/xml/Screens/ProductScreen/ActionpadWidget.xml index 72c1b891477..6ab196ef9d6 100644 --- a/addons/pos_restaurant/static/src/xml/Screens/ProductScreen/ActionpadWidget.xml +++ b/addons/pos_restaurant/static/src/xml/Screens/ProductScreen/ActionpadWidget.xml @@ -8,10 +8,15 @@ class="button submit-order" t-att-class="addedClasses" t-on-click="submitOrder"> -