From 56aa962414bc12df0d1ca6f7ff25efc04b938cbc Mon Sep 17 00:00:00 2001 From: Joseph Caburnay Date: Mon, 23 Sep 2019 08:42:03 +0000 Subject: [PATCH] [IMP] point_of_sale: centralize the due and change in payment interface The previous behavior is that change is displayed at each payment line and the remaining is displayed at the bottom. Also, total amount is lost in the screen. This commit addresses this issue by showing the values of remaining amount and change at just one area of the payment screen. task-id: 1984690 --- addons/point_of_sale/static/src/css/pos.css | 35 +++++--- addons/point_of_sale/static/src/xml/pos.xml | 83 +++++++++---------- .../static/tests/tours/point_of_sale.js | 40 ++++++++- 3 files changed, 101 insertions(+), 57 deletions(-) diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index 36ab2b77938..53dd2c65481 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -1333,19 +1333,9 @@ td { .pos .paymentline > *{ padding: 8px 12px; } -.pos .paymentline .col-due, -.pos .paymentline .col-tendered, -.pos .paymentline .col-change { +.pos .paymentline .col-tendered { min-width: 90px; } -.pos .paymentline.extra .col-due { - border-radius: 0 0 6px 6px; - border-top: solid 1px rgb(230, 230, 230); - font-weight: bold; -} -.pos .paymentline .col-change.highlight { - background: rgb(184, 152, 204); -} .pos .paymentline .col-name { font-size: 16px; } @@ -1440,6 +1430,29 @@ td { font-size: 16px; } +.payment-status-container { + display: flex; + justify-content: space-between; + font-size: 25px; + padding-top: 15px; +} + +.payment-status-total-due { + font-size: 17px; + padding-top: 12px; + padding-bottom: 12px; + color: #5c5c5cd1; +} + +.payment-status-container .amount.highlight { + font-weight: bold; + color: #6EC89B; +} + +.payment-status-container .label { + padding-right: 7px; +} + /* c) The receipt screen */ .pos .receipt-screen .centered-content .button { diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index 3eacd2edc09..3056b928948 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -578,74 +578,73 @@ - - + Payment request pending - + Send - + Transaction cancelled - + Retry - + Connection error - + Force done - + Waiting for card - + Cancel - + Request sent - + - + Reversal request sent to terminal - + - + Payment Successful - + Reverse - + Payment Successful - + Payment reversed @@ -666,19 +665,40 @@ +
+
+
+ Remaining + + + +
+
+ Total Due + + + +
+
+
+
+ Change + + + +
+
+
+
- - - - @@ -687,7 +707,6 @@ - - - - - - - - - - - - - - -
Due TenderedChange Method
@@ -698,15 +717,6 @@ - - @@ -724,13 +734,7 @@
- - - - @@ -743,11 +747,6 @@
diff --git a/addons/point_of_sale/static/tests/tours/point_of_sale.js b/addons/point_of_sale/static/tests/tours/point_of_sale.js index 77890a56b5a..fa1b55cd0e3 100644 --- a/addons/point_of_sale/static/tests/tours/point_of_sale.js +++ b/addons/point_of_sale/static/tests/tours/point_of_sale.js @@ -354,15 +354,47 @@ odoo.define('point_of_sale.tour.acceptance', function (require) { steps = steps.concat(add_product_to_order('Desk Organizer')); steps = steps.concat(verify_order_total('10.20')); steps = steps.concat(goto_payment_screen_and_select_payment_method()); - steps = steps.concat(generate_payment_screen_keypad_steps("12.20")); + /* add payment line of only 5.20 + status: + order-total := 10.20 + total-payment := 11.70 + expect: + remaining := 0.00 + change := 1.50 + */ + steps = steps.concat(generate_payment_screen_keypad_steps("5.20")); steps = steps.concat([{ - content: "verify tendered", - trigger: '.col-tendered:contains("12.20")', + content: "verify remaining", + trigger: '.payment-status-remaining .amount:contains("5.00")', run: function () {}, // it's a check }, { content: "verify change", - trigger: '.col-change:contains("2.00")', + trigger: '.payment-status-change .amount:contains("0.00")', + run: function () {}, // it's a check + }]); + + /* make additional payment line of 6.50 + status: + order-total := 10.20 + total-payment := 11.70 + expect: + remaining := 0.00 + change := 1.50 + */ + steps = steps.concat([{ + content: "pay with cash", + trigger: '.paymentmethod:contains("Cash")', + }]); + steps = steps.concat(generate_payment_screen_keypad_steps("6.50")); + + steps = steps.concat([{ + content: "verify remaining", + trigger: '.payment-status-remaining .amount:contains("0.00")', + run: function () {}, // it's a check + }, { + content: "verify change", + trigger: '.payment-status-change .amount:contains("1.50")', run: function () {}, // it's a check }]);