Create and optionally send a new invoice to a client. Use when the user wants to invoice someone, bill a client, or create a new Rechnung.
Help the user create and send an invoice step by step:
Identify the client: If a client name is provided in $ARGUMENTS, call list_clients and find the matching client. If ambiguous, ask the user to clarify. If no client exists, offer to create one with create_client.
Gather invoice details: Collect the following information (ask for anything not provided):
Create the invoice: Call create_invoice with all gathered details. Use the correct client_id from step 1.
Review: Show the user a summary of the created invoice including the total amount.
Send: Ask the user if they want to send the invoice now. If yes, call send_invoice to email it to the client.
Important:
create_recurring_invoice insteadInvoice appearance and edits:
get_invoice_settings for the company logo and saved defaults. Pass the saved language/currency when the user does not choose others.list_invoice_templates. Show the available choices and plan access. Do not invent template IDs or bypass paid access.document_design: template, version, logo size (25โ100), text size, spacing and table borders. Use font and color_schema for the font and colour. Omit these three options to preserve company branding. A partial design takes the chosen template's defaults.update_invoice for invoice/quote edits and update_recurring_invoice for schedule edits. Send only changed fields in changes. Keep existing line IDs when editing items. A partial document design keeps the document's other saved controls; changing its template starts from that template's defaults. Explicit false, zero, blank strings and valid nulls are different from omitted fields.update_invoice_settings only when the user wants to change future document defaults. Existing documents keep their saved design. Show-customer-number, show-contact-person, QR codes and online payment defaults are included.starts_from_date, payment_due_days and billing_in_advance; their legacy issue/service/due-date arguments do not control generated dates.is_to_send / isToSend only when sending is requested or already authorized. Otherwise save the document without sending it.Corrections and delivery notes (documents made from an existing document):
cancel_invoice with the invoice id. Norman writes the Stornorechnung with the same lines, the next invoice number and a reference to the invoice, and marks the invoice cancelled. Confirm with the user first: a cancellation is a numbered document the client receives, not an edit. A draft is edited with update_invoice, never cancelled.create_credit_note with the invoice id and the lines to credit. Without lines the whole invoice is credited. Norman prints "Rechnungskorrektur", never "Gutschrift", because since 2013 that word means self-billing under ยง 14 UStG. Use status: "draft" when the user wants to review it first.create_delivery_note with the invoice id, or the id of a quote the client approved. It prints quantities and units only, no prices, and lands in the company's Files space under "Delivery notes". Pass lines for a partial delivery.convert_offer_to_invoice makes a draft invoice from a quote. The quote stays, with the status "invoiced", and the invoice links to it. Issue the invoice with update_invoice (status "saved") before sending it.duplicate_invoice with the invoice or quote id: it makes a draft dated today with the same lines and payment term. Move the service or delivery dates with update_invoice, then set status "saved" to issue it. A draft is never emailed or matched to a payment.message.