@things-factory/tax-invoice 6.2.86 → 6.2.90
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/client/pages/tax-invoice/tax-invoice-detail-popup.ts +12 -6
- package/client/pages/tax-invoice/tax-invoice-list-page.ts +147 -176
- package/client/pages/tax-invoice-api/tax-invoice-api-page.ts +52 -114
- package/client/pages/tax-invoice-company/tax-invoice-company-importer.ts +2 -2
- package/client/pages/tax-invoice-send/tax-invoice-send-page.ts +580 -0
- package/client/route.ts +4 -4
- package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js +18 -9
- package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js.map +1 -1
- package/dist-client/pages/tax-invoice/tax-invoice-list-page.d.ts +63 -23
- package/dist-client/pages/tax-invoice/tax-invoice-list-page.js +149 -168
- package/dist-client/pages/tax-invoice/tax-invoice-list-page.js.map +1 -1
- package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.d.ts +3 -5
- package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js +52 -105
- package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js.map +1 -1
- package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.js +2 -2
- package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.js.map +1 -1
- package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.d.ts +100 -0
- package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js +510 -0
- package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js.map +1 -0
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +3 -3
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-mutation.js +132 -27
- package/dist-server/service/tax-invoice/tax-invoice-mutation.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-query.js +24 -1
- package/dist-server/service/tax-invoice/tax-invoice-query.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-type.js +22 -259
- package/dist-server/service/tax-invoice/tax-invoice-type.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice.js +22 -16
- package/dist-server/service/tax-invoice/tax-invoice.js.map +1 -1
- package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js +13 -21
- package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js.map +1 -1
- package/dist-server/service/tax-invoice-api/tax-invoice-api-query.js +4 -25
- package/dist-server/service/tax-invoice-api/tax-invoice-api-query.js.map +1 -1
- package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js +5 -0
- package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js.map +1 -1
- package/dist-server/service/tax-invoice-api/tax-invoice-api.js +7 -1
- package/dist-server/service/tax-invoice-api/tax-invoice-api.js.map +1 -1
- package/dist-server/service/tax-invoice-item/tax-invoice-item-query.js.map +1 -1
- package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js +4 -4
- package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js.map +1 -1
- package/dist-server/service/tax-invoice-item/tax-invoice-item.js +3 -3
- package/dist-server/service/tax-invoice-item/tax-invoice-item.js.map +1 -1
- package/dist-server/service/unipost-api/tax-invoice-inquiry.js +90 -0
- package/dist-server/service/unipost-api/tax-invoice-inquiry.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/server/service/tax-invoice/tax-invoice-mutation.ts +137 -36
- package/server/service/tax-invoice/tax-invoice-query.ts +21 -3
- package/server/service/tax-invoice/tax-invoice-type.ts +21 -199
- package/server/service/tax-invoice/tax-invoice.ts +38 -45
- package/server/service/tax-invoice-api/tax-invoice-api-mutation.ts +19 -33
- package/server/service/tax-invoice-api/tax-invoice-api-query.ts +4 -21
- package/server/service/tax-invoice-api/tax-invoice-api-type.ts +4 -0
- package/server/service/tax-invoice-api/tax-invoice-api.ts +7 -15
- package/server/service/tax-invoice-item/tax-invoice-item-query.ts +1 -1
- package/server/service/tax-invoice-item/tax-invoice-item-type.ts +4 -7
- package/server/service/tax-invoice-item/tax-invoice-item.ts +3 -3
- package/server/service/unipost-api/tax-invoice-inquiry.ts +103 -0
- package/translations/ko.json +10 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.callTaxInvoiceConfirm = exports.getTaxInvoiceByUniposApi = exports.UnipostTaxType = void 0;
|
|
4
|
+
const tax_invoice_1 = require("../tax-invoice/tax-invoice");
|
|
5
|
+
// import getTestTaxInvoiceData from './test-data'
|
|
6
|
+
// 세금계산서 조회 API
|
|
7
|
+
const INQUIRY_URL = {
|
|
8
|
+
dev: 'https://inf1dev.unipost.co.kr:47523/unitax/rest/v3/hometax/searchbills',
|
|
9
|
+
prod: 'https://inf1.unipost.co.kr/unitax/rest/v3/hometax/searchbills'
|
|
10
|
+
};
|
|
11
|
+
// 세금계산서 조회 후 처리 결과 갱신
|
|
12
|
+
const CONFIRM_URL = {
|
|
13
|
+
dev: 'https://inf1dev.unipost.co.kr:47523/unitax/rest/v3/hometax/updateBills',
|
|
14
|
+
prod: 'https://inf1.unipost.co.kr/unitax/rest/v3/hometax/updateBills'
|
|
15
|
+
};
|
|
16
|
+
var UnipostTaxType;
|
|
17
|
+
(function (UnipostTaxType) {
|
|
18
|
+
UnipostTaxType["EXPORT"] = "AR";
|
|
19
|
+
UnipostTaxType["IMPORT"] = "AP"; // 매입
|
|
20
|
+
})(UnipostTaxType = exports.UnipostTaxType || (exports.UnipostTaxType = {}));
|
|
21
|
+
async function getTaxInvoiceByUniposApi(businessRegistrationNumber, aid, bearer) {
|
|
22
|
+
if (!businessRegistrationNumber || !aid || !bearer) {
|
|
23
|
+
throw new Error('no parameter in unipos api');
|
|
24
|
+
}
|
|
25
|
+
const approvalNoList = [];
|
|
26
|
+
const taxList = [];
|
|
27
|
+
const taxTypeArr = [UnipostTaxType.EXPORT, UnipostTaxType.IMPORT];
|
|
28
|
+
// 매입, 매출 각각 요청
|
|
29
|
+
for (const taxType of taxTypeArr) {
|
|
30
|
+
const response = await _callTaxInvoiceInquiry(businessRegistrationNumber, aid, bearer, taxType);
|
|
31
|
+
// 성공 일시 세금 계산서 데이터 배열에 추가
|
|
32
|
+
if (response.status === 200) {
|
|
33
|
+
const category = taxType === 'AR' ? tax_invoice_1.Category.EXPORT : tax_invoice_1.Category.IMPORT;
|
|
34
|
+
const taxData = await response.json();
|
|
35
|
+
if (taxData.success === true) {
|
|
36
|
+
for (let tax of taxData.tAliceEntry) {
|
|
37
|
+
approvalNoList.push(tax.tid_issueid);
|
|
38
|
+
taxList.push(Object.assign(Object.assign({}, tax), { category }));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
// 테스트 코드
|
|
43
|
+
// const category = taxType === 'AR' ? Category.EXPORT : Category.IMPORT
|
|
44
|
+
// const taxData = getTestTaxInvoiceData(category)
|
|
45
|
+
// if (taxData.success === true) {
|
|
46
|
+
// for (let tax of taxData.tAliceEntry) {
|
|
47
|
+
// approvalNoList.push(tax.tid_issueid)
|
|
48
|
+
// taxList.push({ ...tax, category })
|
|
49
|
+
// }
|
|
50
|
+
// }
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
approvalNoList,
|
|
54
|
+
taxList
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
exports.getTaxInvoiceByUniposApi = getTaxInvoiceByUniposApi;
|
|
58
|
+
async function _callTaxInvoiceInquiry(businessRegistrationNumber, aid, bearer, taxType) {
|
|
59
|
+
const response = await fetch(INQUIRY_URL.dev, {
|
|
60
|
+
method: 'POST',
|
|
61
|
+
headers: {
|
|
62
|
+
'Content-Type': 'application/json',
|
|
63
|
+
Authorization: 'Basic ' + bearer,
|
|
64
|
+
AID: aid,
|
|
65
|
+
COM_REGNO: businessRegistrationNumber
|
|
66
|
+
},
|
|
67
|
+
body: JSON.stringify({
|
|
68
|
+
aid,
|
|
69
|
+
tax_type: taxType,
|
|
70
|
+
biz_no: businessRegistrationNumber,
|
|
71
|
+
period: 30
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
return response;
|
|
75
|
+
}
|
|
76
|
+
async function callTaxInvoiceConfirm(businessRegistrationNumber, aid, bearer, confirmData) {
|
|
77
|
+
const response = await fetch(CONFIRM_URL.dev, {
|
|
78
|
+
method: 'POST',
|
|
79
|
+
headers: {
|
|
80
|
+
'Content-Type': 'application/json',
|
|
81
|
+
Authorization: 'Basic ' + bearer,
|
|
82
|
+
AID: aid,
|
|
83
|
+
COM_REGNO: businessRegistrationNumber
|
|
84
|
+
},
|
|
85
|
+
body: JSON.stringify(confirmData)
|
|
86
|
+
});
|
|
87
|
+
return response;
|
|
88
|
+
}
|
|
89
|
+
exports.callTaxInvoiceConfirm = callTaxInvoiceConfirm;
|
|
90
|
+
//# sourceMappingURL=tax-invoice-inquiry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tax-invoice-inquiry.js","sourceRoot":"","sources":["../../../server/service/unipost-api/tax-invoice-inquiry.ts"],"names":[],"mappings":";;;AAAA,4DAAqD;AACrD,kDAAkD;AAElD,eAAe;AACf,MAAM,WAAW,GAAG;IAClB,GAAG,EAAE,wEAAwE;IAC7E,IAAI,EAAE,+DAA+D;CACtE,CAAA;AACD,sBAAsB;AACtB,MAAM,WAAW,GAAG;IAClB,GAAG,EAAE,wEAAwE;IAC7E,IAAI,EAAE,+DAA+D;CACtE,CAAA;AAED,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,+BAAa,CAAA;IACb,+BAAa,CAAA,CAAC,KAAK;AACrB,CAAC,EAHW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAGzB;AAUM,KAAK,UAAU,wBAAwB,CAAC,0BAAkC,EAAE,GAAW,EAAE,MAAc;IAC5G,IAAI,CAAC,0BAA0B,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,EA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AAE,MAAM;QACd,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,QAAQ,GAAG,MAAM;YAChC,GAAG,EAAE,GAAG;YACR,SAAS,EAAE,0BAA0B;SACtC;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,GAAG;YACH,QAAQ,EAAE,OAAO;YACjB,MAAM,EAAE,0BAA0B;YAClC,MAAM,EAAE,EAAE;SACX,CAAC;KACH,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAA;AACjB,CAAC;AACM,KAAK,UAAU,qBAAqB,CAAC,0BAAkC,EAAE,GAAW,EAAE,MAAc,EAAE,WAA0B;IACrI,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QAC5C,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,QAAQ,GAAG,MAAM;YAChC,GAAG,EAAE,GAAG;YACR,SAAS,EAAE,0BAA0B;SACtC;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;KAClC,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAA;AACjB,CAAC;AAbD,sDAaC","sourcesContent":["import { Category } from '../tax-invoice/tax-invoice'\n// import getTestTaxInvoiceData from './test-data'\n\n// 세금계산서 조회 API\nconst INQUIRY_URL = {\n dev: 'https://inf1dev.unipost.co.kr:47523/unitax/rest/v3/hometax/searchbills',\n prod: 'https://inf1.unipost.co.kr/unitax/rest/v3/hometax/searchbills'\n}\n// 세금계산서 조회 후 처리 결과 갱신\nconst CONFIRM_URL = {\n dev: 'https://inf1dev.unipost.co.kr:47523/unitax/rest/v3/hometax/updateBills',\n prod: 'https://inf1.unipost.co.kr/unitax/rest/v3/hometax/updateBills'\n}\n\nexport enum UnipostTaxType {\n EXPORT = 'AR', // 매출\n IMPORT = 'AP' // 매입\n}\n\nexport interface ConfirmData {\n aid: string\n tax_type: UnipostTaxType\n tid_issueid: string\n success: boolean\n message: string\n}\n\nexport async function getTaxInvoiceByUniposApi(businessRegistrationNumber: string, aid: string, bearer: string) {\n if (!businessRegistrationNumber || !aid || !bearer) {\n throw new Error('no parameter in unipos api')\n }\n\n const approvalNoList: Array<string> = []\n const taxList = []\n const taxTypeArr = [UnipostTaxType.EXPORT, UnipostTaxType.IMPORT]\n\n // 매입, 매출 각각 요청\n for (const taxType of taxTypeArr) {\n const response = await _callTaxInvoiceInquiry(businessRegistrationNumber, aid, bearer, taxType)\n\n // 성공 일시 세금 계산서 데이터 배열에 추가\n if (response.status === 200) {\n const category = taxType === 'AR' ? Category.EXPORT : Category.IMPORT\n const taxData = await response.json()\n\n if (taxData.success === true) {\n for (let tax of taxData.tAliceEntry) {\n approvalNoList.push(tax.tid_issueid)\n taxList.push({ ...tax, category })\n }\n }\n }\n\n // 테스트 코드\n // const category = taxType === 'AR' ? Category.EXPORT : Category.IMPORT\n // const taxData = getTestTaxInvoiceData(category)\n // if (taxData.success === true) {\n // for (let tax of taxData.tAliceEntry) {\n // approvalNoList.push(tax.tid_issueid)\n // taxList.push({ ...tax, category })\n // }\n // }\n }\n\n return {\n approvalNoList,\n taxList\n }\n}\n\nasync function _callTaxInvoiceInquiry(businessRegistrationNumber: string, aid: string, bearer: string, taxType: UnipostTaxType) {\n const response = await fetch(INQUIRY_URL.dev, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: 'Basic ' + bearer,\n AID: aid,\n COM_REGNO: businessRegistrationNumber\n },\n body: JSON.stringify({\n aid,\n tax_type: taxType,\n biz_no: businessRegistrationNumber,\n period: 30\n })\n })\n\n return response\n}\nexport async function callTaxInvoiceConfirm(businessRegistrationNumber: string, aid: string, bearer: string, confirmData: ConfirmData[]) {\n const response = await fetch(CONFIRM_URL.dev, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: 'Basic ' + bearer,\n AID: aid,\n COM_REGNO: businessRegistrationNumber\n },\n body: JSON.stringify(confirmData)\n })\n\n return response\n}\n"]}
|