@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
|
-
//
|
|
1373
|
-
//
|
|
1374
|
-
//
|
|
1375
|
-
|
|
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,
|