Invoice Generator
Create professional invoices from text descriptions or structured data.
Workflow
- Collect invoice details from the user (or parse from prompt):
- Sender (business name, address, email)
- Recipient (client name, address, email)
- Line items (description, quantity, unit price)
- Invoice number, date, due date
- Payment terms/methods
- Tax rate (optional)
- Notes (optional)
- Read the template at
assets/invoice-template.html - Replace placeholders with actual data, calculate totals
- Save as
.htmlfile — user can open in browser and Print → PDF
Calculations
- Subtotal = sum of (quantity × unit price) for each line item
- Tax = subtotal × tax rate
- Total = subtotal + tax
- Always format currency with 2 decimal places
Template Placeholders
| Placeholder | Description |
|---|---|
{{INVOICE_NUMBER}} |
Unique invoice ID |
{{INVOICE_DATE}} |
Issue date |
{{DUE_DATE}} |
Payment due date |
{{SENDER_*}} |
Sender name, address, email, phone |
{{CLIENT_*}} |
Client name, address, email |
{{LINE_ITEMS}} |
HTML table rows for items |
{{SUBTOTAL}} |
Pre-tax total |
{{TAX_RATE}} |
Tax percentage |
{{TAX_AMOUNT}} |
Calculated tax |
{{TOTAL}} |
Final amount due |
{{PAYMENT_TERMS}} |
Payment instructions |
{{NOTES}} |
Additional notes |
Defaults
- Currency: USD (configurable)
- Tax: 0% unless specified
- Due date: 30 days from invoice date unless specified
- Invoice number: auto-increment or user-specified
Common Mistakes to Avoid
- Don't guess line items — if the user is vague ("invoice them for the work"), ask for specifics (hours, rate, deliverables)
- Don't invent sender details — use what the user provides or ask
- Don't skip the math — always verify subtotal + tax = total. Rounding errors on invoices are unprofessional
- Don't add fake payment links — only include payment methods the user explicitly provides