chore: build
This commit is contained in:
@@ -71,6 +71,7 @@ func GetMyDeliveries(c *gin.Context) {
|
|||||||
"status": cmd["status"],
|
"status": cmd["status"],
|
||||||
"adresse": cmd["adresse"],
|
"adresse": cmd["adresse"],
|
||||||
"total_prix": cmd["total_prix"],
|
"total_prix": cmd["total_prix"],
|
||||||
|
"referral_used": cmd["referral_used"],
|
||||||
"created_at": cmd["created_at"],
|
"created_at": cmd["created_at"],
|
||||||
"client_info": clientInfo,
|
"client_info": clientInfo,
|
||||||
"items": itemsSummary,
|
"items": itemsSummary,
|
||||||
|
|||||||
@@ -472,7 +472,7 @@ function ConsultationHistorique() {
|
|||||||
|
|
||||||
<div className="order-card-footer">
|
<div className="order-card-footer">
|
||||||
<span className="order-card-total">
|
<span className="order-card-total">
|
||||||
{formatPrice(order.total_prix || 0)}
|
{formatPrice((order.total_prix || 0) - (order.referral_used || 0))}
|
||||||
</span>
|
</span>
|
||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
icon={faChevronRight}
|
icon={faChevronRight}
|
||||||
|
|||||||
@@ -315,10 +315,12 @@ export default function OrderDetailsScreen() {
|
|||||||
const currentIdx = STATUS_INDEX[status] ?? -1;
|
const currentIdx = STATUS_INDEX[status] ?? -1;
|
||||||
const isCancelled = status === "cancelled";
|
const isCancelled = status === "cancelled";
|
||||||
const address = order.delivery_address || order.adresse || "N/A";
|
const address = order.delivery_address || order.adresse || "N/A";
|
||||||
const total =
|
const rawTotal =
|
||||||
order.total ||
|
order.total ||
|
||||||
order.total_prix ||
|
order.total_prix ||
|
||||||
products.reduce((s: number, p: any) => s + (p.prix || p.price || 0), 0);
|
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 (
|
return (
|
||||||
<ScrollView
|
<ScrollView
|
||||||
@@ -524,6 +526,14 @@ export default function OrderDetailsScreen() {
|
|||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<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}>
|
<View style={styles.totalRow}>
|
||||||
<Text style={styles.totalLabel}>Total</Text>
|
<Text style={styles.totalLabel}>Total</Text>
|
||||||
<Text style={styles.totalValue}>{formatPrice(total)}</Text>
|
<Text style={styles.totalValue}>{formatPrice(total)}</Text>
|
||||||
|
|||||||
@@ -623,7 +623,7 @@ export default function OrderHistoryScreen() {
|
|||||||
)}
|
)}
|
||||||
<View style={styles.orderFooter}>
|
<View style={styles.orderFooter}>
|
||||||
<Text style={styles.orderTotal}>
|
<Text style={styles.orderTotal}>
|
||||||
{formatPrice(order.total_prix || 0)}
|
{formatPrice((order.total_prix || 0) - (order.referral_used || 0))}
|
||||||
</Text>
|
</Text>
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name="chevron-forward"
|
name="chevron-forward"
|
||||||
|
|||||||
Reference in New Issue
Block a user