Merge branch 'rebrand-ui' of https://github.com/frappe/erpnext into rebrand-ui
diff --git a/erpnext/public/scss/point-of-sale.scss b/erpnext/public/scss/point-of-sale.scss
index f388093..f975738 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 28076db..eb29976 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 @@
}
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);
@@ -333,9 +333,25 @@
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 => {