@things-factory/tax-invoice 6.2.84 → 6.2.86
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 +23 -6
- package/client/pages/tax-invoice/tax-invoice-list-page.ts +34 -7
- package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js +22 -5
- package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js.map +1 -1
- package/dist-client/pages/tax-invoice/tax-invoice-list-page.js +29 -4
- package/dist-client/pages/tax-invoice/tax-invoice-list-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-mutation.js +12 -21
- package/dist-server/service/tax-invoice/tax-invoice-mutation.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-query.js +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-query.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice.js +0 -8
- package/dist-server/service/tax-invoice/tax-invoice.js.map +1 -1
- package/dist-server/service/tax-invoice-api/tax-invoice-api.js +0 -8
- package/dist-server/service/tax-invoice-api/tax-invoice-api.js.map +1 -1
- package/dist-server/service/tax-invoice-company/tax-invoice-company.js +0 -8
- package/dist-server/service/tax-invoice-company/tax-invoice-company.js.map +1 -1
- package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js +0 -8
- 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 -12
- package/dist-server/service/tax-invoice-item/tax-invoice-item.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/server/service/tax-invoice/tax-invoice-mutation.ts +14 -17
- package/server/service/tax-invoice/tax-invoice-query.ts +1 -1
- package/server/service/tax-invoice/tax-invoice.ts +0 -4
- package/server/service/tax-invoice-api/tax-invoice-api.ts +0 -4
- package/server/service/tax-invoice-company/tax-invoice-company.ts +0 -4
- package/server/service/tax-invoice-item/tax-invoice-item-type.ts +0 -6
- package/server/service/tax-invoice-item/tax-invoice-item.ts +3 -7
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.86",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "dist-client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"@things-factory/export-ui-excel": "^6.2.84",
|
|
34
34
|
"@things-factory/shell": "^6.2.84"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "f90a5c1ff2a93331bb6e375944972dc68dde8a1f"
|
|
37
37
|
}
|
|
@@ -3,22 +3,33 @@ import { In } from 'typeorm'
|
|
|
3
3
|
|
|
4
4
|
import { TaxInvoice } from './tax-invoice'
|
|
5
5
|
import { NewTaxInvoice, TaxInvoicePatch } from './tax-invoice-type'
|
|
6
|
+
import { NewTaxInvoiceItem } from '../tax-invoice-item/tax-invoice-item-type'
|
|
7
|
+
import { TaxInvoiceItem } from '../tax-invoice-item/tax-invoice-item'
|
|
6
8
|
|
|
7
9
|
@Resolver(TaxInvoice)
|
|
8
10
|
export class TaxInvoiceMutation {
|
|
9
11
|
@Directive('@transaction')
|
|
10
12
|
@Mutation(returns => TaxInvoice, { description: 'To create new TaxInvoice' })
|
|
11
|
-
async createTaxInvoice(
|
|
13
|
+
async createTaxInvoice(
|
|
14
|
+
@Arg('taxInvoice') taxInvoice: NewTaxInvoice,
|
|
15
|
+
@Arg('taxInvoiceItems', () => [NewTaxInvoiceItem]) taxInvoiceItems: NewTaxInvoiceItem[],
|
|
16
|
+
@Ctx() context: ResolverContext
|
|
17
|
+
): Promise<TaxInvoice> {
|
|
12
18
|
const { domain, user, tx } = context.state
|
|
13
19
|
|
|
14
|
-
const
|
|
20
|
+
const newTaxInvoice = await tx.getRepository(TaxInvoice).save({
|
|
15
21
|
...taxInvoice,
|
|
16
22
|
domain,
|
|
17
23
|
creator: user,
|
|
18
24
|
updater: user
|
|
19
25
|
})
|
|
20
26
|
|
|
21
|
-
|
|
27
|
+
// 아이템 저장
|
|
28
|
+
for (const item of taxInvoiceItems) {
|
|
29
|
+
await tx.getRepository(TaxInvoiceItem).save({ ...item, taxInvoice: newTaxInvoice, domain, creator: user })
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return newTaxInvoice
|
|
22
33
|
}
|
|
23
34
|
|
|
24
35
|
@Directive('@transaction')
|
|
@@ -105,18 +116,4 @@ export class TaxInvoiceMutation {
|
|
|
105
116
|
|
|
106
117
|
return true
|
|
107
118
|
}
|
|
108
|
-
|
|
109
|
-
@Directive('@transaction')
|
|
110
|
-
@Mutation(returns => Boolean, { description: 'To import multiple TaxInvoices' })
|
|
111
|
-
async importTaxInvoices(@Arg('taxInvoices', type => [TaxInvoicePatch]) taxInvoices: TaxInvoicePatch[], @Ctx() context: ResolverContext): Promise<boolean> {
|
|
112
|
-
const { domain, tx } = context.state
|
|
113
|
-
|
|
114
|
-
await Promise.all(
|
|
115
|
-
taxInvoices.map(async (taxInvoice: TaxInvoicePatch) => {
|
|
116
|
-
const createdTaxInvoice: TaxInvoice = await tx.getRepository(TaxInvoice).save({ domain, ...taxInvoice })
|
|
117
|
-
})
|
|
118
|
-
)
|
|
119
|
-
|
|
120
|
-
return true
|
|
121
|
-
}
|
|
122
119
|
}
|
|
@@ -34,7 +34,7 @@ export class TaxInvoiceQuery {
|
|
|
34
34
|
|
|
35
35
|
@FieldResolver(type => [TaxInvoiceItem])
|
|
36
36
|
async taxInvoiceItems(@Root() taxInvoice: TaxInvoice): Promise<TaxInvoiceItem[]> {
|
|
37
|
-
return taxInvoice.id && (await getRepository(TaxInvoiceItem).findBy({
|
|
37
|
+
return taxInvoice.id && (await getRepository(TaxInvoiceItem).findBy({ taxInvoice: { id: taxInvoice.id } }))
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
@FieldResolver(type => Domain)
|
|
@@ -6,9 +6,6 @@ import { TaxInvoiceItem } from './tax-invoice-item'
|
|
|
6
6
|
|
|
7
7
|
@InputType()
|
|
8
8
|
export class NewTaxInvoiceItem {
|
|
9
|
-
@Field({ nullable: false, description: '세금계산서 번호' })
|
|
10
|
-
taxInvoiceId: string
|
|
11
|
-
|
|
12
9
|
@Field(type => Int, { nullable: false, description: '아이템 일련번호' })
|
|
13
10
|
sequence: number
|
|
14
11
|
|
|
@@ -42,9 +39,6 @@ export class TaxInvoiceItemPatch {
|
|
|
42
39
|
@Field(type => ID, { nullable: false })
|
|
43
40
|
id?: string
|
|
44
41
|
|
|
45
|
-
@Field({ nullable: false, description: '세금계산서 번호' })
|
|
46
|
-
taxInvoiceId: string
|
|
47
|
-
|
|
48
42
|
@Field(type => Int, { nullable: false, description: '아이템 일련번호' })
|
|
49
43
|
sequence: number
|
|
50
44
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateDateColumn,
|
|
1
|
+
import { CreateDateColumn, DeleteDateColumn, Entity, Index, Column, JoinColumn, RelationId, ManyToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
2
2
|
import { ObjectType, Field, ID } from 'type-graphql'
|
|
3
3
|
|
|
4
4
|
import { Domain } from '@things-factory/shell'
|
|
@@ -7,17 +7,13 @@ import { TaxInvoice } from '../tax-invoice/tax-invoice'
|
|
|
7
7
|
|
|
8
8
|
@Entity()
|
|
9
9
|
@Index('ix_tax_invoice_item_0', (taxInvoiceItem: TaxInvoiceItem) => [taxInvoiceItem.domain, taxInvoiceItem.id, taxInvoiceItem.deletedAt], { unique: true })
|
|
10
|
-
|
|
10
|
+
@Index('ix_tax_invoice_item_1', (taxInvoiceItem: TaxInvoiceItem) => [taxInvoiceItem.taxInvoice])
|
|
11
11
|
@ObjectType({ description: 'Entity for TaxInvoiceItem' })
|
|
12
12
|
export class TaxInvoiceItem {
|
|
13
13
|
@PrimaryGeneratedColumn('uuid')
|
|
14
14
|
@Field(type => ID)
|
|
15
15
|
readonly id!: string
|
|
16
16
|
|
|
17
|
-
@VersionColumn()
|
|
18
|
-
@Field({ nullable: true })
|
|
19
|
-
version?: number = 1
|
|
20
|
-
|
|
21
17
|
@ManyToOne(type => Domain)
|
|
22
18
|
@Field({ nullable: true })
|
|
23
19
|
domain?: Domain
|
|
@@ -25,7 +21,7 @@ export class TaxInvoiceItem {
|
|
|
25
21
|
@RelationId((taxInvoiceItem: TaxInvoiceItem) => taxInvoiceItem.domain)
|
|
26
22
|
domainId?: string
|
|
27
23
|
|
|
28
|
-
@ManyToOne(type => TaxInvoice)
|
|
24
|
+
@ManyToOne(type => TaxInvoice, taxInvoice => taxInvoice.taxInvoiceItems)
|
|
29
25
|
@Field({ nullable: false })
|
|
30
26
|
taxInvoice!: TaxInvoice
|
|
31
27
|
|