b2m-utils 0.0.220 → 0.0.222
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 +6 -3
- package/build/index.esm.js.gz +0 -0
- package/build/index.esm.js.map +1 -1
- package/build/index.js +6 -3
- package/build/index.js.gz +0 -0
- package/build/index.js.map +1 -1
- package/build/types/Cte/index.d.ts +1 -0
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -398,9 +398,12 @@ var calculateFee = function (ratecardLaneFee, cte, allFees, debug, allFeesForCal
|
|
|
398
398
|
return +previous + +current;
|
|
399
399
|
}, 0);
|
|
400
400
|
if (totalValueFromAllFees && !isNaN(+totalValueFromAllFees)) {
|
|
401
|
-
var
|
|
401
|
+
var icmsValue = (cte.icmsIncidence !== undefined && cte.icmsIncidence !== null && !isNaN(+cte.icmsIncidence))
|
|
402
|
+
? cte.icmsIncidence
|
|
403
|
+
: value;
|
|
404
|
+
var valueToDivide = (1 - icmsValue).toFixed(2);
|
|
402
405
|
var firstTotal = +totalValueFromAllFees / +valueToDivide;
|
|
403
|
-
var total = +firstTotal * +
|
|
406
|
+
var total = +firstTotal * +icmsValue;
|
|
404
407
|
var totalValueFromAllFeesCurrency = convertNumberToCurrency(+totalValueFromAllFees, 'pt-br');
|
|
405
408
|
var truncatedTo3Decimals_1 = Math.floor(total * 1000) / 1000;
|
|
406
409
|
totalFee = Number(truncatedTo3Decimals_1.toFixed(2));
|
|
@@ -409,7 +412,7 @@ var calculateFee = function (ratecardLaneFee, cte, allFees, debug, allFeesForCal
|
|
|
409
412
|
style: 'currency',
|
|
410
413
|
currency: 'BRL',
|
|
411
414
|
});
|
|
412
|
-
var result = "(".concat(totalValueFromAllFeesCurrency, " / ").concat(valueToDivide, ") x ").concat(
|
|
415
|
+
var result = "(".concat(totalValueFromAllFeesCurrency, " / ").concat(valueToDivide, ") x ").concat(icmsValue, " = ").concat(resultCurrency);
|
|
413
416
|
resultFee = result;
|
|
414
417
|
}
|
|
415
418
|
}
|
package/build/index.js.gz
CHANGED
|
Binary file
|