fix: order summary qty alignment

This commit is contained in:
Saqib Ansari 2020-11-30 17:41:38 +05:30
parent ac164c66ed
commit 02d1491e39
2 changed files with 17 additions and 0 deletions

View File

@ -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);

View File

@ -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 => {