mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Improve handling of undefined or null amounts in financial documents
Adjusted client-side logic in `Avoirs.tsx` to correctly display financial amounts, preventing errors when amounts are not explicitly set. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869/H30E1Dv
This commit is contained in:
1 parent
11d1b999fe
commit
559d26aa38
3 files changed
+204
-3
No files matched your search
@@ -1119,7 +1119,7 @@ export default function Avoirs() {
|
||||
</td>
|
||||
<td className="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">
|
||||
<div className="flex items-center">
|
||||
{avoir.amount ? `${avoir.amount.toFixed(2)} €` : 'Non spécifié'}
|
||||
{avoir.amount !== null && avoir.amount !== undefined ? `${avoir.amount.toFixed(2)} €` : 'Non spécifié'}
|
||||
{avoir.commercialProcessed && (
|
||||
<div title="Avoir fait par commercial">
|
||||
<UserCheck className="h-4 w-4 text-blue-600 ml-2" />
|
||||
@@ -1407,7 +1407,7 @@ export default function Avoirs() {
|
||||
<div className="text-sm">
|
||||
<div><strong>Fournisseur:</strong> {selectedAvoir.supplier?.name || 'Fournisseur non défini'}</div>
|
||||
<div><strong>Référence:</strong> {selectedAvoir.invoiceReference || 'Sans référence'}</div>
|
||||
<div><strong>Montant:</strong> {selectedAvoir.amount ? `${selectedAvoir.amount.toFixed(2)} €` : 'Non spécifié'}</div>
|
||||
<div><strong>Montant:</strong> {selectedAvoir.amount !== null && selectedAvoir.amount !== undefined ? `${selectedAvoir.amount.toFixed(2)} €` : 'Non spécifié'}</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
@@ -1444,7 +1444,7 @@ export default function Avoirs() {
|
||||
Magasin: {selectedAvoirForUpload.group?.name || 'Magasin non défini'}
|
||||
</div>
|
||||
<div className="text-gray-600">
|
||||
Montant: {selectedAvoirForUpload.amount ? `${selectedAvoirForUpload.amount.toFixed(2)} €` : 'Non spécifié'}
|
||||
Montant: {selectedAvoirForUpload.amount !== null && selectedAvoirForUpload.amount !== undefined ? `${selectedAvoirForUpload.amount.toFixed(2)} €` : 'Non spécifié'}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user