diff --git a/backend/gestion/handlers/deleviry.go b/backend/gestion/handlers/deleviry.go index ad0508b5..8832dbd9 100644 --- a/backend/gestion/handlers/deleviry.go +++ b/backend/gestion/handlers/deleviry.go @@ -67,15 +67,16 @@ func GetMyDeliveries(c *gin.Context) { etaData, _ := database.GetCommandETA(commandID) filteredCommands[i] = gin.H{ - "id": cmd["id"], - "status": cmd["status"], - "adresse": cmd["adresse"], - "total_prix": cmd["total_prix"], - "created_at": cmd["created_at"], - "client_info": clientInfo, - "items": itemsSummary, - "items_count": len(items), - "eta": etaData, + "id": cmd["id"], + "status": cmd["status"], + "adresse": cmd["adresse"], + "total_prix": cmd["total_prix"], + "referral_used": cmd["referral_used"], + "created_at": cmd["created_at"], + "client_info": clientInfo, + "items": itemsSummary, + "items_count": len(items), + "eta": etaData, } } diff --git a/frontend-prep/src/pages/User/ConsultationHistorique.tsx b/frontend-prep/src/pages/User/ConsultationHistorique.tsx index 3f797a94..2b130a5f 100644 --- a/frontend-prep/src/pages/User/ConsultationHistorique.tsx +++ b/frontend-prep/src/pages/User/ConsultationHistorique.tsx @@ -472,7 +472,7 @@ function ConsultationHistorique() {
- {formatPrice(order.total_prix || 0)} + {formatPrice((order.total_prix || 0) - (order.referral_used || 0))} s + (p.prix || p.price || 0), 0); + const referralUsed: number = order.referral_used || 0; + const total = rawTotal - referralUsed; return ( + {referralUsed > 0 && ( + + Crédit parrainage + + -{formatPrice(referralUsed)} + + + )} Total {formatPrice(total)} diff --git a/mobile/src/screens/client/OrderHistoryScreen.tsx b/mobile/src/screens/client/OrderHistoryScreen.tsx index 49d6d70b..8c3bfae3 100644 --- a/mobile/src/screens/client/OrderHistoryScreen.tsx +++ b/mobile/src/screens/client/OrderHistoryScreen.tsx @@ -623,7 +623,7 @@ export default function OrderHistoryScreen() { )} - {formatPrice(order.total_prix || 0)} + {formatPrice((order.total_prix || 0) - (order.referral_used || 0))}