diff --git a/src/features/grid/api/get-product-rows.ts b/src/features/grid/api/get-product-rows.ts index 5e3476d..f8b77c7 100644 --- a/src/features/grid/api/get-product-rows.ts +++ b/src/features/grid/api/get-product-rows.ts @@ -70,6 +70,8 @@ export async function getProductRows(input: GetProductRowsInput): Promise ( -
- - {row.original.libelle1} - -
- {row.original.workingStores.map((magasin) => { - const config = getStoreConfig(magasin); - return ( -
- - {config.label} -
- ); - })} + cell: ({ row }) => { + const r = row.original; + const isDifferentSupplier = r.fournisseurPrincipalCode && r.fournisseurPrincipalCode !== r.codeFournisseur; + const warnTitle = isDifferentSupplier + ? `Dernier fournisseur enregistré : ${r.fournisseurPrincipalNom ?? r.fournisseurPrincipalCode} (${r.fournisseurPrincipalCode}) — les ventes sont à attribuer à ce fournisseur` + : undefined; + return ( +
+ {isDifferentSupplier && ( + + + + )} + + {r.libelle1} + +
+ {r.workingStores.map((magasin) => { + const config = getStoreConfig(magasin); + return ( +
+ + {config.label} +
+ ); + })} +
-
- ), + ); + }, }, { accessorKey: "libelle3", diff --git a/src/lib/pg-ff-client.ts b/src/lib/pg-ff-client.ts index b870110..323096c 100644 --- a/src/lib/pg-ff-client.ts +++ b/src/lib/pg-ff-client.ts @@ -42,9 +42,11 @@ export interface PgArticle { pcb?: number; reference?: string; ean13?: string; - gtin?: string; // art_gtin.gtin (préférentiel) - pv_central?: number; // article_infosup.prix_vente_mini - pa?: number; // cube_pa.pa + gtin?: string; // art_gtin.gtin (préférentiel) + pv_central?: number; // article_infosup.prix_vente_mini + pa?: number; // cube_pa.pa + codefou_principal?: string; // artfou1.code où preference=1 + nomfou_principal?: string; // nom du fournisseur principal } export interface PgMensuelRow { @@ -117,6 +119,7 @@ export async function pgGetArticlesByFournisseur(codefou: string): Promise