softseti-sale-calculator-library 3.7.5 → 3.7.6

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "softseti-sale-calculator-library",
3
- "version": "3.7.5",
3
+ "version": "3.7.6",
4
4
  "description": "Sales calculation engine by Softseti",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -136,7 +136,7 @@ function preprocessSale(sale) {
136
136
  original_currency_iso: originalCurrency?.iso,
137
137
  currency_id: sale.currency_id,
138
138
  currency_iso: sale.currency_iso,
139
- change_amount: Math.max(0, payment.gived_amount - payment.amount)
139
+ change_amount: 0
140
140
  };
141
141
  }
142
142
 
@@ -568,7 +568,7 @@ function calculatePaymentDetails(payment, sale) {
568
568
  original_amount, // Applied amount in payment's original currency
569
569
  original_gived_amount: payment.original_gived_amount, // Original given amount unchanged
570
570
  exchange_rate,
571
- change_amount: roundCurrency(payment.gived_amount - payment.amount) // Change in sale currency
571
+ change_amount: roundCurrency(gived_amount - amount) // Change in sale currency
572
572
  };
573
573
  }
574
574