FlowmageDocs

Create sales invoice

BetaChanges data

Makes a Twinfield sales invoice from articles and lets Twinfield number it.

Settings

SettingWhat it is
ConnectionRequiredThe Twinfield connection the step signs in with.
Company codeLeave empty to use the company code on the connection.
Invoice typeRequiredThe Twinfield sales-invoice type this invoice is made in.
Customer codeRequiredThe customer's own Twinfield code — Find dimensions resolves one from a name.
Invoice dateTwinfield writes dates as yyyymmdd.
Due datetext
Banktext
Periodtext
Currencytext
StatusWrite concept to leave the invoice unfinished in Twinfield.
Payment methodtext
What this run doesPriced only, Twinfield works out the totals and posts nothing — so a flow can show them before anyone is billed.
Report Twinfield's warningstrue/false
LinesOne 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
KeyValue
connectiontexta connection id from `requires.connections` (provider `twinfield`)
officetext
invoiceTypetext
customertext
invoiceDatetext
dueDatetext
banktext
periodtext
currencytext
statustext
paymentMethodtext
mode"post" or "price", by default "post"
raiseWarningtrue/false, by default false
lineslist of {article?: text, subArticle?: text, quantity?: text, unitsPriceExcl?: text, vatCode?: text, description?: text}, by default []
linesJsontext

Output

FieldType
invoiceobject
invoiceNumberstring
valueExclTotal excl. VATstring
valueIncTotal incl. VATstring
Sample output, and the expression for each field
  • invoice
    • header
      • [0]
        • invoicenumber
          • [0]"1001"
    • result"1"
  • 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
}