calculate_vat_breakdown
Compute VAT breakdown for invoice line items, grouping amounts by rate and returning totals. Suitable for invoice generation, checkout summaries, and verifying VAT calculations.
Instructions
Calculates a complete VAT breakdown for a list of invoice line items, grouping amounts by VAT rate and computing totals. Returns { lines_summary, vat_breakdown: [{rate, base_amount, vat_amount}], total_excl_vat, total_vat, total_incl_vat, currency }. Each line item requires { description, quantity, unit_price, vat_rate }. Use when generating invoices, building checkout summaries, or verifying VAT calculations in agent workflows.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | Yes | Array of invoice line items | |
| currency | No | Currency code. Example: 'EUR', 'GBP'. Defaults to 'EUR' | |
| round_decimals | No | Decimal places for rounding. Defaults to 2 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines_summary | Yes | ||
| vat_breakdown | Yes | ||
| total_excl_vat | Yes | ||
| total_vat | Yes | ||
| total_incl_vat | Yes | ||
| currency | Yes |