foodbot-cart-calculations 1.0.12 → 1.0.13

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.
@@ -611,7 +611,7 @@ async function getBeforeTaxPriceOfItem(taxes, price, taxType, quantity) {
611
611
 
612
612
  // Calculate taxAmount based on tax type 1 = exclusive and 2 = inclusive
613
613
  if (taxType == 2) {
614
- beforeTax = (beforeTax / (1 + totalTax / 100));
614
+ beforeTax = (beforeTax / (1 + totalTax / 100)).toFixed(2);
615
615
  }
616
616
 
617
617
  // ieps tax type = 1 precentage 2 absoulte
@@ -624,16 +624,16 @@ async function getBeforeTaxPriceOfItem(taxes, price, taxType, quantity) {
624
624
  iepsTaxRate = tax.tax_rate * quantity / beforeTaxIeps
625
625
  iepsTaxRateQuantity = tax.tax_rate * quantity
626
626
  iepsTaxRate = parseFloat(iepsTaxRate)
627
- iepsTaxAmount = tax.tax_rate * quantity;
627
+ iepsTaxAmount = (tax.tax_rate * quantity).toFixed(2);
628
628
  }
629
629
  }
630
630
  else if (tax.ieps_type && tax.ieps_type == 1) {
631
631
  beforeTaxIeps = beforeTax ;
632
632
  iepsTaxRate = tax.tax_rate
633
- iepsTaxAmount = (firstAmount - beforeTax - taxAmount);
633
+ iepsTaxAmount = (firstAmount - beforeTax - taxAmount).toFixed(2);
634
634
  }
635
635
  else{
636
- taxAmount = ((beforeTax * tax.tax_rate) / 100);
636
+ taxAmount = ((beforeTax * tax.tax_rate) / 100).toFixed(2);
637
637
  }
638
638
  });
639
639
  resolve({ beforeTax, taxAmount, beforeTaxIeps, iepsTaxRate,iepsTaxAmount,iepsTaxRateQuantity });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foodbot-cart-calculations",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
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": {