b2m-utils 0.0.193 → 0.0.195

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.
@@ -426,11 +426,11 @@ var calculateFee = function (ratecardLaneFee, cte, allFees, debug, allFeesForCal
426
426
  });
427
427
  if (totalFromAllFees && (totalFromAllFees === null || totalFromAllFees === void 0 ? void 0 : totalFromAllFees.length) > 0) {
428
428
  var totalValueFromAllFees = totalFromAllFees.filter(function (i) { return !isNaN(+i) && +i > 0; }).reduce(function (previous, current) {
429
- if (previous && current && !isNaN(+previous) && !isNaN(+current)) {
429
+ if (!isNaN(+previous) && !isNaN(+current)) {
430
430
  return +previous + +current;
431
431
  }
432
432
  else {
433
- return 0;
433
+ return previous;
434
434
  }
435
435
  }, 0);
436
436
  console.log('💰 TOTAL_PERCENTAGE - Valor total calculado:', {
@@ -438,8 +438,8 @@ var calculateFee = function (ratecardLaneFee, cte, allFees, debug, allFeesForCal
438
438
  validValues: totalFromAllFees.filter(function (i) { return !isNaN(+i) && +i > 0; })
439
439
  });
440
440
  if (totalValueFromAllFees && !isNaN(+totalValueFromAllFees)) {
441
- var valueToMultiply = (1 - value);
442
- var total_1 = +totalValueFromAllFees * (valueToMultiply / 100);
441
+ var valueToMultiply = (+value / 100);
442
+ var total_1 = +totalValueFromAllFees * valueToMultiply;
443
443
  console.log('🧮 TOTAL_PERCENTAGE - Cálculo final:', {
444
444
  totalValueFromAllFees: totalValueFromAllFees,
445
445
  valueToMultiply: valueToMultiply,
Binary file