b2m-utils 0.0.208 → 0.0.209
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 -9
- package/build/index.esm.js.gz +0 -0
- package/build/index.esm.js.map +1 -1
- package/build/index.js +6 -9
- package/build/index.js.gz +0 -0
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -375,9 +375,9 @@ var calculateFee = function (ratecardLaneFee, cte, allFees, debug, allFeesForCal
|
|
|
375
375
|
var firstTotal = +totalValueFromAllFees / +valueToDivide;
|
|
376
376
|
var total = +firstTotal * +value;
|
|
377
377
|
var totalValueFromAllFeesCurrency = convertNumberToCurrency(+totalValueFromAllFees, 'pt-br');
|
|
378
|
-
var
|
|
379
|
-
totalFee = Number(
|
|
380
|
-
totalToCalc = Number(
|
|
378
|
+
var truncatedTo3Decimals_1 = Math.floor(total * 1000) / 1000;
|
|
379
|
+
totalFee = Number(truncatedTo3Decimals_1.toFixed(2));
|
|
380
|
+
totalToCalc = Number(truncatedTo3Decimals_1.toFixed(2));
|
|
381
381
|
var resultCurrency = (+totalToCalc).toLocaleString('pt-BR', {
|
|
382
382
|
style: 'currency',
|
|
383
383
|
currency: 'BRL',
|
|
@@ -513,11 +513,6 @@ var calculateFee = function (ratecardLaneFee, cte, allFees, debug, allFeesForCal
|
|
|
513
513
|
feesWithMaxWeight === null || feesWithMaxWeight === void 0 ? void 0 : feesWithMaxWeight.sort(function (a, b) { return b.maxWeight - a.maxWeight; });
|
|
514
514
|
// Pegar o primeiro (maior maxWeight)
|
|
515
515
|
var highestIntervalFee = feesWithMaxWeight === null || feesWithMaxWeight === void 0 ? void 0 : feesWithMaxWeight[0];
|
|
516
|
-
console.log({
|
|
517
|
-
feesWithMaxWeight: feesWithMaxWeight,
|
|
518
|
-
highestIntervalFee: highestIntervalFee,
|
|
519
|
-
allFeesForCalc: allFeesForCalc,
|
|
520
|
-
});
|
|
521
516
|
if (highestIntervalFee) {
|
|
522
517
|
// Calcula baseado na taxa do intervalo mais alto que tem maxWeight
|
|
523
518
|
var total_4 = +highestIntervalFee.value;
|
|
@@ -656,7 +651,9 @@ var calculateFee = function (ratecardLaneFee, cte, allFees, debug, allFeesForCal
|
|
|
656
651
|
}*/
|
|
657
652
|
}
|
|
658
653
|
}
|
|
659
|
-
totalToCalc = totalFee;
|
|
654
|
+
// totalToCalc = totalFee;
|
|
655
|
+
var truncatedTo3Decimals = Math.floor(+totalFee * 1000) / 1000;
|
|
656
|
+
totalToCalc = Number(truncatedTo3Decimals.toFixed(2));
|
|
660
657
|
if (fee_1.parentId) {
|
|
661
658
|
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; });
|
|
662
659
|
if (siblingFees && (siblingFees === null || siblingFees === void 0 ? void 0 : siblingFees.length) > 0) {
|
package/build/index.js.gz
CHANGED
|
Binary file
|