@unimaze/billing 0.21.7 → 0.21.9

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.
Files changed (93) hide show
  1. package/lib/common/components/base-information/index.js +1 -1
  2. package/lib/common/components/billing-lines/BillingCalculations.js +0 -3
  3. package/lib/common/components/billing-lines/NewBillingLines.js +1 -1
  4. package/lib/common/components/billing-lines/SingleBillingLine.js +1 -1
  5. package/lib/common/components/invoice-preview/InvoicePreviewCustomerSupplierInfo.d.ts +0 -0
  6. package/lib/common/components/invoice-preview/InvoicePreviewCustomerSupplierInfo.js +109 -0
  7. package/lib/common/components/invoice-preview/InvoicePreviewCustomerSupplierInfoBox.d.ts +14 -0
  8. package/lib/common/components/invoice-preview/InvoicePreviewCustomerSupplierInfoBox.js +73 -0
  9. package/lib/common/components/invoice-preview/InvoicePreviewInvoiceLines.d.ts +12 -0
  10. package/lib/common/components/invoice-preview/InvoicePreviewInvoiceLines.js +93 -0
  11. package/lib/common/components/invoice-preview/InvoicePreviewPaymentInfo.d.ts +0 -0
  12. package/lib/common/components/invoice-preview/InvoicePreviewPaymentInfo.js +110 -0
  13. package/lib/common/components/invoice-preview/InvoicePreviewPaymentInfoBox.d.ts +14 -0
  14. package/lib/common/components/invoice-preview/InvoicePreviewPaymentInfoBox.js +77 -0
  15. package/lib/common/components/invoice-preview/InvoicePreviewTotalAmountPreview.d.ts +14 -0
  16. package/lib/common/components/invoice-preview/InvoicePreviewTotalAmountPreview.js +52 -0
  17. package/lib/common/components/payment-method/index.js +3 -0
  18. package/lib/unimaze-billing/src/common/components/CommonTranslations.d.ts +1 -29
  19. package/lib/unimaze-billing/src/common/components/CommonTranslations.js +4 -32
  20. package/lib/unimaze-billing/src/common/components/attachments/Attachment.d.ts +1 -1
  21. package/lib/unimaze-billing/src/common/components/attachments/AttachmentModal.d.ts +1 -1
  22. package/lib/unimaze-billing/src/common/components/attachments/AttachmentModal.js +5 -2
  23. package/lib/unimaze-billing/src/common/components/attachments/index.d.ts +1 -1
  24. package/lib/unimaze-billing/src/common/components/base-information/AccountingCost.d.ts +1 -1
  25. package/lib/unimaze-billing/src/common/components/base-information/OrderReference.d.ts +1 -1
  26. package/lib/unimaze-billing/src/common/components/base-information/ProjectReference.d.ts +1 -1
  27. package/lib/unimaze-billing/src/common/components/base-information/ReferenceIdentifiers.d.ts +6 -1
  28. package/lib/unimaze-billing/src/common/components/base-information/ReferenceIdentifiers.js +34 -12
  29. package/lib/unimaze-billing/src/common/components/base-information/index.d.ts +10 -1
  30. package/lib/unimaze-billing/src/common/components/base-information/index.js +10 -2
  31. package/lib/unimaze-billing/src/common/components/billing-lines/BillingCalculations.d.ts +1 -1
  32. package/lib/unimaze-billing/src/common/components/billing-lines/BillingCalculations.js +3 -5
  33. package/lib/unimaze-billing/src/common/components/billing-lines/BillingLinePreview.d.ts +4 -1
  34. package/lib/unimaze-billing/src/common/components/billing-lines/BillingLinePreview.js +45 -25
  35. package/lib/unimaze-billing/src/common/components/billing-lines/BillingTaxSummary.d.ts +1 -1
  36. package/lib/unimaze-billing/src/common/components/billing-lines/BillingTaxSummary.js +0 -1
  37. package/lib/unimaze-billing/src/common/components/billing-lines/NewBillingLines.d.ts +6 -1
  38. package/lib/unimaze-billing/src/common/components/billing-lines/NewBillingLines.js +41 -327
  39. package/lib/unimaze-billing/src/common/components/billing-lines/SingleBillingLine.d.ts +10 -5
  40. package/lib/unimaze-billing/src/common/components/billing-lines/SingleBillingLine.js +137 -61
  41. package/lib/unimaze-billing/src/common/components/billing-lines/index.d.ts +3 -6
  42. package/lib/unimaze-billing/src/common/components/billing-lines/index.js +1 -1
  43. package/lib/unimaze-billing/src/common/components/customer/CostCenter.d.ts +1 -1
  44. package/lib/unimaze-billing/src/common/components/customer/CustomerContactName.d.ts +1 -1
  45. package/lib/unimaze-billing/src/common/components/customer/index.d.ts +1 -1
  46. package/lib/unimaze-billing/src/common/components/customer/index.js +7 -9
  47. package/lib/unimaze-billing/src/common/components/delivery-location/index.d.ts +1 -1
  48. package/lib/unimaze-billing/src/common/components/form-item/index.d.ts +1 -1
  49. package/lib/unimaze-billing/src/common/components/input/index.d.ts +1 -1
  50. package/lib/unimaze-billing/src/common/components/invoice/index.d.ts +3 -1
  51. package/lib/unimaze-billing/src/common/components/invoice/index.js +21 -14
  52. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewCustomerSupplierInfo.d.ts +14 -0
  53. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewCustomerSupplierInfo.js +75 -0
  54. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewCustomerSupplierInfoBox.d.ts +14 -0
  55. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewCustomerSupplierInfoBox.js +73 -0
  56. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewHeader.d.ts +1 -1
  57. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewHeader.js +7 -8
  58. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewInvoiceLines.d.ts +12 -0
  59. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewInvoiceLines.js +93 -0
  60. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewPaymentInfo.d.ts +14 -0
  61. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewPaymentInfo.js +77 -0
  62. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewPaymentInfoBox.d.ts +14 -0
  63. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewPaymentInfoBox.js +58 -0
  64. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewTotalAmountPreview.d.ts +14 -0
  65. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewTotalAmountPreview.js +52 -0
  66. package/lib/unimaze-billing/src/common/components/invoice-preview/index.d.ts +87 -1
  67. package/lib/unimaze-billing/src/common/components/invoice-preview/index.js +27 -236
  68. package/lib/unimaze-billing/src/common/components/payment-method/index.d.ts +1 -1
  69. package/lib/unimaze-billing/src/common/components/supplier/CityAutofill.d.ts +1 -1
  70. package/lib/unimaze-billing/src/common/components/supplier/index.d.ts +1 -1
  71. package/lib/unimaze-billing/src/common/components/supplier/index.js +1 -1
  72. package/lib/unimaze-billing/src/common/components/welcome-modal/index.d.ts +1 -1
  73. package/lib/unimaze-billing/src/common/types/AppConfiguration.d.ts +7 -4
  74. package/lib/unimaze-billing/src/common/types/ReceiverRequirements.d.ts +2 -0
  75. package/lib/unimaze-billing/src/common/types/ReceiverRequirements.js +2 -0
  76. package/lib/unimaze-billing/src/create-invoice/index.d.ts +11 -3
  77. package/lib/unimaze-billing/src/create-invoice/index.js +91 -64
  78. package/lib/unimaze-billing/src/enums.d.ts +3 -0
  79. package/lib/unimaze-billing/src/translations/locales/en.json +13 -13
  80. package/lib/unimaze-billing/src/translations/locales/is.json +8 -8
  81. package/lib/unimaze-billing/src/translations/locales.d.ts +16 -16
  82. package/lib/unimaze-billing/src/utils/ApiUtility.d.ts +9 -3
  83. package/lib/unimaze-billing/src/utils/ApiUtility.js +31 -13
  84. package/lib/unimaze-billing/src/utils/BillingLineUtility.d.ts +4 -1
  85. package/lib/unimaze-billing/src/utils/BillingLineUtility.js +36 -4
  86. package/lib/unimaze-billing/src/utils/ConversionUtility.d.ts +2 -2
  87. package/lib/unimaze-billing/src/utils/ConversionUtility.js +10 -11
  88. package/lib/unimaze-billing/src/utils/IntlUtility.d.ts +1 -0
  89. package/lib/unimaze-billing/src/utils/IntlUtility.js +33 -10
  90. package/lib/unimaze-billing/src/utils/RequirementsUtility.d.ts +3 -1
  91. package/lib/unimaze-billing/src/utils/RequirementsUtility.js +49 -1
  92. package/lib/utils/BillingLineUtility.js +3 -2
  93. package/package.json +1 -1
