b2m-utils 0.0.263 → 0.0.265
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
|
@@ -548,9 +548,9 @@ var calculateFee = function (ratecardLaneFee, cte, allFees, debug, allFeesForCal
|
|
|
548
548
|
var firstTotal = +totalValueFromAllFees / +valueToDivide;
|
|
549
549
|
var total = +firstTotal * +icmsValue;
|
|
550
550
|
var totalValueFromAllFeesCurrency = convertNumberToCurrency(+totalValueFromAllFees, 'pt-br');
|
|
551
|
-
var
|
|
552
|
-
totalFee = Number(
|
|
553
|
-
totalToCalc = Number(
|
|
551
|
+
var truncatedTo3Decimals = Math.floor(total * 1000) / 1000;
|
|
552
|
+
totalFee = Number(truncatedTo3Decimals.toFixed(2));
|
|
553
|
+
totalToCalc = Number(truncatedTo3Decimals.toFixed(2));
|
|
554
554
|
var resultCurrency = (+totalToCalc).toLocaleString('pt-BR', {
|
|
555
555
|
style: 'currency',
|
|
556
556
|
currency: 'BRL',
|
|
@@ -891,8 +891,7 @@ var calculateFee = function (ratecardLaneFee, cte, allFees, debug, allFeesForCal
|
|
|
891
891
|
}
|
|
892
892
|
}
|
|
893
893
|
// totalToCalc = totalFee;
|
|
894
|
-
|
|
895
|
-
totalToCalc = Number(truncatedTo3Decimals.toFixed(2));
|
|
894
|
+
// totalToCalc = Math.round(+totalFee * 100) / 100;
|
|
896
895
|
if (fee_1.parentId) {
|
|
897
896
|
var siblingFees = allFees === null || allFees === void 0 ? void 0 : allFees.filter(function (i) { var _a, _b; return ((_a = i.fee) === null || _a === void 0 ? void 0 : _a.parentId) === fee_1.parentId && ((_b = i.fee) === null || _b === void 0 ? void 0 : _b.id) !== fee_1.id; });
|
|
898
897
|
if (siblingFees && (siblingFees === null || siblingFees === void 0 ? void 0 : siblingFees.length) > 0) {
|
|
@@ -922,7 +921,7 @@ var calculateFee = function (ratecardLaneFee, cte, allFees, debug, allFeesForCal
|
|
|
922
921
|
return {
|
|
923
922
|
totalFee: +totalFee.toFixed(2),
|
|
924
923
|
resultFee: resultFee,
|
|
925
|
-
totalToCalc:
|
|
924
|
+
totalToCalc: +totalFee.toFixed(2),
|
|
926
925
|
feeValue: ratecardLaneFee.value,
|
|
927
926
|
fee: fee_1,
|
|
928
927
|
};
|
package/build/index.js.gz
CHANGED
|
Binary file
|