@things-factory/tax-invoice 6.2.147 → 6.2.149
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-send/company-list-popup.ts +3 -0
- package/client/pages/tax-invoice-send/tax-invoice-send-page.ts +9 -898
- package/client/pages/tax-invoice-send/tax-invoice-send.ts +951 -0
- package/dist-client/pages/tax-invoice-send/company-list-popup.d.ts +3 -0
- package/dist-client/pages/tax-invoice-send/company-list-popup.js +3 -0
- 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.d.ts +2 -79
- package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js +8 -796
- 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.d.ts +112 -0
- package/dist-client/pages/tax-invoice-send/tax-invoice-send.js +869 -0
- package/dist-client/pages/tax-invoice-send/tax-invoice-send.js.map +1 -0
- package/dist-client/route.d.ts +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/index.js +1 -0
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-mutation.js +0 -4
- package/dist-server/service/tax-invoice/tax-invoice-mutation.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-query.js +18 -6
- package/dist-server/service/tax-invoice/tax-invoice-query.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-type.js +4 -0
- package/dist-server/service/tax-invoice/tax-invoice-type.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-util.js +1 -0
- package/dist-server/service/tax-invoice/tax-invoice-util.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice.js +5 -0
- package/dist-server/service/tax-invoice/tax-invoice.js.map +1 -1
- package/dist-server/service/unipost-api/test-data.js +3812 -0
- package/dist-server/service/unipost-api/test-data.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/server/service/index.ts +1 -0
- package/server/service/tax-invoice/tax-invoice-mutation.ts +0 -3
- package/server/service/tax-invoice/tax-invoice-query.ts +19 -7
- package/server/service/tax-invoice/tax-invoice-type.ts +3 -0
- package/server/service/tax-invoice/tax-invoice-util.ts +1 -0
- package/server/service/tax-invoice/tax-invoice.ts +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/tax-invoice",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.149",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "dist-client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"@things-factory/export-ui-excel": "^6.2.147",
|
|
35
35
|
"@things-factory/shell": "^6.2.147"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "adb6670393456383495523244763b982fe8ae857"
|
|
38
38
|
}
|
package/server/service/index.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export * from './tax-audit-result/tax-audit-result'
|
|
3
3
|
export * from './tax-invoice-item/tax-invoice-item'
|
|
4
4
|
export * from './tax-invoice/tax-invoice'
|
|
5
|
+
export * from './tax-invoice-company/tax-invoice-company'
|
|
5
6
|
|
|
6
7
|
/* IMPORT ENTITIES AND RESOLVERS */
|
|
7
8
|
import { entities as TaxAuditResultEntities, resolvers as TaxAuditResultResolvers, subscribers as TaxAuditResultSubscribers } from './tax-audit-result'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx } from 'type-graphql'
|
|
2
2
|
import { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'
|
|
3
3
|
import { User } from '@things-factory/auth-base'
|
|
4
|
-
import { TaxInvoice } from './tax-invoice'
|
|
4
|
+
import { Category, Purpose, TaxInvoice } from './tax-invoice'
|
|
5
5
|
import { TaxInvoiceList, TaxInvoiceSummary } from './tax-invoice-type'
|
|
6
6
|
import { TaxInvoiceItem } from '../tax-invoice-item/tax-invoice-item'
|
|
7
7
|
|
|
@@ -34,18 +34,30 @@ export class TaxInvoiceQuery {
|
|
|
34
34
|
@Query(returns => TaxInvoiceSummary, { description: 'To fetch TaxInvoices Summary' })
|
|
35
35
|
async taxInvoicesSummary(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<TaxInvoiceSummary> {
|
|
36
36
|
const { domain } = context.state
|
|
37
|
+
let category = params.filters.filter(v => v.name === 'category')?.[0]?.value
|
|
37
38
|
|
|
38
39
|
const queryBuilder = getQueryBuilderFromListParams({
|
|
39
40
|
domain,
|
|
40
41
|
params: { ...params, pagination: {} },
|
|
41
42
|
repository: await getRepository(TaxInvoice)
|
|
42
43
|
})
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
|
|
45
|
+
// 매입/매출이 있으면 그냥 가격으로 표시, 전체 조회면 매출-매입 으로 계산
|
|
46
|
+
if (category) {
|
|
47
|
+
queryBuilder
|
|
48
|
+
.select('COUNT(id)', 'cnt')
|
|
49
|
+
.addSelect('SUM(supply_amount)', 'supply_amount')
|
|
50
|
+
.addSelect('SUM(tax_amount)', 'tax_amount')
|
|
51
|
+
.addSelect('SUM(total_amount)', 'total_amount')
|
|
52
|
+
} else {
|
|
53
|
+
queryBuilder
|
|
54
|
+
.select('COUNT(id)', 'cnt')
|
|
55
|
+
.addSelect(`SUM(CASE WHEN category = \'${Category.EXPORT}\' THEN supply_amount ELSE -1 * supply_amount END)`, 'supply_amount')
|
|
56
|
+
.addSelect(`SUM(CASE WHEN category = \'${Category.EXPORT}\' THEN tax_amount ELSE -1 * tax_amount END)`, 'tax_amount')
|
|
57
|
+
.addSelect(`SUM(CASE WHEN category = \'${Category.EXPORT}\' THEN total_amount ELSE -1 * total_amount END)`, 'total_amount')
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const summary = await queryBuilder.getRawOne()
|
|
49
61
|
|
|
50
62
|
return { summary }
|
|
51
63
|
}
|
|
@@ -150,6 +150,7 @@ export function parseTaxInvoiceByUnipostFormat(unipostTaxInvoice: UnipostTaxInvo
|
|
|
150
150
|
remark0: unipostTaxInvoice.tid_desc0,
|
|
151
151
|
remark1: unipostTaxInvoice.tid_desc1,
|
|
152
152
|
remark2: unipostTaxInvoice.tid_desc2,
|
|
153
|
+
isSentByApi: true,
|
|
153
154
|
category: category,
|
|
154
155
|
supplierBusinessRegistrationCategory: unipostTaxInvoice.tit_alice_specorg_biztypecode,
|
|
155
156
|
supplierBusinessRegistrationNumber: unipostTaxInvoice.tit_alice_id,
|
|
@@ -146,6 +146,10 @@ export class TaxInvoice {
|
|
|
146
146
|
@Field({ nullable: true, description: '비고2' })
|
|
147
147
|
remark2?: string
|
|
148
148
|
|
|
149
|
+
@Column({ nullable: true, default: false, comment: 'API를 통한 발행 여부' })
|
|
150
|
+
@Field({ nullable: true, description: 'API를 통한 발행 여부' })
|
|
151
|
+
isSentByApi?: boolean
|
|
152
|
+
|
|
149
153
|
@Column({ nullable: true, comment: '공급자 사업자등록번호 구분 코드' })
|
|
150
154
|
@Field({ nullable: true, description: '공급자 사업자등록번호 구분 코드' })
|
|
151
155
|
supplierBusinessRegistrationCategory?: BusinessRegistrationCategory
|