diff --git a/src/app/(dashboard)/stock-negatif/client.tsx b/src/app/(dashboard)/stock-negatif/client.tsx index 9401e2a..673a1f3 100644 --- a/src/app/(dashboard)/stock-negatif/client.tsx +++ b/src/app/(dashboard)/stock-negatif/client.tsx @@ -66,15 +66,15 @@ function TabStockNegatif({ rows, magasin }: { rows: PgStockNegatifRow[]; magasin const ExcelJS = (await import("exceljs")).default; const wb = new ExcelJS.Workbook(); const ws = wb.addWorksheet("Stock Négatif"); - ws.addRow(["Code article", "Libellé", "Fournisseur", "Stock négatif"]); + ws.addRow(["Code article", "Libellé", "Fournisseur", "Magasin", "Stock négatif", "Dernière vente", "Dernière entrée en stock"]); ws.getRow(1).eachCell(cell => { cell.fill = { type: "pattern", pattern: "solid", fgColor: { argb: "FF1E293B" } }; cell.font = { color: { argb: "FFFFFFFF" }, bold: true }; cell.alignment = { vertical: "middle", horizontal: "center" }; }); ws.getRow(1).height = 22; - for (const r of sorted) ws.addRow([r.codein, r.libelle1, r.fournisseur, r.stockdispo]); - ws.columns = [{ width: 16 }, { width: 40 }, { width: 30 }, { width: 14 }]; + for (const r of sorted) ws.addRow([r.codein, r.libelle1, r.fournisseur, r.site, r.stockdispo, fmtDate(r.dernierevente), fmtDate(r.derniereentree)]); + ws.columns = [{ width: 16 }, { width: 40 }, { width: 30 }, { width: 10 }, { width: 14 }, { width: 16 }, { width: 22 }]; const buffer = await wb.xlsx.writeBuffer(); const blob = new Blob([buffer], { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" }); const url = URL.createObjectURL(blob); @@ -103,11 +103,12 @@ function TabStockNegatif({ rows, magasin }: { rows: PgStockNegatifRow[]; magasin {th("site", "Magasin")} {th("stockdispo", "Stock")} {th("dernierevente", "Dernière vente")} + {th("derniereentree", "Dernière entrée")}
{sorted.length === 0 && ( -