Generate a structured plain-text invoice from business/client info, settings, and line items; parse entries, compute subtotal/discount/tax/total due; format currency; keep item order; omit missing fields.
Prompt Content
Create a plain-text invoice from the provided details and line items, calculating line totals, subtotal, discount, tax, and total due.
1) Use data from
<business-and-client-info>
Business And Client Info
</business-and-client-info>
and
<settings>
Settings
</settings>
.
2) Parse
<line-items>
Line Items
</line-items>
: each line is "Description | Quantity | Unit Price".
3) For each item: Line Total = Quantity × Unit Price.
4) Subtotal = sum of line totals; apply Discount (%) to Subtotal before Tax (%); Total Due = (Subtotal - Discount) + Tax.
5) Prefix all amounts with the provided Currency code (e.g., USD 125.00); round to 2 decimals; no thousands separators.
6) Do not invent data; if a field is missing, leave it blank or omit that line. Keep items in the given order.
Output exactly this structure:
INVOICE
Seller:
Client:
Invoice No:
Issue Date:
Due Date:
Payment Terms:
Currency:
Items:
| Description | Qty | Unit Price | Line Total |
[one row per item]
Subtotal:
Discount (X%):
Tax (X%):
Total Due:
Notes:
<example>
LINE_ITEMS:
Design services | 10 | 75
Hosting (12 months) | 1 | 120
</example>
<example>
SETTINGS:
Invoice No: INV-1045
Issue Date: 2025-11-12
Due Date: 2025-12-12
Currency: USD
Tax Rate: 8.25%
Discount: 10%
Payment Terms: Net 30
Notes: Thank you for your business.
</example>
BUSINESS_AND_CLIENT_INFO:
<business-and-client-info>
Business And Client Info
</business-and-client-info>
LINE_ITEMS:
<line-items>
Line Items
</line-items>
SETTINGS:
<settings>
Settings
</settings>
Variables
Business And Client Info
Seller and client details for the invoice header. Include business (seller) info and client info (names, addresses, contacts). You may label sections as Seller: ... and Client: ...
Example: Seller: Acme Studio, 123 Market St, San Francisco, CA, [email protected], +1 555-0100
Client: Beacon Corp, 77 King Rd, Austin, TX, [email protected], +1 555-0142
Settings
Invoice metadata and calculations settings: Invoice No, Issue Date, Due Date, Currency code (e.g., USD), Tax Rate (e.g., 8.25%), optional Discount (e.g., 10%), Payment Terms, and Notes.
Example: Invoice No: INV-2025-0041
Issue Date: 2025-11-12
Due Date: 2025-12-12
Currency: USD
Tax Rate: 8.25%
Discount: 10%
Payment Terms: Net 30
Notes: Thank you for your business.
Line Items
Newline-separated items in the format: Description | Quantity | Unit Price