Merge branch 'develop' into feature/csr-1790
This commit is contained in:
commit
06ee721cf2
1 changed files with 14 additions and 7 deletions
|
|
@ -267,8 +267,6 @@ export default {
|
|||
"payment"
|
||||
);
|
||||
|
||||
// TODO: Data fetching Promise declarations
|
||||
|
||||
const promiseResultMap = [
|
||||
{
|
||||
resultKey: "cmsContent",
|
||||
|
|
@ -509,17 +507,26 @@ export default {
|
|||
}
|
||||
},
|
||||
getPiaLineItems() {
|
||||
let itemsForPia = "";
|
||||
const itemMap = new Map();
|
||||
const glassParts = store.getters.order.lineItems.glassParts;
|
||||
const supportingItems = store.getters.order.lineItems.supportingItems;
|
||||
const vaps = store.getters.order.lineItems.vaps;
|
||||
const items = [...(glassParts ?? []), ...(supportingItems ?? []), ...(vaps ?? [])];
|
||||
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
const amount = items[i].laborAmount + items[i].sellingPrice;
|
||||
itemsForPia += items[i].partType + "|" + amount + "|1|";
|
||||
for (const item of items) {
|
||||
const amount = item.laborAmount + item.sellingPrice;
|
||||
const key = `${item.partType}|${amount}`;
|
||||
|
||||
if (itemMap.has(key)) {
|
||||
itemMap.get(key).quantity++;
|
||||
} else {
|
||||
itemMap.set(key, { partType: item.partType, amount, quantity: 1 });
|
||||
}
|
||||
}
|
||||
return itemsForPia;
|
||||
|
||||
return Array.from(itemMap.values())
|
||||
.map((item) => `${item.partType}|${item.amount}|${item.quantity}`)
|
||||
.join("||");
|
||||
},
|
||||
getAmountDue() {
|
||||
return baseMixin.methods.getAmountDue(store.getters.order.lineItems);
|
||||
|
|
|
|||
Loading…
Reference in a new issue