@@ -33,12 +33,49 @@ var __importStar = (this && this.__importStar) || function (mod) {
33
33
  __setModuleDefault(result, mod);
34
34
  return result;
35
35
  };
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ var __generator = (this && this.__generator) || function (thisArg, body) {
46
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
47
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
48
+ function verb(n) { return function (v) { return step([n, v]); }; }
49
+ function step(op) {
50
+ if (f) throw new TypeError("Generator is already executing.");
51
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
52
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
53
+ if (y = 0, t) op = [op[0] & 2, t.value];
54
+ switch (op[0]) {
55
+ case 0: case 1: t = op; break;
56
+ case 4: _.label++; return { value: op[1], done: false };
57
+ case 5: _.label++; y = op[1]; op = [0]; continue;
58
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
59
+ default:
60
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
61
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
62
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
63
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
64
+ if (t[2]) _.ops.pop();
65
+ _.trys.pop(); continue;
66
+ }
67
+ op = body.call(thisArg, _);
68
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
69
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
70
+ }
71
+ };
36
72
  var __importDefault = (this && this.__importDefault) || function (mod) {
37
73
  return (mod && mod.__esModule) ? mod : { "default": mod };
38
74
  };
39
75
  Object.defineProperty(exports, "__esModule", { value: true });
40
76
  var React = __importStar(require("react"));
41
77
  var react_1 = require("react");
78
+ var react_intl_1 = require("react-intl");
42
79
  var antd_1 = require("antd");
43
80
  var form_item_1 = __importDefault(require("../form-item"));
44
81
  var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
@@ -55,7 +92,9 @@ var formLayout_1 = require("../../consts/formLayout");
55
92
  var icons_1 = require("@ant-design/icons");
56
93
  var NewBillingLines_1 = require("./NewBillingLines");
57
94
  var BillingLinePreview_1 = __importDefault(require("./BillingLinePreview"));
