@things-factory/tax-invoice 6.2.177 → 6.2.178
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/dist-client/pages/main.js.map +1 -1
- package/dist-client/pages/tax-audit-result/tax-audit-result-importer.js.map +1 -1
- package/dist-client/pages/tax-audit-result/tax-audit-result-list-page.js.map +1 -1
- 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 +5 -5
- 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.js.map +1 -1
- package/dist-client/pages/tax-invoice-company/tax-invoice-company-list-page.js.map +1 -1
- package/dist-client/pages/tax-invoice-send/company-list-popup.js.map +1 -1
- package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js +1 -1
- package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js.map +1 -1
- package/dist-client/pages/tax-invoice-send/tax-invoice-send.js +1 -1
- package/dist-client/pages/tax-invoice-send/tax-invoice-send.js.map +1 -1
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/index.d.ts +2 -0
- package/dist-server/routes.d.ts +1 -0
- package/dist-server/service/index.d.ts +9 -0
- package/dist-server/service/tax-audit-result/event-subscriber.d.ts +7 -0
- package/dist-server/service/tax-audit-result/event-subscriber.js +2 -2
- package/dist-server/service/tax-audit-result/event-subscriber.js.map +1 -1
- package/dist-server/service/tax-audit-result/index.d.ts +7 -0
- package/dist-server/service/tax-audit-result/tax-audit-result-history.d.ts +25 -0
- package/dist-server/service/tax-audit-result/tax-audit-result-history.js +2 -2
- package/dist-server/service/tax-audit-result/tax-audit-result-history.js.map +1 -1
- package/dist-server/service/tax-audit-result/tax-audit-result-mutation.d.ts +10 -0
- package/dist-server/service/tax-audit-result/tax-audit-result-mutation.js +2 -2
- package/dist-server/service/tax-audit-result/tax-audit-result-mutation.js.map +1 -1
- package/dist-server/service/tax-audit-result/tax-audit-result-query.d.ts +12 -0
- package/dist-server/service/tax-audit-result/tax-audit-result-query.js +2 -2
- package/dist-server/service/tax-audit-result/tax-audit-result-query.js.map +1 -1
- package/dist-server/service/tax-audit-result/tax-audit-result-type.d.ts +23 -0
- package/dist-server/service/tax-audit-result/tax-audit-result-type.js +6 -6
- package/dist-server/service/tax-audit-result/tax-audit-result-type.js.map +1 -1
- package/dist-server/service/tax-audit-result/tax-audit-result.d.ts +25 -0
- package/dist-server/service/tax-audit-result/tax-audit-result.js +3 -3
- package/dist-server/service/tax-audit-result/tax-audit-result.js.map +1 -1
- package/dist-server/service/tax-invoice/index.d.ts +5 -0
- package/dist-server/service/tax-invoice/tax-invoice-mutation.d.ts +10 -0
- package/dist-server/service/tax-invoice/tax-invoice-mutation.js +2 -2
- package/dist-server/service/tax-invoice/tax-invoice-mutation.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-query.d.ts +14 -0
- package/dist-server/service/tax-invoice/tax-invoice-query.js +2 -2
- package/dist-server/service/tax-invoice/tax-invoice-query.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-type.d.ts +86 -0
- package/dist-server/service/tax-invoice/tax-invoice-type.js +8 -8
- package/dist-server/service/tax-invoice/tax-invoice-type.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-util.d.ts +133 -0
- package/dist-server/service/tax-invoice/tax-invoice-util.js +1 -2
- package/dist-server/service/tax-invoice/tax-invoice-util.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice.d.ts +120 -0
- package/dist-server/service/tax-invoice/tax-invoice.js +7 -7
- package/dist-server/service/tax-invoice/tax-invoice.js.map +1 -1
- package/dist-server/service/tax-invoice-api/index.d.ts +5 -0
- package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.d.ts +8 -0
- package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js +2 -2
- 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.d.ts +10 -0
- package/dist-server/service/tax-invoice-api/tax-invoice-api-query.js +2 -2
- 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.d.ts +33 -0
- package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js +6 -6
- 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.d.ts +31 -0
- package/dist-server/service/tax-invoice-api/tax-invoice-api.js +2 -2
- package/dist-server/service/tax-invoice-api/tax-invoice-api.js.map +1 -1
- package/dist-server/service/tax-invoice-company/index.d.ts +5 -0
- package/dist-server/service/tax-invoice-company/tax-invoice-company-mutation.d.ts +7 -0
- package/dist-server/service/tax-invoice-company/tax-invoice-company-mutation.js +2 -2
- package/dist-server/service/tax-invoice-company/tax-invoice-company-mutation.js.map +1 -1
- package/dist-server/service/tax-invoice-company/tax-invoice-company-query.d.ts +14 -0
- package/dist-server/service/tax-invoice-company/tax-invoice-company-query.js +2 -2
- package/dist-server/service/tax-invoice-company/tax-invoice-company-query.js.map +1 -1
- package/dist-server/service/tax-invoice-company/tax-invoice-company-type.d.ts +38 -0
- package/dist-server/service/tax-invoice-company/tax-invoice-company-type.js +6 -6
- package/dist-server/service/tax-invoice-company/tax-invoice-company-type.js.map +1 -1
- package/dist-server/service/tax-invoice-company/tax-invoice-company.d.ts +29 -0
- package/dist-server/service/tax-invoice-company/tax-invoice-company.js +2 -2
- package/dist-server/service/tax-invoice-company/tax-invoice-company.js.map +1 -1
- package/dist-server/service/tax-invoice-item/index.d.ts +5 -0
- package/dist-server/service/tax-invoice-item/tax-invoice-item-mutation.d.ts +10 -0
- package/dist-server/service/tax-invoice-item/tax-invoice-item-mutation.js +2 -2
- package/dist-server/service/tax-invoice-item/tax-invoice-item-mutation.js.map +1 -1
- package/dist-server/service/tax-invoice-item/tax-invoice-item-query.d.ts +11 -0
- package/dist-server/service/tax-invoice-item/tax-invoice-item-query.js +2 -2
- 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.d.ts +29 -0
- package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js +6 -6
- 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.d.ts +23 -0
- package/dist-server/service/tax-invoice-item/tax-invoice-item.js +2 -2
- package/dist-server/service/tax-invoice-item/tax-invoice-item.js.map +1 -1
- package/dist-server/service/unipost-api/tax-invoice-inquiry.d.ts +16 -0
- package/dist-server/service/unipost-api/tax-invoice-inquiry.js +4 -4
- package/dist-server/service/unipost-api/tax-invoice-inquiry.js.map +1 -1
- package/dist-server/service/unipost-api/tax-invoice-send.d.ts +1 -0
- package/dist-server/service/unipost-api/tax-invoice-send.js +1 -2
- package/dist-server/service/unipost-api/tax-invoice-send.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tax-invoice-item.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-item/tax-invoice-item.ts"],"names":[],"mappings":";;;;AAAA,qCAA8I;AAC9I,+CAAoD;AAEpD,iDAAgE;AAChE,yDAAgD;AAChD,4DAAuD;AAMhD,IAAM,cAAc,GAApB,MAAM,cAAc;CAqE1B,CAAA;
|
|
1
|
+
{"version":3,"file":"tax-invoice-item.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-item/tax-invoice-item.ts"],"names":[],"mappings":";;;;AAAA,qCAA8I;AAC9I,+CAAoD;AAEpD,iDAAgE;AAChE,yDAAgD;AAChD,4DAAuD;AAMhD,IAAM,cAAc,GAApB,MAAM,cAAc;CAqE1B,CAAA;AArEY,wCAAc;AAGhB;IAFR,IAAA,gCAAsB,E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BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;iDAAA;AAIhB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;iDAAA;AAIhB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;+CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,cAA8B,EAAE,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC;;iDACrD;yBApEP,cAAc;IAJ1B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,uBAAuB,EAAE,CAAC,cAA8B,EAAE,EAAE,CAAC,CAAC,cAAc,CAAC,MAAM,EAAE,cAAc,CAAC,EAAE,EAAE,cAAc,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC1J,IAAA,eAAK,EAAC,uBAAuB,EAAE,CAAC,cAA8B,EAAE,EAAE,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IAC/F,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;GAC5C,cAAc,CAqE1B","sourcesContent":["import { CreateDateColumn, DeleteDateColumn, Entity, Index, Column, JoinColumn, RelationId, ManyToOne, PrimaryGeneratedColumn } from 'typeorm'\nimport { ObjectType, Field, ID } from 'type-graphql'\n\nimport { Domain, roundTransformer } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { TaxInvoice } from '../tax-invoice/tax-invoice'\n\n@Entity()\n@Index('ix_tax_invoice_item_0', (taxInvoiceItem: TaxInvoiceItem) => [taxInvoiceItem.domain, taxInvoiceItem.id, taxInvoiceItem.deletedAt], { unique: true })\n@Index('ix_tax_invoice_item_1', (taxInvoiceItem: TaxInvoiceItem) => [taxInvoiceItem.taxInvoice])\n@ObjectType({ description: 'Entity for TaxInvoiceItem' })\nexport class TaxInvoiceItem {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id!: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((taxInvoiceItem: TaxInvoiceItem) => taxInvoiceItem.domain)\n domainId?: string\n\n @ManyToOne(type => TaxInvoice, taxInvoice => taxInvoice.taxInvoiceItems)\n @Field({ nullable: false })\n taxInvoice!: TaxInvoice\n\n @RelationId((taxInvoiceItem: TaxInvoiceItem) => taxInvoiceItem.taxInvoice)\n taxInvoiceId!: string\n\n @Column({ nullable: true, comment: '아이템 일련번호' })\n @Field({ nullable: true, description: '아이템 일련번호' })\n sequence?: number\n\n @Column({ nullable: false, comment: '공급년월일(YYYY-MM-DD)' })\n @Field({ nullable: false, description: '공급년월일(YYYY-MM-DD)' })\n supplyDate!: Date\n\n @Column({ nullable: false, comment: '품목명' })\n @Field({ nullable: false, description: '품목명' })\n itemName!: string\n\n @Column({ nullable: false, comment: '규격' })\n @Field({ nullable: false, description: '규격' })\n specification!: string\n\n @Column('float', { nullable: false, comment: '수량 (소수점 2자리까지 허용)', transformer: roundTransformer })\n @Field({ nullable: false, description: '수량 (소수점 2자리까지 허용)' })\n quantity!: number\n\n @Column('float', { nullable: false, comment: '단가 (소수점 2자리까지 허용)', transformer: roundTransformer })\n @Field({ nullable: false, description: '단가 (소수점 2자리까지 허용)' })\n unitPrice!: number\n\n @Column({ nullable: false, comment: '공급 가액' })\n @Field({ nullable: false, description: '공급 가액' })\n supplyPrice!: number\n\n @Column({ nullable: false, comment: '세액' })\n @Field({ nullable: false, description: '세액' })\n taxPrice!: number\n\n @Column({ nullable: true, comment: '비고' })\n @Field({ nullable: true, description: '비고' })\n remark?: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((taxInvoiceItem: TaxInvoiceItem) => taxInvoiceItem.creator)\n creatorId?: string\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare enum UnipostTaxType {
|
|
2
|
+
EXPORT = "AR",// 매출
|
|
3
|
+
IMPORT = "AP"
|
|
4
|
+
}
|
|
5
|
+
export interface ConfirmData {
|
|
6
|
+
aid: string;
|
|
7
|
+
tax_type: UnipostTaxType;
|
|
8
|
+
tid_issueid: string;
|
|
9
|
+
success: boolean;
|
|
10
|
+
message: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function getTaxInvoiceByUniposApi(businessRegistrationNumber: string, aid: string, bearer: string): Promise<{
|
|
13
|
+
issueNoList: string[];
|
|
14
|
+
taxList: any[];
|
|
15
|
+
}>;
|
|
16
|
+
export declare function callTaxInvoiceConfirm(businessRegistrationNumber: string, aid: string, bearer: string, confirmData: ConfirmData[]): Promise<Response>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.UnipostTaxType = void 0;
|
|
4
|
+
exports.getTaxInvoiceByUniposApi = getTaxInvoiceByUniposApi;
|
|
5
|
+
exports.callTaxInvoiceConfirm = callTaxInvoiceConfirm;
|
|
4
6
|
const tax_invoice_1 = require("../tax-invoice/tax-invoice");
|
|
5
7
|
const env_1 = require("@things-factory/env");
|
|
6
8
|
// import getTestTaxInvoiceData from './test-data'
|
|
@@ -13,7 +15,7 @@ var UnipostTaxType;
|
|
|
13
15
|
(function (UnipostTaxType) {
|
|
14
16
|
UnipostTaxType["EXPORT"] = "AR";
|
|
15
17
|
UnipostTaxType["IMPORT"] = "AP"; // 매입
|
|
16
|
-
})(UnipostTaxType
|
|
18
|
+
})(UnipostTaxType || (exports.UnipostTaxType = UnipostTaxType = {}));
|
|
17
19
|
async function getTaxInvoiceByUniposApi(businessRegistrationNumber, aid, bearer) {
|
|
18
20
|
if (!businessRegistrationNumber || !aid || !bearer) {
|
|
19
21
|
throw new Error('no parameter in unipos api');
|
|
@@ -50,7 +52,6 @@ async function getTaxInvoiceByUniposApi(businessRegistrationNumber, aid, bearer)
|
|
|
50
52
|
taxList
|
|
51
53
|
};
|
|
52
54
|
}
|
|
53
|
-
exports.getTaxInvoiceByUniposApi = getTaxInvoiceByUniposApi;
|
|
54
55
|
async function _callTaxInvoiceInquiry(businessRegistrationNumber, aid, bearer, taxType) {
|
|
55
56
|
const response = await fetch(INQUIRY_URL, {
|
|
56
57
|
method: 'POST',
|
|
@@ -82,5 +83,4 @@ async function callTaxInvoiceConfirm(businessRegistrationNumber, aid, bearer, co
|
|
|
82
83
|
});
|
|
83
84
|
return response;
|
|
84
85
|
}
|
|
85
|
-
exports.callTaxInvoiceConfirm = callTaxInvoiceConfirm;
|
|
86
86
|
//# sourceMappingURL=tax-invoice-inquiry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tax-invoice-inquiry.js","sourceRoot":"","sources":["../../../server/service/unipost-api/tax-invoice-inquiry.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"tax-invoice-inquiry.js","sourceRoot":"","sources":["../../../server/service/unipost-api/tax-invoice-inquiry.ts"],"names":[],"mappings":";;;AAuBA,4DAyCC;AAqBD,sDAaC;AAlGD,4DAAqD;AACrD,6CAA4C;AAC5C,kDAAkD;AAElD,MAAM,aAAa,GAAG,YAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;AAC9C,eAAe;AACf,MAAM,WAAW,GAAG,aAAa,CAAC,WAAW,IAAI,EAAE,CAAA;AACnD,sBAAsB;AACtB,MAAM,WAA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ACH,CAAC;QACH,CAAC;QAED,SAAS;QACT,wEAAwE;QACxE,kDAAkD;QAClD,kCAAkC;QAClC,2CAA2C;QAC3C,mCAAmC;QACnC,yCAAyC;QACzC,MAAM;QACN,IAAI;IACN,CAAC;IAED,OAAO;QACL,WAAW;QACX,OAAO;KACR,CAAA;AACH,CAAC;AAED,KAAK,UAAU,sBAAsB,CAAC,0BAAkC,EAAE,GAAW,EAAE,MAAc,EAAE,OAAuB;IAC5H,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,WAAW,EAAE;QACxC,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;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,EAAE;QACxC,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","sourcesContent":["import { Category } from '../tax-invoice/tax-invoice'\nimport { config } from '@things-factory/env'\n// import getTestTaxInvoiceData from './test-data'\n\nconst UNITAX_CONFIG = config.get('unitax', {})\n// 세금계산서 조회 API\nconst INQUIRY_URL = UNITAX_CONFIG.INQUIRY_URL || ''\n// 세금계산서 조회 후 처리 결과 갱신\nconst CONFIRM_URL = UNITAX_CONFIG.CONFIRM_URL || ''\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 issueNoList: 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 issueNoList.push(tax.exd_id)\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 // issueNoList.push(tax.exd_id)\n // taxList.push({ ...tax, category })\n // }\n // }\n }\n\n return {\n issueNoList,\n taxList\n }\n}\n\nasync function _callTaxInvoiceInquiry(businessRegistrationNumber: string, aid: string, bearer: string, taxType: UnipostTaxType) {\n const response = await fetch(INQUIRY_URL, {\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, {\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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sendTaxInvoiceByUniposApi(businessRegistrationNumber: string, aid: string, bearer: string, taxInvoiceSendList: any): Promise<any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sendTaxInvoiceByUniposApi =
|
|
3
|
+
exports.sendTaxInvoiceByUniposApi = sendTaxInvoiceByUniposApi;
|
|
4
4
|
const env_1 = require("@things-factory/env");
|
|
5
5
|
const UNITAX_CONFIG = env_1.config.get('unitax', {});
|
|
6
6
|
// 세금계산서 발행 API
|
|
@@ -12,7 +12,6 @@ async function sendTaxInvoiceByUniposApi(businessRegistrationNumber, aid, bearer
|
|
|
12
12
|
const response = await _callTaxInvoiceSend(businessRegistrationNumber, aid, bearer, taxInvoiceSendList);
|
|
13
13
|
return (response === null || response === void 0 ? void 0 : response.status) === 200 ? await response.json() : false;
|
|
14
14
|
}
|
|
15
|
-
exports.sendTaxInvoiceByUniposApi = sendTaxInvoiceByUniposApi;
|
|
16
15
|
async function _callTaxInvoiceSend(businessRegistrationNumber, aid, bearer, taxInvoiceSendList) {
|
|
17
16
|
try {
|
|
18
17
|
return await fetch(SEND_URL, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tax-invoice-send.js","sourceRoot":"","sources":["../../../server/service/unipost-api/tax-invoice-send.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tax-invoice-send.js","sourceRoot":"","sources":["../../../server/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AAC","sourcesContent":["import { config } from '@things-factory/env'\n\nconst UNITAX_CONFIG = config.get('unitax', {})\n// 세금계산서 발행 API\nconst SEND_URL = UNITAX_CONFIG.SEND_URL || ''\n\nexport async function sendTaxInvoiceByUniposApi(businessRegistrationNumber: string, aid: string, bearer: string, taxInvoiceSendList) {\n if (!businessRegistrationNumber || !aid || !bearer || !taxInvoiceSendList) {\n throw new Error('no parameter in unipos api')\n }\n\n const response = await _callTaxInvoiceSend(businessRegistrationNumber, aid, bearer, taxInvoiceSendList)\n\n return response?.status === 200 ? await response.json() : false\n}\n\nasync function _callTaxInvoiceSend(businessRegistrationNumber: string, aid: string, bearer: string, taxInvoiceSendList) {\n try {\n return await fetch(SEND_URL, {\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(taxInvoiceSendList)\n })\n } catch (e) {\n console.log('e : ', e)\n }\n}\n"]}
|