Convert journal between accounting programs
convert_journalConvert accounting journals between Spanish formats (A3, ContaPlus, ContaSol) and CSV, QuickBooks, or Xero, with automatic source format detection.
Instructions
Convert a libro diario (journal) between Spanish accounting programs.
Formats: a3 (a3ASESOR/a3ECO/a3CON SUENLACE.DAT, apuntes tipo 0), contaplus_csv (Sage ContaPlus / Sage 50
Diario CSV, 142 fields), contaplus_ascii (XDiario.txt fixed width), contasol (ContaSol APU.ods, destination only:
save content_base64 as APU.ods and import it in Utilidades > Importaciones), csv (spreadsheet with header:
Holded, Excel, any ERP; columns auto-detected, override with column_map), quickbooks_iif (QuickBooks
Desktop general journal), quickbooks_csv (QuickBooks Online journal import), xero_csv (Xero manual
journal import). The source is auto-detected. QuickBooks/Xero accounts are names or codes, not PGC
subaccounts: use account_map to translate them when converting to or from A3/ContaPlus.
Args: target_format: a3 | contaplus_csv | contaplus_ascii | contasol | csv | quickbooks_iif | quickbooks_csv | xero_csv. content: The file as text. content_base64: raw bytes as base64 (Latin-1/CP1252 files with Ñ). source_format: auto (default) or one of the formats. account_digits: Resize every subaccount to this length (ContaPlus uses a fixed length, e.g. 8); also expands '430.1' shorthand. 0 keeps them. account_split: Where zeros are inserted/removed when resizing (default 4: 4300001 -> 43000001). account_map: Exact account renames applied first, e.g. {"5720001": "57200005"}. start_entry_number: Renumber entries from this number (ContaPlus requires numbers; A3 does not use them). company_code: A3 company code (1-99999). a3_format: 5 (512-byte records, current) or 4 (256, old). column_map: For csv sources, e.g. {"debit": "Importe D", "account": "Cta"}. Keys: number, date, account, account_name, debit, credit, amount, dh, concept, document. csv_delimiter: For csv source/target; auto-detected on read, ';' on write. decimal_comma: csv output with decimal comma (Spanish Excel). fiscal_year: flag dates outside it. strict: Refuse to write a file with validation errors (default), so the target program never rejects it. date_style: Dates in QuickBooks/Xero files, read and write: mdy (US, QuickBooks default), dmy (UK/AU/NZ, Xero default) or iso. xero_tax_rate: TaxRate written on every Xero line, as named in that Xero organisation (UK "No VAT", AU "BAS Excluded", NZ "No GST", US "Tax Exempt").
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"target_format": "<target_format>"
},
"name": "convert_journal"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| strict | No | ||
| content | No | ||
| a3_format | No | ||
| column_map | No | ||
| date_style | No | ||
| account_map | No | ||
| fiscal_year | No | ||
| company_code | No | 00001 | |
| account_split | No | ||
| csv_delimiter | No | ||
| decimal_comma | No | ||
| source_format | No | auto | |
| target_format | Yes | ||
| xero_tax_rate | No | No VAT | |
| account_digits | No | ||
| content_base64 | No | ||
| start_entry_number | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||