58
- var mapi_1 = require("../../../../../unimaze-api-clients/src/mapi");
95
+ var lodash_1 = require("lodash");
96
+ var Form_1 = require("antd/es/form/Form");
97
+ var react_use_1 = require("react-use");
59
98
  var SingleBillingLine = function (props) {
60
99
  var fieldName = props.fieldName, index = props.index, intl = props.intl;
61
100
  var _a = React.useState(false), isMobile = _a[0], setIsMobile = _a[1];
@@ -64,60 +103,94 @@ var SingleBillingLine = function (props) {
64
103
  var _d = React.useState("PERCENTAGE"), discountType = _d[0], setDiscountType = _d[1];
65
104
  var _e = (0, react_1.useState)(undefined), addNewLinesTooltip = _e[0], setAddNewLinesTooltip = _e[1];
66
105
  var _f = React.useState(true), isSaveButtonDisabled = _f[0], setIsSaveButtonDisabled = _f[1];
67
- var _g = (0, react_1.useState)(false), isEditing = _g[0], setIsEditing = _g[1];
68
- var fieldValues1 = props.formInstance.getFieldsValue([
69
- ["invoice", "invoiceLines", fieldName],
70
- ]);
71
- var removeBillingLine = function (id) {
72
- // remove(index);
73
- // const newBillingLines = billingLineData.filter((lineData) => lineData.key !== id);
74
- // setBillingLineData(newBillingLines);
75
- };
76
- var editBillingLine = function (id) {
77
- if (id) {
78
- // setIdOfLineForEdit(id);
106
+ var _g = (0, react_1.useState)(), field = _g[0], setField = _g[1];
107
+ var _h = (0, react_1.useState)(false), isEditing = _h[0], setIsEditing = _h[1];
108
+ var invoiceLines = (0, Form_1.useWatch)(["invoice", "invoiceLines"], props.formInstance);
109
+ var width = (0, react_use_1.useWindowSize)().width;
110
+ (0, react_1.useEffect)(function () {
111
+ if (props.outsideVatScope) {
112
+ setTaxCatType(enums_1.AvailableTaxCategoryTypeEnum.OutsideTaxScope);
79
113
  }
80
- };
81
- var addBillingLine = function () {
82
- var fieldValues = props.formInstance.getFieldsValue(["invoice", "invoiceLines"]);
83
- if (fieldValues &&
84
- fieldValues.invoice &&
85
- fieldValues.invoice.invoiceLines &&
86
- fieldValues.invoice.invoiceLines[fieldName]) {
87
- var _a = fieldValues.invoice.invoiceLines[fieldName], name_1 = _a.name, taxableAmount = _a.taxableAmount, quantity = _a.quantity, unitOfMeasure = _a.unitOfMeasure, unitPriceAmount = _a.unitPriceAmount, taxCategoryType = _a.taxCategoryType, discountValue = _a.discountValue, _discountType = _a.discountType, currencyCode = _a.currencyCode;
88
- var unit = unitOfMeasure.unit;
89
- var billingLineId = "billingLine-".concat(name_1, "-").concat(fieldName);
90
- var taxPercentage = (0, BillingLineUtility_1.calculateTaxPercentage)(taxCategoryType);
91
- var taxAmount = (0, BillingLineUtility_1.calculateTaxAmount)(taxableAmount, taxPercentage);
92
- var newBillingLineData = {
93
- key: fieldName,
94
- name: name_1,
95
- taxableAmount: taxableAmount,
96
- taxPercentage: taxPercentage,
97
- taxAmount: taxAmount,
98
- quantity: quantity,
99
- // TODO: fix this
100
- unitOfMeasure: {
101
- value: mapi_1.Units.CubicMetre,
102
- label: unit
103
- },
104
- unitPriceAmount: unitPriceAmount,
105
- taxCategoryType: taxCategoryType,
106
- discountValue: discountValue,
107
- discountType: _discountType,
108
- currencyCode: currencyCode,
109
- onDelete: function () {
110
- removeBillingLine(fieldName);
111
- },
112
- onEdit: function () {
113
- editBillingLine(fieldName);
114
- }
115
- };
116
- // setBillingLineData([...billingLineData, newBillingLineData]);
117
- //
118
- // add();
114
+ else {
115
+ setTaxCatType(enums_1.AvailableTaxCategoryTypeEnum.StandardRated);
116
+ }
117
+ }, [props.outsideVatScope]);
118
+ (0, react_1.useEffect)(function () {
119
+ if (width < 768) {
120
+ setIsMobile(true);
119
121
  }
122
+ else {
123
+ setIsMobile(false);
124
+ }
125
+ }, [width]);
126
+ // init
127
+ (0, react_1.useEffect)(function () {
128
+ if (props.formInstance) {
129
+ var lines = props.formInstance.getFieldValue(["invoice", "invoiceLines"]) || [];
130
+ var currentField = lines[fieldName];
131
+ if (currentField) {
132
+ setIsEditing(currentField.editing);
133
+ setField(currentField);
134
+ }
135
+ if ((lines === null || lines === void 0 ? void 0 : lines.length) === 1) {
136
+ setIsCurrencyDisabled(false);
137
+ }
138
+ else {
139
+ setIsCurrencyDisabled(true);
140
+ }
141
+ }
142
+ }, [invoiceLines]);
143
+ var handleOnEdit = function () {
144
+ var lines = props.formInstance.getFieldValue(["invoice", "invoiceLines"]) || [];
145
+ lines[fieldName].editing = true;
146
+ setIsEditing(true);
147
+ props.formInstance.setFieldValue(["invoice", "invoiceLines"], lines);
148
+ };
149
+ var handleRemove = function () {
150
+ props.remove(fieldName);
120
151
  };
152
+ var validateFormListFields = function () { return __awaiter(void 0, void 0, void 0, function () {
153
+ var fieldPaths;
154
+ return __generator(this, function (_a) {
155
+ switch (_a.label) {
156
+ case 0:
157
+ if (!invoiceLines)
158
+ return [2 /*return*/];
159
+ fieldPaths = [
160
+ ["invoice", "invoiceLines", fieldName, "itemNo"],
161
+ ["invoice", "invoiceLines", fieldName, "name"],
162
+ ["invoice", "invoiceLines", fieldName, "quantity"],
163
+ ["invoice", "invoiceLines", fieldName, "unitPriceAmount"],
164
+ ["invoice", "invoiceLines", fieldName, "taxableAmount"],
165
+ ["invoice", "invoiceLines", fieldName, "taxCategoryType"],
166
+ ["invoice", "invoiceLines", fieldName, "discountValue"],
167
+ ["invoice", "invoiceLines", fieldName, "unitOfMeasure", "unit"],
168
+ ];
169
+ return [4 /*yield*/, props.formInstance.validateFields(fieldPaths, { validateOnly: true })
170
+ .then(function () {
171
+ setIsSaveButtonDisabled(false);
172
+ setAddNewLinesTooltip(undefined);
173
+ })
174
+ .catch(function (error) {
175
+ var _a;
176
+ var requiredFields = [];
177
+ (_a = error.errorFields) === null || _a === void 0 ? void 0 : _a.map(function (errorField) {
178
+ requiredFields.push(errorField.name[errorField.name.length - 1]);
179
+ });
180
+ if ((requiredFields === null || requiredFields === void 0 ? void 0 : requiredFields.length) > 0)
181
+ setAddNewLinesTooltip((0, RequirementsUtility_1.getRequiredTooltipMessage)(props.intl.formatMessage(CommonTranslations_1.commonTranslationMessages.missingRequiredData), (0, BillingLineUtility_1.getFieldNames)(requiredFields, props.intl)));
182
+ setIsSaveButtonDisabled(true);
183
+ })];
184
+ case 1:
185
+ _a.sent();
186
+ return [2 /*return*/];
187
+ }
188
+ });
189
+ }); };
190
+ var debouncedValidateFormListFields = React.useCallback((0, lodash_1.debounce)(validateFormListFields, 500), [invoiceLines]);
191
+ (0, react_1.useEffect)(function () {
192
+ debouncedValidateFormListFields();
193
+ }, [invoiceLines, props.formInstance.getFieldValue(["invoice", "currencyCode"])]);
121
194
  var getTaxableAmount = function () {
122
195
  var fieldValues = props.formInstance.getFieldsValue([
123
196
  ["invoice", "invoiceLines", fieldName],
@@ -145,9 +218,7 @@ var SingleBillingLine = function (props) {
145
218
  props.formInstance.setFieldsValue({ invoice: { currencyCode: value } });
146
219
  };
147
220
  var discountTypeSelectorOnSelectHandle = function (value) { return setDiscountType(value); };
148
- var editingRender = (React.createElement(antd_1.Flex, { vertical: true,
149
- // style={field.name !== fields.length - 1 ? {display: "none"} : {}}
150
- key: "invoiceLine-".concat(index) },
221
+ var editingRender = (React.createElement(antd_1.Flex, { vertical: true, key: "invoiceLine-".concat(index) },
151
222
  React.createElement(form_item_1.default, { className: "umz_noValidationMessage", receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["invoiceLines.itemNo"], defaultIsRequired: false, fieldName: [fieldName, "itemNo"], defaultLabel: props.intl.formatMessage(NewBillingLines_1.translationMessages.billingLines_itemNo), verticalLabels: true, onlyLabelOnFirstInList: true }, (0, BillingLineUtility_1.getCorrectInputNode)("itemNo", props.intl, props.intl.formatMessage(NewBillingLines_1.translationMessages.billingLines_itemNo), (0, RequirementsUtility_1.getFieldIsRequired)(props.receiverRequirements, ReceiverRequirements_1.AvailableFields["invoiceLines.itemNo"], false))),
152
223
  React.createElement(form_item_1.default, { className: "umz_noValidationMessage", receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["invoiceLines.name"], defaultIsRequired: true, fieldName: [fieldName, "name"], defaultLabel: props.intl.formatMessage(NewBillingLines_1.translationMessages.billingLines_name), verticalLabels: true, onlyLabelOnFirstInList: true, index: index }, (0, BillingLineUtility_1.getCorrectInputNode)("name", props.intl, props.intl.formatMessage(NewBillingLines_1.translationMessages.billingLines_name), (0, RequirementsUtility_1.getFieldIsRequired)(props.receiverRequirements, ReceiverRequirements_1.AvailableFields["invoiceLines.name"], true))),
153
224
  React.createElement(antd_1.Row, { gutter: 20 },
@@ -178,22 +249,27 @@ var SingleBillingLine = function (props) {
178
249
  " ",
179
250
  props.intl.formatMessage(NewBillingLines_1.translationMessages.billingLines_taxCategoryType))) : (props.intl.formatMessage(NewBillingLines_1.translationMessages.billingLines_taxCategoryType)), popupMatchSelectWidth: false }, Object.keys(enums_1.AvailableTaxCategoryTypeEnum).map(function (taxCategoryType) {
180
251
  var taxPercentage = (0, BillingLineUtility_1.calculateTaxPercentage)(enums_1.AvailableTaxCategoryTypeEnum[taxCategoryType]);
181
- return (React.createElement(antd_1.Select.Option, { disabled: (0, BillingLineUtility_1.getTaxCategoryDisabled)(enums_1.AvailableTaxCategoryTypeEnum[taxCategoryType], props.outsideVatScope), value: taxCategoryType, title: taxCategoryType, key: taxCategoryType }, "".concat(props.intl.formatMessage(CommonTranslations_1.commonTranslationMessages["taxCategoryType_labels_".concat(taxCategoryType)]), " (").concat(taxPercentage, "%)")));
252
+ return (React.createElement(antd_1.Select.Option, { disabled: (0, BillingLineUtility_1.getTaxCategoryDisabled)(enums_1.AvailableTaxCategoryTypeEnum[taxCategoryType], props.outsideVatScope), value: taxCategoryType, title: taxCategoryType, key: taxCategoryType }, "".concat(props.intl.formatMessage(CommonTranslations_1.commonTranslationMessages.taxCategoryType_label, { taxCategoryType: taxCategoryType }), " (").concat(taxPercentage, "%)")));
182
253
  })),
183
254
  " ",
184
255
  React.createElement(tooltip_1.default, { title: props.intl.formatMessage(NewBillingLines_1.translationMessages.billingLines_taxCategoryType_title) })))),
185
256
  React.createElement(antd_1.Col, { span: 12 },
186
- React.createElement(form_item_1.default, { className: "umz_noValidationMessage", receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["invoiceLines.discountValue"], defaultIsRequired: false, fieldName: [fieldName, "discountValue"], defaultLabel: props.intl.formatMessage(NewBillingLines_1.translationMessages.billingLines_discount), verticalLabels: true, onlyLabelOnFirstInList: true, defaultLabelTooltip: props.intl.formatMessage(NewBillingLines_1.translationMessages.billingLines_discount_helpText), index: index },
257
+ React.createElement(form_item_1.default, { className: "umz_noValidationMessage", receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["invoiceLines.discountValue"], defaultIsRequired: false, fieldName: [fieldName, "discountValue"], defaultLabel: props.intl.formatMessage(NewBillingLines_1.translationMessages.billingLines_discount), verticalLabels: true, onlyLabelOnFirstInList: true, defaultLabelTooltip: props.intl.formatMessage(NewBillingLines_1.translationMessages.billingLines_discount_helpText), rules: [
258
+ {
259
+ pattern: /^\d+(\.\d+)?$/,
260
+ message: props.intl.formatMessage(NewBillingLines_1.translationMessages.billingLines_input_must_be_number_validationMessage),
261
+ },
262
+ ], index: index },
187
263
  React.createElement(antd_1.Flex, { gap: "middle", align: "center" },
188
- (0, BillingLineUtility_1.getCorrectInputNode)("discountValue", props.intl, props.intl.formatMessage(NewBillingLines_1.translationMessages.billingLines_discount), (0, RequirementsUtility_1.getFieldIsRequired)(props.receiverRequirements, ReceiverRequirements_1.AvailableFields["invoiceLines.discountValue"], false), React.createElement(DiscountTypeSelector_1.default, { fieldName: fieldName, initialValue: discountType, onSelect: discountTypeSelectorOnSelectHandle, formInstance: props.formInstance })),
264
+ (0, BillingLineUtility_1.getCorrectInputNode)("discountValue", props.intl, props.intl.formatMessage(NewBillingLines_1.translationMessages.billingLines_discount), (0, RequirementsUtility_1.getFieldIsRequired)(props.receiverRequirements, ReceiverRequirements_1.AvailableFields["invoiceLines.discountValue"], false), React.createElement(DiscountTypeSelector_1.default, { fieldName: fieldName, initialValue: discountType, onSelect: discountTypeSelectorOnSelectHandle, formInstance: props.formInstance }), false, props.formInstance.getFieldValue(["invoice", "invoiceLines"])[fieldName].discountValue),
189
265
  React.createElement(tooltip_1.default, { title: (0, RequirementsUtility_1.getFieldLabelTooltipOverride)(props.receiverRequirements, ReceiverRequirements_1.AvailableFields["invoiceLines.discountValue"], props.intl.formatMessage(NewBillingLines_1.translationMessages.billingLines_discount_helpText)) }))))),
190
266
  React.createElement(antd_1.Form.Item, __assign({}, formLayout_1.fullWidthInput),
191
267
  React.createElement(antd_1.Tooltip, { title: addNewLinesTooltip },
192
- React.createElement(antd_1.Button, { type: "primary", onClick: addBillingLine, style: { width: "100%" }, disabled: isSaveButtonDisabled },
268
+ React.createElement(antd_1.Button, { type: "primary", onClick: function () { return props.handleAddNewLine(fieldName); }, style: { width: "100%" }, disabled: isSaveButtonDisabled },
193
269
  React.createElement(icons_1.CheckCircleOutlined, null),
194
270
  props.intl.formatMessage(NewBillingLines_1.translationMessages.billingLines_labels_addButton))))));
195
271
  return (React.createElement(React.Fragment, null, isEditing
196
272
  ? editingRender
197
- : React.createElement(BillingLinePreview_1.default, { name: props.fieldName, discountValue: fieldValues1 === null || fieldValues1 === void 0 ? void 0 : fieldValues1.discountValue, discountType: fieldValues1 === null || fieldValues1 === void 0 ? void 0 : fieldValues1.discountType, taxCategoryType: fieldValues1 === null || fieldValues1 === void 0 ? void 0 : fieldValues1.taxCategoryType, currencyCode: fieldValues1 === null || fieldValues1 === void 0 ? void 0 : fieldValues1.currencyCode, onEdit: function () { setIsEditing(true); }, quantity: fieldValues1 === null || fieldValues1 === void 0 ? void 0 : fieldValues1.quantity, taxableAmount: fieldValues1 === null || fieldValues1 === void 0 ? void 0 : fieldValues1.taxableAmount, unitPriceAmount: fieldValues1 === null || fieldValues1 === void 0 ? void 0 : fieldValues1.unitPriceAmount, unit: fieldValues1 === null || fieldValues1 === void 0 ? void 0 : fieldValues1.unitPriceAmount, onDelete: function () { setIsEditing(true); } })));
273
+ : React.createElement(BillingLinePreview_1.default, { itemNo: field === null || field === void 0 ? void 0 : field.itemNo, name: field === null || field === void 0 ? void 0 : field.name, discountValue: field === null || field === void 0 ? void 0 : field.discountValue, discountType: field === null || field === void 0 ? void 0 : field.discountType, taxCategoryType: field === null || field === void 0 ? void 0 : field.taxCategoryType, currencyCode: field === null || field === void 0 ? void 0 : field.currencyCode, onEdit: handleOnEdit, quantity: field === null || field === void 0 ? void 0 : field.quantity, taxableAmount: field === null || field === void 0 ? void 0 : field.taxableAmount, unitPriceAmount: field === null || field === void 0 ? void 0 : field.unitPriceAmount, unit: field === null || field === void 0 ? void 0 : field.unitPriceAmount, unitOfMeasure: field === null || field === void 0 ? void 0 : field.unitOfMeasure, onDelete: handleRemove })));
198
274
  };
199
- exports.default = SingleBillingLine;
275
+ exports.default = (0, react_intl_1.injectIntl)(SingleBillingLine);
@@ -2,12 +2,8 @@ import * as React from "react";
2
2
  import { WrappedComponentProps } from "react-intl";
3
3
  import { BillingLineMetadataOverride } from "../../types/BillingLineMetadataOverride";
4
4
  import { FormInstance } from "antd/es/form";
5
- import { TaxCategoryTypeEnum, Units } from "@unimaze/api-clients/lib/mapi/api";
5
+ import { Units } from "@unimaze/api-clients/lib/mapi/api";
6
6
  import { NewReceiverRequirements } from "../../types/NewReceiverRequirements";
7
- export interface TaxCategoryTypeWithPercentageEnum {
8
- value: TaxCategoryTypeEnum;
9
- label: string;
10
- }
11
7
  export interface UnitOfMeasureLabelInValueEnum {
12
8
  value: Units;
13
9
  label: string;
@@ -17,6 +13,7 @@ interface Props extends WrappedComponentProps {
17
13
  billingLinesMetadata: BillingLineMetadataOverride[] | undefined;
18
14
  receiverRequirements: NewReceiverRequirements;
19
15
  outsideVatScope: boolean;
16
+ validateFields: (fieldNames: string[][], validateOnly?: boolean | undefined) => void;
20
17
  }
21
18
  export declare const translationMessages: {
22
19
  billingLines_title: {
@@ -45,7 +42,7 @@ export declare const translationMessages: {
45
42
  };
46
43
  };
47
44
  declare const BillingLinesIntl: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
48
- forwardedRef?: React.Ref<any> | undefined;
45
+ forwardedRef?: React.Ref<any>;
49
46
  } & React.RefAttributes<any>> & {
50
47
  WrappedComponent: React.ComponentType<Props>;
51
48
  };
@@ -94,7 +94,7 @@ var BillingLines = function (props) {
94
94
  React.createElement(antd_1.Typography.Title, { level: 5 }, props.intl.formatMessage(exports.translationMessages.billingLines_title)),
95
95
  React.createElement(antd_1.Flex, { style: { marginBottom: (_a = token.Typography) === null || _a === void 0 ? void 0 : _a.titleMarginBottom } },
96
96
  React.createElement(tooltip_1.default, { title: props.intl.formatMessage(exports.translationMessages.billingLines_tooltip_title) }))),
97
- React.createElement(NewBillingLines_1.default, { formInstance: props.formInstance, receiverRequirements: props.receiverRequirements, outsideVatScope: props.outsideVatScope })),
97
+ React.createElement(NewBillingLines_1.default, { formInstance: props.formInstance, receiverRequirements: props.receiverRequirements, outsideVatScope: props.outsideVatScope, validateFields: props.validateFields })),
98
98
  React.createElement(antd_1.Flex, { gap: "middle", vertical: true },
99
99
  React.createElement(BillingCalculations_1.default, { currencyCode: currencyCode, formInstance: props.formInstance, outsideVatScope: props.outsideVatScope }),
100
100
  React.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.notes, defaultLabel: props.intl.formatMessage(exports.translationMessages.baseInformation_notes), defaultIsRequired: false, fieldName: ["invoice", "notes"], style: { marginBottom: 0 } },
@@ -10,7 +10,7 @@ interface Props extends WrappedComponentProps {
10
10
  legalIdentifier: string;
11
11
  }
12
12
  declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
13
- forwardedRef?: React.Ref<any> | undefined;
13
+ forwardedRef?: React.Ref<any>;
14
14
  } & React.RefAttributes<any>> & {
15
15
  WrappedComponent: React.ComponentType<Props>;
16
16
  };
@@ -10,7 +10,7 @@ interface CustomerContactNameProps extends WrappedComponentProps {
10
10
  legalIdentifier: string;
11
11
  }
12
12
  declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<CustomerContactNameProps, "intl"> & {
13
- forwardedRef?: React.Ref<any> | undefined;
13
+ forwardedRef?: React.Ref<any>;
14
14
  } & React.RefAttributes<any>> & {
15
15
  WrappedComponent: React.ComponentType<CustomerContactNameProps>;
16
16
  };
@@ -19,7 +19,7 @@ interface Props extends WrappedComponentProps {
19
19
  isActiveStep: boolean;
20
20
  }
21
21
  declare const CustomerIntl: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
22
- forwardedRef?: React.Ref<any> | undefined;
22
+ forwardedRef?: React.Ref<any>;
23
23
  } & React.RefAttributes<any>> & {
24
24
  WrappedComponent: React.ComponentType<Props>;
25
25
  };
