What we would need to receive from ERP vendors to populate the CSVs
Given the CSVs and HTMLs we already have, would it be possible to define the INFORMATION/DATA we would need to receive from supermarket ERP vendors to populate the CSVs?
Each CSV the system uses is essentially a "data contract": the corresponding HTML page expects specific columns, in a specific order, with a specific format. Since the parsers for all pages are already mapped, it is possible to work backwards — starting from what each screen consumes and deriving exactly which fields the ERP needs to deliver.
This becomes a data dictionary (an integration specification) that can be delivered to any ERP vendor.
Most columns in the CSVs are calculated, not raw. In arquivao.csv, for example, fields such as MARGIN, M_PERC, GMP, CO_VE, PART_VEN, PART_GMP, PEC all derive from just a few raw numbers (quantity, selling price, cost price, total sold, total purchased).
In other words: we should not ask the ERP for the derived columns — we would only request the source fields, and +PROFIT itself (or a conversion step) computes the rest. This has two major advantages:
| Block | Feeds the screens | Essential raw data |
|---|---|---|
| 1. Product/period movement | ABC, GMP, PEC, PURIX, CostVar, Shrinkage | Store, hierarchy (dept/group/category), product code + description, period, qty sold, qty purchased, selling price, cost price, total sold, total purchased |
| 2. Daily sales | Purchases (projection), ADS | Date/day of week, daily sales (projected and actual) — and for ADS, two comparable periods |
| 3. Cash expenses | Monthly/annual expenses | Payment date, expense amount |
| 4. Cash balances | Monthly/annual balance | Date, end-of-day balance (currently entered manually — would come from ERP/bank) |
| 5. P&L result | P&L | Statement lines (revenues, costs, expenses by category, period) |
Note that almost everything originates from a single powerful query (block 1, by product and period). The other blocks are small and well-defined.
These are the points where integrations typically fail, so it would be worth specifying them clearly for vendors:
Not only is it possible, it is recommended: what already exists can be turned into a technical specification document ("Data Requirements for ERP Integration → +PROFIT"), with a field-by-field dictionary, data types, formats, and a sample CSV template for each extract.
This professionalizes the product and makes it easier to engage with any vendor.