Locoia
Ask or search…
K
Links
Comment on page

Actions Examples

Examples of best practice created actions

Invoicing

Line Items

1. LexOffice > Create Vouchers
UI form schema:
1
{
2
"type": {
3
"type": "select",
4
"title": "Type",
5
"enum": [
6
"salesinvoice",
7
"salescreditnote",
8
"purchaseinvoice",
9
"purchasecreditnote",
10
"invoice",
11
"downpaymentinvoice",
12
"creditnote",
13
"orderconfirmation",
14
"quotation",
15
"deliverynote"
16
],
17
"info": "Possible values are salesinvoice (e.g. for sales orders), and salescreditnote (e.g. for refunds or returned sales orders).",
18
"required": true
19
},
20
"voucherNumber": {
21
"type": "text",
22
"title": "Voucher number",
23
"placeholder": "2345678",
24
"required": true
25
},
26
"voucherDate": {
27
"type": "date",
28
"placeholder": "2016-06-29T15:15:09.447+02:00",
29
"title": "Voucher date",
30
"required": true
31
},
32
"shippingDate": {
33
"type": "date",
34
"placeholder": "2016-06-29T15:15:09.447+02:00",
35
"title": "Shipping date",
36
"required": false
37
},
38
"dueDate": {
39
"type": "date",
40
"placeholder": "2016-06-29T15:15:09.447+02:00",
41
"info": "If not specified then the voucherDate will also be used for dueDate.",
42
"title": "Due date",
43
"required": false
44
},
45
"totalGrossAmount": {
46
"type": "text",
47
"placeholder": "119.00",
48
"title": "Total gross amount",
49
"required": true
50
},
51
"totalTaxAmount": {
52
"type": "text",
53
"placeholder": "19",
54
"title": "Total tax amount",
55
"required": true
56
},
57
"taxType": {
58
"type": "select",
59
"enum": [
60
"net",
61
"gross"
62
],
63
"default": "gross",
64
"allowCreate": true,
65
"title": "Tax type",
66
"required": true
67
},
68
"useCollectiveContact": {
69
"type": "switch",
70
"default": true,
71
"title": "Use collective contact",
72
"info": "Set to true if the Collective Contact (customer/vendor) within lexoffice should be used. If used, the optional contactId will be ignored.",
73
"required": false
74
},
75
"remark": {
76
"type": "text",
77
"title": "Subject remarks",
78
"placeholder": "AWS invoice",
79
"required": true
80
},
81
"voucherItems": {
82
"type": "code",
83
"mode": "jinja2",
84
"rows": "9",
85
"title": "Voucher items (Jinja code field)",
86
"placeholder": "{% for item in line_items %}\n {\n \"amount\": {{ item.amount }},\n \"taxAmount\": {{ item.taxAmount }},\n \"taxRatePercent\": {{ item.taxRatePercent }},\n \"categoryId\": \"8f8664a8-fd86-11e1-a21f-0800200c9a66\" {# this id is Warenverkäufe as per https://developers.lexoffice.io/docs/#vouchers-endpoint-list-of-categoryids #}\n }\n {% if not loop.last %},{% endif %}\n{% endfor %}",
87
"default": "{% for item in line_items %}\n {\n \"amount\": {{ item.amount }},\n \"taxAmount\": {{ item.taxAmount }},\n \"taxRatePercent\": {{ item.taxRatePercent }},\n \"categoryId\": \"8f8664a8-fd86-11e1-a21f-0800200c9a66\" {# this id is Warenverkäufe as per https://developers.lexoffice.io/docs/#vouchers-endpoint-list-of-categoryids #}\n }\n {% if not loop.last %},{% endif %}\n{% endfor %}",
88
"info": "Use this field if you want to define your line items flexibly (multiple). Here is the docs: https://developers.lexoffice.io/docs/#vouchers-endpoint-create-a-voucher",
89
"required": false
90
}
91
}
Request body of the action:
1
{
2
"type": "{{ type }}",
3
"voucherNumber": "{{ voucherNumber }}",
4
"voucherDate": "{{ voucherDate }}",
5
{% if shippingDate is defined %}
6
,"shippingDate": "{{ shippingDate }}"
7
{% endif %}
8
{% if dueDate is defined %}
9
,"dueDate": "{{ dueDate }}"
10
{% endif %}
11
"totalGrossAmount": {{ totalGrossAmount }},
12
"totalTaxAmount": {{ totalTaxAmount }},
13
"taxType": "{{ taxType }}",
14
"useCollectiveContact": {{ useCollectiveContact | lower }},
15
"remark": "{{ remark }}",
16
"voucherItems": [ {{ voucherItems }} ]
17
}