Invoice from hours
invoice_from_hoursCreates an invoice by billing hours at an hourly rate, with optional currency conversion and tax/discount adjustments.
Instructions
Shortcut for the common case: bill one client for N hours at an hourly rate. Creates and returns a single-line invoice, converting the rate into target_currency when you supply fx_rates, and echoing back any entry_ids.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rate | Yes | Hourly rate in major units, expressed in currency (or the business default currency) | |
| hours | Yes | ||
| notes | No | ||
| client | Yes | ||
| currency | No | Currency the rate is in. Without target_currency this is also the invoice currency | |
| due_days | No | ||
| fx_rates | No | Conversion rates, the same pair expense_to_invoice takes: fx_rates maps the RATE's currency to the number of target units one of it buys, meaning 1 unit of that currency = X units of target_currency, e.g. {"EUR": 1.1578} with target_currency "USD". You supply the rate; nothing here fetches or guesses one | |
| tax_rate | No | ||
| entry_ids | No | Time-tracker entry ids these hours came from (the entry_ids invoice_summary returns). Echoed back with the new invoice number so you can call entry_mark_billed | |
| issue_date | No | ||
| description | No | Line description, default 'Consulting services' | |
| round_total | No | D-R46: when converting with fx_rates, round the line's TOTAL to the exact converted amount instead of rounding the hourly rate to cents first. Default false keeps the D-R24 basis (unit price x hours always equals the printed line, so a rounding_note explains any drift from the exact conversion); true removes the drift but unit_price x hours may then be a cent or two off the printed total. | |
| target_currency | No | Issue the invoice in this currency instead, converting the rate. Needs fx_rates for the rate currency | |
| discount_percent | No |