From 655f86d5e2d9a6b8c5d936f5986cc8c2a0c01b3d Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 29 Aug 2017 14:27:01 +0530 Subject: [PATCH] UI fixes --- erpnext/public/css/erpnext.css | 20 ++++++++-------- erpnext/public/css/pos.css | 3 ++- erpnext/public/less/erpnext.less | 22 +++++++++--------- erpnext/public/less/pos.less | 3 ++- .../page/point_of_sale/point_of_sale.js | 23 ++++++++++--------- 5 files changed, 37 insertions(+), 34 deletions(-) diff --git a/erpnext/public/css/erpnext.css b/erpnext/public/css/erpnext.css index 0660b39208..13fdcf1501 100644 --- a/erpnext/public/css/erpnext.css +++ b/erpnext/public/css/erpnext.css @@ -308,16 +308,6 @@ body[data-route="pos"] .item-list .image-field .placeholder-text { body[data-route="pos"] .item-list .pos-item-wrapper { position: relative; } -body[data-route="pos"] .item-list .price-info { - position: absolute; - left: 0; - bottom: 0; - margin: 0 0 15px 15px; - background-color: rgba(141, 153, 166, 0.6); - padding: 5px 9px; - border-radius: 3px; - color: #fff; -} body[data-route="pos"] .pos-bill-toolbar { margin-top: 10px; } @@ -356,3 +346,13 @@ body[data-route="pos"] .btn-more { body[data-route="pos"] .collapse-btn { cursor: pointer; } +.price-info { + position: absolute; + left: 0; + bottom: 0; + margin: 0 0 15px 15px; + background-color: rgba(141, 153, 166, 0.6); + padding: 5px 9px; + border-radius: 3px; + color: #fff; +} diff --git a/erpnext/public/css/pos.css b/erpnext/public/css/pos.css index 10355f456c..f66abc8081 100644 --- a/erpnext/public/css/pos.css +++ b/erpnext/public/css/pos.css @@ -80,7 +80,8 @@ .pos-item-wrapper { display: flex; flex-direction: column; - justify-content: space-between; + position: relative; + width: 25%; } .image-view-container { display: block; diff --git a/erpnext/public/less/erpnext.less b/erpnext/public/less/erpnext.less index 6c616c9e32..de46c53df8 100644 --- a/erpnext/public/less/erpnext.less +++ b/erpnext/public/less/erpnext.less @@ -364,17 +364,6 @@ body[data-route="pos"] { .pos-item-wrapper { position: relative; } - - .price-info { - position: absolute; - left: 0; - bottom: 0; - margin: 0 0 15px 15px; - background-color: rgba(141, 153, 166, 0.6); - padding: 5px 9px; - border-radius: 3px; - color: #fff; - } } .pos-bill-toolbar { @@ -423,4 +412,15 @@ body[data-route="pos"] { .collapse-btn { cursor: pointer; } +} + +.price-info { + position: absolute; + left: 0; + bottom: 0; + margin: 0 0 15px 15px; + background-color: rgba(141, 153, 166, 0.6); + padding: 5px 9px; + border-radius: 3px; + color: #fff; } \ No newline at end of file diff --git a/erpnext/public/less/pos.less b/erpnext/public/less/pos.less index b699a55f85..9653a82658 100644 --- a/erpnext/public/less/pos.less +++ b/erpnext/public/less/pos.less @@ -108,7 +108,8 @@ .pos-item-wrapper { display: flex; flex-direction: column; - justify-content: space-between; + position: relative; + width: 25%; } .image-view-container { 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 4096ed436e..cc1e3f164d 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.js +++ b/erpnext/selling/page/point_of_sale/point_of_sale.js @@ -39,6 +39,7 @@ class PointOfSale { this.bind_events(); }, () => this.make_new_invoice(), + () => this.page.set_title(__('Point of Sale')) ]); } @@ -584,7 +585,7 @@ class POSCart { const $item = this.$cart_items.find(`[data-item-code="${item.item_code}"]`); if(item.qty > 0) { $item.find('.quantity input').val(item.qty); - $item.find('.discount').text(item.discount_percentage); + $item.find('.discount').text(item.discount_percentage + '%'); $item.find('.rate').text(format_currency(item.rate, this.frm.doc.currency)); } else { $item.remove(); @@ -700,23 +701,23 @@ class POSCart { frappe.model.set_value(this.frm.doctype, this.frm.docname, 'additional_discount_percentage', e.target.value) .then(() => { - let discount_wrapper = this.wrapper.find('.discount_amount') - discount_wrapper.val(this.frm.doc.discount_amount) - discount_wrapper.trigger('change') - }) - }) + let discount_wrapper = this.wrapper.find('.discount_amount'); + discount_wrapper.val(this.frm.doc.discount_amount); + discount_wrapper.trigger('change'); + }); + }); this.wrapper.find('.discount_amount').on('change', (e) => { frappe.model.set_value(this.frm.doctype, this.frm.docname, - 'discount_amount', e.target.value) + 'discount_amount', e.target.value); this.frm.trigger('discount_amount') .then(() => { let discount_wrapper = this.wrapper.find('.additional_discount_percentage'); discount_wrapper.val(this.frm.doc.additional_discount_percentage); - this.update_taxes_and_totals() - this.update_grand_total() - }) - }) + this.update_taxes_and_totals(); + this.update_grand_total(); + }); + }); } set_selected_item($item) {