@@ -131,15 +131,13 @@ var Customer = function (props) {
131
131
  }, justify: "center" },
132
132
  react_1.default.createElement(antd_1.Flex, { vertical: true, style: { width: "100%", maxWidth: "900px" }, gap: isMobile || onlyOneCustomer ? "small" : "middle" },
133
133
  react_1.default.createElement(Title_1.default, { level: 5 }, props.intl.formatMessage(translationMessages.customer_title)),
134
- onlyOneCustomer ?
135
- react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: 20, paddingBottom: 5 }, className: "ant-form-text" }, props.customers[0].name)
136
- :
137
- react_1.default.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, defaultLabel: props.customers.length > 1
138
- ? props.intl.formatMessage(translationMessages.customer_selectTheCustomer)
139
- : props.intl.formatMessage(translationMessages.customer_title), defaultIsRequired: true, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["customer.identifier"], fieldName: ["invoice", "customer", "name"], style: { marginBottom: 0 } }, props.customers.length > 0 ? (react_1.default.createElement(antd_1.Select, __assign({ onChange: function (value) {
140
- onCustomerChange(value);
141
- }, disabled: props.customers.length === 1 }, formLayout_1.formItemLayout), props.customers.map(function (customer, index) { return (react_1.default.createElement(antd_1.Select.Option, { key: index, value: index }, customer.name)); }))) : ("Error - no customer configured")),
142
- react_1.default.createElement(antd_1.Flex, { vertical: true, gap: 5 },
134
+ react_1.default.createElement(antd_1.Flex, { vertical: true, gap: "middle" },
135
+ onlyOneCustomer && (react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: 20, paddingBottom: 5 }, className: "ant-form-text" }, props.customers[0].name)),
136
+ react_1.default.createElement(form_item_1.default, { hidden: onlyOneCustomer, receiverRequirements: props.receiverRequirements, defaultLabel: props.customers.length > 1
137
+ ? props.intl.formatMessage(translationMessages.customer_selectTheCustomer)
138
+ : props.intl.formatMessage(translationMessages.customer_title), defaultIsRequired: true, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["customer.identifier"], fieldName: ["invoice", "customer", "name"], style: { marginBottom: 0 } }, props.customers.length > 0 ? (react_1.default.createElement(antd_1.Select, __assign({ onChange: function (value) {
139
+ onCustomerChange(value);
140
+ }, disabled: props.customers.length === 1 }, formLayout_1.formItemLayout), props.customers.map(function (customer, index) { return (react_1.default.createElement(antd_1.Select.Option, { key: index, value: index }, customer.name)); }))) : ("Error - no customer configured")),
143
141
  react_1.default.createElement(antd_1.Typography.Text, { className: "ant-form-text", style: { fontSize: 18 }, type: "secondary" },
144
142
  props.intl.formatMessage(translationMessages.customer_identifier),
145
143
  ":",
@@ -5,7 +5,7 @@ interface Props extends WrappedComponentProps {
5
5
  receiverRequirements: NewReceiverRequirements;
6
6
  }
7
7
  declare const DeliveryLocationIntl: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
8
- forwardedRef?: React.Ref<any> | undefined;
8
+ forwardedRef?: React.Ref<any>;
9
9
  } & React.RefAttributes<any>> & {
10
10
  WrappedComponent: React.ComponentType<Props>;
11
11
  };
