testing lower paypal dollar amounts
This commit is contained in:
CarlNation 2023-10-24 15:13:56 -04:00
parent f471bac01c
commit 45add3866b
2 changed files with 12 additions and 11 deletions

View file

@ -326,11 +326,11 @@ export default {
return itemsForPia;
},
getAmountDue() {
return 350.0;
return 2;
//return baseMixin.methods.getAmountDue(store.getters.order.lineItems);
},
getDisplayAmountDue() {
return "$350.00";
return "$2.00"
//return baseMixin.methods.getDisplayAmountDue(store.getters.order.lineItems);
},
isPaypal() {

View file

@ -124,16 +124,17 @@ export default {
},
getAmountDue(lineItems) {
// TODO: verify tax is included in lineitems
// Price everything in lineitems except the server data string
var amountDue = 0;
const itemsClone = { ...lineItems };
delete itemsClone.serverData;
for (var propertyName in itemsClone) {
if (itemsClone[propertyName]) {
amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(
itemsClone[propertyName]
);
}
if (lineItems.glassParts) {
amountDue = this.getTotalPriceOfAllLineItemsAndChildParts(lineItems.glassParts);
}
if (lineItems.supportingItems) {
amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(
lineItems.supportingItems
);
}
if (lineItems.supportingItems.vaps) {
amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(lineItems.vaps);
}
return amountDue;
},