@unimaze/billing 0.1.2-rc.8 → 0.2.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/common/components/attachments/Attachment.d.ts +7 -3
- package/lib/common/components/attachments/Attachment.js +69 -15
- package/lib/common/components/attachments/index.d.ts +5 -2
- package/lib/common/components/attachments/index.js +18 -5
- package/lib/common/components/base-information/ReferenceIdentifiers.d.ts +17 -0
- package/lib/common/components/base-information/ReferenceIdentifiers.js +54 -0
- package/lib/common/components/base-information/index.d.ts +6 -3
- package/lib/common/components/base-information/index.js +131 -80
- package/lib/common/components/billing-lines/BillingCalculations.d.ts +11 -0
- package/lib/common/components/billing-lines/BillingCalculations.js +63 -0
- package/lib/common/components/billing-lines/BillingTaxSummary.d.ts +10 -0
- package/lib/common/components/billing-lines/BillingTaxSummary.js +53 -0
- package/lib/common/components/billing-lines/NewBillingLines.d.ts +10 -0
- package/lib/common/components/billing-lines/NewBillingLines.js +77 -0
- package/lib/common/components/billing-lines/index.d.ts +7 -15
- package/lib/common/components/billing-lines/index.js +173 -62
- package/lib/{src/common/components/issuer/index.d.ts → common/components/customer/hardCoddedCustomer.d.ts} +2 -2
- package/lib/common/components/{issuer/index.js → customer/hardCoddedCustomer.js} +5 -8
- package/lib/common/components/customer/index.d.ts +5 -6
- package/lib/common/components/customer/index.js +101 -12
- package/lib/common/components/delivery-location/index.d.ts +5 -2
- package/lib/common/components/delivery-location/index.js +65 -10
- package/lib/common/components/editable-cell/index.js +7 -9
- package/lib/common/components/form-item/index.d.ts +23 -0
- package/lib/common/components/form-item/index.js +44 -0
- package/lib/common/components/locale-intl/index.d.ts +10 -0
- package/lib/common/components/locale-intl/index.js +45 -0
- package/lib/common/components/payment-method/index.d.ts +6 -3
- package/lib/common/components/payment-method/index.js +107 -15
- package/lib/common/components/payment-method/paymentMethodForConversion.d.ts +9 -0
- package/lib/common/components/payment-method/paymentMethodForConversion.js +44 -0
- package/lib/common/components/supplier/index.d.ts +5 -2
- package/lib/common/components/supplier/index.js +108 -28
- package/lib/common/consts/formLayout.d.ts +44 -0
- package/lib/common/consts/formLayout.js +35 -0
- package/lib/common/consts/validationRules.js +0 -7
- package/lib/common/types/ReceiverRequirements.d.ts +71 -72
- package/lib/common/types/ReceiverRequirements.js +64 -81
- package/lib/create-credit-note/index.js +2 -4
- package/lib/create-invoice/index.js +131 -26
- package/lib/src/common/components/attachments/Attachment.d.ts +7 -3
- package/lib/src/common/components/attachments/index.d.ts +5 -2
- package/lib/src/common/components/base-information/ReferenceIdentifiers.d.ts +17 -0
- package/lib/src/common/components/base-information/index.d.ts +6 -3
- package/lib/src/common/components/billing-lines/BillingCalculations.d.ts +11 -0
- package/lib/src/common/components/billing-lines/BillingTaxSummary.d.ts +10 -0
- package/lib/src/common/components/billing-lines/NewBillingLines.d.ts +10 -0
- package/lib/src/common/components/billing-lines/index.d.ts +7 -15
- package/lib/src/common/components/customer/index.d.ts +5 -6
- package/lib/src/common/components/delivery-location/index.d.ts +5 -2
- package/lib/src/common/components/form-item/index.d.ts +23 -0
- package/lib/src/common/components/locale-intl/index.d.ts +10 -0
- package/lib/src/common/components/payment-method/index.d.ts +6 -3
- package/lib/src/common/components/payment-method/paymentMethodForConversion.d.ts +9 -0
- package/lib/src/common/components/supplier/index.d.ts +5 -2
- package/lib/src/common/consts/formLayout.d.ts +44 -0
- package/lib/src/common/types/ReceiverRequirements.d.ts +71 -72
- package/lib/src/translations/locales.d.ts +75 -0
- package/lib/src/utils/ApiUtility.d.ts +8 -1
- package/lib/src/utils/BillingLineUtility.d.ts +10 -0
- package/lib/src/utils/ConversionUtility.d.ts +4 -3
- package/lib/src/utils/RequirementsUtility.d.ts +3 -1
- package/lib/src/utils/index.d.ts +1 -1
- package/lib/translations/locales/is.json +71 -0
- package/lib/translations/locales.d.ts +75 -0
- package/lib/translations/locales.js +10 -0
- package/lib/utils/ApiUtility.d.ts +8 -1
- package/lib/utils/ApiUtility.js +17 -1
- package/lib/utils/BillingLineUtility.d.ts +10 -0
- package/lib/utils/BillingLineUtility.js +90 -0
- package/lib/utils/ConversionUtility.d.ts +4 -3
- package/lib/utils/ConversionUtility.js +98 -66
- package/lib/utils/RequirementsUtility.d.ts +3 -1
- package/lib/utils/RequirementsUtility.js +15 -5
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +1 -0
- package/package.json +8 -5
- package/lib/common/components/component-container/style/index.d.ts +0 -1
- package/lib/common/components/component-container/style/index.js +0 -3
- package/lib/common/components/issuer/index.d.ts +0 -7
- package/lib/common/components/payer/index.d.ts +0 -3
- package/lib/common/components/payer/index.js +0 -51
- package/lib/src/common/components/payer/index.d.ts +0 -3
- package/lib/style/index.d.ts +0 -1
- package/lib/style/index.js +0 -3
|
@@ -18,6 +18,7 @@ var AvailableFields;
|
|
|
18
18
|
AvailableFields["referenceIdentifiers.type"] = "referenceIdentifiers.type";
|
|
19
19
|
AvailableFields["referenceIdentifiers.code"] = "referenceIdentifiers.code";
|
|
20
20
|
AvailableFields["referenceIdentifiers.value"] = "referenceIdentifiers.value";
|
|
21
|
+
AvailableFields["referenceIdentifiers"] = "referenceIdentifiers";
|
|
21
22
|
AvailableFields["supplier.vatNumber"] = "supplier.vatNumber";
|
|
22
23
|
AvailableFields["supplier.address.streetNameAndNumber"] = "supplier.address.streetNameAndNumber";
|
|
23
24
|
AvailableFields["supplier.address.city"] = "supplier.address.city";
|
|
@@ -46,7 +47,7 @@ var AvailableFields;
|
|
|
46
47
|
AvailableFields["invoiceLines.quantity"] = "invoiceLines.quantity";
|
|
47
48
|
AvailableFields["invoiceLines.uniteOfMeasure.unit"] = "invoiceLines.unitOfMeasure.unit";
|
|
48
49
|
AvailableFields["invoiceLines.uniteOfMeasure.code"] = "invoiceLines.unitOfMeasure.code";
|
|
49
|
-
AvailableFields["invoiceLines.
|
|
50
|
+
AvailableFields["invoiceLines.unitPriceAmount"] = "invoiceLines.unitPriceAmount";
|
|
50
51
|
AvailableFields["invoiceLines.taxCategoryType"] = "invoiceLines.taxCategoryType";
|
|
51
52
|
AvailableFields["invoiceLines.taxableAmount"] = "invoiceLines.taxableAmount";
|
|
52
53
|
AvailableFields["invoiceLines.taxAmount"] = "invoiceLines.taxAmount";
|
|
@@ -72,326 +73,308 @@ exports.receiverRequirementsObject = {
|
|
|
72
73
|
invoiceNo: {
|
|
73
74
|
isRequired: true,
|
|
74
75
|
key: "",
|
|
75
|
-
label: "Invoice number"
|
|
76
76
|
},
|
|
77
77
|
issueDate: {
|
|
78
78
|
isRequired: true,
|
|
79
79
|
key: "",
|
|
80
|
-
label: "Issue date"
|
|
81
80
|
},
|
|
82
81
|
dueDate: {
|
|
83
82
|
isRequired: true,
|
|
84
83
|
key: "",
|
|
85
|
-
label: "Due date"
|
|
86
84
|
},
|
|
87
85
|
graceDate: {
|
|
88
86
|
isRequired: false,
|
|
89
87
|
key: "",
|
|
90
|
-
label: "Grace date"
|
|
91
88
|
},
|
|
92
89
|
currencyCode: {
|
|
93
90
|
isRequired: true,
|
|
94
91
|
key: "",
|
|
95
|
-
|
|
92
|
+
values: [{
|
|
93
|
+
key: "ISK",
|
|
94
|
+
label: "Icelandic krona (ISK)"
|
|
95
|
+
}]
|
|
96
96
|
},
|
|
97
97
|
notes: {
|
|
98
98
|
isRequired: false,
|
|
99
99
|
key: "",
|
|
100
|
-
label: "Notes"
|
|
101
100
|
},
|
|
102
101
|
accountingCost: {
|
|
103
102
|
isRequired: false,
|
|
104
103
|
key: "",
|
|
105
|
-
label: "Accounting cost"
|
|
106
104
|
},
|
|
107
105
|
buyerReference: {
|
|
108
|
-
isRequired:
|
|
106
|
+
isRequired: true,
|
|
109
107
|
key: "",
|
|
110
|
-
label: "
|
|
108
|
+
label: "Claim number"
|
|
111
109
|
},
|
|
112
110
|
"orderReference.documentNo": {
|
|
113
111
|
isRequired: true,
|
|
114
112
|
key: "",
|
|
115
|
-
label: "Order reference document number"
|
|
116
113
|
},
|
|
117
114
|
"billingReferences.invoices": {
|
|
118
115
|
isRequired: false,
|
|
119
116
|
key: "",
|
|
120
|
-
label: "Billing references Invoice"
|
|
121
117
|
},
|
|
122
118
|
"billingReferences.documentNo": {
|
|
123
119
|
isRequired: true,
|
|
124
120
|
key: "",
|
|
125
|
-
label: "Billing references Document number"
|
|
126
121
|
},
|
|
127
122
|
"billingReferences.issueDate": {
|
|
128
123
|
isRequired: false,
|
|
129
124
|
key: "",
|
|
130
|
-
label: "Billing references Issue Date"
|
|
131
125
|
},
|
|
132
126
|
"billingReferences.creditNotes": {
|
|
133
127
|
isRequired: false,
|
|
134
128
|
key: "",
|
|
135
|
-
label: "Billing References Credit notes"
|
|
136
|
-
},
|
|
137
|
-
"referenceIdentifiers.type": {
|
|
138
|
-
isRequired: false,
|
|
139
|
-
key: "",
|
|
140
|
-
label: "Reference identifier type"
|
|
141
|
-
},
|
|
142
|
-
"referenceIdentifiers.code": {
|
|
143
|
-
isRequired: false,
|
|
144
|
-
key: "",
|
|
145
|
-
label: "Reference identifier code"
|
|
146
129
|
},
|
|
147
|
-
"referenceIdentifiers.
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
130
|
+
// "referenceIdentifiers.type": {
|
|
131
|
+
// isRequired: false,
|
|
132
|
+
// key: "",
|
|
133
|
+
// label: "Reference identifier type"
|
|
134
|
+
// },
|
|
135
|
+
// "referenceIdentifiers.code": {
|
|
136
|
+
// isRequired: false,
|
|
137
|
+
// key: "",
|
|
138
|
+
// label: "Reference identifier code"
|
|
139
|
+
// },
|
|
140
|
+
// "referenceIdentifiers.value": {
|
|
141
|
+
// isRequired: true,
|
|
142
|
+
// key: "",
|
|
143
|
+
// label: "Reference identifier value"
|
|
144
|
+
// },
|
|
145
|
+
"referenceIdentifiers": {
|
|
146
|
+
"isRequired": true,
|
|
147
|
+
"key": "",
|
|
148
|
+
"values": [
|
|
149
|
+
{
|
|
150
|
+
"key": "AKY",
|
|
151
|
+
"label": "Bílnúmer",
|
|
152
|
+
"values": [
|
|
153
|
+
{
|
|
154
|
+
"key": "NY753",
|
|
155
|
+
"label": "NY753"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"key": "IS123"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"key": "RR888"
|
|
162
|
+
},
|
|
163
|
+
]
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"key": "SSN",
|
|
167
|
+
"label": "Kennitala" // "Social security number"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"key": "LOC",
|
|
171
|
+
"label": "Fasteignanúmer",
|
|
172
|
+
"values": [{
|
|
173
|
+
"key": "30909",
|
|
174
|
+
"label": "Mýrargata 26 (30909)"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"key": "34344",
|
|
178
|
+
"label": "Aragata 1 (34344)"
|
|
179
|
+
},
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
]
|
|
151
183
|
},
|
|
152
184
|
"supplier.vatNumber": {
|
|
153
185
|
isRequired: true,
|
|
154
186
|
key: "",
|
|
155
|
-
label: "Supplier VAT number"
|
|
156
187
|
},
|
|
157
188
|
"supplier.address.streetNameAndNumber": {
|
|
158
189
|
isRequired: true,
|
|
159
190
|
key: "",
|
|
160
|
-
label: "Address Street name and number"
|
|
161
191
|
},
|
|
162
192
|
"supplier.address.city": {
|
|
163
193
|
isRequired: false,
|
|
164
194
|
key: "",
|
|
165
|
-
label: "Supplier city"
|
|
166
195
|
},
|
|
167
196
|
"supplier.address.postalZone": {
|
|
168
197
|
isRequired: false,
|
|
169
198
|
key: "",
|
|
170
|
-
label: "Supplier postal zone"
|
|
171
199
|
},
|
|
172
200
|
"supplier.address.countryCode": {
|
|
173
201
|
isRequired: true,
|
|
174
202
|
key: "",
|
|
175
|
-
label: "Supplier country code"
|
|
176
203
|
},
|
|
177
204
|
"supplier.contact.name": {
|
|
178
205
|
isRequired: false,
|
|
179
206
|
key: "",
|
|
180
|
-
label: "Supplier contact name"
|
|
181
207
|
},
|
|
182
208
|
"supplier.contact.electronicMail": {
|
|
183
209
|
isRequired: false,
|
|
184
210
|
key: "",
|
|
185
|
-
label: "Supplier E-mail"
|
|
186
211
|
},
|
|
187
212
|
"supplier.contact.telephone": {
|
|
188
213
|
isRequired: false,
|
|
189
214
|
key: "",
|
|
190
|
-
label: "Supplier contact phone"
|
|
191
215
|
},
|
|
192
216
|
"supplier.name": {
|
|
193
217
|
isRequired: true,
|
|
194
218
|
key: "",
|
|
195
|
-
label: "Supplier name"
|
|
196
219
|
},
|
|
197
220
|
"supplier.identifier": {
|
|
198
221
|
isRequired: true,
|
|
199
222
|
key: "",
|
|
200
|
-
label: "Identifier"
|
|
201
223
|
},
|
|
202
224
|
"customer.address.streetNameAndNumber": {
|
|
203
225
|
isRequired: true,
|
|
204
226
|
key: "",
|
|
205
|
-
label: "Customer street name and number"
|
|
206
227
|
},
|
|
207
228
|
"customer.address.city": {
|
|
208
229
|
isRequired: false,
|
|
209
230
|
key: "",
|
|
210
|
-
label: "Customer city"
|
|
211
231
|
},
|
|
212
232
|
"customer.address.postalZone": {
|
|
213
233
|
isRequired: false,
|
|
214
234
|
key: "",
|
|
215
|
-
label: "Customer postal zone"
|
|
216
235
|
},
|
|
217
236
|
"customer.address.countryCode": {
|
|
218
237
|
isRequired: true,
|
|
219
238
|
key: "",
|
|
220
|
-
label: "Customer country code"
|
|
221
239
|
},
|
|
222
240
|
"customer.contact.name": {
|
|
223
241
|
isRequired: false,
|
|
224
242
|
key: "",
|
|
225
|
-
label: "Customer contact name"
|
|
226
243
|
},
|
|
227
244
|
"customer.contact.electronicMail": {
|
|
228
245
|
isRequired: false,
|
|
229
246
|
key: "",
|
|
230
|
-
label: "Customer E-mail"
|
|
231
247
|
},
|
|
232
248
|
"customer.contact.telephone": {
|
|
233
249
|
isRequired: false,
|
|
234
250
|
key: "",
|
|
235
|
-
label: "Customer phone"
|
|
236
251
|
},
|
|
237
252
|
"customer.name": {
|
|
238
253
|
isRequired: true,
|
|
239
254
|
key: "",
|
|
240
|
-
label: "Name"
|
|
241
255
|
},
|
|
242
256
|
"customer.identifier": {
|
|
243
257
|
isRequired: true,
|
|
244
258
|
key: "",
|
|
245
|
-
label: "Identifier"
|
|
246
259
|
},
|
|
247
260
|
"customer.locationIdentifier": {
|
|
248
261
|
isRequired: false,
|
|
249
262
|
key: "",
|
|
250
|
-
label: "Customer location identifier"
|
|
251
263
|
},
|
|
252
264
|
"payee.name": {
|
|
253
265
|
isRequired: true,
|
|
254
266
|
key: "",
|
|
255
|
-
label: "Payee name"
|
|
256
267
|
},
|
|
257
268
|
"payee.identifier": {
|
|
258
269
|
isRequired: true,
|
|
259
270
|
key: "",
|
|
260
|
-
label: "Payee identifier"
|
|
261
271
|
},
|
|
262
272
|
"payee.sepaBankIdentification": {
|
|
263
273
|
isRequired: false,
|
|
264
274
|
key: "",
|
|
265
|
-
label: "Payee sepa bank identification"
|
|
266
275
|
},
|
|
267
276
|
"invoiceLines.itemNo": {
|
|
268
277
|
isRequired: true,
|
|
269
278
|
key: "",
|
|
270
|
-
label: "Item number"
|
|
271
279
|
},
|
|
272
280
|
"invoiceLines.name": {
|
|
273
281
|
isRequired: true,
|
|
274
282
|
key: "",
|
|
275
|
-
label: "Name"
|
|
276
283
|
},
|
|
277
284
|
"invoiceLines.quantity": {
|
|
278
285
|
isRequired: true,
|
|
279
286
|
key: "",
|
|
280
|
-
label: "Quantity"
|
|
281
287
|
},
|
|
282
288
|
"invoiceLines.unitOfMeasure.unit": {
|
|
283
289
|
isRequired: true,
|
|
284
290
|
key: "",
|
|
285
|
-
label: "Unit of measure - Unit"
|
|
286
291
|
},
|
|
287
292
|
"invoiceLines.unitOfMeasure.code": {
|
|
288
293
|
isRequired: true,
|
|
289
294
|
key: "",
|
|
290
|
-
label: "Unit of measure - Code"
|
|
291
295
|
},
|
|
292
|
-
"invoiceLines.
|
|
296
|
+
"invoiceLines.unitPriceAmount": {
|
|
293
297
|
isRequired: true,
|
|
294
298
|
key: "",
|
|
295
|
-
label: "Price amount"
|
|
296
299
|
},
|
|
297
300
|
"invoiceLines.taxCategoryType": {
|
|
298
301
|
isRequired: true,
|
|
299
302
|
key: "",
|
|
300
|
-
label: ""
|
|
301
303
|
},
|
|
302
304
|
"invoiceLines.taxAmount": {
|
|
303
305
|
isRequired: true,
|
|
304
306
|
key: "",
|
|
305
|
-
label: "Tax amount"
|
|
306
307
|
},
|
|
307
308
|
"invoiceLines.taxableAmount": {
|
|
308
309
|
isRequired: true,
|
|
309
310
|
key: "",
|
|
310
|
-
label: "Taxable amount"
|
|
311
311
|
},
|
|
312
312
|
"invoiceLines.taxPercentage": {
|
|
313
313
|
isRequired: true,
|
|
314
314
|
key: "",
|
|
315
|
-
label: "Tax percentage"
|
|
316
315
|
},
|
|
317
316
|
"invoiceLines.discountValue": {
|
|
318
317
|
isRequired: true,
|
|
319
318
|
key: "",
|
|
320
|
-
label: "Discount value"
|
|
321
319
|
},
|
|
322
320
|
"paymentTerms.note": {
|
|
323
321
|
isRequired: false,
|
|
324
322
|
key: "",
|
|
325
|
-
label: "Note"
|
|
326
323
|
},
|
|
327
324
|
"paymentMeans.type": {
|
|
328
325
|
isRequired: true,
|
|
329
326
|
key: "",
|
|
330
|
-
label: "Type"
|
|
331
327
|
},
|
|
332
328
|
"paymentMeans.internationalTransfer": {
|
|
333
329
|
isRequired: false,
|
|
334
330
|
key: "",
|
|
335
|
-
label: "International transfer"
|
|
336
331
|
},
|
|
337
332
|
"paymentMeans.domesticTransfer": {
|
|
338
333
|
isRequired: false,
|
|
339
334
|
key: "",
|
|
340
|
-
label: "Domestic transfer"
|
|
341
335
|
},
|
|
342
336
|
"paymentMeans.domesticClaim": {
|
|
343
337
|
isRequired: false,
|
|
344
338
|
key: "",
|
|
345
|
-
label: "Domestic Claim"
|
|
346
339
|
},
|
|
347
340
|
"delivery.partyName": {
|
|
348
341
|
isRequired: false,
|
|
349
342
|
key: "",
|
|
350
|
-
label: "Party Name"
|
|
351
343
|
},
|
|
352
344
|
"delivery.locationIdentifier": {
|
|
353
345
|
isRequired: false,
|
|
354
346
|
key: "",
|
|
355
|
-
label: "Location Identifier"
|
|
356
347
|
},
|
|
357
348
|
"delivery.address.streetNameAndNumber": {
|
|
358
|
-
isRequired:
|
|
349
|
+
isRequired: false,
|
|
359
350
|
key: "",
|
|
360
|
-
label: "Street name and number"
|
|
361
351
|
},
|
|
362
352
|
"delivery.address.city": {
|
|
363
353
|
isRequired: false,
|
|
364
354
|
key: "",
|
|
365
|
-
label: "Item number"
|
|
366
355
|
},
|
|
367
356
|
"delivery.address.postalZone": {
|
|
368
357
|
isRequired: false,
|
|
369
358
|
key: "",
|
|
370
|
-
label: "Postal zone"
|
|
371
359
|
},
|
|
372
360
|
"delivery.address.countryCode": {
|
|
373
|
-
isRequired:
|
|
361
|
+
isRequired: false,
|
|
374
362
|
key: "",
|
|
375
|
-
label: "Country code"
|
|
376
363
|
},
|
|
377
364
|
"delivery.actualDeliveryDate": {
|
|
378
365
|
isRequired: false,
|
|
379
366
|
key: "",
|
|
380
|
-
label: "Delivery Date"
|
|
381
367
|
},
|
|
382
368
|
prepaidAmount: {
|
|
383
369
|
isRequired: false,
|
|
384
370
|
key: "",
|
|
385
|
-
label: "Prepaid amount"
|
|
386
371
|
},
|
|
387
372
|
payableAmount: {
|
|
388
373
|
isRequired: false,
|
|
389
374
|
key: "",
|
|
390
|
-
label: "Payable amount"
|
|
391
375
|
},
|
|
392
376
|
payableRoundingAmount: {
|
|
393
377
|
isRequired: false,
|
|
394
378
|
key: "",
|
|
395
|
-
label: "Payable rounding amount"
|
|
396
379
|
}
|
|
397
380
|
};
|
|
@@ -53,13 +53,11 @@ var CreateInvoice = function (props) {
|
|
|
53
53
|
react_1.default.createElement(antd_1.Row, { gutter: [16, 16] },
|
|
54
54
|
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 12 } },
|
|
55
55
|
react_1.default.createElement(components_1.Supplier, null)),
|
|
56
|
-
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 12 } },
|
|
57
|
-
react_1.default.createElement(components_1.Customer, { customer: props.customer })),
|
|
56
|
+
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 12 } }),
|
|
58
57
|
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 8 } },
|
|
59
58
|
react_1.default.createElement(components_1.BaseInformation, { form: form, documentType: "creditNote" })),
|
|
60
59
|
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 24 }, xl: { span: 16 } }),
|
|
61
|
-
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 24 }, xl: { span: 24 } },
|
|
62
|
-
react_1.default.createElement(components_1.Attachments, null)),
|
|
60
|
+
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 24 }, xl: { span: 24 } }),
|
|
63
61
|
react_1.default.createElement(antd_1.Col, { span: 24 },
|
|
64
62
|
react_1.default.createElement(antd_1.Button, { type: "primary", htmlType: "submit" }, "Submit")))));
|
|
65
63
|
};
|
|
@@ -10,18 +10,30 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
14
|
+
if (mod && mod.__esModule) return mod;
|
|
15
|
+
var result = {};
|
|
16
|
+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
17
|
+
result["default"] = mod;
|
|
18
|
+
return result;
|
|
19
|
+
};
|
|
13
20
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
21
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
22
|
};
|
|
16
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
24
|
require("../style/index.css");
|
|
18
|
-
var react_1 =
|
|
25
|
+
var react_1 = __importStar(require("react"));
|
|
19
26
|
var antd_1 = require("antd");
|
|
20
27
|
var is_IS_1 = __importDefault(require("antd/es/locale-provider/is_IS"));
|
|
21
28
|
var en_US_1 = __importDefault(require("antd/es/locale-provider/en_US"));
|
|
29
|
+
var models_1 = require("@unimaze/api-clients/lib/mapi/models");
|
|
22
30
|
var components_1 = require("../common/components");
|
|
23
31
|
var utils_1 = require("../utils");
|
|
24
32
|
var uuid_1 = require("uuid");
|
|
33
|
+
var BillingLineUtility_1 = require("../utils/BillingLineUtility");
|
|
34
|
+
var mapi_1 = require("@unimaze/api-clients/lib/mapi");
|
|
35
|
+
var formLayout_1 = require("../common/consts/formLayout");
|
|
36
|
+
var paymentMethodForConversion_1 = require("../common/components/payment-method/paymentMethodForConversion");
|
|
25
37
|
/**
|
|
26
38
|
* Component for creating a form for creating an invoice and submitting it to the MAPI transaction services
|
|
27
39
|
*
|
|
@@ -30,32 +42,111 @@ var uuid_1 = require("uuid");
|
|
|
30
42
|
var CreateInvoice = function (props) {
|
|
31
43
|
// const [submitInvoiceRequest, setSubmitInvoiceRequest] = React.useState<CreateSubmitInvoiceRequest>();
|
|
32
44
|
var form = antd_1.Form.useForm()[0];
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
var _a = react_1.useState([]), billingLinesDataSource = _a[0], setBillingLinesDataSource = _a[1];
|
|
46
|
+
var _b = react_1.useState(0), billingLinesEditableIndex = _b[0], setBillingLinesEditableIndex = _b[1];
|
|
47
|
+
// const [files, setFiles] = useState<UploadFile[]>([]);
|
|
48
|
+
//
|
|
49
|
+
// const handleAddFile = (file: UploadFile) => {
|
|
50
|
+
// if (file.status === "removed") {
|
|
51
|
+
// const remainingFiles = files.filter(existingFile => existingFile.uid !== file.uid);
|
|
52
|
+
// setFiles(remainingFiles);
|
|
53
|
+
// } else {
|
|
54
|
+
// setFiles([...files, file])
|
|
55
|
+
// }
|
|
56
|
+
// };
|
|
57
|
+
// BILLING LINES
|
|
58
|
+
var handleBillingLinesDelete = function (index) {
|
|
59
|
+
var newDataSource = billingLinesDataSource.slice();
|
|
60
|
+
newDataSource.splice(index, 1);
|
|
61
|
+
setBillingLinesDataSource(newDataSource);
|
|
62
|
+
};
|
|
63
|
+
var handleBillingLinesAdd = function () {
|
|
64
|
+
var newData = {
|
|
65
|
+
key: billingLinesEditableIndex,
|
|
66
|
+
itemNo: "Item No.",
|
|
67
|
+
quantity: 0,
|
|
68
|
+
taxAmount: 0,
|
|
69
|
+
name: "New Item",
|
|
70
|
+
unitOfMeasure: models_1.UnitOfMeasureMetadataUnitEnum.Piece,
|
|
71
|
+
unitPriceAmount: 0,
|
|
72
|
+
taxCategoryType: models_1.BillingLineMetadataTaxCategoryTypeEnum.StandardRated,
|
|
73
|
+
discountValue: "0",
|
|
74
|
+
taxableAmount: 0,
|
|
75
|
+
taxPercentage: null
|
|
76
|
+
};
|
|
77
|
+
setBillingLinesDataSource(billingLinesDataSource.concat([newData]));
|
|
78
|
+
setBillingLinesEditableIndex(billingLinesEditableIndex + 1);
|
|
42
79
|
};
|
|
80
|
+
var handleBillingLinesSave = function (row, formInstance) {
|
|
81
|
+
var newData = billingLinesDataSource.slice();
|
|
82
|
+
var index = newData.findIndex(function (i) {
|
|
83
|
+
return row.key === i.key;
|
|
84
|
+
});
|
|
85
|
+
var item = newData[index];
|
|
86
|
+
newData.splice(index, 1, __assign({}, item, row));
|
|
87
|
+
var billingLineMetadata = newData.map(function (current) {
|
|
88
|
+
return __assign({}, current, { unitOfMeasure: {
|
|
89
|
+
unit: current.unitOfMeasure,
|
|
90
|
+
} });
|
|
91
|
+
});
|
|
92
|
+
setBillingLinesDataSource(newData);
|
|
93
|
+
handleSetBillingLineMetadata(formInstance, billingLineMetadata);
|
|
94
|
+
};
|
|
95
|
+
// END BILLING LINES
|
|
43
96
|
var handleSetBillingLineMetadata = function (formInstance, billingLineMetadata) {
|
|
44
97
|
formInstance.setFieldsValue({
|
|
45
98
|
"billingLinesMetadata": billingLineMetadata
|
|
46
99
|
});
|
|
47
100
|
};
|
|
48
101
|
var handleSubmit = function (values) {
|
|
49
|
-
var
|
|
102
|
+
var attachments = [
|
|
103
|
+
values.attachments.file1 && values.attachments.file1,
|
|
104
|
+
values.attachments.file2 && values.attachments.file2,
|
|
105
|
+
values.attachments.file3 && values.attachments.file3,
|
|
106
|
+
];
|
|
107
|
+
// Clear the array of undefined
|
|
108
|
+
attachments = attachments.filter(function (attachment) { return attachment.file !== undefined; });
|
|
109
|
+
var billingLinesArray = form.getFieldValue("billingLinesMetadata");
|
|
110
|
+
if (!billingLinesArray || billingLinesArray.length <= 0) {
|
|
111
|
+
antd_1.message.error("Add at least one document line");
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
var invoiceMetadataInput = utils_1.convertToInvoiceMetadataInput(values, BillingLineUtility_1.billingLinesFieldsMetadata(form), paymentMethodForConversion_1.PaymentMethodFormData(values), props.customer);
|
|
50
115
|
var createSubmitInvoice = {
|
|
51
116
|
invoiceMetadataInput: invoiceMetadataInput,
|
|
52
|
-
more:
|
|
117
|
+
more: attachments.length > 0,
|
|
53
118
|
messageId: uuid_1.v4(),
|
|
119
|
+
processingMode: mapi_1.TransactionProcessingMode.Device
|
|
54
120
|
};
|
|
55
121
|
utils_1.submitInvoice(createSubmitInvoice, props.mapiBaseUrl, props.apiKey, "submitInvoice", props.language)
|
|
56
|
-
.then(
|
|
122
|
+
.then(function (resp) {
|
|
123
|
+
antd_1.message.success("successfully submitted the invoice");
|
|
124
|
+
var messageId = resp.data.uniqueId;
|
|
125
|
+
var _loop_1 = function () {
|
|
126
|
+
var nextFileArray = attachments.splice(0, 1);
|
|
127
|
+
var nextFile = nextFileArray[0].file[0].originFileObj;
|
|
128
|
+
var nextFileDescription = nextFileArray[0].description;
|
|
129
|
+
var createAttachDocument = {
|
|
130
|
+
messageId: messageId,
|
|
131
|
+
contentType: nextFile.type,
|
|
132
|
+
more: attachments.length > 0,
|
|
133
|
+
name: nextFileDescription // nextFile.name,
|
|
134
|
+
};
|
|
135
|
+
utils_1.submitDocument(nextFile, createAttachDocument, props.mapiBaseUrl, props.apiKey)
|
|
136
|
+
.then(function (submitDocumentResponse) {
|
|
137
|
+
antd_1.message.success("successfully uploaded attachment " + nextFileDescription);
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
while (attachments.length > 0) {
|
|
141
|
+
_loop_1();
|
|
142
|
+
}
|
|
143
|
+
form.resetFields();
|
|
144
|
+
// Clear the billing line dataSource
|
|
145
|
+
setBillingLinesDataSource([]);
|
|
146
|
+
setBillingLinesEditableIndex(0);
|
|
147
|
+
})
|
|
57
148
|
.catch(function (error) {
|
|
58
|
-
antd_1.message.error(error);
|
|
149
|
+
antd_1.message.error(error.message);
|
|
59
150
|
});
|
|
60
151
|
};
|
|
61
152
|
var setLocale = function (language) {
|
|
@@ -69,22 +160,36 @@ var CreateInvoice = function (props) {
|
|
|
69
160
|
}
|
|
70
161
|
};
|
|
71
162
|
return (react_1.default.createElement(antd_1.ConfigProvider, { locale: setLocale(props.language), componentSize: "small" },
|
|
72
|
-
react_1.default.createElement(antd_1.Form, __assign({}, formItemLayout, { form: form, onFinish: handleSubmit, initialValues: {
|
|
73
|
-
|
|
163
|
+
react_1.default.createElement(antd_1.Form, __assign({}, formLayout_1.formItemLayout, { form: form, onFinish: handleSubmit, initialValues: {
|
|
164
|
+
invoice: {
|
|
165
|
+
currencyCode: "ISK",
|
|
166
|
+
supplier: {
|
|
167
|
+
address: {
|
|
168
|
+
countryCode: "IS"
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
customer: {
|
|
172
|
+
address: {
|
|
173
|
+
countryCode: "IS"
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
} }),
|
|
74
178
|
react_1.default.createElement(antd_1.Row, { gutter: [16, 16] },
|
|
75
|
-
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }
|
|
179
|
+
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 } },
|
|
76
180
|
react_1.default.createElement(components_1.Supplier, null)),
|
|
77
|
-
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }
|
|
78
|
-
react_1.default.createElement(components_1.
|
|
79
|
-
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }
|
|
80
|
-
react_1.default.createElement(components_1.Customer, { customer: props.customer })),
|
|
81
|
-
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 8 } },
|
|
181
|
+
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 } },
|
|
182
|
+
react_1.default.createElement(components_1.Customer, null)),
|
|
183
|
+
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 } },
|
|
82
184
|
react_1.default.createElement(components_1.BaseInformation, { form: form, documentType: "invoice" })),
|
|
83
|
-
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span:
|
|
84
|
-
react_1.default.createElement(components_1.
|
|
85
|
-
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span:
|
|
185
|
+
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 } },
|
|
186
|
+
react_1.default.createElement(components_1.DeliveryLocation, null)),
|
|
187
|
+
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 24 } },
|
|
188
|
+
react_1.default.createElement(components_1.BillingLines, { setBillingLineMetadata: handleSetBillingLineMetadata, formInstance: form, dataSource: billingLinesDataSource, editableIndex: billingLinesEditableIndex, handleAdd: handleBillingLinesAdd, handleDelete: handleBillingLinesDelete, handleSave: handleBillingLinesSave })),
|
|
189
|
+
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 8 } },
|
|
86
190
|
react_1.default.createElement(components_1.PaymentMethod, null)),
|
|
87
|
-
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 16 }
|
|
191
|
+
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 16 } },
|
|
192
|
+
react_1.default.createElement(components_1.Attachments /*handleAddFile={handleAddFile}*/, null)),
|
|
88
193
|
react_1.default.createElement(antd_1.Col, { span: 24 },
|
|
89
194
|
react_1.default.createElement(antd_1.Form.Item, null,
|
|
90
195
|
react_1.default.createElement(antd_1.Button, { type: "primary", htmlType: "submit" }, "Submit")))))));
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import '@ant-design/compatible/assets/index.css';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { InjectedIntlProps } from "react-intl";
|
|
4
|
+
interface Props extends InjectedIntlProps {
|
|
5
|
+
fieldName: "file1" | "file2" | "file3";
|
|
5
6
|
}
|
|
6
7
|
interface States {
|
|
7
8
|
file: any[];
|
|
@@ -12,4 +13,7 @@ declare class Attachment extends React.Component<Props, States> {
|
|
|
12
13
|
normFile: (e: any) => any;
|
|
13
14
|
render(): JSX.Element;
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
+
declare const _default: React.ComponentClass<Pick<Props & React.RefAttributes<Attachment>, "ref" | "key" | "fieldName">, any> & {
|
|
17
|
+
WrappedComponent: React.ComponentType<Props & React.RefAttributes<Attachment> & InjectedIntlProps>;
|
|
18
|
+
};
|
|
19
|
+
export default _default;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { InjectedIntlProps } from "react-intl";
|
|
3
|
+
declare const AttachmentGroupIntl: React.ComponentClass<Pick<InjectedIntlProps, never>, any> & {
|
|
4
|
+
WrappedComponent: React.ComponentType<InjectedIntlProps>;
|
|
5
|
+
};
|
|
6
|
+
export default AttachmentGroupIntl;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { InjectedIntlProps } from "react-intl";
|
|
3
|
+
import { StoreValue } from "rc-field-form/lib/interface";
|
|
4
|
+
interface FieldData {
|
|
5
|
+
name: number;
|
|
6
|
+
key: number;
|
|
7
|
+
fieldKey: number;
|
|
8
|
+
}
|
|
9
|
+
interface Props extends InjectedIntlProps {
|
|
10
|
+
fields: FieldData[];
|
|
11
|
+
add: (defaultValue?: StoreValue) => void;
|
|
12
|
+
remove: (index: number) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const _default: React.ComponentClass<Pick<Props, "remove" | "fields" | "add">, any> & {
|
|
15
|
+
WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|