mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Ensure credit amounts display correctly by converting to numbers
Fixes a TypeError in the Avoirs page where the 'amount' field was not treated as a number, preventing the toFixed method from being called. This change ensures that amounts are correctly formatted to two decimal places. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869 Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869/uMhb9Na
This commit is contained in:
1 parent
a70c81d465
commit
552ba6a221
1 file changed
+3
-3
@@ -1102,7 +1102,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 !== null && avoir.amount !== undefined ? `${avoir.amount.toFixed(2)} €` : 'Non spécifié'}
|
||||
{avoir.amount !== null && avoir.amount !== undefined ? `${Number(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" />
|
||||
@@ -1403,7 +1403,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 !== null && selectedAvoir?.amount !== undefined ? `${selectedAvoir.amount.toFixed(2)} €` : 'Non spécifié'}</div>
|
||||
<div><strong>Montant:</strong> {selectedAvoir?.amount !== null && selectedAvoir?.amount !== undefined ? `${Number(selectedAvoir.amount).toFixed(2)} €` : 'Non spécifié'}</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
@@ -1440,7 +1440,7 @@ export default function Avoirs() {
|
||||
Magasin: {selectedAvoirForUpload?.group?.name || 'Magasin non défini'}
|
||||
</div>
|
||||
<div className="text-gray-600">
|
||||
Montant: {selectedAvoirForUpload?.amount !== null && selectedAvoirForUpload?.amount !== undefined ? `${selectedAvoirForUpload.amount.toFixed(2)} €` : 'Non spécifié'}
|
||||
Montant: {selectedAvoirForUpload?.amount !== null && selectedAvoirForUpload?.amount !== undefined ? `${Number(selectedAvoirForUpload.amount).toFixed(2)} €` : 'Non spécifié'}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user