diff --git a/erpnext/public/css/pos.css b/erpnext/public/css/pos.css index b19372b295e..10355f456c2 100644 --- a/erpnext/public/css/pos.css +++ b/erpnext/public/css/pos.css @@ -1,6 +1,16 @@ +[data-route="point-of-sale"] .layout-main-section-wrapper { + margin-bottom: 0; +} +[data-route="point-of-sale"] .pos-items-wrapper { + max-height: calc(100vh - 210px); +} .pos { padding: 15px; } +.list-item { + min-height: 40px; + height: auto; +} .cart-container { padding: 0 15px; display: inline-block; @@ -33,7 +43,7 @@ flex: 1.5; } .cart-items { - height: 200px; + height: 150px; overflow: auto; } .cart-items .list-item.current-item { @@ -132,3 +142,32 @@ input[type=number]::-webkit-outer-spin-button { background-color: #5E64FF; color: #ffffff; } +.discount-amount .discount-inputs { + display: flex; + flex-direction: column; + padding: 15px 0; +} +.discount-amount input:first-child { + margin-bottom: 10px; +} +.taxes-and-totals { + border-top: 1px solid #d1d8dd; +} +.taxes-and-totals .taxes { + display: flex; + flex-direction: column; + padding: 15px 0; + align-items: flex-end; +} +.taxes-and-totals .taxes > div:first-child { + margin-bottom: 10px; +} +.grand-total { + border-top: 1px solid #d1d8dd; +} +.grand-total .list-item { + height: 60px; +} +.grand-total .grand-total-value { + font-size: 24px; +} diff --git a/erpnext/public/less/pos.less b/erpnext/public/less/pos.less index bcbd142dd11..b699a55f85c 100644 --- a/erpnext/public/less/pos.less +++ b/erpnext/public/less/pos.less @@ -1,10 +1,25 @@ @import "../../../../frappe/frappe/public/less/variables.less"; +[data-route="point-of-sale"] { + .layout-main-section-wrapper { + margin-bottom: 0; + } + + .pos-items-wrapper { + max-height: ~"calc(100vh - 210px)"; + } +} + .pos { // display: flex; padding: 15px; } +.list-item { + min-height: 40px; + height: auto; +} + .cart-container { padding: 0 15px; // flex: 2; @@ -46,7 +61,7 @@ } .cart-items { - height: 200px; + height: 150px; overflow: auto; .list-item.current-item { @@ -163,4 +178,44 @@ input[type=number]::-webkit-outer-spin-button { background-color: @brand-primary; color: #ffffff; } +} + +// taxes, totals and discount area +.discount-amount { + .discount-inputs { + display: flex; + flex-direction: column; + padding: 15px 0; + } + + input:first-child { + margin-bottom: 10px; + } +} + +.taxes-and-totals { + border-top: 1px solid @border-color; + + .taxes { + display: flex; + flex-direction: column; + padding: 15px 0; + align-items: flex-end; + + & > div:first-child { + margin-bottom: 10px; + } + } +} + +.grand-total { + border-top: 1px solid @border-color; + + .list-item { + height: 60px; + } + + .grand-total-value { + font-size: 24px; + } } \ No newline at end of file diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.js b/erpnext/selling/page/point_of_sale/point_of_sale.js index dbe47956c50..236e923255c 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.js +++ b/erpnext/selling/page/point_of_sale/point_of_sale.js @@ -150,8 +150,9 @@ class PointOfSale { this.cart.add_item(item); }) .then(() => { - this.show_taxes_and_totals(); - }) + this.cart.update_taxes_and_totals(); + this.cart.update_grand_total(); + }); // if (barcode) { // const value = barcode['serial_no'] ? @@ -170,7 +171,8 @@ class PointOfSale { .then(() => { // update cart this.cart.add_item(item); - this.show_taxes_and_totals(); + this.cart.update_taxes_and_totals(); + this.cart.update_grand_total(); }); } @@ -306,28 +308,9 @@ class PointOfSale { }); this.page.add_menu_item(__("Email"), function () { - me.frm.email_doc(); + this.frm.email_doc(); }); } - - show_taxes_and_totals() { - let tax_template = ''; - let currency = this.frm.doc.currency; - const taxes_wrapper = $(this.wrapper).find('.taxes'); - - this.frm.refresh_field('taxes'); - $(this.wrapper).find('.net-total').html(format_currency(this.frm.doc.net_total, this.currency)) - $.each(this.frm.doc.taxes, function(index, data) { - tax_template += ` -