mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-20 21:49:07 +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
@@ -46,6 +46,7 @@ export class InvoiceVerificationService {
|
||||
invoiceReference: cached.invoiceReference,
|
||||
supplierName: cached.supplierName,
|
||||
invoiceAmount: cached.invoiceAmount ? parseFloat(cached.invoiceAmount) : undefined,
|
||||
invoiceAmountTTC: cached.invoiceAmountTTC ? parseFloat(cached.invoiceAmountTTC) : undefined,
|
||||
dueDate: cached.dueDate ? new Date(cached.dueDate).toISOString() : null,
|
||||
fromCache: true,
|
||||
permanent: true
|
||||
@@ -62,6 +63,7 @@ export class InvoiceVerificationService {
|
||||
invoiceReference: cached.invoiceReference,
|
||||
supplierName: cached.supplierName,
|
||||
invoiceAmount: cached.invoiceAmount ? parseFloat(cached.invoiceAmount) : undefined,
|
||||
invoiceAmountTTC: cached.invoiceAmountTTC ? parseFloat(cached.invoiceAmountTTC) : undefined,
|
||||
dueDate: cached.dueDate ? new Date(cached.dueDate).toISOString() : null,
|
||||
fromCache: true,
|
||||
permanent: false
|
||||
@@ -122,6 +124,7 @@ export class InvoiceVerificationService {
|
||||
invoiceReference,
|
||||
supplierName: supplierName || null,
|
||||
invoiceAmount: result.invoiceAmount || null,
|
||||
invoiceAmountTTC: result.invoiceAmountTTC || null,
|
||||
dueDate: result.dueDate ? new Date(result.dueDate) : null,
|
||||
exists: result.exists,
|
||||
matchType: result.matchType,
|
||||
@@ -405,6 +408,7 @@ export class InvoiceVerificationService {
|
||||
matchType: 'invoice_reference' as const,
|
||||
invoiceReference: matchResult.data.invoice_reference || invoiceReference,
|
||||
invoiceAmount: parseFloat(matchResult.data[group.nocodbAmountColumnName || 'amount'] || '0'),
|
||||
invoiceAmountTTC: parseFloat(matchResult.data[group.nocodbInvoiceAmountTTCColumnName || 'Montant TTC'] || '0'),
|
||||
supplierName: matchResult.data[group.nocodbSupplierColumnName || 'supplier'] || 'Inconnu',
|
||||
dueDate: matchResult.data[group.nocodbDueDateColumnName || 'Echeance'] || null
|
||||
};
|
||||
@@ -442,6 +446,7 @@ export class InvoiceVerificationService {
|
||||
matchType: 'bl_number' as const,
|
||||
invoiceReference: matchResult.data.invoice_reference || `BL_${invoiceReference}`,
|
||||
invoiceAmount: parseFloat(matchResult.data[group.nocodbAmountColumnName || 'amount'] || '0'),
|
||||
invoiceAmountTTC: parseFloat(matchResult.data[group.nocodbInvoiceAmountTTCColumnName || 'Montant TTC'] || '0'),
|
||||
supplierName: matchResult.data[group.nocodbSupplierColumnName || 'supplier'] || 'Inconnu',
|
||||
dueDate: matchResult.data[group.nocodbDueDateColumnName || 'Echeance'] || null
|
||||
};
|
||||
@@ -807,6 +812,7 @@ export class InvoiceVerificationService {
|
||||
matchType: 'bl_number' as const,
|
||||
invoiceReference: matchResult.data[group.invoiceColumnName || 'RefFacture'] || `BL_${blNumber}`,
|
||||
invoiceAmount: parseFloat(matchResult.data[group.nocodbAmountColumnName || 'amount'] || '0'),
|
||||
invoiceAmountTTC: parseFloat(matchResult.data[group.nocodbInvoiceAmountTTCColumnName || 'Montant TTC'] || '0'),
|
||||
supplierName: foundSupplier || supplierName,
|
||||
dueDate: matchResult.data[group.nocodbDueDateColumnName || 'Echeance'] || null
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user