Product column added in the company profile Export

This commit is contained in:
unknown 2026-01-20 16:01:39 +05:30
parent 3237a62939
commit f1c1084b7b

View File

@ -416,6 +416,7 @@ exports.getAllEstablishments = async (req, res) => {
{ header: "Emirate", key: "emirate_name", width: 20 },
{ header: "ISIC Code", key: "isic_code", width: 20 },
{ header: "Establishment ID", key: "establishment_code", width: 20 },
{ header: "Products", key: "products", width: 20 },
{ header: "Total Employees", key: "total_employees", width: 20 },
{ header: "Created By", key: "created_user", width: 20 },
{ header: "Created On", key: "created_at", width: 20 },
@ -425,6 +426,8 @@ exports.getAllEstablishments = async (req, res) => {
// Format data
data.forEach((item) => {
worksheet.addRow({
id: item.id,
factory_name: item.factory_name,
@ -432,6 +435,7 @@ exports.getAllEstablishments = async (req, res) => {
emirate_name: item.establishment_emirate?.name || "-",
isic_code: item.isic_code || "-",
establishment_code: item.establishment_code,
products: item.product_count,
total_employees: item.total_employees,
created_user: item.created_user?.name || "-",
created_at: new Date(item.created_at).toLocaleDateString(),