CSR-1392
set amount due for PIA
This commit is contained in:
parent
23373e8925
commit
f2fc50cd3e
5 changed files with 16 additions and 19 deletions
|
|
@ -129,8 +129,6 @@ export default {
|
||||||
|
|
||||||
let vapsCartItemsForSelectedPackage = [];
|
let vapsCartItemsForSelectedPackage = [];
|
||||||
|
|
||||||
console.log(this.cartItems);
|
|
||||||
console.log(packageContentTypes);
|
|
||||||
this.cartItems.forEach((cartItem) => {
|
this.cartItems.forEach((cartItem) => {
|
||||||
packageContentTypes.forEach((vapType) => {
|
packageContentTypes.forEach((vapType) => {
|
||||||
if (vapType == cartItem.cartItemType) {
|
if (vapType == cartItem.cartItemType) {
|
||||||
|
|
@ -153,17 +151,10 @@ export default {
|
||||||
return vapsTypeName.Text;
|
return vapsTypeName.Text;
|
||||||
},
|
},
|
||||||
removeItem(cartItemType, category) {
|
removeItem(cartItemType, category) {
|
||||||
console.log(
|
|
||||||
this.lineItems[category].filter(
|
|
||||||
(lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType
|
|
||||||
)
|
|
||||||
);
|
|
||||||
this.lineItems[category] = this.lineItems[category].filter(
|
this.lineItems[category] = this.lineItems[category].filter(
|
||||||
(lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType
|
(lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType
|
||||||
);
|
);
|
||||||
|
|
||||||
//console.log(`lineItemToDelete: ${lineItemIdToDelete}`)
|
|
||||||
|
|
||||||
this.$emit("update:modelValue", this.lineItems);
|
this.$emit("update:modelValue", this.lineItems);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -269,8 +260,6 @@ export default {
|
||||||
nonpackageCartItems() {
|
nonpackageCartItems() {
|
||||||
const nonpackageCartItems = [];
|
const nonpackageCartItems = [];
|
||||||
|
|
||||||
console.log("packageCartItems");
|
|
||||||
|
|
||||||
this.cartItems.forEach((cartItem) => {
|
this.cartItems.forEach((cartItem) => {
|
||||||
if (cartItem == this.recycleFeeCartItem || cartItem == this.mobileFeeCartItem) {
|
if (cartItem == this.recycleFeeCartItem || cartItem == this.mobileFeeCartItem) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -272,8 +272,18 @@ export default {
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// save lineitems as they now have salestax added
|
||||||
|
await this.dispatchStoreAction(
|
||||||
|
storeActions.SAVE_GLASS_PARTS,
|
||||||
|
this.lineItems.glassParts,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
await this.dispatchStoreAction(
|
||||||
|
storeActions.SAVE_SUPPORTING_ITEMS,
|
||||||
|
this.lineItems.supportingItems,
|
||||||
|
false
|
||||||
|
);
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false);
|
await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false);
|
||||||
|
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_PROMOS, this.lineItems.promos, false);
|
await this.dispatchStoreAction(storeActions.SAVE_PROMOS, this.lineItems.promos, false);
|
||||||
|
|
||||||
if (this.paymentMethod == paymentMethods.LATER) {
|
if (this.paymentMethod == paymentMethods.LATER) {
|
||||||
|
|
|
||||||
|
|
@ -419,12 +419,10 @@ export default {
|
||||||
return itemsForPia;
|
return itemsForPia;
|
||||||
},
|
},
|
||||||
getAmountDue() {
|
getAmountDue() {
|
||||||
return 1600;
|
return baseMixin.methods.getAmountDue(store.getters.order.lineItems);
|
||||||
//return baseMixin.methods.getAmountDue(store.getters.order.lineItems);
|
|
||||||
},
|
},
|
||||||
getDisplayAmountDue() {
|
getDisplayAmountDue() {
|
||||||
return "$1600.00";
|
return baseMixin.methods.getDisplayAmountDue(store.getters.order.lineItems);
|
||||||
//return baseMixin.methods.getDisplayAmountDue(store.getters.order.lineItems);
|
|
||||||
},
|
},
|
||||||
isPaypal() {
|
isPaypal() {
|
||||||
if (this.getPaymentType() == "pp") {
|
if (this.getPaymentType() == "pp") {
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,9 @@ export default {
|
||||||
return totalPrice;
|
return totalPrice;
|
||||||
},
|
},
|
||||||
getTotalLineItemPrice(lineItem) {
|
getTotalLineItemPrice(lineItem) {
|
||||||
return lineItem.kitPrice + lineItem.laborAmount + lineItem.sellingPrice;
|
return (
|
||||||
|
lineItem.kitPrice + lineItem.laborAmount + lineItem.sellingPrice + lineItem.salesTax
|
||||||
|
);
|
||||||
},
|
},
|
||||||
getDisplayAmountDue(lineItems) {
|
getDisplayAmountDue(lineItems) {
|
||||||
return this.getAmountDue(lineItems).toLocaleString("en-US", {
|
return this.getAmountDue(lineItems).toLocaleString("en-US", {
|
||||||
|
|
@ -123,7 +125,6 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getAmountDue(lineItems) {
|
getAmountDue(lineItems) {
|
||||||
// TODO: verify tax is included in lineitems
|
|
||||||
var amountDue = 0;
|
var amountDue = 0;
|
||||||
if (lineItems.glassParts) {
|
if (lineItems.glassParts) {
|
||||||
amountDue = this.getTotalPriceOfAllLineItemsAndChildParts(lineItems.glassParts);
|
amountDue = this.getTotalPriceOfAllLineItemsAndChildParts(lineItems.glassParts);
|
||||||
|
|
|
||||||
|
|
@ -1291,7 +1291,6 @@ export const actions = {
|
||||||
});
|
});
|
||||||
|
|
||||||
syncLineItemIds(response.data, context.getters.order.lineItems.vaps);
|
syncLineItemIds(response.data, context.getters.order.lineItems.vaps);
|
||||||
console.log(response.data);
|
|
||||||
return response;
|
return response;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue