mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Add quality control process for supplier deliveries
Introduce a new 'requires_control' flag for suppliers, enabling a quality control workflow for deliveries. This includes UI updates, database schema changes, and API endpoints to manage and track control validation. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 1e4433b5-47ab-464c-b663-fea2e53367dd Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/1e4433b5-47ab-464c-b663-fea2e53367dd/e7P7sOc
This commit is contained in:
1 parent
b643ea5fa8
commit
a2ab38a412
7 files changed
+97
-6
No files matched your search
@@ -10,7 +10,7 @@ import { Input } from "@/components/ui/input";
|
||||
import { useToast } from "@/hooks/use-toast";
|
||||
import { apiRequest } from "@/lib/queryClient";
|
||||
import { isUnauthorizedError } from "@/lib/authUtils";
|
||||
import { Check, X } from "lucide-react";
|
||||
import { Check, X, AlertTriangle } from "lucide-react";
|
||||
|
||||
const validateDeliverySchema = z.object({
|
||||
blNumber: z.string().min(1, "Le numéro de bon de livraison est obligatoire"),
|
||||
@@ -110,6 +110,21 @@ export default function ValidateDeliveryModal({
|
||||
</p>
|
||||
</DialogHeader>
|
||||
|
||||
{/* Alerte si le fournisseur nécessite un contrôle */}
|
||||
{delivery.supplier?.requiresControl && (
|
||||
<div className="bg-orange-50 border border-orange-200 rounded-lg p-3 flex items-start space-x-3">
|
||||
<AlertTriangle className="w-5 h-5 text-orange-600 flex-shrink-0 mt-0.5" />
|
||||
<div className="flex-1">
|
||||
<h4 className="text-sm font-semibold text-orange-800">
|
||||
⚠️ Contrôle à effectuer sur cette livraison
|
||||
</h4>
|
||||
<p className="text-xs text-orange-700 mt-1">
|
||||
Ce fournisseur nécessite un contrôle qualité lors de la réception de la livraison.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<Form {...form}>
|
||||
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-4">
|
||||
{/* Informations de la livraison */}
|
||||
|
||||
@@ -38,6 +38,7 @@ export default function Suppliers() {
|
||||
phone: "",
|
||||
hasDlc: false,
|
||||
automaticReconciliation: false,
|
||||
requiresControl: false,
|
||||
});
|
||||
|
||||
const { data: suppliers = [], isLoading } = useQuery<Supplier[]>({
|
||||
@@ -191,6 +192,7 @@ export default function Suppliers() {
|
||||
phone: "",
|
||||
hasDlc: false,
|
||||
automaticReconciliation: false,
|
||||
requiresControl: false,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -227,6 +229,7 @@ export default function Suppliers() {
|
||||
phone: supplier.phone || "",
|
||||
hasDlc: supplier.hasDlc || false,
|
||||
automaticReconciliation: supplier.automaticReconciliation || false,
|
||||
requiresControl: supplier.requiresControl || false,
|
||||
});
|
||||
setShowEditModal(true);
|
||||
};
|
||||
@@ -410,10 +413,16 @@ export default function Suppliers() {
|
||||
<span className="text-xs font-medium">Auto-rapprochement</span>
|
||||
</div>
|
||||
)}
|
||||
{supplier.requiresControl && (
|
||||
<div className="flex items-center text-orange-600 bg-orange-50 px-2 py-1 rounded-full">
|
||||
<CheckCircle className="w-3 h-3 mr-1" />
|
||||
<span className="text-xs font-medium">Contrôle requis</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{!supplier.hasDlc && !supplier.automaticReconciliation && (
|
||||
{!supplier.hasDlc && !supplier.automaticReconciliation && !supplier.requiresControl && (
|
||||
<div className="text-xs text-gray-500 mt-2">
|
||||
Aucune option activée
|
||||
</div>
|
||||
@@ -524,6 +533,18 @@ export default function Suppliers() {
|
||||
</Label>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center space-x-2">
|
||||
<Checkbox
|
||||
id="requiresControl"
|
||||
checked={formData.requiresControl}
|
||||
onCheckedChange={(checked) => handleChange('requiresControl', checked === true)}
|
||||
data-testid="checkbox-requires-control"
|
||||
/>
|
||||
<Label htmlFor="requiresControl" className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70">
|
||||
Fournisseur à contrôler
|
||||
</Label>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center space-x-3 pt-4">
|
||||
<Button
|
||||
type="button"
|
||||
|
||||
Reference in new issue
Block a user