Trial run invoice mapping
csv2zugferd_invoice_getMaps a CSV invoice to ZUGFeRD XML in memory without writing files, returning totals, tax breakdown, warnings, and optional line-item, party, and PDF template checks.
Instructions
Runs the real csv2zugferd mapping for one CSV file with the given configuration (configPath or configYaml) without writing any output file: reads the CSV, maps header, parties, line items and totals, builds the ZUGFeRD XML in memory and returns invoice number, type, totals, tax breakdown, warnings with codes and paths, and the XML size. includeLineItems and includeParties (default false) add details; pdfTemplatePath also embeds the XML into a temporary PDF copy to check format and template. Does not create the XML or PDF for production; that is done by the csv2zugferd CLI (csv2zugferd_config_file_create returns the command). Read-only for the user's files; a temporary PDF is created and deleted only with pdfTemplatePath.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| csvPath | Yes | Path to the CSV file with the invoice data. | |
| configPath | No | Path to an existing YAML configuration file. Use either configPath or configYaml, not both. | |
| configYaml | No | YAML configuration as text (the content of config.yml). Use either configPath or configYaml, not both. | |
| includeParties | No | True adds seller and buyer (name, city, country) to the result. | |
| pdfTemplatePath | No | Optional PDF template: the trial run also embeds the XML into a copy of this PDF in the temp directory (deleted afterwards) and reports its size, which checks zugferd.format and the template. | |
| includeLineItems | No | True adds the mapped line items (name, quantity, unit, price, line total, tax rate) to the result. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | Yes | Effective XML syntax (applied in the PDF only). | |
| totals | Yes | Document totals (BG-22). | |
| parties | No | Seller and buyer; only with includeParties. | |
| profile | Yes | Effective ZUGFeRD profile as library name; a configured EN16931 is reported as Comfort (same profile). | |
| version | Yes | Effective ZUGFeRD version. | |
| currency | Yes | Currency code (BT-5). | |
| pdfBytes | No | Size of the generated PDF in bytes; only with pdfTemplatePath. | |
| rowCount | Yes | Data rows read from the CSV. | |
| typeCode | Yes | Invoice type code (BT-3), for example 380. | |
| warnings | Yes | All findings of the run: document checks, fallbacks, unparsable values, ignored or missing sections. | |
| xmlBytes | Yes | Size of the generated XML in bytes. | |
| lineItems | No | Mapped line items; only with includeLineItems. | |
| invoiceDate | Yes | Invoice date (BT-2) as yyyy-MM-dd; 0001-01-01 when the date could not be parsed. | |
| taxBreakdown | Yes | VAT breakdown per rate and category (BG-23). | |
| invoiceNumber | Yes | Invoice number (BT-1) as mapped. | |
| lineItemCount | Yes | Line items in the invoice. |