From ac32a541a10074312c1d1090a73b83c132174b4c Mon Sep 17 00:00:00 2001 From: fahed Date: Sun, 19 Apr 2026 12:55:49 +0300 Subject: [PATCH] fix: count full visitor per museum for combo tickets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bundle tickets grant access to multiple museums, so each museum should count 1 visitor — not 0.5. Revenue split remains 50/50. Co-Authored-By: Claude Sonnet 4.6 --- server/src/services/etlSync.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/services/etlSync.ts b/server/src/services/etlSync.ts index 4be56d2..e7572ae 100644 --- a/server/src/services/etlSync.ts +++ b/server/src/services/etlSync.ts @@ -77,7 +77,7 @@ export function aggregateTransactions(sales: ERPSaleRecord[]): AggregatedRecord[ } const visitors = isB2C ? product.UnitQuantity : product.PeopleCount; - entry.Visits += visitors * split; + entry.Visits += visitors; // each museum in a combo counts the full visitor entry.Tickets += product.UnitQuantity * split; entry.GrossRevenue += product.TotalPrice * split; entry.NetRevenue += (product.TotalPrice - product.TaxAmount) * split;