Fix: Implement dynamic column detection to handle Excel structure changes (insertion of PM Classification). This fixes the Missing data error in Pricing Units and other views.

This commit is contained in:
Christian Vidal Wolf
2026-04-22 16:52:59 +02:00
parent 8471a69529
commit d43d9931c6
15 changed files with 176 additions and 55 deletions
+13
View File
@@ -0,0 +1,13 @@
import * as XLSX from 'xlsx';
import * as fs from 'fs';
const buf = fs.readFileSync('data (3).xlsx');
const wb = XLSX.read(buf, {type: 'buffer'});
const ws = wb.Sheets[wb.SheetNames[0]];
const data = XLSX.utils.sheet_to_json(ws, {header: 1});
const headers = data[0];
console.log('Headers:');
headers.forEach((h, i) => {
console.log(`${i}: ${h}`);
});