b2m-utils 0.0.255 → 0.0.257
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/build/index.esm.js +5 -6
- package/build/index.esm.js.gz +0 -0
- package/build/index.esm.js.map +1 -1
- package/build/index.js +5 -6
- package/build/index.js.gz +0 -0
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -489,9 +489,11 @@ var calculateFee = function (ratecardLaneFee, cte, allFees, debug, allFeesForCal
|
|
|
489
489
|
switch (fee_1.feeCalculationTypeId) {
|
|
490
490
|
case exports.FeeCalculationTypeEnum.TOTAL_PERCENTAGE:
|
|
491
491
|
if (allFees && Array.isArray(allFees) && (allFees === null || allFees === void 0 ? void 0 : allFees.length) > 0) {
|
|
492
|
-
var filteredFees =
|
|
493
|
-
var
|
|
494
|
-
|
|
492
|
+
var filteredFees = allFees.filter(function (i) { var _a; return ((_a = i.fee) === null || _a === void 0 ? void 0 : _a.feeCalculationTypeId) !== exports.FeeCalculationTypeEnum.TOTAL_PERCENTAGE; });
|
|
493
|
+
var filteredFeesResults = filterSiblingFees(filteredFees.map(function (it) {
|
|
494
|
+
return calculateFee(it, cte, allFees, debug, allFeesForCalc);
|
|
495
|
+
}));
|
|
496
|
+
var totalFromAllFees = filteredFeesResults.map(function (result) {
|
|
495
497
|
if (result === null || result === void 0 ? void 0 : result.totalToCalc) {
|
|
496
498
|
return result.totalToCalc;
|
|
497
499
|
}
|
|
@@ -1186,9 +1188,6 @@ var getCtesFeesResult = function (feesToCalc, cte, allFeesForCalc) {
|
|
|
1186
1188
|
var item = nonIcmsFees_1[_i];
|
|
1187
1189
|
_loop_1(item);
|
|
1188
1190
|
}
|
|
1189
|
-
console.log("CALC TOTAL", {
|
|
1190
|
-
results: results,
|
|
1191
|
-
});
|
|
1192
1191
|
// SEGUNDA PASSADA: Calcular ICMS com base nos resultados já filtrados
|
|
1193
1192
|
if (icmsFee) {
|
|
1194
1193
|
// Coletar apenas os valores das fees que realmente contam (total > 0)
|
package/build/index.js.gz
CHANGED
|
Binary file
|