Issue invoice (PDF + ISDOC)
issue_invoiceCreates a new invoice: renders a PDF/A-3a with an embedded ISDOC e-invoice and QR payment code, saves it and records it in the ledger. Use it to bill a customer in one step.
Instructions
Issue a new invoice: render a PDF/A-3a with an embedded ISDOC 6.0.2 e-invoice and a QR Platba+F payment code, save it and record it in the ledger. Returns a summary: PDF path, number, items, totals, due date and variable symbol.
Side effects: writes ~/Documents/Účetnictví/Vydané faktury/<YY_MM_vydane>/faktura_.pdf (folder by
DUZP, tax point date) and ~/.ucetka/invoices/.json; calls ARES when customer_ico is used and the ČNB
rate API when currency is not CZK. Not idempotent: every call creates a new invoice with a new number, so
never retry blindly — check list_invoices first. Validation errors (e.g. reverse-charge rules, missing
customer or bank account) raise before anything is written and consume no number; an existing number or PDF
is never overwritten. Needs supplier config from ucetka init.
Confirm the customer (list_customers / lookup_company) and amounts with the user first. Use
add_manual_invoice instead to record an invoice whose PDF already exists, and issue_credit_note to correct a
delivered invoice. Next step is usually draft_invoice_email.
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": {
"lines": "<lines>"
},
"name": "issue_invoice"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | Free text printed on the invoice. Omitted = none. | |
| lines | Yes | Invoice items (at least one); prices are per unit without VAT. | |
| currency | No | ISO 4217 currency code, e.g. 'CZK' (default) or 'EUR'. For anything other than CZK the ČNB exchange rate valid on the DUZP is downloaded from api.cnb.cz. | CZK |
| due_days | No | Days from issue_date to the due date. Default 14; 0 = due on issue. | |
| language | No | Language of the PDF: 'cs' Czech (default) or 'en' English; ledger and ISDOC stay Czech. | cs |
| issue_date | No | Issue date YYYY-MM-DD. Omitted = today. Also determines the invoice number month. | |
| customer_id | No | Customer key from the address book (see list_customers). Takes precedence over customer_ico and the customer_name/street/city/zip fields. | |
| bank_account | No | Czech bank account to print instead of the supplier's default, format '[prefix-]number/bankcode', e.g. '19-2000145399/0100'. Required if supplier.yaml has no default. | |
| customer_dic | No | DIČ / EU VAT ID of a customer entered by name, e.g. 'DE123456789'. If given, the customer is treated as a VAT payer; required for reverse_charge (must not start with CZ). | |
| customer_ico | No | IČO (company ID, 8 digits) of a Czech customer not in the address book; details are fetched from ARES (network). Used only when customer_id is omitted. | |
| customer_zip | No | Postal code of a customer entered by name, e.g. '10115'. | |
| customer_city | No | City of a customer entered by name, e.g. 'Berlin'. | |
| customer_name | No | Name of a customer without IČO (e.g. a foreign company). Used only when customer_id and customer_ico are omitted, and then customer_street, customer_city and customer_zip are required too. | |
| invoice_number | No | Force a specific number (letters, digits, '-' or '_', max 20 chars), e.g. '2610005'. Omitted = next free number YYMMNNN (see peek_invoice_number). Fails if it is already used. | |
| reverse_charge | No | True for a service to a VAT payer in another EU country: no Czech VAT, the customer self-assesses. Requires customer_dic (non-CZ), a non-CZ country and vat_rate 0 on all lines. Default False. | |
| tax_point_date | No | DUZP (tax point date) YYYY-MM-DD. Omitted = issue_date. Decides the VAT period, the ČNB rate date and the output folder. | |
| customer_street | No | Street and number of a customer entered by name, e.g. 'Musterstraße 1'. | |
| customer_country | No | Country name printed on the invoice for a customer entered by name, e.g. 'Německo'. Omitted = 'Česká republika'. | |
| customer_country_code | No | ISO 3166 alpha-2 country code of a customer entered by name, e.g. 'DE'. Default 'CZ'; must not be CZ for reverse_charge. | CZ |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |