@things-factory/sales-base 4.1.28 → 4.1.31
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-server/service/invoice/invoice-mutation.js +4 -0
- package/dist-server/service/invoice/invoice-mutation.js.map +1 -1
- package/dist-server/service/invoice/invoice-types.js +47 -47
- package/dist-server/service/invoice/invoice-types.js.map +1 -1
- package/dist-server/service/invoice/invoice.js +10 -4
- package/dist-server/service/invoice/invoice.js.map +1 -1
- package/dist-server/service/invoice-product/invoice-product-types.js +2 -12
- package/dist-server/service/invoice-product/invoice-product-types.js.map +1 -1
- package/dist-server/service/order-inventory/order-inventory-types.js +8 -0
- package/dist-server/service/order-inventory/order-inventory-types.js.map +1 -1
- package/dist-server/service/order-inventory/order-inventory.js +101 -41
- package/dist-server/service/order-inventory/order-inventory.js.map +1 -1
- package/dist-server/service/others/other-query.js +6 -1
- package/dist-server/service/others/other-query.js.map +1 -1
- package/package.json +3 -3
- package/server/service/invoice/invoice-mutation.ts +5 -0
- package/server/service/invoice/invoice-types.ts +49 -49
- package/server/service/invoice/invoice.ts +9 -4
- package/server/service/invoice-product/invoice-product-types.ts +2 -10
- package/server/service/order-inventory/order-inventory-types.ts +6 -0
- package/server/service/order-inventory/order-inventory.ts +77 -27
- package/server/service/others/other-query.ts +7 -1
|
@@ -43,26 +43,28 @@ export class Invoice {
|
|
|
43
43
|
description: string
|
|
44
44
|
|
|
45
45
|
@OneToMany(type => InvoiceProduct, invoiceProduct => invoiceProduct.invoice)
|
|
46
|
+
@Field(type => [InvoiceProduct], { nullable: true })
|
|
46
47
|
invoiceProducts: InvoiceProduct[]
|
|
47
48
|
|
|
48
49
|
@OneToOne(type => ReleaseGood, { nullable: true })
|
|
50
|
+
@Field(type => ReleaseGood, { nullable: true })
|
|
49
51
|
@JoinColumn()
|
|
50
52
|
releaseGood: ReleaseGood
|
|
51
53
|
|
|
52
54
|
@Column({ default: '' })
|
|
53
|
-
@Field()
|
|
55
|
+
@Field({ nullable: true })
|
|
54
56
|
refNo1: string
|
|
55
57
|
|
|
56
58
|
@Column({ default: '' })
|
|
57
|
-
@Field()
|
|
59
|
+
@Field({ nullable: true })
|
|
58
60
|
refNo2: string
|
|
59
61
|
|
|
60
62
|
@Column({ default: '' })
|
|
61
|
-
@Field()
|
|
63
|
+
@Field({ nullable: true })
|
|
62
64
|
refNo3: string
|
|
63
65
|
|
|
64
66
|
@Column({ nullable: true })
|
|
65
|
-
@Field()
|
|
67
|
+
@Field({ nullable: true })
|
|
66
68
|
issuedOn: Date
|
|
67
69
|
|
|
68
70
|
@Column({ type: 'uuid', nullable: true })
|
|
@@ -201,6 +203,9 @@ export class Invoice {
|
|
|
201
203
|
@Field()
|
|
202
204
|
billingCountry: string
|
|
203
205
|
|
|
206
|
+
@Field({ nullable: true })
|
|
207
|
+
paymentDue: string
|
|
208
|
+
|
|
204
209
|
@CreateDateColumn()
|
|
205
210
|
@Field()
|
|
206
211
|
createdAt: Date
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Field, Float, InputType, Int, ObjectType } from 'type-graphql'
|
|
2
2
|
|
|
3
|
-
import { ObjectRef } from '@things-factory/shell'
|
|
4
|
-
|
|
5
3
|
import { InvoiceProduct } from './invoice-product'
|
|
6
4
|
|
|
7
5
|
@ObjectType()
|
|
@@ -30,16 +28,13 @@ export class NewInvoiceProduct {
|
|
|
30
28
|
@Field({ nullable: true })
|
|
31
29
|
description: string
|
|
32
30
|
|
|
33
|
-
@Field(type => ObjectRef)
|
|
34
|
-
invoice: ObjectRef
|
|
35
|
-
|
|
36
31
|
@Field(type => ProductInput)
|
|
37
32
|
product: ProductInput
|
|
38
33
|
|
|
39
34
|
@Field(type => Int)
|
|
40
35
|
qty: number
|
|
41
36
|
|
|
42
|
-
@Field(type => Float, { nullable:
|
|
37
|
+
@Field(type => Float, { nullable: true })
|
|
43
38
|
otherCharges: number
|
|
44
39
|
|
|
45
40
|
@Field(type => Float)
|
|
@@ -60,16 +55,13 @@ export class InvoiceProductPatch {
|
|
|
60
55
|
@Field({ nullable: true })
|
|
61
56
|
description: string
|
|
62
57
|
|
|
63
|
-
@Field(type => ObjectRef)
|
|
64
|
-
invoice: ObjectRef
|
|
65
|
-
|
|
66
58
|
@Field(type => ProductInput)
|
|
67
59
|
product: ProductInput
|
|
68
60
|
|
|
69
61
|
@Field(type => Int)
|
|
70
62
|
qty: number
|
|
71
63
|
|
|
72
|
-
@Field(type => Float, { nullable:
|
|
64
|
+
@Field(type => Float, { nullable: true })
|
|
73
65
|
otherCharges: number
|
|
74
66
|
|
|
75
67
|
@Field(type => Float)
|
|
@@ -103,6 +103,12 @@ export class NewOrderInventory {
|
|
|
103
103
|
|
|
104
104
|
@Field(type => Float, { nullable: true })
|
|
105
105
|
returnUomValue: number
|
|
106
|
+
|
|
107
|
+
@Field(type => Int, { nullable: true })
|
|
108
|
+
returnToLocationQty: number
|
|
109
|
+
|
|
110
|
+
@Field(type => Float, { nullable: true })
|
|
111
|
+
returnToLocationUomValue: number
|
|
106
112
|
}
|
|
107
113
|
|
|
108
114
|
@InputType()
|
|
@@ -52,6 +52,7 @@ import { TransferOrder } from '../transfer-order/transfer-order'
|
|
|
52
52
|
],
|
|
53
53
|
{ unique: true }
|
|
54
54
|
)
|
|
55
|
+
|
|
55
56
|
@Index('ix_order-inventory_4', (orderInventory: OrderInventory) => [
|
|
56
57
|
orderInventory.status,
|
|
57
58
|
orderInventory.batchId,
|
|
@@ -62,6 +63,7 @@ import { TransferOrder } from '../transfer-order/transfer-order'
|
|
|
62
63
|
orderInventory.releaseQty,
|
|
63
64
|
orderInventory.uom
|
|
64
65
|
])
|
|
66
|
+
|
|
65
67
|
@ObjectType()
|
|
66
68
|
export class OrderInventory {
|
|
67
69
|
@PrimaryGeneratedColumn('uuid')
|
|
@@ -147,9 +149,6 @@ export class OrderInventory {
|
|
|
147
149
|
@RelationId((orderInventory: OrderInventory) => orderInventory.releaseGood)
|
|
148
150
|
releaseGoodId: string
|
|
149
151
|
|
|
150
|
-
@Field({ nullable: true })
|
|
151
|
-
releaseGoodName: string
|
|
152
|
-
|
|
153
152
|
@ManyToOne(type => InventoryCheck)
|
|
154
153
|
@Field(type => InventoryCheck, { nullable: true })
|
|
155
154
|
inventoryCheck: InventoryCheck
|
|
@@ -254,38 +253,25 @@ export class OrderInventory {
|
|
|
254
253
|
@Field({ nullable: true })
|
|
255
254
|
releaseUomValue: number
|
|
256
255
|
|
|
257
|
-
@Field({ nullable: true })
|
|
258
|
-
releaseUomValueWithUom: string
|
|
259
|
-
|
|
260
256
|
@Column({ nullable: true })
|
|
261
257
|
@Field({ nullable: true })
|
|
262
258
|
uom: string
|
|
263
259
|
|
|
260
|
+
@Column({ nullable: true, type: 'float' })
|
|
264
261
|
@Field({ nullable: true })
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
@Field({ nullable: true })
|
|
268
|
-
productSKU: string
|
|
269
|
-
|
|
270
|
-
@Field({ nullable: true })
|
|
271
|
-
productBrand: string
|
|
272
|
-
|
|
273
|
-
@Field({ nullable: true })
|
|
274
|
-
pallet: string
|
|
275
|
-
|
|
276
|
-
@Field({ nullable: true })
|
|
277
|
-
palletId: string
|
|
262
|
+
returnQty: number
|
|
278
263
|
|
|
264
|
+
@Column({ nullable: true, type: 'float' })
|
|
279
265
|
@Field({ nullable: true })
|
|
280
|
-
|
|
266
|
+
returnUomValue: number
|
|
281
267
|
|
|
282
268
|
@Column({ nullable: true, type: 'float' })
|
|
283
269
|
@Field({ nullable: true })
|
|
284
|
-
|
|
270
|
+
returnToLocationQty: number
|
|
285
271
|
|
|
286
272
|
@Column({ nullable: true, type: 'float' })
|
|
287
273
|
@Field({ nullable: true })
|
|
288
|
-
|
|
274
|
+
returnToLocationUomValue: number
|
|
289
275
|
|
|
290
276
|
@Column({ nullable: true })
|
|
291
277
|
@Field({ nullable: true })
|
|
@@ -314,20 +300,45 @@ export class OrderInventory {
|
|
|
314
300
|
@Field({ nullable: true })
|
|
315
301
|
status: string
|
|
316
302
|
|
|
303
|
+
@ManyToOne(type => User)
|
|
304
|
+
@Field(type => User, { nullable: true })
|
|
305
|
+
pickedByUser: User
|
|
306
|
+
|
|
307
|
+
@Column({ nullable: true })
|
|
317
308
|
@Field({ nullable: true })
|
|
318
|
-
|
|
309
|
+
pickedBy: string
|
|
319
310
|
|
|
311
|
+
@Column({ nullable: true })
|
|
320
312
|
@Field({ nullable: true })
|
|
321
|
-
|
|
313
|
+
pickedAt: Date
|
|
322
314
|
|
|
315
|
+
@ManyToOne(type => User)
|
|
316
|
+
@Field(type => User, { nullable: true })
|
|
317
|
+
packedByUser: User
|
|
318
|
+
|
|
319
|
+
@Column({ nullable: true })
|
|
323
320
|
@Field({ nullable: true })
|
|
324
|
-
|
|
321
|
+
packedBy: string
|
|
325
322
|
|
|
323
|
+
@Column({ nullable: true })
|
|
326
324
|
@Field({ nullable: true })
|
|
327
|
-
|
|
325
|
+
packedAt: Date
|
|
326
|
+
|
|
327
|
+
@ManyToOne(type => User)
|
|
328
|
+
@Field(type => User, { nullable: true })
|
|
329
|
+
loadedByUser: User
|
|
330
|
+
|
|
331
|
+
@Column({ nullable: true })
|
|
332
|
+
@Field({ nullable: true })
|
|
333
|
+
loadedBy: string
|
|
328
334
|
|
|
335
|
+
@Column({ nullable: true })
|
|
329
336
|
@Field({ nullable: true })
|
|
330
|
-
|
|
337
|
+
loadedAt: Date
|
|
338
|
+
|
|
339
|
+
@Column({ nullable: true })
|
|
340
|
+
@Field({ nullable: true })
|
|
341
|
+
shippedAt: Date
|
|
331
342
|
|
|
332
343
|
@CreateDateColumn()
|
|
333
344
|
@Field()
|
|
@@ -350,4 +361,43 @@ export class OrderInventory {
|
|
|
350
361
|
|
|
351
362
|
@RelationId((orderInventory: OrderInventory) => orderInventory.updater)
|
|
352
363
|
updaterId: string
|
|
364
|
+
|
|
365
|
+
@Field({ nullable: true })
|
|
366
|
+
remainQty: number
|
|
367
|
+
|
|
368
|
+
@Field({ nullable: true })
|
|
369
|
+
remainUomValue: string
|
|
370
|
+
|
|
371
|
+
@Field({ nullable: true })
|
|
372
|
+
remainUomValueWithUom: string
|
|
373
|
+
|
|
374
|
+
@Field({ nullable: true })
|
|
375
|
+
isError: boolean
|
|
376
|
+
|
|
377
|
+
@Field({ nullable: true })
|
|
378
|
+
groupType: string
|
|
379
|
+
|
|
380
|
+
@Field({ nullable: true })
|
|
381
|
+
releaseUomValueWithUom: string
|
|
382
|
+
|
|
383
|
+
@Field({ nullable: true })
|
|
384
|
+
releaseGoodName: string
|
|
385
|
+
|
|
386
|
+
@Field({ nullable: true })
|
|
387
|
+
productName: string
|
|
388
|
+
|
|
389
|
+
@Field({ nullable: true })
|
|
390
|
+
productSKU: string
|
|
391
|
+
|
|
392
|
+
@Field({ nullable: true })
|
|
393
|
+
productBrand: string
|
|
394
|
+
|
|
395
|
+
@Field({ nullable: true })
|
|
396
|
+
pallet: string
|
|
397
|
+
|
|
398
|
+
@Field({ nullable: true })
|
|
399
|
+
palletId: string
|
|
400
|
+
|
|
401
|
+
@Field({ nullable: true })
|
|
402
|
+
extraJsonData: string
|
|
353
403
|
}
|
|
@@ -272,14 +272,20 @@ export class OtherQuery {
|
|
|
272
272
|
const bizplaces: Bizplace[] = [foundPermittedBizplace, companyBizplace]
|
|
273
273
|
if (bizplace) bizplaces.push(bizplace)
|
|
274
274
|
|
|
275
|
+
let strictProduct: boolean = false
|
|
276
|
+
|
|
275
277
|
const strictProductSelectionSetting: Setting = await tx.getRepository(Setting).findOne({
|
|
276
278
|
where: { domain, category: 'id-rule', name: 'strict-product-selection' }
|
|
277
279
|
})
|
|
278
280
|
|
|
281
|
+
if (strictProductSelectionSetting) strictProduct = strictProductSelectionSetting.value
|
|
282
|
+
|
|
279
283
|
const partnerStrictProductSelectionSetting: PartnerSetting = await tx.getRepository(PartnerSetting).findOne({
|
|
280
284
|
where: { setting: strictProductSelectionSetting, domain, partnerDomain: foundPermittedBizplace?.domain }
|
|
281
285
|
})
|
|
282
286
|
|
|
287
|
+
if (partnerStrictProductSelectionSetting) strictProduct = partnerStrictProductSelectionSetting.value
|
|
288
|
+
|
|
283
289
|
let newOrderProducts: any[] = []
|
|
284
290
|
|
|
285
291
|
for (var i = 0; i < orderProducts.length; i++) {
|
|
@@ -316,7 +322,7 @@ export class OtherQuery {
|
|
|
316
322
|
})
|
|
317
323
|
|
|
318
324
|
const uomValue: number =
|
|
319
|
-
|
|
325
|
+
strictProduct == true
|
|
320
326
|
? productDetail?.uomValue
|
|
321
327
|
? productDetail.uomValue
|
|
322
328
|
: null
|