feat(pos): Total item qty field to POS screen (#28331)
This commit is contained in:
parent
0d9b0fe6dc
commit
2f6a6afaa8
@ -495,6 +495,11 @@
|
||||
font-size: var(--text-md);
|
||||
}
|
||||
|
||||
> .item-qty-total-container {
|
||||
@extend .net-total-container;
|
||||
padding: 5px 0px 0px 0px;
|
||||
}
|
||||
|
||||
> .taxes-container {
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
|
@ -100,6 +100,10 @@ erpnext.PointOfSale.ItemCart = class {
|
||||
`<div class="add-discount-wrapper">
|
||||
${this.get_discount_icon()} ${__('Add Discount')}
|
||||
</div>
|
||||
<div class="item-qty-total-container">
|
||||
<div class="item-qty-total-label">${__('Total Items')}</div>
|
||||
<div class="item-qty-total-value">0.00</div>
|
||||
</div>
|
||||
<div class="net-total-container">
|
||||
<div class="net-total-label">${__("Net Total")}</div>
|
||||
<div class="net-total-value">0.00</div>
|
||||
@ -142,6 +146,7 @@ erpnext.PointOfSale.ItemCart = class {
|
||||
|
||||
this.$numpad_section.prepend(
|
||||
`<div class="numpad-totals">
|
||||
<span class="numpad-item-qty-total"></span>
|
||||
<span class="numpad-net-total"></span>
|
||||
<span class="numpad-grand-total"></span>
|
||||
</div>`
|
||||
@ -470,6 +475,7 @@ erpnext.PointOfSale.ItemCart = class {
|
||||
if (!frm) frm = this.events.get_frm();
|
||||
|
||||
this.render_net_total(frm.doc.net_total);
|
||||
this.render_total_item_qty(frm.doc.items);
|
||||
const grand_total = cint(frappe.sys_defaults.disable_rounded_total) ? frm.doc.grand_total : frm.doc.rounded_total;
|
||||
this.render_grand_total(grand_total);
|
||||
|
||||
@ -487,6 +493,21 @@ erpnext.PointOfSale.ItemCart = class {
|
||||
);
|
||||
}
|
||||
|
||||
render_total_item_qty(items) {
|
||||
var total_item_qty = 0;
|
||||
items.map((item) => {
|
||||
total_item_qty = total_item_qty + item.qty;
|
||||
});
|
||||
|
||||
this.$totals_section.find('.item-qty-total-container').html(
|
||||
`<div>${__('Total Quantity')}</div><div>${total_item_qty}</div>`
|
||||
);
|
||||
|
||||
this.$numpad_section.find('.numpad-item-qty-total').html(
|
||||
`<div>${__('Total Quantity')}: <span>${total_item_qty}</span></div>`
|
||||
);
|
||||
}
|
||||
|
||||
render_grand_total(value) {
|
||||
const currency = this.events.get_frm().doc.currency;
|
||||
this.$totals_section.find('.grand-total-container').html(
|
||||
|
Loading…
x
Reference in New Issue
Block a user