@managesome/eposmatic-toolkit 0.2.497 → 0.2.498

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.
@@ -1369,24 +1369,10 @@ const getUsableData = (data, subtitles) => {
1369
1369
  const netSale = totalPaymentSalesAmount || salesData.grossAmount;
1370
1370
  const itemSales = salesData.totalItemSales;
1371
1371
  const amountCollected = netSale - unpaidAmount;
1372
- // GST is summed from invoice-level gst_amount which may include GST on
1373
- // unpaid invoices. The synthetic UNPAID entry in TOTAL_PAYMENT_SALES may
1374
- // not carry the same GST treatment, causing netWithoutGst to diverge.
1375
- // Proportionally allocate GST to the collected portion so the displayed
1376
- // "Net Revenue excl. Tax" reflects only GST on collected amounts.
1377
- const collectedRatio = netSale > 0 ? Math.min(1, amountCollected / netSale) : 0;
1378
- const netWithoutGst = netSale - totalGst * collectedRatio;
1379
- // Scale down GST subchannel amounts proportionally so unpaid
1380
- // invoices don't inflate the GST breakdown.
1381
- if (collectedRatio < 1) {
1382
- for (const ch of topLevelChannels) {
1383
- if (ch.ref === constants_1.WAREHOUSE_SALE_ORDER_X_REPORT_TYPE_ENUM.GST) {
1384
- for (const sc of ch.subChannels) {
1385
- sc.amount = (0, common_1.parseNum)(sc.amount * collectedRatio);
1386
- }
1387
- }
1388
- }
1389
- }
1372
+ // Backend already excludes unpaid invoices from the GST aggregation,
1373
+ // so the GST amounts reflect only collected payments. No proportional
1374
+ // scaling is needed — the full GST amount is already correct.
1375
+ const netWithoutGst = netSale - totalGst;
1390
1376
  const channelData = {
1391
1377
  ...subtitles,
1392
1378
  _id: staffId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.2.497",
3
+ "version": "0.2.498",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",