@unimaze/billing 0.9.0 → 0.10.1
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/utils/ApiUtility.js
CHANGED
|
@@ -32,10 +32,28 @@ var initialiseMessageApi = function (mapiBaseUrl) {
|
|
|
32
32
|
return new api_clients_1.mapi.MessageApi(initiatedConfig);
|
|
33
33
|
};
|
|
34
34
|
var submitDocument = function (data, attachDocument, mapiBaseUrl, apiKey) {
|
|
35
|
-
var messageApi = initialiseMessageApi(mapiBaseUrl);
|
|
36
35
|
var messageId = attachDocument.messageId, name = attachDocument.name, contentType = attachDocument.contentType, more = attachDocument.more;
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
return axios_1.default.post(mapiBaseUrl + "/api/v1/messages/" + messageId + "/documents", data, {
|
|
37
|
+
params: {
|
|
38
|
+
name: name,
|
|
39
|
+
contentType: contentType,
|
|
40
|
+
more: more
|
|
41
|
+
},
|
|
42
|
+
headers: __assign({}, (apiKey && { Authorization: "Bearer " + window.btoa(apiKey) }), { "Content-Type": "application/octet-stream" })
|
|
43
|
+
});
|
|
44
|
+
// const messageApi = initialiseMessageApi(mapiBaseUrl);
|
|
45
|
+
//
|
|
46
|
+
// const options = createOptionsData(data, apiKey)
|
|
47
|
+
// return messageApi.addDocuments(
|
|
48
|
+
// messageId,
|
|
49
|
+
// name,
|
|
50
|
+
// contentType,
|
|
51
|
+
// more,
|
|
52
|
+
// undefined,
|
|
53
|
+
// undefined,
|
|
54
|
+
// undefined,
|
|
55
|
+
// options
|
|
56
|
+
// )
|
|
39
57
|
};
|
|
40
58
|
exports.submitDocument = submitDocument;
|
|
41
59
|
var submitInvoice = function (createSubmitInvoice, mapiBaseUrl, apiKey, callName, language) {
|
|
@@ -7,4 +7,4 @@ export declare const calculateTaxableAmount: (discountValue: string | null | und
|
|
|
7
7
|
export declare const calculateTaxAmount: (taxableAmount: number, taxPercentage: number) => number;
|
|
8
8
|
export declare const calculateTaxPercentage: (taxCategoryType: TaxCategoryTypeEnum) => number;
|
|
9
9
|
export declare const generateTaxCategoryLabel: (taxCategoryType: TaxCategoryTypeEnum, taxCategoryTypeTranslated: string) => string;
|
|
10
|
-
export declare const getCorrectInputNode: (dataIdx: "key" | "name" | "description" | "referenceIdentifiers" | "notes" | "accountingCost" | "billingPeriod" | "unitOfMeasure" | "taxCategoryType" | "itemNo" | "quantity" | "unitPriceAmount" | "taxableAmount" | "taxAmount" | "taxPercentage" | "discountValue" | "discountReason" | "
|
|
10
|
+
export declare const getCorrectInputNode: (dataIdx: "key" | "name" | "description" | "referenceIdentifiers" | "notes" | "accountingCost" | "billingPeriod" | "unitOfMeasure" | "taxCategoryType" | "itemNo" | "quantity" | "unitPriceAmount" | "taxableAmount" | "taxAmount" | "taxPercentage" | "discountValue" | "discountReason" | "buyersItemNo" | "standardItemNo" | "originCountryCode" | "commodityClassification" | "additionalItemProperties" | "orderLineReference") => React.ReactChild;
|
|
@@ -35,15 +35,16 @@ var isEmpty = function (map) {
|
|
|
35
35
|
};
|
|
36
36
|
var getIdentifierWithPrefix = function (identifier) {
|
|
37
37
|
if (!identifier.startsWith("0196:")) {
|
|
38
|
-
return "0196:" + identifier
|
|
38
|
+
return "0196:" + cleanIdentifier(identifier);
|
|
39
39
|
}
|
|
40
40
|
else {
|
|
41
|
-
return
|
|
41
|
+
return cleanIdentifier(identifier);
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
|
|
45
|
-
//
|
|
46
|
-
//
|
|
44
|
+
var cleanIdentifier = function (identifier) {
|
|
45
|
+
// return identifier.replace(/[^0-9]/g, "") // replace anything that isn't a numeric character
|
|
46
|
+
return identifier.replace("-", ""); // remove the '-'
|
|
47
|
+
};
|
|
47
48
|
var convertToInvoiceMetadataInput = function (formValues, billingLines, paymentMethod, chosenCustomer) {
|
|
48
49
|
var issueDate = convertDates(formValues.invoice.issueDate);
|
|
49
50
|
var dueDate = convertDates(formValues.invoice.dueDate);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unimaze/billing",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@ant-design/compatible": "latest",
|
|
12
12
|
"@types/react-google-recaptcha": "^2.1.0",
|
|
13
|
-
"@unimaze/api-clients": "
|
|
13
|
+
"@unimaze/api-clients": "1.2.1",
|
|
14
14
|
"antd-mask-input": "^0.1.13",
|
|
15
15
|
"react-google-recaptcha": "^2.1.0",
|
|
16
16
|
"react-hot-loader": "^4.12.20",
|