@@ -28,7 +28,7 @@ interface Props extends WrappedComponentProps, FormItemProps {
28
28
  index?: number;
29
29
  }
30
30
  declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
31
- forwardedRef?: React.Ref<any> | undefined;
31
+ forwardedRef?: React.Ref<any>;
32
32
  } & React.RefAttributes<any>> & {
33
33
  WrappedComponent: React.ComponentType<Props>;
34
34
  };
@@ -16,7 +16,7 @@ interface Props extends WrappedComponentProps {
16
16
  size?: "large" | "middle" | "small";
17
17
  }
18
18
  declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
19
- forwardedRef?: React.Ref<any> | undefined;
19
+ forwardedRef?: React.Ref<any>;
20
20
  } & React.RefAttributes<any>> & {
21
21
  WrappedComponent: React.ComponentType<Props>;
22
22
  };
@@ -31,9 +31,11 @@ interface Props extends WrappedComponentProps {
31
31
  isSaveFieldValuesSelected: boolean;
32
32
  onSaveFieldValuesChange: () => void;
33
33
  isActiveStep: boolean;
34
+ setReferenceIdentifierIsMandatory: (referenceIdentifierIsMandatory: boolean) => void;
34
35
  }
36
+ export declare const fieldPaths: string[][];
35
37
  declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
