Instruction file imported from kishormane798/Covoro_OMN_Invoice (
.cursor/rules/excel-and-utils.mdc). Copyright stays with the author.
Excel and test data
Test data
- Static templates:
testData/uploads/(primary:template.xlsx) - Field validation configs:
testData/FieldValidations/ - Submit rows use Excel header keys:
Invoice Type Code,Tax Category,Tax Rate, etc. - Header mapping lives in one place — avoid duplicating column names across files.
Excel generation (utils/excel/invoiceExcel.ts)
- Calls Python via
utils/pythonRunner.ts— ensurerequirements.txtpackages are installed. - Submit pipeline recalculates totals; do not assume manual totals in input rows persist.
- Tax category rules: only
Standard rate.uses sheet Tax Rate for effective VAT; other categories → 0% in totals. - Error file validation:
validateErrorFileColumn,getErrorFieldExcelDetailsvia Python reader. - Pipeline choice / testcase → workbook: rule
excel-generation-from-tests; skillsgenerate-excel-from-testcase,author-excel-testcase-data.
Risky changes (require extra review)
- Rounding/tax effective-rate logic in
invoiceExcel.tsorinvoice_excel_writer.py - Worker output path or cleanup in
baseTest.ts/invoiceExcel.ts - Template mapping recovery in
UploadInvoicePage.ensureExpectedTemplateMapping