Merge pull request #380 from R0m1k3/1.1

Improve handling of numeric input for financial amounts in task manag…
This commit is contained in:
LogiFlow authored and GitHub committed 2025-09-08 18:23:17 +02:00
commit 17165dc306
2 files changed
+4 -1

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

+4 -1
View File
@@ -71,7 +71,10 @@ const avoirSchema = z.object({
supplierId: z.coerce.number().min(1, "Veuillez sélectionner un fournisseur"),
groupId: z.coerce.number().min(1, "Veuillez sélectionner un magasin"),
invoiceReference: z.string().optional(),
amount: z.preprocess((val) => val === "" ? undefined : val, z.coerce.number().positive().optional()),
amount: z.union([
z.string().length(0).transform(() => undefined),
z.coerce.number().positive()
]).optional(),
comment: z.string().optional(),
commercialProcessed: z.boolean().optional(),
status: z.enum(["En attente de demande", "Demandé", "Reçu"]).optional(),