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 +1 -1
- package/src/SaleCalculator.js +1 -0
- package/src/index.d.ts +23 -13
package/package.json
CHANGED
package/src/SaleCalculator.js
CHANGED
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
-
|
|
98
|
-
*
|
|
99
|
-
* @
|
|
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
|