Fix Gesamt-Provision: shop minus employee share

Gesamt-Provision represents what the shop keeps after paying the
employee, not the sum of both. Update both the frontend KPI card
calculation and the /api/provisionen total_gesamt_provision field so
they agree.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
kerimatilganandClaude Opus 4.7 committed 2026-05-15 18:22:39 +02:00
1 parent b88938a1f6
commit 65395c0cae
2 files changed
+3 -2

No files matched your search

+2 -1
View File
@@ -2338,7 +2338,8 @@ function updateProvisionenTable(schaltungen, totalShopProvision, totalMitarbeite
tbody.appendChild(tr);
});
const totalGesamt = (totalShopProvision || 0) + (totalMitarbeiterProvision || 0);
// Gesamt-Provision = what the shop keeps after paying out the employee share.
const totalGesamt = (totalShopProvision || 0) - (totalMitarbeiterProvision || 0);
if (totalShopSpan) totalShopSpan.textContent = formatEuro(totalShopProvision);
if (totalMitarbeiterSpan) totalMitarbeiterSpan.textContent = formatEuro(totalMitarbeiterProvision);
if (totalGesamtSpan) totalGesamtSpan.textContent = formatEuro(totalGesamt);
+1 -1
View File
@@ -138,7 +138,7 @@ router.get('/provisionen', asyncHandler(async (req, res) => {
total_provision: totalShop.toFixed(2),
total_shop_provision: totalShop.toFixed(2),
total_mitarbeiter_provision: totalMitarbeiter.toFixed(2),
total_gesamt_provision: (totalShop + totalMitarbeiter).toFixed(2),
total_gesamt_provision: (totalShop - totalMitarbeiter).toFixed(2),
});
}));