mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-21 22:18:17 +02:00
Merge pull request #361 from R0m1k3/1.1
Update the credits section to make reference and amount optional
This commit is contained in:
2 files changed
+12
-12
No files matched your search
@@ -255,6 +255,12 @@ export default function Sidebar() {
|
|||||||
icon: FileText,
|
icon: FileText,
|
||||||
roles: ["admin", "directeur"]
|
roles: ["admin", "directeur"]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/avoirs",
|
||||||
|
label: "Avoirs",
|
||||||
|
icon: Receipt,
|
||||||
|
roles: ["admin", "directeur", "manager"]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "/publicities",
|
path: "/publicities",
|
||||||
label: "Publicités",
|
label: "Publicités",
|
||||||
@@ -285,12 +291,6 @@ export default function Sidebar() {
|
|||||||
icon: Wrench,
|
icon: Wrench,
|
||||||
roles: ["admin", "directeur", "manager", "employee"]
|
roles: ["admin", "directeur", "manager", "employee"]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: "/avoirs",
|
|
||||||
label: "Avoirs",
|
|
||||||
icon: Receipt,
|
|
||||||
roles: ["admin", "directeur", "manager"]
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const adminItems = [
|
const adminItems = [
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ interface Group {
|
|||||||
const avoirSchema = z.object({
|
const avoirSchema = z.object({
|
||||||
supplierId: z.number().min(1, "Veuillez sélectionner un fournisseur"),
|
supplierId: z.number().min(1, "Veuillez sélectionner un fournisseur"),
|
||||||
groupId: z.number().min(1, "Veuillez sélectionner un magasin"),
|
groupId: z.number().min(1, "Veuillez sélectionner un magasin"),
|
||||||
invoiceReference: z.string().min(1, "La référence facture est requise"),
|
invoiceReference: z.string().optional(),
|
||||||
amount: z.number().min(0.01, "Le montant doit être supérieur à 0"),
|
amount: z.number().optional(),
|
||||||
comment: z.string().optional(),
|
comment: z.string().optional(),
|
||||||
commercialProcessed: z.boolean().optional(),
|
commercialProcessed: z.boolean().optional(),
|
||||||
});
|
});
|
||||||
@@ -148,7 +148,7 @@ export default function Avoirs() {
|
|||||||
supplierId: 0,
|
supplierId: 0,
|
||||||
groupId: 0,
|
groupId: 0,
|
||||||
invoiceReference: "",
|
invoiceReference: "",
|
||||||
amount: 0,
|
amount: undefined,
|
||||||
comment: "",
|
comment: "",
|
||||||
commercialProcessed: false,
|
commercialProcessed: false,
|
||||||
},
|
},
|
||||||
@@ -296,7 +296,7 @@ export default function Avoirs() {
|
|||||||
name="invoiceReference"
|
name="invoiceReference"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Référence facture</FormLabel>
|
<FormLabel>Référence facture (optionnel)</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input placeholder="Numéro de facture" {...field} />
|
<Input placeholder="Numéro de facture" {...field} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
@@ -310,14 +310,14 @@ export default function Avoirs() {
|
|||||||
name="amount"
|
name="amount"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Montant (€)</FormLabel>
|
<FormLabel>Montant (€) (optionnel)</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input
|
<Input
|
||||||
type="number"
|
type="number"
|
||||||
step="0.01"
|
step="0.01"
|
||||||
placeholder="0.00"
|
placeholder="0.00"
|
||||||
{...field}
|
{...field}
|
||||||
onChange={(e) => field.onChange(parseFloat(e.target.value) || 0)}
|
onChange={(e) => field.onChange(e.target.value ? parseFloat(e.target.value) : undefined)}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
|
|||||||
Reference in new issue
Block a user