mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-24 15:38:09 +02:00
feat(commandes-auto): cadencier d'alertes de commande par fournisseur et magasin
Ajoute un onglet "Cadencier / Alertes" dans la page Commandes auto. Depuis la liste des fournisseurs, on active un fournisseur en alerte de commande sur un magasin (292/579) avec une fréquence en X semaines, gérée indépendamment par magasin. L'échéance est calculée à partir de la dernière réception réelle (mvtart, genremvt 1/2, fournisseur principal artfou1.preference=1) + X semaines. Statut: à commander / bientôt / OK, avec temps restant. - Table commande_cadences (schema + db-init) - pgGetDerniereReceptionParFournisseur (mvtart par fournisseur/site) - Server actions CRUD (list/upsert/toggle/remove) - UI à onglets + cadencier (ajout, édition intervalle, activer/supprimer)
This commit is contained in:
7 files changed
+668
-4
No files matched your search
@@ -1,15 +1,21 @@
|
||||
import { pgGetCommandesAuto, type PgCommandeAutoRow } from "@/lib/pg-ff-client";
|
||||
import { CommandesAutoClient } from "./client";
|
||||
import { listCadences, getFournisseursPourCadence } from "@/features/commandes-auto/actions";
|
||||
import { CommandesAutoTabs } from "./tabs";
|
||||
|
||||
export type { PgCommandeAutoRow };
|
||||
|
||||
export default async function CommandesAutoPage() {
|
||||
const rows = await pgGetCommandesAuto();
|
||||
const [rows, cadences, fournisseurs] = await Promise.all([
|
||||
pgGetCommandesAuto(),
|
||||
listCadences(),
|
||||
getFournisseursPourCadence(),
|
||||
]);
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-gray-50 p-6">
|
||||
<div className="mx-auto max-w-screen-2xl">
|
||||
<h1 className="mb-6 text-3xl font-bold text-gray-900">Commandes automatiques</h1>
|
||||
<CommandesAutoClient rows={rows} />
|
||||
<CommandesAutoTabs rows={rows} cadences={cadences} fournisseurs={fournisseurs} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user