foodbot-cart-calculations 1.0.25 → 1.0.27

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.
@@ -767,8 +767,6 @@ function addItemQuantity(items, offer) {
767
767
  });
768
768
  }
769
769
  }
770
- } else {
771
- count++;
772
770
  }
773
771
  count++;
774
772
  if (count == items.length) {
@@ -338,7 +338,7 @@ function calculateModiTax(cart, itemIndex, element, tax_settings, afterDicsount,
338
338
  element.item_modifiers[modiIndex].tax_array = tax_array;
339
339
  cart = await setTaxes(cart, JSON.parse(JSON.stringify(modiItemTaxArray)));
340
340
 
341
- element.item_modifiers[modiIndex].tax_amount = parseFloat(itemModiTotalTax).toFixed(2);
341
+ element.item_modifiers[modiIndex].tax_amount = parseFloat(element.item_modifiers[modiIndex].tax_amount) + parseFloat(taxAmount);
342
342
  element.item_modifiers[modiIndex].tax_amount = parseFloat(element.item_modifiers[modiIndex].tax_amount).toFixed(6)
343
343
  element.tax_amount_modifier = parseFloat(element.tax_amount_modifier) + parseFloat(taxAmount)
344
344
  element.tax_amount_modifier = parseFloat(element.tax_amount_modifier).toFixed(6)
@@ -457,7 +457,7 @@ function calculatePackageModiTax(cart, itemIndex, element, tax_settings, afterDi
457
457
  element.package_items[packageItemIndex].modifiers[modiIndex].tax_array = tax_array;
458
458
  cart = await setTaxes(cart, JSON.parse(JSON.stringify(modiItemTaxArray)))
459
459
 
460
- element.package_items[packageItemIndex].modifiers[modiIndex].tax_amount = parseFloat(itemModiTotalTax).toFixed(2);
460
+ element.package_items[packageItemIndex].modifiers[modiIndex].tax_amount = parseFloat(element.package_items[packageItemIndex].modifiers[modiIndex].tax_amount) + parseFloat(taxAmount);
461
461
  element.package_items[packageItemIndex].tax_amount_modifier = (parseFloat(element.package_items[packageItemIndex].tax_amount_modifier) + parseFloat(taxAmount)).toFixed(6)
462
462
  element.package_items[packageItemIndex].total_tax_amount = (parseFloat(element.package_items[packageItemIndex].total_tax_amount) + parseFloat(taxAmount)).toFixed(6)
463
463
  element.tax_amount_modifier = (parseFloat(element.tax_amount_modifier) + parseFloat(taxAmount)).toFixed(6)
package/index.js CHANGED
@@ -364,6 +364,4 @@ async function calculateTax(inputJSON) {
364
364
  // console.log(err)
365
365
  // })
366
366
 
367
- module.exports = { calculateTax }
368
-
369
-
367
+ module.exports = { calculateTax }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foodbot-cart-calculations",
3
- "version": "1.0.25",
3
+ "version": "1.0.27",
4
4
  "description": "Package for cart calculations in which it performs discount distribution and tax distribution on order",
5
5
  "main": "index.js",
6
6
  "scripts": {