Create sales invoice
BetaChanges data
Makes a Twinfield sales invoice from articles and lets Twinfield number it.
Settings
| Setting | What it is |
|---|---|
| ConnectionRequired | The Twinfield connection the step signs in with. |
| Company code | Leave empty to use the company code on the connection. |
| Invoice typeRequired | The Twinfield sales-invoice type this invoice is made in. |
| Customer codeRequired | The customer's own Twinfield code — Find dimensions resolves one from a name. |
| Invoice date | Twinfield writes dates as yyyymmdd. |
| Due date | text |
| Bank | text |
| Period | text |
| Currency | text |
| Status | Write concept to leave the invoice unfinished in Twinfield. |
| Payment method | text |
| What this run does | Priced only, Twinfield works out the totals and posts nothing — so a flow can show them before anyone is billed. |
| Report Twinfield's warnings | true/false |
| Lines | One row per article. Twinfield prices the invoice from the article and the quantity. |
| Lines (JSON) | Lines an earlier node built, instead of the rows above — for example [{"article":"1","quantity":"2","unitspriceexcl":"50.00","vatcode":"VH","description":"Consultancy"}] |
Technical details
| Key | Value |
|---|---|
connection | texta connection id from `requires.connections` (provider `twinfield`) |
office | text |
invoiceType | text |
customer | text |
invoiceDate | text |
dueDate | text |
bank | text |
period | text |
currency | text |
status | text |
paymentMethod | text |
mode | "post" or "price", by default "post" |
raiseWarning | true/false, by default false |
lines | list of {article?: text, subArticle?: text, quantity?: text, unitsPriceExcl?: text, vatCode?: text, description?: text}, by default [] |
linesJson | text |
Output
| Field | Type |
|---|---|
invoice | object |
invoiceNumber | string |
valueExclTotal excl. VAT | string |
valueIncTotal incl. VAT | string |
Sample output, and the expression for each field
- invoice
- header
- [0]
- invoicenumber
- [0]"1001"
- invoicenumber
- [0]
- result"1"
- header
- invoiceNumber"1001"
- valueExcl"100.00"
- valueInc"121.00"
Errors
When a step of this node stops a run, the run page shows a code. Look it up:
Example step
The step as a flow file holds it. Replace each value in <…>.
{
"config": {
"bank": "",
"connection": "<connection id>",
"currency": "",
"customer": "<customer code>",
"dueDate": "",
"invoiceDate": "",
"invoiceType": "<invoice type>",
"lines": [],
"linesJson": "",
"mode": "post",
"office": "",
"paymentMethod": "",
"period": "",
"raiseWarning": false,
"status": ""
},
"label": "Create sales invoice",
"type": "twinfield.createSalesInvoice",
"version": 1
}