chore: build

This commit is contained in:
2026-06-11 11:10:51 +02:00
parent 38e9bff7ee
commit fbb680ccb2
4 changed files with 23 additions and 12 deletions
@@ -315,10 +315,12 @@ export default function OrderDetailsScreen() {
const currentIdx = STATUS_INDEX[status] ?? -1;
const isCancelled = status === "cancelled";
const address = order.delivery_address || order.adresse || "N/A";
const total =
const rawTotal =
order.total ||
order.total_prix ||
products.reduce((s: number, p: any) => s + (p.prix || p.price || 0), 0);
const referralUsed: number = order.referral_used || 0;
const total = rawTotal - referralUsed;
return (
<ScrollView
@@ -524,6 +526,14 @@ export default function OrderDetailsScreen() {
</Card>
<Card>
{referralUsed > 0 && (
<View style={styles.totalRow}>
<Text style={styles.totalLabel}>Crédit parrainage</Text>
<Text style={[styles.totalValue, { color: colors.accent }]}>
-{formatPrice(referralUsed)}
</Text>
</View>
)}
<View style={styles.totalRow}>
<Text style={styles.totalLabel}>Total</Text>
<Text style={styles.totalValue}>{formatPrice(total)}</Text>
@@ -623,7 +623,7 @@ export default function OrderHistoryScreen() {
)}
<View style={styles.orderFooter}>
<Text style={styles.orderTotal}>
{formatPrice(order.total_prix || 0)}
{formatPrice((order.total_prix || 0) - (order.referral_used || 0))}
</Text>
<Ionicons
name="chevron-forward"