u
This commit is contained in:
@@ -358,6 +358,7 @@ export async function executeCompanyExport({
|
||||
'"attributes"',
|
||||
'"brandPictureFiles"',
|
||||
'"pictureFiles"',
|
||||
'"supplieer"',
|
||||
'"desc"',
|
||||
];
|
||||
const articleCsvRows = [articleCsvHeaders.join(';')];
|
||||
@@ -415,6 +416,21 @@ export async function executeCompanyExport({
|
||||
// Categories
|
||||
const catStr = Array.isArray(a.categoryIds) ? a.categoryIds.join(';') : '';
|
||||
|
||||
// Suppliers: <supplier_name>:<supplier_sku>:<vpe>:<tax_rate>:<net_purchase_price> separated by |
|
||||
let supplierStr = '';
|
||||
if (Array.isArray(a.suppliers) && a.suppliers.length > 0) {
|
||||
supplierStr = a.suppliers
|
||||
.map((s) => {
|
||||
const sName = String(s.supplierName || '').replace(/[:|]/g, ' ').trim();
|
||||
const sSku = String(s.sku || '').replace(/[:|]/g, ' ').trim();
|
||||
const vpe = (s.pu != null && Number(s.pu) > 1) ? Number(s.pu) : 0;
|
||||
const sTaxRate = s.price?.taxRate != null ? Number(s.price.taxRate) : 0;
|
||||
const netPrice = Number(s.price?.net || 0).toFixed(2);
|
||||
return `${sName}:${sSku}:${vpe}:${sTaxRate}:${netPrice}`;
|
||||
})
|
||||
.join('|');
|
||||
}
|
||||
|
||||
const row = [
|
||||
formatCsvField(a.id),
|
||||
formatCsvStringFormula(a.sku),
|
||||
@@ -436,6 +452,7 @@ export async function executeCompanyExport({
|
||||
formatCsvField(pfandAttr),
|
||||
formatCsvField(brandPicRel),
|
||||
formatCsvField(picPaths.join(';')),
|
||||
formatCsvField(supplierStr),
|
||||
formatCsvField(a.desc || ''),
|
||||
];
|
||||
articleCsvRows.push(row.join(';'));
|
||||
|
||||
Reference in New Issue
Block a user