b2m-utils 0.0.281 → 0.0.283

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.
@@ -1281,7 +1281,7 @@ var getCtesFeesResult = function (feesToCalc, cte, allFeesForCalc) {
1281
1281
  var results = [];
1282
1282
  // Separar fees por tipo: normais, TOTAL_PERCENTAGE e ICMS
1283
1283
  var icmsFee = feesToCalc.find(function (f) { var _a; return ((_a = f.fee) === null || _a === void 0 ? void 0 : _a.id) === FeeEnum.ICMS || f.feeId === FeeEnum.ICMS; });
1284
- var totalPercentageFees = feesToCalc.filter(function (f) { var _a; return ((_a = f.fee) === null || _a === void 0 ? void 0 : _a.feeCalculationTypeId) === FeeCalculationTypeEnum.TOTAL_PERCENTAGE; });
1284
+ var totalPercentageFees = feesToCalc.filter(function (f) { var _a, _b; return ((_a = f.fee) === null || _a === void 0 ? void 0 : _a.feeCalculationTypeId) === FeeCalculationTypeEnum.TOTAL_PERCENTAGE && ((_b = f.fee) === null || _b === void 0 ? void 0 : _b.id) !== FeeEnum.ICMS && f.feeId !== FeeEnum.ICMS; });
1285
1285
  var normalFees = feesToCalc.filter(function (f) {
1286
1286
  var _a, _b;
1287
1287
  return ((_a = f.fee) === null || _a === void 0 ? void 0 : _a.id) !== FeeEnum.ICMS &&
@@ -1302,7 +1302,13 @@ var getCtesFeesResult = function (feesToCalc, cte, allFeesForCalc) {
1302
1302
  var totalToPush = totalFee;
1303
1303
  if ((_b = item.fee) === null || _b === void 0 ? void 0 : _b.parentId) {
1304
1304
  var fee_1 = item.fee;
1305
- var siblingFees = feesToCalc === null || feesToCalc === void 0 ? void 0 : feesToCalc.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; });
1305
+ var siblingFees = feesToCalc === null || feesToCalc === void 0 ? void 0 : feesToCalc.filter(function (i) {
1306
+ var _a, _b, _c;
1307
+ return ((_a = i.fee) === null || _a === void 0 ? void 0 : _a.parentId) === fee_1.parentId &&
1308
+ ((_b = i.fee) === null || _b === void 0 ? void 0 : _b.id) !== fee_1.id &&
1309
+ ((_c = i.fee) === null || _c === void 0 ? void 0 : _c.id) !== FeeEnum.ICMS &&
1310
+ i.feeId !== FeeEnum.ICMS;
1311
+ });
1306
1312
  if (siblingFees && (siblingFees === null || siblingFees === void 0 ? void 0 : siblingFees.length) > 0) {
1307
1313
  var siblingFeesResults = [];
1308
1314
  for (var _f = 0, siblingFees_1 = siblingFees; _f < siblingFees_1.length; _f++) {
Binary file