@8medusa/utils 2.10.18 → 2.10.20

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.
@@ -22,13 +22,26 @@ function setRefundableTotal(item, discountsTotal, totals, context) {
22
22
  const itemDetail = item.detail;
23
23
  const totalReturnedQuantity = math_1.MathBN.sum(itemDetail.return_requested_quantity ?? 0, itemDetail.return_received_quantity ?? 0, itemDetail.return_dismissed_quantity ?? 0);
24
24
  const currentQuantity = math_1.MathBN.sub(item.quantity, totalReturnedQuantity);
25
- const discountPerUnit = math_1.MathBN.div(discountsTotal, item.quantity);
26
- const refundableSubTotal = math_1.MathBN.sub(math_1.MathBN.mult(currentQuantity, item.unit_price), math_1.MathBN.mult(currentQuantity, discountPerUnit));
25
+ // Use line-level calculation for refundable total
26
+ const isTaxInclusive = item.is_tax_inclusive ?? context.includeTax;
27
+ const sumTax = math_1.MathBN.sum(...((item.tax_lines ?? []).map((taxLine) => taxLine.rate) ?? []));
28
+ const sumTaxRate = math_1.MathBN.div(sumTax, 100);
29
+ const unitNet = isTaxInclusive
30
+ ? math_1.MathBN.div(item.unit_price, math_1.MathBN.add(1, sumTaxRate))
31
+ : item.unit_price;
32
+ const discountPerUnit = math_1.MathBN.eq(item.quantity, 0)
33
+ ? 0
34
+ : math_1.MathBN.div(discountsTotal, item.quantity);
35
+ // Compute refundable line net (high precision)
36
+ const refundableLineNetExact = math_1.MathBN.mult(currentQuantity, math_1.MathBN.sub(unitNet, discountPerUnit));
37
+ // Round at line level (matches Helios algorithm)
38
+ const refundableLineNetRounded = math_1.MathBN.round(refundableLineNetExact, 2);
39
+ // Compute tax on rounded line net
27
40
  const taxTotal = (0, tax_1.calculateTaxTotal)({
28
41
  taxLines: item.tax_lines || [],
29
- taxableAmount: refundableSubTotal,
42
+ taxableAmount: refundableLineNetRounded,
30
43
  });
31
- const refundableTotal = math_1.MathBN.add(refundableSubTotal, taxTotal);
44
+ const refundableTotal = math_1.MathBN.round(math_1.MathBN.add(refundableLineNetRounded, taxTotal), 2);
32
45
  totals.refundable_total_per_unit = new big_number_1.BigNumber(math_1.MathBN.eq(currentQuantity, 0)
33
46
  ? 0
34
47
  : math_1.MathBN.div(refundableTotal, currentQuantity));
@@ -39,11 +52,11 @@ function getLineItemTotals(item, context) {
39
52
  const sumTax = math_1.MathBN.sum(...((item.tax_lines ?? []).map((taxLine) => taxLine.rate) ?? []));
40
53
  const sumTaxRate = math_1.MathBN.div(sumTax, 100);
41
54
  /*
42
- Calculate unit subtotal first
55
+ Calculate unit subtotal (net price per unit)
43
56
  If the price is inclusive of tax, we need to remove the taxed amount from the subtotal
44
57
  Original Price = Total Price / (1 + Tax Rate)
45
58
  */
46
- const unitSubtotal = isTaxInclusive
59
+ const unitNet = isTaxInclusive
47
60
  ? math_1.MathBN.div(item.unit_price, math_1.MathBN.add(1, sumTaxRate))
48
61
  : item.unit_price;
49
62
  const { adjustmentsTotal: discountsTotal, adjustmentsSubtotal: discountsSubtotal, adjustmentsTaxTotal: discountTaxTotal, } = (0, adjustment_1.calculateAdjustmentTotal)({
@@ -51,35 +64,32 @@ function getLineItemTotals(item, context) {
51
64
  includesTax: isTaxInclusive,
52
65
  taxRate: sumTaxRate,
53
66
  });
54
- const unitDiscount = math_1.MathBN.eq(item.quantity, 0)
55
- ? 0
56
- : math_1.MathBN.div(discountsSubtotal, item.quantity);
57
- const unitPriceAfterDiscount = math_1.MathBN.sub(unitSubtotal, unitDiscount);
58
- const unitTax = (0, tax_1.calculateTaxTotal)({
59
- taxLines: item.tax_lines || [],
60
- taxableAmount: unitPriceAfterDiscount,
61
- setTotalField: "total",
62
- });
63
- // Step 4: Add tax to get gross unit price and round per item
64
- const unitTotalBeforeRounding = math_1.MathBN.add(unitPriceAfterDiscount, unitTax);
65
- const unitTotal = math_1.MathBN.round(unitTotalBeforeRounding, 2);
66
- // Step 5: Multiply rounded unit total by quantity
67
- const subtotal = math_1.MathBN.mult(unitSubtotal, item.quantity);
68
- const total = math_1.MathBN.mult(unitTotal, item.quantity);
69
- // Calculate original total using the same EU-standard method as total
70
- const unitOriginalTotal = math_1.MathBN.round(unitTotalBeforeRounding, 2);
71
- const originalTotal = math_1.MathBN.mult(unitOriginalTotal, item.quantity);
72
- // Calculate tax totals for reporting
67
+ // LINE-LEVEL CALCULATION (Helios-compatible rounding)
68
+ // Compute line net before discounts (high precision, no rounding)
69
+ const lineNetBefore = math_1.MathBN.mult(unitNet, item.quantity);
70
+ const subtotal = lineNetBefore;
71
+ // Apply discounts at line level (high precision)
72
+ const lineNetAfterExact = math_1.MathBN.sub(lineNetBefore, discountsSubtotal);
73
+ // CRITICAL ROUNDING POINT - Round at NET LINE level (matches Helios algorithm)
74
+ // Helios reconstructs: lineNet = totalPrice / (1 + vatRate), then rounds to 2 decimals
75
+ // By rounding here, we ensure Helios gets the same lineNet without additional drift
76
+ const lineNetAfterRounded = math_1.MathBN.round(lineNetAfterExact, 2);
77
+ // Compute tax on the rounded line net (ensures tax is based on the same value Helios uses)
73
78
  const taxTotal = (0, tax_1.calculateTaxTotal)({
74
79
  taxLines: item.tax_lines || [],
75
- taxableAmount: math_1.MathBN.sub(subtotal, discountsSubtotal),
80
+ taxableAmount: lineNetAfterRounded,
76
81
  setTotalField: "total",
77
82
  });
83
+ // Compute gross line total from rounded line net + tax
84
+ const total = math_1.MathBN.round(math_1.MathBN.add(lineNetAfterRounded, taxTotal), 2);
85
+ // Calculate original totals using line-level rounding (before discounts)
86
+ const lineNetOriginalRounded = math_1.MathBN.round(lineNetBefore, 2);
78
87
  const originalTaxTotal = (0, tax_1.calculateTaxTotal)({
79
88
  taxLines: item.tax_lines || [],
80
- taxableAmount: subtotal,
81
- setTotalField: "subtotal",
89
+ taxableAmount: lineNetOriginalRounded,
90
+ setTotalField: "total",
82
91
  });
92
+ const originalTotal = math_1.MathBN.round(math_1.MathBN.add(lineNetOriginalRounded, originalTaxTotal), 2);
83
93
  const totals = {
84
94
  quantity: item.quantity,
85
95
  unit_price: item.un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;IAElD,MAAM,cAAc,GAAG;QACrB,GAAG,CAAC,OAAO,CAAC,mBAAmB,IAAI,EAAE,CAAC;KACvC,CAAA;IAED,KAAK,MAAM,KAAK,IAAI,cAAc,EAAE,CAAC;QACnC,MAAM,UAAU,GAAG,cAAc,CAAC,KAAK,CAAC,CAAA;QAExC,IAAI,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,CAAA;QAC7B,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACxB,MAAM,GAAG,IAAA,4BAAmB,EAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QAC3C,CAAC;QAED,IAAI,CAAC,IAAA,kBAAS,EAAC,MAAM,CAAC,EAAE,CAAC;YACvB,SAAQ;QACV,CAAC;QAED,MAAM,CAAC,UAAU,CAAC,GAAG,IAAI,sBAAS,CAAC,aAAM,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAA;IACvE,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@8medusa/utils",
3
- "version": "2.10.18",
3
+ "version": "2.10.20",
4
4
  "description": "Medusa utilities functions shared by Medusa core and Modules",
5
5
  "main": "dist/index.js",
6
6
  "exports": {