|
| 1 | +# invoice-pro |
| 2 | + |
| 3 | +Modern Invoice Template for Typst |
| 4 | + |
| 5 | +A professional, compliant, and automated invoice template for [Typst](https://typst.app). This package follows the German **DIN 5008** standard (Form A & B) and automates calculations, VAT handling, and payment details. |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | +## Features |
| 10 | + |
| 11 | +- **Internationalization (i18n) (New in v0.3.0):** Built-in support for English and German out of the box, plus a highly flexible `locale` API to inject custom translations for any language. |
| 12 | +- **DIN 5008 Compliant:** Supports both Form A and Form B layouts natively via the flexible Theming API. |
| 13 | +- **Block-based API:** Clean, scoped, and declarative data structure using `#line-items`, `#item`, and `#bundle`—inspired by CeTZ, keeping your document clutter-free. |
| 14 | +- **Automatic Calculations:** Effortlessly handles line items, nested bundles, sub-totals, and calculates taxes automatically. |
| 15 | +- **EPC QR-Code (GiroCode):** Automatically generates a scannable banking QR code for quick and easy payments using banking apps. |
| 16 | +- **Advanced Modifiers:** Apply specific discounts, surcharges, and custom tax rates at the item, bundle, or global level. |
| 17 | +- **Highly Customizable:** Easy configuration of sender, recipient, payment goals, bank details, and visual themes to match your corporate identity. |
| 18 | + |
| 19 | +## Documentation |
| 20 | + |
| 21 | +For comprehensive guides, API references, theming instructions, and advanced examples, please visit our official documentation: |
| 22 | + |
| 23 | +👉 **[Read the Full Documentation Here](https://leonieziechmann.github.io/invoice-pro/)** |
| 24 | + |
| 25 | +## Getting Started |
| 26 | + |
| 27 | +### Installation |
| 28 | + |
| 29 | +Import the package at the top of your Typst file: |
| 30 | + |
| 31 | +```typst |
| 32 | +#import "@preview/invoice-pro:0.3.1": * |
| 33 | +``` |
| 34 | + |
| 35 | +### Basic Usage |
| 36 | + |
| 37 | +Here is an example of how to create an invoice using the new v0.3 API: |
| 38 | + |
| 39 | +```typst |
| 40 | +#import "@preview/invoice-pro:0.3.1": * |
| 41 | +
|
| 42 | +#show: invoice.with( |
| 43 | + theme: themes.DIN-5008(form: "A"), // or form: "B" |
| 44 | + locale: locale.en-de, |
| 45 | + sender: ( |
| 46 | + name: "Your Company / Name", |
| 47 | + address: "1 Example Street", |
| 48 | + city: "12345 Example City", |
| 49 | + ), |
| 50 | + recipient: ( |
| 51 | + name: "Customer Name", |
| 52 | + address: "5 Customer Street", |
| 53 | + city: "98765 Customer City", |
| 54 | + ), |
| 55 | + invoice-nr: "2026-01", |
| 56 | + tax-nr: "123/456/789", |
| 57 | +) |
| 58 | +
|
| 59 | +// Add Invoice Items inside a scoped block |
| 60 | +#line-items[ |
| 61 | + #item( |
| 62 | + [Consulting & Concept], |
| 63 | + price: 85.00, |
| 64 | + quantity: 5, |
| 65 | + unit: "hrs" |
| 66 | + ) |
| 67 | +
|
| 68 | + #item( |
| 69 | + [Web Design Layout (Flat Rate)], |
| 70 | + price: 1200.00, |
| 71 | + ) |
| 72 | +
|
| 73 | + #item( |
| 74 | + [Stock Licenses (Images)], |
| 75 | + price: 25.00, |
| 76 | + quantity: 4, |
| 77 | + ) |
| 78 | +
|
| 79 | + #discount([Project Discount (Regular Customer)], amount: 10%) |
| 80 | +] |
| 81 | +
|
| 82 | +// Payment Terms |
| 83 | +#payment-goal(days: 14) |
| 84 | +
|
| 85 | +// Bank Details with QR Code |
| 86 | +#bank-details( |
| 87 | + bank: "Example Bank", |
| 88 | + iban: "DE07100202005821158846", |
| 89 | + bic: "EXAMPLEBIC", |
| 90 | +) |
| 91 | +
|
| 92 | +#signature() |
| 93 | +``` |
| 94 | + |
| 95 | +## API Stability |
| 96 | + |
| 97 | +With the major refactoring introduced in version 0.2.0, the package structure is solidifying. Here is the current stability status of the various API components: |
| 98 | + |
| 99 | +- **Invoice Header (`invoice` arguments):** **Mostly Stable**. The core invoice configuration is established. Future updates to the header will be non-breaking and will primarily consist of adding new optional fields. |
| 100 | +- **Data Model (`#line-items`, `#bundle`, `#item`):** **Stable**. The new block-based data model is considered almost finished and safe to use. |
| 101 | + - _Exception:_ The `unit` argument in `#item` and `#bundle` will change in a future release to strictly comply with the standardized unit formats and codes required for upcoming ZUGFeRD e-invoicing support. |
| 102 | +- **Theming (`theme`):** **Under Construction**. The theming engine is still evolving and will most likely experience breaking changes in the next updates as we refine customization capabilities. |
| 103 | +- **Localization (`locale`):** **Under Construction**. The localization and internationalization systems are actively being worked on and are subject to change. |
| 104 | + |
| 105 | +## Dependencies |
| 106 | + |
| 107 | +This template relies on these amazing packages: |
| 108 | + |
| 109 | +- `letter-pro` for the DIN layout. |
| 110 | +- `sepay` for EPC-QR-Code generation. |
| 111 | +- `ibanator` for IBAN formatting. |
| 112 | +- `loom` for reactive document rendering. |
| 113 | + |
| 114 | +**Acknowledgements:** |
| 115 | + |
| 116 | +- Special thanks to [classy-german-invoice](https://github.com/erictapen/typst-invoice) by Kerstin Humm, which served as inspiration and provided the logic for the EPC-QR-Code implementation. |
| 117 | + |
| 118 | +## License |
| 119 | + |
| 120 | +MIT |
0 commit comments