From b5394aec7c811c21a2a15e04a202d89d7d687e43 Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Mon, 16 Mar 2026 22:39:24 -0700 Subject: [PATCH] Include PlatformFee in order detail total calculation getDetail.php was computing total as subtotal + tax + tip, omitting the Payfrit service fee. This caused the order detail view to show a lower total than what the cart/checkout displayed at order time. Co-Authored-By: Claude Opus 4.6 (1M context) --- api/orders/getDetail.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/orders/getDetail.php b/api/orders/getDetail.php index 2200bb3..f6392b4 100644 --- a/api/orders/getDetail.php +++ b/api/orders/getDetail.php @@ -42,7 +42,7 @@ try { SELECT o.ID, o.UUID, o.BusinessID, o.UserID, o.ServicePointID, o.StatusID, o.OrderTypeID, o.Remarks, o.AddedOn, o.LastEditedOn, - o.SubmittedOn, o.TipAmount, + o.SubmittedOn, o.TipAmount, o.PlatformFee, u.FirstName, u.LastName, u.ContactNumber, u.EmailAddress, sp.Name AS Name, sp.TypeID AS TypeID, b.Name AS BizName, b.TaxRate @@ -112,7 +112,8 @@ try { $taxRate = (is_numeric($qOrder['TaxRate']) && (float) $qOrder['TaxRate'] > 0) ? (float) $qOrder['TaxRate'] : 0; $tax = $subtotal * $taxRate; $tip = is_numeric($qOrder['TipAmount']) ? (float) $qOrder['TipAmount'] : 0; - $total = $subtotal + $tax + $tip; + $platformFee = is_numeric($qOrder['PlatformFee']) ? (float) $qOrder['PlatformFee'] : 0; + $total = $subtotal + $tax + $tip + $platformFee; // Get staff who worked on this order $qStaff = queryTimed(" @@ -157,6 +158,7 @@ try { 'Subtotal' => $subtotal, 'Tax' => $tax, 'Tip' => $tip, + 'PlatformFee' => $platformFee, 'Total' => $total, 'Notes' => $qOrder['Remarks'], 'CreatedOn' => toISO8601($qOrder['AddedOn']),