diff --git a/attached_assets/{23C5A9FE-38C6-4571-B600-92377646DB7C}_1762252125737.png b/attached_assets/{23C5A9FE-38C6-4571-B600-92377646DB7C}_1762252125737.png new file mode 100644 index 0000000..68346ad Binary files /dev/null and b/attached_assets/{23C5A9FE-38C6-4571-B600-92377646DB7C}_1762252125737.png differ diff --git a/client/src/pages/Groups.tsx b/client/src/pages/Groups.tsx index 8b7b776..a66fd16 100644 --- a/client/src/pages/Groups.tsx +++ b/client/src/pages/Groups.tsx @@ -50,6 +50,7 @@ export default function Groups() { invoiceColumnName: "", nocodbBlColumnName: "", nocodbAmountColumnName: "", + nocodbInvoiceAmountTTCColumnName: "", nocodbSupplierColumnName: "", nocodbDueDateColumnName: "", webhookUrl: "", @@ -106,6 +107,7 @@ export default function Groups() { invoiceColumnName: "", nocodbBlColumnName: "", nocodbAmountColumnName: "", + nocodbInvoiceAmountTTCColumnName: "", nocodbSupplierColumnName: "", nocodbDueDateColumnName: "", webhookUrl: "", @@ -151,6 +153,7 @@ export default function Groups() { invoiceColumnName: "", nocodbBlColumnName: "", nocodbAmountColumnName: "", + nocodbInvoiceAmountTTCColumnName: "", nocodbSupplierColumnName: "", nocodbDueDateColumnName: "", webhookUrl: "", @@ -259,6 +262,7 @@ export default function Groups() { invoiceColumnName: "", nocodbBlColumnName: "", nocodbAmountColumnName: "", + nocodbInvoiceAmountTTCColumnName: "", nocodbSupplierColumnName: "", nocodbDueDateColumnName: "", webhookUrl: "", @@ -276,6 +280,7 @@ export default function Groups() { invoiceColumnName: group.invoiceColumnName || "", nocodbBlColumnName: group.nocodbBlColumnName || "", nocodbAmountColumnName: group.nocodbAmountColumnName || "", + nocodbInvoiceAmountTTCColumnName: group.nocodbInvoiceAmountTTCColumnName || "", nocodbSupplierColumnName: group.nocodbSupplierColumnName || "", nocodbDueDateColumnName: group.nocodbDueDateColumnName || "", webhookUrl: group.webhookUrl || "", @@ -624,7 +629,7 @@ export default function Groups() {
- +
+
+ + handleChange('nocodbInvoiceAmountTTCColumnName', e.target.value)} + placeholder="ex: Montant_TTC" + /> +
+
{ return filteredSchedules.reduce((sum, schedule) => sum + schedule.amount, 0); }, [filteredSchedules]); - // Grouper par mode de paiement + // Calculer le total du mois (TTC) + const monthTotalTTC = useMemo(() => { + return filteredSchedules.reduce((sum, schedule) => sum + schedule.amountTTC, 0); + }, [filteredSchedules]); + + // Grouper par mode de paiement (HT) const paymentMethodTotals = useMemo(() => { const totals: Record = {}; filteredSchedules.forEach(schedule => { @@ -102,6 +108,16 @@ export default function PaymentSchedulePage() { return totals; }, [filteredSchedules]); + // Grouper par mode de paiement (TTC) + const paymentMethodTotalsTTC = useMemo(() => { + const totals: Record = {}; + filteredSchedules.forEach(schedule => { + const method = schedule.paymentMethod || 'Non défini'; + totals[method] = (totals[method] || 0) + schedule.amountTTC; + }); + return totals; + }, [filteredSchedules]); + if (!selectedStoreId) { return (
@@ -188,10 +204,21 @@ export default function PaymentSchedulePage() { -
- {monthTotal.toFixed(2)} € +
+
+ HT: + + {monthTotal.toFixed(2)} € + +
+
+ TTC: + + {monthTotalTTC.toFixed(2)} € + +
-

+

{filteredSchedules.length} échéance{filteredSchedules.length > 1 ? 's' : ''}

@@ -203,11 +230,20 @@ export default function PaymentSchedulePage() { -
- {Object.entries(paymentMethodTotals).map(([method, total]) => ( -
- {method}: - {total.toFixed(2)} € +
+ {Object.entries(paymentMethodTotals).map(([method, totalHT]) => ( +
+
{method}
+
+ HT: + {totalHT.toFixed(2)} € +
+
+ TTC: + + {paymentMethodTotalsTTC[method]?.toFixed(2) || '0.00'} € + +
))}
@@ -272,9 +308,18 @@ export default function PaymentSchedulePage() { )}
-
-
- {schedule.amount.toFixed(2)} € +
+
+ HT: + + {schedule.amount.toFixed(2)} € + +
+
+ TTC: + + {schedule.amountTTC.toFixed(2)} € +
diff --git a/server/routes.ts b/server/routes.ts index 8611f21..5103197 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -445,6 +445,7 @@ export async function registerRoutes(app: Express): Promise { invoiceReference: delivery.invoiceReference, dueDate: delivery.dueDate, amount: delivery.invoiceAmount ? parseFloat(delivery.invoiceAmount) : 0, + amountTTC: delivery.invoiceAmountTTC ? parseFloat(delivery.invoiceAmountTTC) : 0, supplierName: supplier?.name || 'Fournisseur inconnu', paymentMethod: supplier?.paymentMethod || null, groupId: group.id,