Invoice ======= A professional invoice with company header, client details, itemized table, and totals — all driven by JSON data. Template — ``invoice.craft`` ---------------------------- .. code-block:: xml ${company_name} Invoice ${invoice_number}
${company_name} ${company_address}
INVOICE ${invoice_number} Bill To: ${client_name} ${client_address} ${client_email} Date: ${invoice_date} Due Date: ${due_date} Payment Terms: ${payment_terms} Description Qty Unit Price Amount
Subtotal: ${subtotal} Tax (${tax_rate}): ${tax_amount} Total: ${total}
Data — ``invoice.json`` ----------------------- .. code-block:: json { "company_name": "TechCraft Srl", "company_address": "Via Roma 42, 20100 Milano, Italy", "vat_number": "IT12345678901", "invoice_number": "INV-2025-0042", "invoice_date": "2025-03-08", "due_date": "2025-04-07", "payment_terms": "Net 30", "client_name": "Acme Corporation", "client_address": "123 Business Ave, New York, NY 10001", "client_email": "billing@acme.com", "items": [ ["Cloud Hosting (March)", "1", "EUR 450.00", "EUR 450.00"], ["API Integration Setup", "3", "EUR 120.00", "EUR 360.00"], ["Technical Support", "10", "EUR 75.00", "EUR 750.00"], ["SSL Certificate", "2", "EUR 25.00", "EUR 50.00"] ], "subtotal": "EUR 1,610.00", "tax_rate": "22%", "tax_amount": "EUR 354.20", "total": "EUR 1,964.20" } Usage ----- .. code-block:: bash docraft_tool invoice.craft output/invoice.pdf -d invoice.json Output Example -------------- .. image:: ../_static/invoice.png :alt: Invoice Example Output :align: center :width: 600px