@unimaze/billing 0.2.8 → 0.3.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.
@@ -15,6 +15,7 @@ var components_1 = require("../../components");
15
15
  var Attachment_1 = __importDefault(require("./Attachment"));
16
16
  var react_intl_1 = require("react-intl");
17
17
  var antd_1 = require("antd");
18
+ var icons_1 = require("@ant-design/icons");
18
19
  var translationMessages = react_intl_1.defineMessages({
19
20
  attachment_title: {
20
21
  id: "attachment.title",
@@ -22,9 +23,15 @@ var translationMessages = react_intl_1.defineMessages({
22
23
  },
23
24
  });
24
25
  var AttachmentsGroup = function (props) {
25
- return (
26
+ var attachmentLabelNode = (React.createElement(antd_1.Tooltip
26
27
  // props.intl.formatMessage(translationMessages.attachment_title)}
27
- React.createElement(components_1.ComponentContainer, { title: "Viðhengi" },
28
+ , {
29
+ // props.intl.formatMessage(translationMessages.attachment_title)}
30
+ title: "Hámarks stærð er ??MB. Fylgigögn reiknings geta verið afrit af upprunalega reikningnum eða fylgigögn, svo sem tímaskýrslur", placement: "right" },
31
+ React.createElement("span", null,
32
+ "Vi\u00F0hengi ",
33
+ React.createElement(icons_1.QuestionCircleOutlined, null))));
34
+ return (React.createElement(components_1.ComponentContainer, { title: attachmentLabelNode },
28
35
  React.createElement(antd_1.Row, null,
29
36
  React.createElement(antd_1.Col, { span: 24 },
30
37
  React.createElement(Attachment_1.default, { key: "attachment1", fieldName: "file1" })),
@@ -30,10 +30,16 @@ var translationMessages = react_intl_1.defineMessages({
30
30
  },
31
31
  });
32
32
  var ReferenceIdentifiers = function (props) {
33
+ var referenceIdentifierLabelNode = (react_1.default.createElement(antd_1.Tooltip
34
+ // props.intl.formatMessage(translationMessages.referenceIdentifiers_labels_referenceIdentifier)
35
+ , {
36
+ // props.intl.formatMessage(translationMessages.referenceIdentifiers_labels_referenceIdentifier)
37
+ title: "Númer er á við tjónið sem um ræðir (bílnúmer, fasteignanúmer eða kennitala)", placement: "right" },
38
+ react_1.default.createElement("span", null,
39
+ "Tilv\u00EDsunarn\u00FAmer ",
40
+ react_1.default.createElement(icons_1.QuestionCircleOutlined, null))));
33
41
  return (react_1.default.createElement("div", null,
34
- props.fields.map(function (field, index) { return (react_1.default.createElement(antd_1.Form.Item, __assign({ key: "referenceIdentifier-" + index }, (index === 0 ? formLayout_1.formItemLayout : formLayout_1.formItemLayoutWithOutLabel), {
35
- // props.intl.formatMessage(translationMessages.referenceIdentifiers_labels_referenceIdentifier)
36
- label: index === 0 ? "Tilvísunarnúmer" : "" }),
42
+ props.fields.map(function (field, index) { return (react_1.default.createElement(antd_1.Form.Item, __assign({ key: "referenceIdentifier-" + index }, (index === 0 ? formLayout_1.formItemLayout : formLayout_1.formItemLayoutWithOutLabel), { label: index === 0 ? referenceIdentifierLabelNode : "" }),
37
43
  react_1.default.createElement(antd_1.Space, { key: field.key, style: { display: "flex", marginBottom: 0 }, align: "start" },
38
44
  react_1.default.createElement(antd_1.Form.Item, __assign({}, field, { name: [field.name, "code"], fieldKey: [field.fieldKey, "code"], rules: [{ required: true }] }),
39
45
  react_1.default.createElement(antd_1.Select, { labelInValue: true, style: { width: "150px" } },
@@ -45,9 +51,7 @@ var ReferenceIdentifiers = function (props) {
45
51
  react_1.default.createElement(icons_1.MinusCircleOutlined, { onClick: function () {
46
52
  props.remove(field.name);
47
53
  } })))); }),
48
- react_1.default.createElement(antd_1.Form.Item, __assign({}, (props.fields.length === 0 ? formLayout_1.formItemLayout : formLayout_1.formItemLayoutWithOutLabel), {
49
- // props.intl.formatMessage(translationMessages.referenceIdentifiers_labels_referenceIdentifier)
50
- label: props.fields.length === 0 ? "Tilvísunarnúmer" : "" }),
54
+ react_1.default.createElement(antd_1.Form.Item, __assign({}, (props.fields.length === 0 ? formLayout_1.formItemLayout : formLayout_1.formItemLayoutWithOutLabel), { label: props.fields.length === 0 ? referenceIdentifierLabelNode : "" }),
51
55
  react_1.default.createElement(antd_1.Button, { type: "dashed", onClick: function () {
52
56
  props.add();
53
57
  }, style: { width: "100%" } },
@@ -18,6 +18,7 @@ var form_item_1 = __importDefault(require("../form-item"));
18
18
  var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
19
19
  var react_intl_1 = require("react-intl");
20
20
  var ReferenceIdentifiers_1 = __importDefault(require("./ReferenceIdentifiers"));
21
+ var icons_1 = require("@ant-design/icons");
21
22
  var translationMessages = react_intl_1.defineMessages({
22
23
  baseInformation_title: {
23
24
  id: "baseInformation_title",
@@ -103,6 +104,22 @@ var BaseInformation = function (props) {
103
104
  });
104
105
  }
105
106
  };
107
+ var dueDateLabelNode = (React.createElement(antd_1.Tooltip
108
+ // props.intl.formatMessage(translationMessages.baseInformation_dueDate)
109
+ , {
110
+ // props.intl.formatMessage(translationMessages.baseInformation_dueDate)
111
+ title: "Eindagi skal vera sá sami og gjalddagi", placement: "right" },
112
+ React.createElement("span", null,
113
+ "Gjalddagi ",
114
+ React.createElement(icons_1.QuestionCircleOutlined, null))));
115
+ var issueDateLabelNode = (React.createElement(antd_1.Tooltip
116
+ // props.intl.formatMessage(translationMessages.baseInformation_issueDate)
117
+ , {
118
+ // props.intl.formatMessage(translationMessages.baseInformation_issueDate)
119
+ title: "Útgáfudagsetning stjórnar á hvaða uppgjörstímabili færslan skráist", placement: "right" },
120
+ React.createElement("span", null,
121
+ "\u00DAtg\u00E1fudags. ",
122
+ React.createElement(icons_1.QuestionCircleOutlined, null))));
106
123
  return (
107
124
  // props.intl.formatMessage(translationMessages.baseInformation_title)
108
125
  React.createElement(components_1.ComponentContainer, { title: "Grunnupplýsingar" },
@@ -118,17 +135,13 @@ var BaseInformation = function (props) {
118
135
  // // receiverRequirements={receiverRequirementsObject}
119
136
  , {
120
137
  // // receiverRequirements={receiverRequirementsObject}
121
- receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.issueDate,
122
- // props.intl.formatMessage(translationMessages.baseInformation_issueDate)
123
- defaultLabel: "Útgáfudags.", defaultIsRequired: true, fieldName: ["invoice", "issueDate"] },
138
+ receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.issueDate, defaultLabel: issueDateLabelNode, defaultIsRequired: true, fieldName: ["invoice", "issueDate"] },
124
139
  React.createElement(antd_1.DatePicker, null)),
125
140
  React.createElement(form_item_1.default
126
141
  // // receiverRequirements={receiverRequirementsObject}
127
142
  , {
128
143
  // // receiverRequirements={receiverRequirementsObject}
129
- receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.dueDate,
130
- // props.intl.formatMessage(translationMessages.baseInformation_dueDate)
131
- defaultLabel: "Gjalddagi", defaultIsRequired: false, fieldName: ["invoice", "dueDate"], additionalRules: [
144
+ receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.dueDate, defaultLabel: dueDateLabelNode, defaultIsRequired: false, fieldName: ["invoice", "dueDate"], additionalRules: [
132
145
  {
133
146
  validator: (function (rule, value, callback) {
134
147
  if (!value) {
@@ -132,7 +132,14 @@ var BillingLines = /** @class */ (function (_super) {
132
132
  align: "right",
133
133
  },
134
134
  {
135
- title: "Skattflokkur",
135
+ title: (React.createElement(antd_1.Tooltip
136
+ // this.props.intl.formatMessage(translationMessages.billingLines_taxCategoryType)
137
+ , {
138
+ // this.props.intl.formatMessage(translationMessages.billingLines_taxCategoryType)
139
+ title: " Ekki er hægt að leggja virðisauka á vöru nema gefa upp VSK númer", placement: "right" },
140
+ React.createElement("span", null,
141
+ "Skattflokkur ",
142
+ React.createElement(icons_1.QuestionCircleOutlined, null)))),
136
143
  dataIndex: 'taxCategoryType',
137
144
  editable: true,
138
145
  },
@@ -210,11 +217,15 @@ var BillingLines = /** @class */ (function (_super) {
210
217
  handleSave: function (billingLineMetadataOverrideRecord, rowIndex) { return _this.props.handleSave(billingLineMetadataOverrideRecord, _this.props.formInstance); },
211
218
  }); } });
212
219
  });
213
- return (React.createElement(components_1.ComponentContainer
220
+ var billingLinesLabelNode = (React.createElement(antd_1.Tooltip
214
221
  // this.props.intl.formatMessage(translationMessages.billingLines_title)
215
222
  , {
216
223
  // this.props.intl.formatMessage(translationMessages.billingLines_title)
217
- title: "Reikningslínur" },
224
+ title: "Hér þarf að skilgreina Vörunr, Nafn, Fjölda, Mælieiningu, Verð pr. einingu og upphæð. Virðisauki reiknast sjálfkrafa. Smelltu á \"Bæta við röð\" til þess að bæta við vörulínu", placement: "right" },
225
+ React.createElement("span", null,
226
+ "Reikningsl\u00EDnur ",
227
+ React.createElement(icons_1.QuestionCircleOutlined, null))));
228
+ return (React.createElement(components_1.ComponentContainer, { title: billingLinesLabelNode },
218
229
  React.createElement(antd_1.Table, {
219
230
  // style={{minHeight: "170px"}}
220
231
  components: components, dataSource: dataSource, columns: columns, pagination: false, rowKey: (function (record, index) { return index.toString(); }) }),
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { IconProps } from "@ant-design/compatible/es/icon";
3
3
  interface HeaderProps {
4
4
  iconProps?: IconProps;
5
- title?: string;
5
+ title?: string | React.ReactNode;
6
6
  action?: React.ReactNode;
7
7
  }
8
8
  declare const Header: React.FC<HeaderProps>;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { IconProps } from "@ant-design/compatible/es/icon";
3
3
  interface Props {
4
4
  iconProps?: IconProps;
5
- title?: string;
5
+ title?: string | React.ReactNode;
6
6
  action?: React.ReactNode;
7
7
  noPadding?: boolean;
8
8
  noHeader?: boolean;
@@ -1,15 +1,16 @@
1
1
  import React from 'react';
2
2
  import { InjectedIntlProps } from "react-intl";
3
- import { ProfileOutput } from "@unimaze/api-clients/lib/wapi2";
4
3
  import { FormInstance } from "antd/es/form";
5
4
  import { PartyMetadata } from "@unimaze/api-clients/lib/mapi";
5
+ import { ProfileOutputWithApiKey } from "../../types/AppConfiguration";
6
6
  interface Props extends InjectedIntlProps {
7
- customers: ProfileOutput[];
7
+ customers: ProfileOutputWithApiKey[];
8
8
  formInstance: FormInstance;
9
9
  chosenCustomer: PartyMetadata | undefined;
10
10
  setChosenCustomer: (chosenCustomer: PartyMetadata) => void;
11
+ setChosenCustomerApiKey: (chosenCustomerApiKey: string) => void;
11
12
  }
12
- declare const CustomerIntl: React.ComponentClass<Pick<Props, "formInstance" | "customers" | "chosenCustomer" | "setChosenCustomer">, any> & {
13
+ declare const CustomerIntl: React.ComponentClass<Pick<Props, "formInstance" | "customers" | "chosenCustomer" | "setChosenCustomer" | "setChosenCustomerApiKey">, any> & {
13
14
  WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
14
15
  };
15
16
  export default CustomerIntl;
@@ -27,6 +27,10 @@ var translationMessages = react_intl_1.defineMessages({
27
27
  id: "customer_title",
28
28
  defaultMessage: "Customer",
29
29
  },
30
+ customer_selectTheCustomer: {
31
+ id: "customer_selectTheCustomer",
32
+ defaultMessage: "Select the customer",
33
+ },
30
34
  customer_name: {
31
35
  id: "customer_name",
32
36
  defaultMessage: "Name",
@@ -67,12 +71,17 @@ var Customer = function (props) {
67
71
  var prevValues = props.formInstance.getFieldsValue();
68
72
  var newFormValues = __assign({}, prevValues, { invoice: __assign({}, prevValues.invoice, { customer: __assign({}, prevValues.invoice.customer, customerPartyMetadata) }) });
69
73
  setChosenCustomer(__assign({}, prevValues.invoice.customer, customerPartyMetadata));
74
+ props.setChosenCustomerApiKey(props.customers[customerIndex].apiKey);
70
75
  props.formInstance.setFieldsValue(newFormValues);
71
76
  };
72
77
  return (
73
78
  // props.intl.formatMessage(translationMessages.customer_title)
74
79
  react_1.default.createElement(components_1.ComponentContainer, { title: "Viðskiptavinur" },
75
- react_1.default.createElement(form_item_1.default, { defaultLabel: "Select the customer", defaultIsRequired: true, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["customer.identifier"], fieldName: ["invoice", "customer", "name"] },
80
+ react_1.default.createElement(form_item_1.default
81
+ // defaultLabel={"Select the customer"}
82
+ , {
83
+ // defaultLabel={"Select the customer"}
84
+ defaultLabel: "Veldu viðskiptavin", defaultIsRequired: true, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["customer.identifier"], fieldName: ["invoice", "customer", "name"] },
76
85
  react_1.default.createElement(antd_1.Select, { onChange: function (value) {
77
86
  onCustomerChange(value);
78
87
  } }, props.customers.map(function (customer, index) { return (react_1.default.createElement(antd_1.Select.Option, { key: index, value: index }, customer.name)); }))),
@@ -17,6 +17,7 @@ var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
17
17
  var form_item_1 = __importDefault(require("../form-item"));
18
18
  var react_intl_1 = require("react-intl");
19
19
  var models_1 = require("@unimaze/api-clients/lib/mapi/models");
20
+ var icons_1 = require("@ant-design/icons");
20
21
  // import {defineMessages} from "react-intl.macro"
21
22
  var translationMessages = react_intl_1.defineMessages({
22
23
  supplier_title: {
@@ -65,6 +66,14 @@ var translationMessages = react_intl_1.defineMessages({
65
66
  }
66
67
  });
67
68
  var Supplier = function (props) {
69
+ var electronicMailLabelNode = (React.createElement(antd_1.Tooltip
70
+ // props.intl.formatMessage(translationMessages.supplier_contact_email)
71
+ , {
72
+ // props.intl.formatMessage(translationMessages.supplier_contact_email)
73
+ title: "Send verður greiðslutilkynning á þetta netfang", placement: "right" },
74
+ React.createElement("span", null,
75
+ "Netfang ",
76
+ React.createElement(icons_1.QuestionCircleOutlined, null))));
68
77
  return (
69
78
  // props.intl.formatMessage(translationMessages.supplier_title)
70
79
  React.createElement(components_1.ComponentContainer, { title: "Birgi" },
@@ -92,9 +101,9 @@ var Supplier = function (props) {
92
101
  // props.intl.formatMessage(translationMessages.supplier_vatNumber)
93
102
  defaultLabel: "VSK nr.", defaultIsRequired: true, fieldName: ["invoice", "supplier", "vatNumber"], additionalRules: [
94
103
  {
95
- required: props.billingLinesDataSource.some(function (billingLine) { return ((billingLine.taxCategoryType !== models_1.BillingLineMetadataTaxCategoryTypeEnum.ZeroRated) && (billingLine.taxCategoryType !== models_1.BillingLineMetadataTaxCategoryTypeEnum.Exempt)); }),
96
- // message: "VAT number is required if some document lines are using any tax category type other than Exempt or ZeroRated"
97
- message: "Það er þörf á VSK númer ef einhverjar reikningslínur eru að nota skattaflokk sem er ekki 0% skattur eða undanþeginn skatt"
104
+ required: props.billingLinesDataSource.some(function (billingLine) { return (billingLine.taxCategoryType !== models_1.BillingLineMetadataTaxCategoryTypeEnum.Exempt); }),
105
+ // message: "VAT number is required if some document lines are using any tax category type other than Exempt"
106
+ message: ""
98
107
  }
99
108
  ] },
100
109
  React.createElement(antd_1.Input, null)),
@@ -134,9 +143,7 @@ var Supplier = function (props) {
134
143
  // receiverRequirements={receiverRequirementsObject}
135
144
  , {
136
145
  // receiverRequirements={receiverRequirementsObject}
137
- receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["supplier.contact.electronicMail"],
138
- // props.intl.formatMessage(translationMessages.supplier_contact_email)
139
- defaultLabel: "Netfang", defaultIsRequired: false, fieldName: ["invoice", "supplier", "contact", "electronicMail"], additionalRules: [
146
+ receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["supplier.contact.electronicMail"], defaultLabel: electronicMailLabelNode, defaultIsRequired: false, fieldName: ["invoice", "supplier", "contact", "electronicMail"], additionalRules: [
140
147
  {
141
148
  type: 'email',
142
149
  message: "Þetta er ekki gilt netfang",
@@ -5,10 +5,12 @@ interface AppConfiguration {
5
5
  rapiUrl: string;
6
6
  env: HostConfiguration[];
7
7
  }
8
+ interface ProfileOutputWithApiKey extends ProfileOutput {
9
+ apiKey: string;
10
+ }
8
11
  interface HostConfiguration {
9
12
  host: string;
10
13
  legalIdentifier: string;
11
- apiKey: string;
12
- customer: ProfileOutput[];
14
+ customers: ProfileOutputWithApiKey[];
13
15
  }
14
- export { AppConfiguration, HostConfiguration };
16
+ export { AppConfiguration, HostConfiguration, ProfileOutputWithApiKey };
@@ -2,6 +2,5 @@ export interface CommonProps {
2
2
  language?: LanguageProp;
3
3
  mapiBaseUrl: string;
4
4
  rapiBaseUrl: string;
5
- apiKey: string;
6
5
  }
7
6
  export declare type LanguageProp = "en" | "is" | "pl" | undefined;
@@ -183,7 +183,7 @@ exports.receiverRequirementsObject = {
183
183
  ]
184
184
  },
185
185
  "supplier.vatNumber": {
186
- isRequired: true,
186
+ isRequired: false,
187
187
  key: "",
188
188
  },
189
189
  "supplier.address.streetNameAndNumber": {
@@ -1,9 +1,9 @@
1
1
  import "../style/index.css";
2
2
  import React from "react";
3
- import { ProfileOutput } from "@unimaze/api-clients/lib/wapi2";
4
3
  import { CommonProps } from "../common/types/CommonProps";
4
+ import { ProfileOutputWithApiKey } from "../common/types/AppConfiguration";
5
5
  interface Props extends CommonProps {
6
- customers: ProfileOutput[];
6
+ customers: ProfileOutputWithApiKey[];
7
7
  }
8
8
  /**
9
9
  * Component for creating a form for creating an invoice and submitting it to the MAPI transaction services
@@ -44,7 +44,8 @@ var CreateInvoice = function (props) {
44
44
  var form = antd_1.Form.useForm()[0];
45
45
  var _a = react_1.useState(false), submitting = _a[0], setSubmitting = _a[1];
46
46
  var _b = react_1.useState(/*profileOutputToPartyMetadata(props.customers[0])*/ undefined), chosenCustomer = _b[0], setChosenCustomer = _b[1];
47
- var _c = react_1.useState(1), billingLinesEditableIndex = _c[0], setBillingLinesEditableIndex = _c[1];
47
+ var _c = react_1.useState(), chosenCustomerApiKey = _c[0], setChosenCustomerApiKey = _c[1];
48
+ var _d = react_1.useState(1), billingLinesEditableIndex = _d[0], setBillingLinesEditableIndex = _d[1];
48
49
  var initialBillingLineData = {
49
50
  key: billingLinesEditableIndex,
50
51
  itemNo: "Item No.",
@@ -58,7 +59,7 @@ var CreateInvoice = function (props) {
58
59
  taxableAmount: 0,
59
60
  taxPercentage: null
60
61
  };
61
- var _d = react_1.useState([__assign({}, initialBillingLineData, { key: 0 })]), billingLinesDataSource = _d[0], setBillingLinesDataSource = _d[1];
62
+ var _e = react_1.useState([__assign({}, initialBillingLineData, { key: 0 })]), billingLinesDataSource = _e[0], setBillingLinesDataSource = _e[1];
62
63
  // BILLING LINES
63
64
  var handleBillingLinesDelete = function (index) {
64
65
  var newDataSource = billingLinesDataSource.slice();
@@ -117,7 +118,7 @@ var CreateInvoice = function (props) {
117
118
  processingMode: mapi_1.TransactionProcessingMode.Device
118
119
  // processingMode: TransactionProcessingMode.DeviceRouted
119
120
  };
120
- utils_1.submitInvoice(createSubmitInvoice, props.mapiBaseUrl, props.apiKey, "submitInvoice", props.language)
121
+ utils_1.submitInvoice(createSubmitInvoice, props.mapiBaseUrl, chosenCustomerApiKey, "submitInvoice", props.language)
121
122
  .then(function (resp) {
122
123
  antd_1.message.success("successfully submitted the invoice");
123
124
  var messageId = resp.data.uniqueId;
@@ -132,7 +133,7 @@ var CreateInvoice = function (props) {
132
133
  name: nextFileDescription // nextFile.name,
133
134
  };
134
135
  setSubmitting(true);
135
- utils_1.submitDocument(nextFile, createAttachDocument, props.mapiBaseUrl, props.apiKey)
136
+ utils_1.submitDocument(nextFile, createAttachDocument, props.mapiBaseUrl, chosenCustomerApiKey)
136
137
  .then(function (submitDocumentResponse) {
137
138
  antd_1.message.success("successfully uploaded attachment " + nextFileDescription);
138
139
  setSubmitting(false);
@@ -145,6 +146,7 @@ var CreateInvoice = function (props) {
145
146
  form.resetFields();
146
147
  // Clear the billing line dataSource
147
148
  setChosenCustomer(undefined);
149
+ setChosenCustomerApiKey(undefined);
148
150
  setBillingLinesDataSource([__assign({}, initialBillingLineData, { key: 0 })]);
149
151
  setBillingLinesEditableIndex(0);
150
152
  })
@@ -183,7 +185,7 @@ var CreateInvoice = function (props) {
183
185
  react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 } },
184
186
  react_1.default.createElement(components_1.Supplier, { billingLinesDataSource: billingLinesDataSource })),
185
187
  react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 } },
186
- react_1.default.createElement(components_1.Customer, { formInstance: form, customers: props.customers, chosenCustomer: chosenCustomer, setChosenCustomer: setChosenCustomer })),
188
+ react_1.default.createElement(components_1.Customer, { formInstance: form, customers: props.customers, chosenCustomer: chosenCustomer, setChosenCustomer: setChosenCustomer, setChosenCustomerApiKey: setChosenCustomerApiKey })),
187
189
  react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 24 } },
188
190
  react_1.default.createElement(components_1.BillingLines, { setBillingLineMetadata: handleSetBillingLineMetadata, formInstance: form, dataSource: billingLinesDataSource, editableIndex: billingLinesEditableIndex, handleAdd: handleBillingLinesAdd, initialBillingLineData: initialBillingLineData, handleDelete: handleBillingLinesDelete, handleSave: handleBillingLinesSave })),
189
191
  react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 8 } },
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { IconProps } from "@ant-design/compatible/es/icon";
3
3
  interface HeaderProps {
4
4
  iconProps?: IconProps;
5
- title?: string;
5
+ title?: string | React.ReactNode;
6
6
  action?: React.ReactNode;
7
7
  }
8
8
  declare const Header: React.FC<HeaderProps>;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { IconProps } from "@ant-design/compatible/es/icon";
3
3
  interface Props {
4
4
  iconProps?: IconProps;
5
- title?: string;
5
+ title?: string | React.ReactNode;
6
6
  action?: React.ReactNode;
7
7
  noPadding?: boolean;
8
8
  noHeader?: boolean;
@@ -1,15 +1,16 @@
1
1
  import React from 'react';
2
2
  import { InjectedIntlProps } from "react-intl";
3
- import { ProfileOutput } from "@unimaze/api-clients/lib/wapi2";
4
3
  import { FormInstance } from "antd/es/form";
5
4
  import { PartyMetadata } from "@unimaze/api-clients/lib/mapi";
5
+ import { ProfileOutputWithApiKey } from "../../types/AppConfiguration";
6
6
  interface Props extends InjectedIntlProps {
7
- customers: ProfileOutput[];
7
+ customers: ProfileOutputWithApiKey[];
8
8
  formInstance: FormInstance;
9
9
  chosenCustomer: PartyMetadata | undefined;
10
10
  setChosenCustomer: (chosenCustomer: PartyMetadata) => void;
11
+ setChosenCustomerApiKey: (chosenCustomerApiKey: string) => void;
11
12
  }
12
- declare const CustomerIntl: React.ComponentClass<Pick<Props, "chosenCustomer" | "setChosenCustomer" | "customers" | "formInstance">, any> & {
13
+ declare const CustomerIntl: React.ComponentClass<Pick<Props, "chosenCustomer" | "setChosenCustomer" | "setChosenCustomerApiKey" | "customers" | "formInstance">, any> & {
13
14
  WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
14
15
  };
15
16
  export default CustomerIntl;
@@ -1,9 +1,9 @@
1
1
  import "../style/index.css";
2
2
  import React from "react";
3
- import { ProfileOutput } from "@unimaze/api-clients/lib/wapi2";
4
3
  import { CommonProps } from "../common/types/CommonProps";
4
+ import { ProfileOutputWithApiKey } from "../common/types/AppConfiguration";
5
5
  interface Props extends CommonProps {
6
- customers: ProfileOutput[];
6
+ customers: ProfileOutputWithApiKey[];
7
7
  }
8
8
  /**
9
9
  * Component for creating a form for creating an invoice and submitting it to the MAPI transaction services
@@ -62,6 +62,7 @@ declare const _default: {
62
62
  "supplier_contact_name": string;
63
63
  "supplier_notValidEmail": string;
64
64
  "customer_title": string;
65
+ "customer_selectTheCustomer": string;
65
66
  "customer_name": string;
66
67
  "customer_identifier": string;
67
68
  "customer_address_streetNameAndNumber": string;
@@ -60,6 +60,7 @@
60
60
  "supplier_contact_name": "Nafn tengiliðs",
61
61
  "supplier_notValidEmail": "Þetta er ekki gilt netfang",
62
62
  "customer_title": "Viðskiptavinur",
63
+ "customer_selectTheCustomer": "Veldu viðskiptavini",
63
64
  "customer_name": "Nafn viðskiptavinar",
64
65
  "customer_identifier": "Kennitala",
65
66
  "customer_address_streetNameAndNumber": "Heimilisfang",
@@ -62,6 +62,7 @@ declare const _default: {
62
62
  "supplier_contact_name": string;
63
63
  "supplier_notValidEmail": string;
64
64
  "customer_title": string;
65
+ "customer_selectTheCustomer": string;
65
66
  "customer_name": string;
66
67
  "customer_identifier": string;
67
68
  "customer_address_streetNameAndNumber": string;
@@ -79,6 +79,7 @@ var convertToInvoiceMetadataInput = function (formValues, billingLines, paymentM
79
79
  fallbackContactName: partyMetadata.name
80
80
  };
81
81
  };
82
+ var vatNumber = invoice.supplier.vatNumber ? invoice.supplier.vatNumber : "N/A";
82
83
  var resp = {
83
84
  messageHandling: getMessageHandling(chosenCustomer),
84
85
  invoice: {
@@ -104,7 +105,7 @@ var convertToInvoiceMetadataInput = function (formValues, billingLines, paymentM
104
105
  city: invoice.supplier.address.city,
105
106
  countryCode: invoice.supplier.address.countryCode,
106
107
  },
107
- vatNumber: invoice.supplier.vatNumber,
108
+ vatNumber: vatNumber,
108
109
  name: invoice.supplier.name,
109
110
  contact: {
110
111
  electronicMail: invoice.supplier.contact.electronicMail,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unimaze/billing",
3
- "version": "0.2.8",
3
+ "version": "0.3.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",