36
- forwardedRef?: React.Ref<any> | undefined;
38
+ forwardedRef?: React.Ref<any>;
37
39
  } & React.RefAttributes<any>> & {
38
40
  WrappedComponent: React.ComponentType<Props>;
39
41
  };
@@ -23,30 +23,37 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.fieldPaths = void 0;
26
27
  var react_1 = __importStar(require("react"));
27
28
  var react_intl_1 = require("react-intl");
28
29
  var __1 = require("..");
29
30
  var lodash_1 = require("lodash");
31
+ exports.fieldPaths = [
32
+ ["invoice", "invoiceNo"],
33
+ ["invoice", "issueDate"],
34
+ ["invoice", "dueDate"],
35
+ ["invoice", "buyerReference"],
36
+ ["invoice", "orderReference", "documentNo"],
37
+ ["invoice", "accountingCost"],
38
+ ["invoice", "documentReferences", "project", "documentNo"],
39
+ ["invoice", "invoiceLines"],
40
+ ["invoice", "singleReferenceIdentifier", "value"],
41
+ ["invoice", "referenceIdentifiers"],
42
+ ];
30
43
  var Invoice = function (props) {
31
- var fieldPaths = [
32
- ["invoice", "invoiceNo"],
33
- ["invoice", "issueDate"],
34
- ["invoice", "dueDate"],
35
- ["invoice", "buyerReference"],
36
- ["invoice", "orderReference", "documentNo"],
37
- ["invoice", "accountingCost"],
38
- ["invoice", "documentReferences", "project", "documentNo"],
39
- ["invoice", "invoiceLines"]
40
- ];
41
44
  var debouncedValidateFields = (0, lodash_1.debounce)(props.validateFields, 500);
42
45
  (0, react_1.useEffect)(function () {
43
46
  if (!props.isActiveStep)
44
47
  return;
45
- debouncedValidateFields(fieldPaths, true);
46
- }, [props.isActiveStep, JSON.stringify(props.form.getFieldsValue(fieldPaths))]);
48
+ debouncedValidateFields(exports.fieldPaths, true);
49
+ }, [props.isActiveStep, JSON.stringify(props.form.getFieldsValue(exports.fieldPaths))]);
50
+ (0, react_1.useEffect)(function () {
51
+ // Update validateField if there are changes to referenceIdentifierValidateStatus (which are debounced and thus late)
52
+ props.validateFields(exports.fieldPaths, true);
53
+ }, [props.referenceIdentifierValidateStatus]);
47
54
  return (react_1.default.createElement(react_1.default.Fragment, null,
48
- react_1.default.createElement(__1.BaseInformation, { receiverRequirements: props.receiverRequirements, form: props.form, documentType: "invoice", updateReceiverRequirementsProp: props.updateReceiverRequirementsProp, rapiBaseUrl: props.rapiBaseUrl, legalIdentifier: props.chosenCustomer.identifier, referenceIdentifiersLabelText: props.referenceIdentifiersLabelText, referenceIdentifiersHelpText: props.referenceIdentifiersHelpText, referenceIdentifierValidateStatus: props.referenceIdentifierValidateStatus, setReferenceIdentifierValidateStatus: props.setReferenceIdentifierValidateStatus, dueDateMinimumOffset: props.dueDateMinimumOffset, isSaveFieldValuesSelected: props.isSaveFieldValuesSelected, onSaveFieldValuesChange: props.onSaveFieldValuesChange }),
49
- react_1.default.createElement(__1.BillingLines, { formInstance: props.form, billingLinesMetadata: props.billingLinesMetadata, receiverRequirements: props.receiverRequirements, outsideVatScope: props.outsideVatScope }),
55
+ react_1.default.createElement(__1.BaseInformation, { receiverRequirements: props.receiverRequirements, form: props.form, documentType: "invoice", updateReceiverRequirementsProp: props.updateReceiverRequirementsProp, rapiBaseUrl: props.rapiBaseUrl, legalIdentifier: props.chosenCustomer.identifier, referenceIdentifiersLabelText: props.referenceIdentifiersLabelText, referenceIdentifiersHelpText: props.referenceIdentifiersHelpText, referenceIdentifierValidateStatus: props.referenceIdentifierValidateStatus, setReferenceIdentifierValidateStatus: props.setReferenceIdentifierValidateStatus, dueDateMinimumOffset: props.dueDateMinimumOffset, isSaveFieldValuesSelected: props.isSaveFieldValuesSelected, onSaveFieldValuesChange: props.onSaveFieldValuesChange, setReferenceIdentifierIsMandatory: props.setReferenceIdentifierIsMandatory }),
56
+ react_1.default.createElement(__1.BillingLines, { formInstance: props.form, billingLinesMetadata: props.billingLinesMetadata, receiverRequirements: props.receiverRequirements, outsideVatScope: props.outsideVatScope, validateFields: props.validateFields }),
50
57
  react_1.default.createElement(__1.Attachments, { formInstance: props.form, uploadSizeLimit: props.uploadSizeLimit, attachmentTooltipText: props.attachmentTooltipText, languageString: props.languageString })));
