From 02d1491e39951a25b1c502fb9abf337e08a34b2c Mon Sep 17 00:00:00 2001 From: Saqib Ansari Date: Mon, 30 Nov 2020 17:41:38 +0530 Subject: [PATCH 1/2] fix: order summary qty alignment --- erpnext/public/scss/point-of-sale.scss | 1 + .../page/point_of_sale/pos_past_order_summary.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/erpnext/public/scss/point-of-sale.scss b/erpnext/public/scss/point-of-sale.scss index f388093548..f9757384cb 100644 --- a/erpnext/public/scss/point-of-sale.scss +++ b/erpnext/public/scss/point-of-sale.scss @@ -1067,6 +1067,7 @@ display: flex; text-align: right; margin-left: var(--margin-md); + justify-content: flex-end; > .item-disc { color: var(--dark-green-500); diff --git a/erpnext/selling/page/point_of_sale/pos_past_order_summary.js b/erpnext/selling/page/point_of_sale/pos_past_order_summary.js index 28076db63b..4b75c0bb73 100644 --- a/erpnext/selling/page/point_of_sale/pos_past_order_summary.js +++ b/erpnext/selling/page/point_of_sale/pos_past_order_summary.js @@ -333,9 +333,25 @@ erpnext.PointOfSale.PastOrderSummary = class { doc.items.forEach((item, i) => { const item_dom = this.get_item_html(doc, item); this.$items_container.append(item_dom); + this.set_dynamic_rate_header_width(); }); } + set_dynamic_rate_header_width() { + const rate_cols = Array.from(this.$items_container.find(".item-rate-disc")); + this.$items_container.find(".item-rate-disc").css("width", ""); + let max_width = rate_cols.reduce((max_width, elm) => { + if ($(elm).width() > max_width) + max_width = $(elm).width(); + return max_width; + }, 0); + + max_width += 1; + if (max_width == 1) max_width = ""; + + this.$items_container.find(".item-rate-disc").css("width", max_width); + } + attach_payments_info(doc) { this.$payment_container.html(''); doc.payments.forEach(p => { From 188e0ecbcb11f994f16a1a1ff9a7fc5abb3bad7d Mon Sep 17 00:00:00 2001 From: Saqib Ansari Date: Mon, 30 Nov 2020 17:53:19 +0530 Subject: [PATCH 2/2] fix: submit order summary center alignment --- .../page/point_of_sale/pos_past_order_summary.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/erpnext/selling/page/point_of_sale/pos_past_order_summary.js b/erpnext/selling/page/point_of_sale/pos_past_order_summary.js index 4b75c0bb73..eb29976371 100644 --- a/erpnext/selling/page/point_of_sale/pos_past_order_summary.js +++ b/erpnext/selling/page/point_of_sale/pos_past_order_summary.js @@ -299,12 +299,12 @@ erpnext.PointOfSale.PastOrderSummary = class { } load_summary_of(doc, after_submission=false) { - this.toggle_summary_placeholder(false) - after_submission ? - this.$summary_wrapper.css('grid-column', 'span 10 / span 10') : - this.$summary_wrapper.css('grid-column', 'span 6 / span 6') - + this.$component.css('grid-column', 'span 10 / span 10') : + this.$component.css('grid-column', 'span 6 / span 6') + + this.toggle_summary_placeholder(false) + this.doc = doc; this.attach_document_info(doc);