softseti-sale-calculator-library 3.6.0 → 3.7.1

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.6.0",
3
+ "version": "3.7.1",
4
4
  "description": "Sales calculation engine by Softseti",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -871,6 +871,7 @@ module.exports = {
871
871
  appliedWholesaleLevels,
872
872
  getApplicableDwTaxes,
873
873
  getConsolidatedTaxes,
874
+ calcDwSaleProductPrice,
874
875
  _internals: {
875
876
  calcDwSaleProductSum,
876
877
  calcDwSaleProductDiscount,
package/src/index.d.ts CHANGED
@@ -79,6 +79,8 @@ declare module 'softseti-sale-calculator-library' {
79
79
  */
80
80
  export function calculatePaymentDetails(payment: any, sale: Sale): PaymentCalculation;
81
81
 
82
+
83
+ export function calcDwSaleProductPrice(saleProduct: any, sale: any): number;
82
84
  /**
83
85
  * Gets applied wholesale levels
84
86
  * @param {Sale} sale - Sale object
@@ -86,18 +88,26 @@ declare module 'softseti-sale-calculator-library' {
86
88
  */
87
89
  export function appliedWholesaleLevels(sale: any): WholesaleLevel[];
88
90
 
89
- /**
90
- * Calculates all applicable taxes for the sale and returns them in API format
91
- * @param {Object} sale - Sale object
92
- * @returns {Array} Array of tax objects with id, abbreviation, and amount
93
- */
94
- export function getApplicableDwTaxes(sale: any): any[];
91
+ /**
92
+ * Calculates all applicable taxes for the sale and returns them in API format
93
+ * @param {Object} sale - Sale object
94
+ * @returns {Array} Array of tax objects with id, abbreviation, and amount
95
+ */
96
+ export function getApplicableDwTaxes(sale: any): any[];
95
97
 
96
- /**
97
- * Calculates comprehensive sale totals
98
- * @param {Sale} sale - Sale object
99
- * @returns {SaleTotals} Sale totals
98
+
99
+ /**
100
+ * Gets getConsolidatedTaxes taxes by merging taxes with same id, abbreviation and rate
101
+ * @param {Object} sale - Sale data object
102
+ * @returns {Array} Array of unified tax objects with id, abbreviation, rate and total amount
100
103
  */
104
+ export function getConsolidatedTaxes(sale: any): any[];
105
+
106
+ /**
107
+ * Calculates comprehensive sale totals
108
+ * @param {Sale} sale - Sale object
109
+ * @returns {SaleTotals} Sale totals
110
+ */
101
111
  export function calculateSaleTotals(sale: any): SaleTotals;
102
112
 
103
113
  /**
@@ -109,19 +119,19 @@ declare module 'softseti-sale-calculator-library' {
109
119
  * @internal
110
120
  */
111
121
  calcDwSaleProductSum: (saleProduct: any, sale: Sale) => number;
112
-
122
+
113
123
  /**
114
124
  * Calculates sale product discount
115
125
  * @internal
116
126
  */
117
127
  calcDwSaleProductDiscount: (product: any, sale: Sale) => number;
118
-
128
+
119
129
  /**
120
130
  * Gets applicable product taxes
121
131
  * @internal
122
132
  */
123
133
  getApplicableProductTaxes: (saleProduct: any, productSum: number, sale: Sale) => number;
124
-
134
+
125
135
  /**
126
136
  * Currency exchange calculation
127
137
  * @internal