ERP data
ERP imports reject records whose identifiers fail a check digit or whose formats do not match the country. Ghost Bakery has smart types for the identifiers, bank details, product codes and reference data those imports check. Every example on this page links to a recipe in the recipe library. The test suite generates each of those recipes and verifies its output.
The data is well formed, not audit grade. Values pass format and check-digit validation, but no cross-row accounting rule is applied: journals do not balance, and depreciation, aging and payments are not reconciled.
Smart types for ERP records
| Area | Smart types | What is checked |
|---|---|---|
| Banking | iban, bic |
IBAN mod 97 and the national BBAN checks (BE, ES, FR, IT, PT), for the EU-27, GB, BR, SA and TR |
| Tax | vatId |
The check digit of each EU-27 country, GB and BR (CNPJ) |
| Company and person IDs | identifier |
National kinds such as ustIdNr, steuerId, siren, siret, partitaIva, codiceFiscale, gbVat, gbCrn, utr and cnpjAlfanumerico |
| Products | gtin, unitOfMeasure |
GS1 check digit; UN/ECE Recommendation 20 or common ERP unit codes |
| Addresses | postcode, phone, subdivision, legalForm |
Postal and mobile number plans of every G20 country, CLDR subdivisions and common company forms |
| Amounts | money |
Rounded to the ISO 4217 minor unit of the currency |
Countries that agree within a row
ERP master records keep one country across their columns. Put the country-dependent columns in a same(geo) group, and the row's city, country, postcode, phone, subdivision, legal form, IBAN, BIC and currency all follow the same country. A country argument fixes the country instead, and it accepts codes or names in any catalog language ("DE", "de", "Germany", "Deutschland").
When a type has no data for the requested country, the plan picks a documented fallback and reports it as a country_fallback warning. It rejects the recipe only when no sensible value exists. The supplier import recipe groups ten columns this way, and bank accounts writes formatted IBANs.
Reference data from catalogs
Charts of accounts, payment terms and VAT rates are catalog data, not generated text. A catalog(...) table writes one row per record, and catalogField(column: "...") reads a column of the row's record. See catalog tables for the syntax.
glAccount: the generic chart and the account class structure of SKR 03, SKR 04 and the French PCG, with our own account names. Chart of accounts exports the generic chart.paymentTerm: twelve terms with net days, discount and texts in six languages. See payment terms.countryhas avat_ratecolumn with the standard rate. Catalog-backed invoices combines accounts, terms, G20 VAT rates andmoneyamounts.localeholds the decimal and group separators, short date pattern and legacy charset of 19 locales such asde-DE, for number and date conventions of ERP imports.legalFormandunitare the lists thelegalFormandunitOfMeasuresmart types read.
Codes without their own smart type
Some ERP codes come from fixed lists or have a simple structure. enum and regexp write them, so there is no separate smart type. Each line below comes from a tested recipe.
| Code | Column definition | Recipe |
|---|---|---|
| Debit or credit | enum(values: ["S", "H"]), or ["D", "C"], ["+", "-"] |
General ledger |
| Fiscal period | regexp(pattern: "0(0[1-9]|1[0-6])"): SAP periods 001 to 012 and special periods 013 to 016 |
General ledger |
| Depreciation method | enum(values: ["linear", "declining", "units"]) |
Fixed assets |
| Incoterm | enum of the eleven Incoterms 2020 codes, EXW to CIF |
Supplier invoices |
| Customs tariff code | regexp(pattern: "[0-9]{8}") for the EU Combined Nomenclature; {6} for HS, {10} for HTS |
Inventory import |
| UN/LOCODE | regexp(pattern: "DE[A-Z]{3}") |
Inventory import |
| Batch number | pattern(pattern: "B-#####") |
Product batches |
| Serial number | regexp(pattern: "[A-Z]{2}[0-9]{8}") with unique |
Fixed assets |
Tariff codes and UN/LOCODEs have a plausible structure but are not looked up in the official lists, and no descriptions are included.
Recipes by ERP area
| Area | Recipes |
|---|---|
| Vendor master | Supplier master data, Supplier import, Suppliers |
| Customer master | Customer master data, Customer import |
| Open items | Accounts payable, Accounts receivable, Supplier invoices, Customer invoices |
| Fixed assets | Fixed assets, Asset register |
| Inventory | Inventory import, Inventory balances, Inventory movements, Product batches |
| General ledger | General ledger, Chart of accounts, Catalog-backed invoices |
| Banking | Bank accounts, Bank statement |
German-style CSV is supported: decimal comma, digit grouping, trailing minus, dd.MM.yyyy dates, empty or 00.00.0000 dates and Windows-1252, through the CSV and TSV spelling options. The GDPdU export writes data files with an index.xml for German tax audits. DATEV EXTF and fixed width are not supported yet. The recipes write the standard output formats.