Create Invoice from Proposal
create_invoice_from_proposalConverts an accepted proposal into a draft invoice in one step. A workshop proposal must be won (status "accepted") and linked to a client: its priced rows become the invoice lines, and a deposit it asks becomes the invoice's payment schedule (depositDue). An older quote (marked legacy: true) must have status "accepted" and converts from its own tasks; if no client by its client name exists yet, one is created. Returns the invoice ID and number. A proposal converts once: calling again returns the invoice it already became (alreadyConverted: true). A proposal in Trash is not found. Creates the invoice as a draft; nothing is sent. Handles requests like "invoice that proposal", "convert the proposal for [client]", or "create an invoice from the accepted proposal".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dueDate | No | Override due date as ISO string (overrides netDays if provided) | |
| netDays | No | Payment terms in days (default 30) | |
| proposalId | Yes | ID of the accepted proposal to convert |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | No | Invoice total, in currency units | |
| status | No | ||
| currency | No | ||
| invoiceId | No | ||
| depositDue | No | Due on acceptance, from the invoice payment schedule; absent when none | |
| invoiceNumber | No | ||
| lineItemCount | No | ||
| unresolvedCount | No | Priced rows with no figure yet, left off the invoice | |
| alreadyConverted | No |