mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-24 07:28:19 +02:00
feat: add mobile page for managing credit notes (Avoirs) with search, filter, and CRUD functionalities
This commit is contained in:
1 parent
4a25c2040b
commit
77bbeed9c0
1 file changed
+19
-6
@@ -11,6 +11,7 @@ import { Card, CardContent } from "@/components/ui/card";
|
|||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Badge } from "@/components/ui/badge";
|
import { Badge } from "@/components/ui/badge";
|
||||||
|
import { Checkbox } from "@/components/ui/checkbox";
|
||||||
import {
|
import {
|
||||||
FileText,
|
FileText,
|
||||||
Search,
|
Search,
|
||||||
@@ -63,6 +64,7 @@ const avoirSchema = z.object({
|
|||||||
invoiceReference: z.string().optional(),
|
invoiceReference: z.string().optional(),
|
||||||
amount: z.coerce.number().optional(),
|
amount: z.coerce.number().optional(),
|
||||||
comment: z.string().optional(),
|
comment: z.string().optional(),
|
||||||
|
commercialProcessed: z.boolean().default(false),
|
||||||
status: z.enum(["En attente de demande", "Demandé", "Reçu"]).default("En attente de demande"),
|
status: z.enum(["En attente de demande", "Demandé", "Reçu"]).default("En attente de demande"),
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -132,6 +134,7 @@ export default function MobileAvoirsPage() {
|
|||||||
invoiceReference: "",
|
invoiceReference: "",
|
||||||
amount: 0,
|
amount: 0,
|
||||||
comment: "",
|
comment: "",
|
||||||
|
commercialProcessed: false,
|
||||||
status: "En attente de demande"
|
status: "En attente de demande"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -148,8 +151,7 @@ export default function MobileAvoirsPage() {
|
|||||||
|
|
||||||
createMutation.mutate({
|
createMutation.mutate({
|
||||||
...data,
|
...data,
|
||||||
groupId,
|
groupId
|
||||||
commercialProcessed: false
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -344,15 +346,26 @@ export default function MobileAvoirsPage() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="comment"
|
name="commercialProcessed"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem className="flex flex-row items-center space-x-3 space-y-0 p-2 bg-gray-50 rounded mt-2">
|
||||||
<FormLabel>Commentaire / Raison</FormLabel>
|
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Textarea placeholder="Erreur prix, manquant..." {...field} />
|
<Checkbox
|
||||||
|
checked={field.value}
|
||||||
|
onCheckedChange={field.onChange}
|
||||||
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
<div className="space-y-1 leading-none">
|
||||||
|
<FormLabel className="font-normal text-sm text-gray-700">
|
||||||
|
Déjà traité par commercial
|
||||||
|
</FormLabel>
|
||||||
|
</div>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in new issue
Block a user