washday-sdk 0.0.162 → 0.0.163
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -18,7 +18,7 @@ export const calculateOrderTotal = (order, selectedCustomer, storeSettings, hasS
|
|
|
18
18
|
discountCodeAmount = includesProducts ? discountCodeObj.value : 0;
|
|
19
19
|
}
|
|
20
20
|
// ORDER TOTAL CALCULATION AND CREDIT APPLIED
|
|
21
|
-
let orderTotalWithOutCredit = +(totalImportWithDiscount +
|
|
21
|
+
let orderTotalWithOutCredit = +(totalImportWithDiscount + shippingCost - discountCodeAmount).toFixed(2);
|
|
22
22
|
let creditApplied = getCreditApplied(selectedCustomer, orderTotalWithOutCredit);
|
|
23
23
|
let orderTotal = +(orderTotalWithOutCredit - creditApplied).toFixed(2);
|
|
24
24
|
return Object.assign(Object.assign({}, order), { totalQuantity, customerDiscount: order.discountCode ? 0 : (_a = selectedCustomer === null || selectedCustomer === void 0 ? void 0 : selectedCustomer.customer) === null || _a === void 0 ? void 0 : _a.discount, productTotal: totalImportWithDiscount, taxesTotal: totalImporTaxes, total: orderTotal, creditApplied, productTotalWithoutDiscount: totalImportWithoutDiscount, totalDiscountAmount: totalDiscountAmount + discountCodeAmount, shippingServiceTotal: shippingCost, appliedOrderDiscounts });
|
|
@@ -46,7 +46,8 @@ export const calculateTotalTaxesOverPrice = (order, selectedCustomer, storeSetti
|
|
|
46
46
|
const totalTaxesApplied = +(taxes).toFixed(2);
|
|
47
47
|
const lineDiscount = +(productDiscount * qty).toFixed(2);
|
|
48
48
|
// Se suma el extraAmount a la parte del producto descontado para obtener el valor total a cobrar de la línea
|
|
49
|
-
const prodLinePriceWithDiscount = +(((discountedProductPrice * qty) + current.extraAmount)).toFixed(2);
|
|
49
|
+
//const prodLinePriceWithDiscount = +(((discountedProductPrice * qty) + current.extraAmount)).toFixed(2);
|
|
50
|
+
const prodLinePriceWithDiscount = +((((discountedProductPrice * qty) + current.extraAmount) * (1 + taxPercentage))).toFixed(2);
|
|
50
51
|
return {
|
|
51
52
|
product: current,
|
|
52
53
|
qty,
|
package/package.json
CHANGED
|
@@ -37,7 +37,7 @@ export const calculateOrderTotal = (
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
// ORDER TOTAL CALCULATION AND CREDIT APPLIED
|
|
40
|
-
let orderTotalWithOutCredit = +(totalImportWithDiscount +
|
|
40
|
+
let orderTotalWithOutCredit = +(totalImportWithDiscount + shippingCost - discountCodeAmount).toFixed(2);
|
|
41
41
|
let creditApplied = getCreditApplied(selectedCustomer, orderTotalWithOutCredit);
|
|
42
42
|
let orderTotal = +(orderTotalWithOutCredit - creditApplied).toFixed(2);
|
|
43
43
|
|
|
@@ -59,7 +59,8 @@ export const calculateTotalTaxesOverPrice = (
|
|
|
59
59
|
const totalTaxesApplied = +(taxes).toFixed(2);
|
|
60
60
|
const lineDiscount = +(productDiscount * qty).toFixed(2);
|
|
61
61
|
// Se suma el extraAmount a la parte del producto descontado para obtener el valor total a cobrar de la línea
|
|
62
|
-
const prodLinePriceWithDiscount = +(((discountedProductPrice * qty) + current.extraAmount)).toFixed(2);
|
|
62
|
+
//const prodLinePriceWithDiscount = +(((discountedProductPrice * qty) + current.extraAmount)).toFixed(2);
|
|
63
|
+
const prodLinePriceWithDiscount = +((((discountedProductPrice * qty) + current.extraAmount) * (1 + taxPercentage))).toFixed(2);
|
|
63
64
|
|
|
64
65
|
return {
|
|
65
66
|
product: current,
|