51
58
  };
52
59
  exports.default = (0, react_intl_1.injectIntl)(Invoice);
@@ -0,0 +1,14 @@
1
+ import { FormInstance } from "antd";
2
+ import React from "react";
3
+ import { WrappedComponentProps } from "react-intl";
4
+ import { PartyMetadata } from "../../../../../unimaze-api-clients/src/mapi";
5
+ interface Props extends WrappedComponentProps {
6
+ form: FormInstance;
7
+ chosenCustomer: PartyMetadata;
8
+ }
9
+ declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
10
+ forwardedRef?: React.Ref<any>;
11
+ } & React.RefAttributes<any>> & {
12
+ WrappedComponent: React.ComponentType<Props>;
13
+ };
14
+ export default _default;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var antd_1 = require("antd");
7
+ var react_1 = __importDefault(require("react"));
8
+ var react_intl_1 = require("react-intl");
9
+ var index_1 = require("./index");
10
+ var colors_1 = require("@ant-design/colors");
11
+ var InvoicePreviewCustomerSupplierInfo = function (props) {
12
+ var _a, _b, _c, _d, _e;
13
+ var token = antd_1.theme.useToken().token;
14
+ return (react_1.default.createElement(antd_1.Card, { bordered: false, style: { backgroundColor: "#F5F5F5" }, title: react_1.default.createElement(antd_1.Row, { gutter: 20 },
15
+ react_1.default.createElement(antd_1.Col, { span: 12 },
16
+ react_1.default.createElement(antd_1.Flex, { justify: "space-between", align: "flex-end", style: { fontWeight: 400 } },
17
+ react_1.default.createElement(antd_1.Typography.Text, null, props.intl.formatMessage(index_1.translationMessages.baseInformation_issueDate)),
18
+ react_1.default.createElement(antd_1.Typography.Text, { type: "secondary", style: { fontSize: token.fontSizeSM } }, (_a = props.form.getFieldValue(["invoice", "issueDate"])) === null || _a === void 0 ? void 0 : _a.format("DD.MM.YYYY")))),
19
+ react_1.default.createElement(antd_1.Col, { span: 12, style: { borderLeft: "1px solid ".concat(colors_1.grey[0]) } },
20
+ react_1.default.createElement(antd_1.Flex, { justify: "space-between", align: "flex-end", style: { fontWeight: 400 } },
21
+ react_1.default.createElement(antd_1.Typography.Text, null, props.intl.formatMessage(index_1.translationMessages.baseInformation_dueDate)),
22
+ react_1.default.createElement(antd_1.Typography.Text, { type: "secondary", style: { fontSize: token.fontSizeSM } }, (_b = props.form.getFieldValue(["invoice", "dueDate"])) === null || _b === void 0 ? void 0 : _b.format("DD.MM.YYYY"))))) },
23
+ react_1.default.createElement(antd_1.Flex, { vertical: true, gap: "small" },
24
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: token.fontSizeHeading4, fontWeight: 500 } },
25
+ props.intl.formatMessage(index_1.translationMessages.customer_title),
26
+ ":"),
27
+ react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" }, props.chosenCustomer.name),
28
+ react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
29
+ props.intl.formatMessage(index_1.translationMessages.customer_identifier),
30
+ ":",
31
+ " ",
32
+ props.chosenCustomer.identifier),
33
+ ((_c = props.chosenCustomer.address) === null || _c === void 0 ? void 0 : _c.streetNameAndNumber) &&
34
+ ((_d = props.chosenCustomer.address) === null || _d === void 0 ? void 0 : _d.postalZone) &&
35
+ ((_e = props.chosenCustomer.address) === null || _e === void 0 ? void 0 : _e.city) && (react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
36
+ props.intl.formatMessage(index_1.translationMessages.customer_address_streetNameAndNumber),
37
+ ": ",
38
+ props.chosenCustomer.address.streetNameAndNumber,
39
+ ",",
40
+ " ",
41
+ props.chosenCustomer.address.postalZone,
42
+ " ",
43
+ props.chosenCustomer.address.city)),
44
+ props.form.getFieldValue(["invoice", "customer", "locationIdentifier"]) && (react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
45
+ props.intl.formatMessage(index_1.translationMessages.baseInformation_costCenter),
46
+ ":",
47
+ " ",
48
+ props.form.getFieldValue(["invoice", "customer", "locationIdentifier"]))),
49
+ react_1.default.createElement(antd_1.Col, { span: 8, style: { padding: 0 } },
50
+ react_1.default.createElement("hr", null)),
51
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: token.fontSizeHeading4, fontWeight: 500 } },
52
+ props.intl.formatMessage(index_1.translationMessages.supplier_title),
53
+ ":"),
54
+ react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" }, props.form.getFieldValue(["invoice", "supplier", "name"])),
55
+ react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
56
+ props.intl.formatMessage(index_1.translationMessages.supplier_identifier),
57
+ ":",
58
+ " ",
59
+ props.form.getFieldValue(["invoice", "supplier", "identifier"])),
60
+ react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
61
+ props.intl.formatMessage(index_1.translationMessages.supplier_address_streetNameAndNumber),
62
+ ":",
63
+ " ",
64
+ props.form.getFieldValue(["invoice", "supplier", "address", "streetNameAndNumber",]),
65
+ ", ",
66
+ props.form.getFieldValue(["invoice", "supplier", "address", "postalZone"]),
67
+ " ",
68
+ props.form.getFieldValue(["invoice", "supplier", "address", "city"])),
69
+ props.form.getFieldValue(["invoice", "supplier", "contact", "telephone"]) && (react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
70
+ props.intl.formatMessage(index_1.translationMessages.supplier_contact_phoneNumber),
71
+ ":",
72
+ props.form.getFieldValue(["invoice", "supplier", "contact", "telephone"]))),
73
+ props.form.getFieldValue(["invoice", "supplier", "contact", "electronicMail"]) && (react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" }, props.form.getFieldValue(["invoice", "supplier", "contact", "electronicMail"]))))));
74
+ };
75
+ exports.default = (0, react_intl_1.injectIntl)(InvoicePreviewCustomerSupplierInfo);
@@ -0,0 +1,14 @@
1
+ import { FormInstance } from "antd";
2
+ import React from "react";
3
+ import { WrappedComponentProps } from "react-intl";
4
+ import { PartyMetadata } from "../../../../../unimaze-api-clients/lib/mapi";
5
+ interface Props extends WrappedComponentProps {
6
+ form: FormInstance;
7
+ chosenCustomer: PartyMetadata;
8
+ }
9
+ declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
10
+ forwardedRef?: React.Ref<any>;
11
+ } & React.RefAttributes<any>> & {
12
+ WrappedComponent: React.ComponentType<Props>;
13
+ };
14
+ export default _default;