mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-22 22:48:15 +02:00
Add total invoice amount for verification and delivery processing
Update invoice verification service and database storage to include and process `invoiceAmountTTC` (total invoice amount). Modify routes to conditionally save TTC amount and adjust related schemas and cache definitions. Remove commented-out code and unused imports related to SAV ticket history. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 1e4433b5-47ab-464c-b663-fea2e53367dd Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 87886fa2-6eb3-432f-a67f-dd9d21591981 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/1e4433b5-47ab-464c-b663-fea2e53367dd/5hnOUe4
This commit is contained in:
1 parent
eb183bb06b
commit
da6ec893d2
4 files changed
+84
-110
No files matched your search
+15
-6
@@ -110,7 +110,6 @@ import {
|
||||
insertAnnouncementSchema,
|
||||
insertNocodbConfigSchema,
|
||||
insertSavTicketSchema,
|
||||
insertSavTicketHistorySchema,
|
||||
insertWeatherDataSchema,
|
||||
insertWeatherSettingsSchema,
|
||||
insertWebhookBapConfigSchema,
|
||||
@@ -1881,7 +1880,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
||||
console.log('✅ Résultat vérification:', result);
|
||||
|
||||
// CRITICAL FIX: Sauvegarder les données dans la table deliveries après vérification réussie
|
||||
if (result.exists && (result.invoiceAmount !== undefined || result.dueDate !== undefined || result.invoiceReference !== undefined)) {
|
||||
if (result.exists && (result.invoiceAmount !== undefined || result.invoiceAmountTTC !== undefined || result.dueDate !== undefined || result.invoiceReference !== undefined)) {
|
||||
try {
|
||||
const updateData: any = {};
|
||||
|
||||
@@ -1890,11 +1889,16 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
||||
updateData.invoiceReference = result.invoiceReference;
|
||||
}
|
||||
|
||||
// Ajouter le montant facture si trouvé
|
||||
// Ajouter le montant facture HT si trouvé
|
||||
if (result.invoiceAmount !== undefined && result.invoiceAmount !== null) {
|
||||
updateData.invoiceAmount = result.invoiceAmount.toString();
|
||||
}
|
||||
|
||||
// Ajouter le montant facture TTC si trouvé
|
||||
if (result.invoiceAmountTTC !== undefined && result.invoiceAmountTTC !== null) {
|
||||
updateData.invoiceAmountTTC = result.invoiceAmountTTC.toString();
|
||||
}
|
||||
|
||||
// Ajouter l'échéance si trouvée
|
||||
if (result.dueDate) {
|
||||
const normalizedDateString = normalizeDateString(result.dueDate);
|
||||
@@ -4823,14 +4827,19 @@ RÉSUMÉ DU SCAN
|
||||
}
|
||||
|
||||
// Parse and validate history entry
|
||||
const historyData = insertSavTicketHistorySchema.parse({
|
||||
// const historyData = insertSavTicketHistorySchema.parse({
|
||||
// ticketId: ticketId,
|
||||
// action: 'comment',
|
||||
// description: req.body.description,
|
||||
// createdBy: user.id,
|
||||
// });
|
||||
|
||||
const history = await storage.addSavTicketHistory({
|
||||
ticketId: ticketId,
|
||||
action: 'comment',
|
||||
description: req.body.description,
|
||||
createdBy: user.id,
|
||||
});
|
||||
|
||||
const history = await storage.addSavTicketHistory(historyData);
|
||||
res.status(201).json(history);
|
||||
} catch (error) {
|
||||
console.error("Error adding SAV ticket history:", error);
|
||||
|
||||
Reference in new issue
Block a user