@things-factory/sales-base 4.3.639 → 4.3.642
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/arrival-notice/arrival-notice-mutation.js +33 -2
- package/dist-server/service/arrival-notice/arrival-notice-mutation.js.map +1 -1
- package/dist-server/service/arrival-notice/arrival-notice-query.js +10 -3
- package/dist-server/service/arrival-notice/arrival-notice-query.js.map +1 -1
- package/dist-server/service/arrival-notice/arrival-notice-types.js +2 -2
- package/dist-server/service/arrival-notice/arrival-notice-types.js.map +1 -1
- package/dist-server/service/inventory-check-item/inventory-check-item-types.js +48 -12
- package/dist-server/service/inventory-check-item/inventory-check-item-types.js.map +1 -1
- package/dist-server/service/inventory-check-item/inventory-check-item.js +56 -4
- package/dist-server/service/inventory-check-item/inventory-check-item.js.map +1 -1
- package/dist-server/service/order-inventory/order-inventory-query.js +5 -1
- package/dist-server/service/order-inventory/order-inventory-query.js.map +1 -1
- package/dist-server/service/order-inventory/order-inventory-types.js +12 -12
- package/dist-server/service/order-inventory/order-inventory-types.js.map +1 -1
- package/dist-server/service/order-inventory/order-inventory.js +189 -13
- package/dist-server/service/order-inventory/order-inventory.js.map +1 -1
- package/dist-server/service/order-package-item/order-package-item-types.js +14 -2
- package/dist-server/service/order-package-item/order-package-item-types.js.map +1 -1
- package/dist-server/service/order-package-item/order-package-item.js +28 -2
- package/dist-server/service/order-package-item/order-package-item.js.map +1 -1
- package/dist-server/service/order-product/order-product-types.js +18 -18
- package/dist-server/service/order-product/order-product-types.js.map +1 -1
- package/dist-server/service/order-product/order-product.js +104 -13
- package/dist-server/service/order-product/order-product.js.map +1 -1
- package/dist-server/service/order-tote-item/order-tote-item-types.js +2 -2
- package/dist-server/service/order-tote-item/order-tote-item-types.js.map +1 -1
- package/dist-server/service/order-tote-item/order-tote-item.js +15 -1
- package/dist-server/service/order-tote-item/order-tote-item.js.map +1 -1
- package/dist-server/service/others/other-query.js +4 -4
- package/dist-server/service/others/other-query.js.map +1 -1
- package/dist-server/service/others/other-types.js +8 -4
- package/dist-server/service/others/other-types.js.map +1 -1
- package/dist-server/service/release-good/release-good-mutation.js +35 -6
- package/dist-server/service/release-good/release-good-mutation.js.map +1 -1
- package/dist-server/service/release-good/release-good-query.js +23 -11
- package/dist-server/service/release-good/release-good-query.js.map +1 -1
- package/dist-server/service/release-good/release-good-types.js +1 -1
- package/dist-server/service/release-good/release-good-types.js.map +1 -1
- package/dist-server/utils/inventory-util.js +18 -14
- package/dist-server/utils/inventory-util.js.map +1 -1
- package/package.json +8 -8
- package/server/service/arrival-notice/arrival-notice-mutation.ts +39 -2
- package/server/service/arrival-notice/arrival-notice-query.ts +40 -68
- package/server/service/arrival-notice/arrival-notice-types.ts +4 -4
- package/server/service/inventory-check-item/inventory-check-item-types.ts +37 -10
- package/server/service/inventory-check-item/inventory-check-item.ts +52 -4
- package/server/service/order-inventory/order-inventory-query.ts +5 -0
- package/server/service/order-inventory/order-inventory-types.ts +12 -12
- package/server/service/order-inventory/order-inventory.ts +171 -13
- package/server/service/order-package-item/order-package-item-types.ts +12 -3
- package/server/service/order-package-item/order-package-item.ts +26 -2
- package/server/service/order-product/order-product-types.ts +18 -18
- package/server/service/order-product/order-product.ts +96 -12
- package/server/service/order-tote-item/order-tote-item-types.ts +3 -3
- package/server/service/order-tote-item/order-tote-item.ts +14 -1
- package/server/service/others/other-query.ts +8 -8
- package/server/service/others/other-types.ts +7 -4
- package/server/service/release-good/release-good-mutation.ts +51 -9
- package/server/service/release-good/release-good-query.ts +30 -14
- package/server/service/release-good/release-good-types.ts +1 -1
- package/server/utils/inventory-util.ts +50 -60
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/sales-base",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.642",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -27,18 +27,18 @@
|
|
|
27
27
|
"@things-factory/auth-base": "^4.3.591",
|
|
28
28
|
"@things-factory/biz-base": "^4.3.595",
|
|
29
29
|
"@things-factory/code-base": "^4.3.591",
|
|
30
|
-
"@things-factory/integration-accounting": "^4.3.
|
|
30
|
+
"@things-factory/integration-accounting": "^4.3.642",
|
|
31
31
|
"@things-factory/integration-base": "^4.3.616",
|
|
32
|
-
"@things-factory/integration-lmd": "^4.3.
|
|
33
|
-
"@things-factory/integration-powrup": "^4.3.
|
|
34
|
-
"@things-factory/integration-sftp": "^4.3.
|
|
32
|
+
"@things-factory/integration-lmd": "^4.3.642",
|
|
33
|
+
"@things-factory/integration-powrup": "^4.3.642",
|
|
34
|
+
"@things-factory/integration-sftp": "^4.3.642",
|
|
35
35
|
"@things-factory/notification": "^4.3.609",
|
|
36
|
-
"@things-factory/product-base": "^4.3.
|
|
36
|
+
"@things-factory/product-base": "^4.3.642",
|
|
37
37
|
"@things-factory/setting-base": "^4.3.609",
|
|
38
38
|
"@things-factory/shell": "^4.3.591",
|
|
39
39
|
"@things-factory/transport-base": "^4.3.631",
|
|
40
|
-
"@things-factory/warehouse-base": "^4.3.
|
|
40
|
+
"@things-factory/warehouse-base": "^4.3.642",
|
|
41
41
|
"axios": "1.7.7"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "7796a1553e51d21f017f3746f80f25cae9e1c695"
|
|
44
44
|
}
|
|
@@ -551,7 +551,44 @@ export async function generateArrivalNoticeFunction(
|
|
|
551
551
|
} else if (arrivalNotice.warehouseId) myBizplace = await getOutletBizplace(arrivalNotice.warehouseId)
|
|
552
552
|
else myBizplace = await getMyBizplace(domain, user)
|
|
553
553
|
|
|
554
|
+
// Add validation for decimal quantities
|
|
554
555
|
for (let patch of orderProducts) {
|
|
556
|
+
// Get product details to check isInventoryDecimal
|
|
557
|
+
const product = (await tx.getRepository(Product).findOne({
|
|
558
|
+
where: { id: patch.product.id }
|
|
559
|
+
})) as Product
|
|
560
|
+
|
|
561
|
+
if (!product) {
|
|
562
|
+
throw new Error(`Product not found for ID: ${patch.product.id}`)
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
// Validate packQty based on isInventoryDecimal flag
|
|
566
|
+
const validatePackQty = (qty: any): boolean => {
|
|
567
|
+
if (qty === null || qty === undefined) return true
|
|
568
|
+
const numQty = Number(qty)
|
|
569
|
+
if (isNaN(numQty)) return false
|
|
570
|
+
|
|
571
|
+
if (product.isInventoryDecimal) {
|
|
572
|
+
// For decimal products, check if decimal places <= 3
|
|
573
|
+
const decimalPlaces = (numQty.toString().split('.')[1] || '').length
|
|
574
|
+
return decimalPlaces <= 3
|
|
575
|
+
} else {
|
|
576
|
+
// For non-decimal products, check if it's a whole number
|
|
577
|
+
return numQty === Math.floor(numQty)
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// Validate only packQty
|
|
582
|
+
if (!validatePackQty(patch.packQty)) {
|
|
583
|
+
throw new Error(
|
|
584
|
+
`Invalid pack quantity for product ${product.name} (SKU: ${product.sku}). ${
|
|
585
|
+
product.isInventoryDecimal
|
|
586
|
+
? 'Decimal quantities must have at most 3 decimal places'
|
|
587
|
+
: 'Only whole numbers are allowed'
|
|
588
|
+
}`
|
|
589
|
+
)
|
|
590
|
+
}
|
|
591
|
+
|
|
555
592
|
// Check for existing LotID in Inventory
|
|
556
593
|
let foundInventoryPallet = await tx.getRepository(Inventory).findOne({
|
|
557
594
|
where: {
|
|
@@ -1115,8 +1152,8 @@ export async function addArrivalNoticeProducts(
|
|
|
1115
1152
|
packing_type: op.packingType,
|
|
1116
1153
|
packing_size: op.packingSize,
|
|
1117
1154
|
uom: op.uom,
|
|
1118
|
-
uom_value: op.uomValue,
|
|
1119
|
-
pack_qty: op.packQty,
|
|
1155
|
+
uom_value: op.uomValue || 0,
|
|
1156
|
+
pack_qty: op.packQty || 0,
|
|
1120
1157
|
total_uom_value: op.totalUomValue,
|
|
1121
1158
|
pallet_qty: op.palletQty,
|
|
1122
1159
|
pallet_id: op.palletId,
|
|
@@ -1,50 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
Args,
|
|
4
|
-
Ctx,
|
|
5
|
-
Directive,
|
|
6
|
-
FieldResolver,
|
|
7
|
-
Query,
|
|
8
|
-
Resolver,
|
|
9
|
-
Root
|
|
10
|
-
} from 'type-graphql'
|
|
11
|
-
import {
|
|
12
|
-
EntityManager,
|
|
13
|
-
getRepository,
|
|
14
|
-
In,
|
|
15
|
-
SelectQueryBuilder
|
|
16
|
-
} from 'typeorm'
|
|
1
|
+
import { Arg, Args, Ctx, Directive, FieldResolver, Query, Resolver, Root } from 'type-graphql'
|
|
2
|
+
import { EntityManager, getRepository, In, SelectQueryBuilder } from 'typeorm'
|
|
17
3
|
|
|
18
4
|
import { Attachment } from '@things-factory/attachment-base'
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
User
|
|
22
|
-
} from '@things-factory/auth-base'
|
|
23
|
-
import {
|
|
24
|
-
Bizplace,
|
|
25
|
-
getCompanyBizplace,
|
|
26
|
-
getPermittedBizplaceIds
|
|
27
|
-
} from '@things-factory/biz-base'
|
|
5
|
+
import { checkUserBelongsDomain, User } from '@things-factory/auth-base'
|
|
6
|
+
import { Bizplace, getCompanyBizplace, getPermittedBizplaceIds } from '@things-factory/biz-base'
|
|
28
7
|
import { Setting } from '@things-factory/setting-base'
|
|
29
|
-
import {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} from '
|
|
34
|
-
|
|
35
|
-
import {
|
|
36
|
-
ArrivalNoticeList,
|
|
37
|
-
NewArrivalNotice,
|
|
38
|
-
RawArrivalNotice
|
|
39
|
-
} from '../'
|
|
40
|
-
import {
|
|
41
|
-
ATTACHMENT_TYPE,
|
|
42
|
-
ORDER_STATUS
|
|
43
|
-
} from '../../constants'
|
|
44
|
-
import {
|
|
45
|
-
OrderInventory,
|
|
46
|
-
OrderProduct
|
|
47
|
-
} from '../../service'
|
|
8
|
+
import { buildQuery, Domain, ListParam } from '@things-factory/shell'
|
|
9
|
+
|
|
10
|
+
import { ArrivalNoticeList, NewArrivalNotice, RawArrivalNotice } from '../'
|
|
11
|
+
import { ATTACHMENT_TYPE, ORDER_STATUS } from '../../constants'
|
|
12
|
+
import { OrderInventory, OrderProduct } from '../../service'
|
|
48
13
|
import { convertExcelDateToISO } from '../../utils/datetime-util'
|
|
49
14
|
import { ArrivalNotice } from './arrival-notice'
|
|
50
15
|
|
|
@@ -344,8 +309,8 @@ export class ArrivalNoticeQuery {
|
|
|
344
309
|
@Arg('rawArrivalNotices', type => [NewArrivalNotice], { nullable: true }) rawArrivalNotices: NewArrivalNotice[],
|
|
345
310
|
@Arg('bizplaceId', type => String) bizplaceId: string
|
|
346
311
|
): Promise<RawArrivalNotice[]> {
|
|
347
|
-
const {domain
|
|
348
|
-
return await validateBulkArrivalNoticesFunction(rawArrivalNotices, bizplaceId, domain,tx)
|
|
312
|
+
const { domain, tx }: { domain: Domain; tx: EntityManager } = context.state
|
|
313
|
+
return await validateBulkArrivalNoticesFunction(rawArrivalNotices, bizplaceId, domain, tx)
|
|
349
314
|
}
|
|
350
315
|
|
|
351
316
|
@FieldResolver(type => Domain)
|
|
@@ -402,7 +367,7 @@ export async function validateBulkArrivalNoticesFunction(
|
|
|
402
367
|
}
|
|
403
368
|
})
|
|
404
369
|
)
|
|
405
|
-
|
|
370
|
+
|
|
406
371
|
const enableLotIdInput: Setting = await trxMgr.getRepository(Setting).findOne({
|
|
407
372
|
where: { domain, category: 'id-rule', name: 'enable-lot-id-input' }
|
|
408
373
|
})
|
|
@@ -410,25 +375,25 @@ export async function validateBulkArrivalNoticesFunction(
|
|
|
410
375
|
//check if palletId is entered but enablelotidinput setting is false
|
|
411
376
|
let lotIdInputSettingChecker = ''
|
|
412
377
|
if (rawArrivalNotices.some(record => record.palletId) && enableLotIdInput.value == 'false') {
|
|
413
|
-
lotIdInputSettingChecker = 'Please enable the setting to create orders with a custom Lot ID'
|
|
378
|
+
lotIdInputSettingChecker = 'Please enable the setting to create orders with a custom Lot ID'
|
|
414
379
|
}
|
|
415
380
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
381
|
+
// uncomment this to show error message as popup
|
|
382
|
+
|
|
383
|
+
// for (let item of rawArrivalNotices) {
|
|
384
|
+
// if (item.palletId) {
|
|
385
|
+
// const foundOrderProductsPallet = await trxMgr.getRepository(OrderProduct).findOne({
|
|
386
|
+
// where: {
|
|
387
|
+
// domain,
|
|
388
|
+
// palletId: item.palletId
|
|
389
|
+
// }
|
|
390
|
+
// })
|
|
391
|
+
|
|
392
|
+
// if (foundOrderProductsPallet) {
|
|
393
|
+
// throw new Error(('Lot ID is already in used. Please enter new Lot ID.'))
|
|
394
|
+
// }
|
|
395
|
+
// }
|
|
396
|
+
// }
|
|
432
397
|
|
|
433
398
|
await trxMgr.query(
|
|
434
399
|
`
|
|
@@ -450,7 +415,7 @@ export async function validateBulkArrivalNoticesFunction(
|
|
|
450
415
|
packing_type VARCHAR(50),
|
|
451
416
|
packing_size INT,
|
|
452
417
|
uom VARCHAR(10),
|
|
453
|
-
pack_qty
|
|
418
|
+
pack_qty NUMERIC(19,3),
|
|
454
419
|
pallet_qty INT,
|
|
455
420
|
pallet_id VARCHAR(50),
|
|
456
421
|
unit_price VARCHAR(50),
|
|
@@ -482,7 +447,7 @@ export async function validateBulkArrivalNoticesFunction(
|
|
|
482
447
|
)
|
|
483
448
|
)
|
|
484
449
|
`,
|
|
485
|
-
[json_oi,domain.id]
|
|
450
|
+
[json_oi, domain.id]
|
|
486
451
|
)
|
|
487
452
|
|
|
488
453
|
await trxMgr.query(
|
|
@@ -612,6 +577,10 @@ export async function validateBulkArrivalNoticesFunction(
|
|
|
612
577
|
WHEN f.pack_qty IS NULL OR f.pack_qty <= 0 THEN 'invalid pack qty,'
|
|
613
578
|
ELSE ''
|
|
614
579
|
END ||
|
|
580
|
+
CASE
|
|
581
|
+
WHEN f.pack_qty % 1 != 0 AND NOT pr.is_inventory_decimal THEN 'decimal quantities are not allowed for this product,'
|
|
582
|
+
ELSE ''
|
|
583
|
+
END ||
|
|
615
584
|
CASE
|
|
616
585
|
WHEN f.batch_id IS NULL THEN 'batch no. is required,'
|
|
617
586
|
ELSE ''
|
|
@@ -659,12 +628,13 @@ export async function validateBulkArrivalNoticesFunction(
|
|
|
659
628
|
FROM
|
|
660
629
|
temp_foo f
|
|
661
630
|
LEFT JOIN temp_foo_duplicates d ON f.pallet_id = d.pallet_id
|
|
631
|
+
LEFT JOIN products pr ON pr.id = f.product_id
|
|
662
632
|
ORDER BY f.ref_no, f.ref_no_2, f.ref_no_3, f.sku;
|
|
663
633
|
`
|
|
664
634
|
)
|
|
665
635
|
|
|
666
636
|
await trxMgr.query('DROP TABLE raw_arrival_notices, temp_gan, temp_foo, temp_foo_duplicates, temp_used_pallet_ids')
|
|
667
|
-
|
|
637
|
+
|
|
668
638
|
return validatedItems.map(item => {
|
|
669
639
|
return {
|
|
670
640
|
refNo: item.ref_no,
|
|
@@ -694,7 +664,9 @@ export async function validateBulkArrivalNoticesFunction(
|
|
|
694
664
|
palletId: item.pallet_id,
|
|
695
665
|
unitPrice: item.unit_price,
|
|
696
666
|
manufactureDate: item.manufacture_date,
|
|
697
|
-
errorMsg: lotIdInputSettingChecker
|
|
667
|
+
errorMsg: lotIdInputSettingChecker
|
|
668
|
+
? lotIdInputSettingChecker + (item.error_msg ? ',' + item.error_msg : '')
|
|
669
|
+
: item.error_msg
|
|
698
670
|
}
|
|
699
671
|
})
|
|
700
672
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Field, Float, InputType, Int, ObjectType } from 'type-graphql'
|
|
2
|
-
import {
|
|
2
|
+
import { OneToMany } from 'typeorm'
|
|
3
3
|
|
|
4
4
|
import { ObjectRef } from '@things-factory/shell'
|
|
5
5
|
|
|
@@ -112,7 +112,7 @@ export class NewArrivalNotice {
|
|
|
112
112
|
@Field(type => Float, { nullable: true })
|
|
113
113
|
packingSize?: number
|
|
114
114
|
|
|
115
|
-
@Field(type =>
|
|
115
|
+
@Field(type => Float, { nullable: true })
|
|
116
116
|
packQty?: number
|
|
117
117
|
|
|
118
118
|
@Field(type => Float, { nullable: true })
|
|
@@ -159,7 +159,7 @@ export class ArrivalNoticePatch {
|
|
|
159
159
|
|
|
160
160
|
@Field({ nullable: true })
|
|
161
161
|
ownTransport: boolean
|
|
162
|
-
|
|
162
|
+
|
|
163
163
|
@Field({ nullable: true })
|
|
164
164
|
transportVehicle: string
|
|
165
165
|
|
|
@@ -292,7 +292,7 @@ export class RawArrivalNotice {
|
|
|
292
292
|
@Field(type => Float, { nullable: true })
|
|
293
293
|
packingSize?: number
|
|
294
294
|
|
|
295
|
-
@Field(type =>
|
|
295
|
+
@Field(type => Float, { nullable: true })
|
|
296
296
|
packQty?: number
|
|
297
297
|
|
|
298
298
|
@Field(type => Float, { nullable: true })
|
|
@@ -19,7 +19,22 @@ export class NewInventoryCheckItem {
|
|
|
19
19
|
name: string
|
|
20
20
|
|
|
21
21
|
@Field({ nullable: true })
|
|
22
|
-
|
|
22
|
+
countNo?: number
|
|
23
|
+
|
|
24
|
+
@Field(type => Float, { nullable: true })
|
|
25
|
+
originQty?: number
|
|
26
|
+
|
|
27
|
+
@Field(type => Float, { nullable: true })
|
|
28
|
+
inspectedQty?: number
|
|
29
|
+
|
|
30
|
+
@Field(type => Float, { nullable: true })
|
|
31
|
+
originUomValue?: number
|
|
32
|
+
|
|
33
|
+
@Field(type => Float, { nullable: true })
|
|
34
|
+
inspectedUomValue?: number
|
|
35
|
+
|
|
36
|
+
@Field({ nullable: true })
|
|
37
|
+
status?: string
|
|
23
38
|
|
|
24
39
|
@Field(type => InventoryPatch, { nullable: true })
|
|
25
40
|
inventory: InventoryPatch
|
|
@@ -42,6 +57,27 @@ export class InventoryCheckItemPatch {
|
|
|
42
57
|
@Field({ nullable: true })
|
|
43
58
|
name: string
|
|
44
59
|
|
|
60
|
+
@Field({ nullable: true })
|
|
61
|
+
countNo?: number
|
|
62
|
+
|
|
63
|
+
@Field(type => Float, { nullable: true })
|
|
64
|
+
originQty?: number
|
|
65
|
+
|
|
66
|
+
@Field(type => Float, { nullable: true })
|
|
67
|
+
inspectedQty?: number
|
|
68
|
+
|
|
69
|
+
@Field(type => Float, { nullable: true })
|
|
70
|
+
originUomValue?: number
|
|
71
|
+
|
|
72
|
+
@Field(type => Float, { nullable: true })
|
|
73
|
+
inspectedUomValue?: number
|
|
74
|
+
|
|
75
|
+
@Field({ nullable: true })
|
|
76
|
+
status: string
|
|
77
|
+
|
|
78
|
+
@Field({ nullable: true })
|
|
79
|
+
cuFlag: string
|
|
80
|
+
|
|
45
81
|
@Field(type => ObjectRef, { nullable: true })
|
|
46
82
|
inventory: ObjectRef
|
|
47
83
|
|
|
@@ -51,12 +87,6 @@ export class InventoryCheckItemPatch {
|
|
|
51
87
|
@Field({ nullable: true })
|
|
52
88
|
batchIdRef: string
|
|
53
89
|
|
|
54
|
-
@Field(type => Int, { nullable: true })
|
|
55
|
-
inspectedQty: number
|
|
56
|
-
|
|
57
|
-
@Field(type => Float, { nullable: true })
|
|
58
|
-
inspectedUomValue: number
|
|
59
|
-
|
|
60
90
|
@Field(type => ObjectRef, { nullable: true })
|
|
61
91
|
inspectedLocation: ObjectRef
|
|
62
92
|
|
|
@@ -71,7 +101,4 @@ export class InventoryCheckItemPatch {
|
|
|
71
101
|
|
|
72
102
|
@Field({ nullable: true })
|
|
73
103
|
productDetailId: string
|
|
74
|
-
|
|
75
|
-
@Field({ nullable: true })
|
|
76
|
-
status: string
|
|
77
104
|
}
|
|
@@ -64,19 +64,67 @@ export class InventoryCheckItem {
|
|
|
64
64
|
@Field({ nullable: true })
|
|
65
65
|
countNo: number
|
|
66
66
|
|
|
67
|
-
@Column({
|
|
67
|
+
@Column({
|
|
68
|
+
type: 'decimal',
|
|
69
|
+
scale: 3,
|
|
70
|
+
nullable: true,
|
|
71
|
+
transformer: {
|
|
72
|
+
to: (value: string | null) => value,
|
|
73
|
+
from: (value: string | null) => {
|
|
74
|
+
if (value === null || value === undefined) return null
|
|
75
|
+
const parsed = parseFloat(value)
|
|
76
|
+
return isNaN(parsed) ? null : parsed
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
})
|
|
68
80
|
@Field({ nullable: true })
|
|
69
81
|
originQty: number
|
|
70
82
|
|
|
71
|
-
@Column({
|
|
83
|
+
@Column({
|
|
84
|
+
type: 'decimal',
|
|
85
|
+
scale: 3,
|
|
86
|
+
nullable: true,
|
|
87
|
+
transformer: {
|
|
88
|
+
to: (value: string | null) => value,
|
|
89
|
+
from: (value: string | null) => {
|
|
90
|
+
if (value === null || value === undefined) return null
|
|
91
|
+
const parsed = parseFloat(value)
|
|
92
|
+
return isNaN(parsed) ? null : parsed
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
})
|
|
72
96
|
@Field({ nullable: true })
|
|
73
97
|
inspectedQty: number
|
|
74
98
|
|
|
75
|
-
@Column({
|
|
99
|
+
@Column({
|
|
100
|
+
type: 'decimal',
|
|
101
|
+
scale: 3,
|
|
102
|
+
nullable: true,
|
|
103
|
+
transformer: {
|
|
104
|
+
to: (value: string | null) => value,
|
|
105
|
+
from: (value: string | null) => {
|
|
106
|
+
if (value === null || value === undefined) return null
|
|
107
|
+
const parsed = parseFloat(value)
|
|
108
|
+
return isNaN(parsed) ? null : parsed
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
})
|
|
76
112
|
@Field({ nullable: true })
|
|
77
113
|
originUomValue: number
|
|
78
114
|
|
|
79
|
-
@Column({
|
|
115
|
+
@Column({
|
|
116
|
+
type: 'decimal',
|
|
117
|
+
scale: 3,
|
|
118
|
+
nullable: true,
|
|
119
|
+
transformer: {
|
|
120
|
+
to: (value: string | null) => value,
|
|
121
|
+
from: (value: string | null) => {
|
|
122
|
+
if (value === null || value === undefined) return null
|
|
123
|
+
const parsed = parseFloat(value)
|
|
124
|
+
return isNaN(parsed) ? null : parsed
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
})
|
|
80
128
|
@Field({ nullable: true })
|
|
81
129
|
inspectedUomValue: number
|
|
82
130
|
|
|
@@ -294,8 +294,12 @@ export class OrderInventoryQuery {
|
|
|
294
294
|
value: releaseGood.id,
|
|
295
295
|
relation: true
|
|
296
296
|
})
|
|
297
|
+
} else {
|
|
298
|
+
// If no matching release good is found, return empty result
|
|
299
|
+
return { items: [], total: 0 }
|
|
297
300
|
}
|
|
298
301
|
}
|
|
302
|
+
|
|
299
303
|
const qb: SelectQueryBuilder<OrderInventory> = getRepository(OrderInventory).createQueryBuilder('oi')
|
|
300
304
|
buildQuery(qb, params, context)
|
|
301
305
|
|
|
@@ -327,6 +331,7 @@ export class OrderInventoryQuery {
|
|
|
327
331
|
productName: item.inventory.product.name,
|
|
328
332
|
productSKU: item.inventory.product.sku,
|
|
329
333
|
productBrand: item.inventory.product.brand,
|
|
334
|
+
isInventoryDecimal: item.inventory.product.isInventoryDecimal,
|
|
330
335
|
packingSize: item.inventory.packingSize
|
|
331
336
|
}
|
|
332
337
|
})
|
|
@@ -68,16 +68,16 @@ export class NewOrderInventory {
|
|
|
68
68
|
@Field({ nullable: true })
|
|
69
69
|
releaseOrderId: string
|
|
70
70
|
|
|
71
|
-
@Field(type =>
|
|
71
|
+
@Field(type => Float, { nullable: true })
|
|
72
72
|
releaseQty: number
|
|
73
73
|
|
|
74
|
-
@Field(type =>
|
|
74
|
+
@Field(type => Float, { nullable: true })
|
|
75
75
|
pickedQty: number
|
|
76
76
|
|
|
77
|
-
@Field(type =>
|
|
77
|
+
@Field(type => Float, { nullable: true })
|
|
78
78
|
sortedQty: number
|
|
79
79
|
|
|
80
|
-
@Field(type =>
|
|
80
|
+
@Field(type => Float, { nullable: true })
|
|
81
81
|
packedQty: number
|
|
82
82
|
|
|
83
83
|
@Field(type => Float, { nullable: true })
|
|
@@ -104,13 +104,13 @@ export class NewOrderInventory {
|
|
|
104
104
|
@Field({ nullable: true })
|
|
105
105
|
existingRow: boolean
|
|
106
106
|
|
|
107
|
-
@Field(type =>
|
|
107
|
+
@Field(type => Float, { nullable: true })
|
|
108
108
|
returnQty: number
|
|
109
109
|
|
|
110
110
|
@Field(type => Float, { nullable: true })
|
|
111
111
|
returnUomValue: number
|
|
112
112
|
|
|
113
|
-
@Field(type =>
|
|
113
|
+
@Field(type => Float, { nullable: true })
|
|
114
114
|
returnToLocationQty: number
|
|
115
115
|
|
|
116
116
|
@Field(type => Float, { nullable: true })
|
|
@@ -146,7 +146,7 @@ export class OrderInventoryPatch {
|
|
|
146
146
|
@Field(type => ObjectRef, { nullable: true })
|
|
147
147
|
inventory: ObjectRef
|
|
148
148
|
|
|
149
|
-
@Field(type =>
|
|
149
|
+
@Field(type => Float, { nullable: true })
|
|
150
150
|
inspectedQty: number
|
|
151
151
|
|
|
152
152
|
@Field(type => Float, { nullable: true })
|
|
@@ -188,19 +188,19 @@ export class OrderInventoryPatch {
|
|
|
188
188
|
@Field({ nullable: true })
|
|
189
189
|
extraJsonData: string
|
|
190
190
|
|
|
191
|
-
@Field(type =>
|
|
191
|
+
@Field(type => Float, { nullable: true })
|
|
192
192
|
releaseQty: number
|
|
193
193
|
|
|
194
194
|
@Field({ nullable: true })
|
|
195
195
|
serialNumber: string
|
|
196
196
|
|
|
197
|
-
@Field(type =>
|
|
197
|
+
@Field(type => Float, { nullable: true })
|
|
198
198
|
sortedQty: number
|
|
199
199
|
|
|
200
|
-
@Field(type =>
|
|
200
|
+
@Field(type => Float, { nullable: true })
|
|
201
201
|
pickedQty: number
|
|
202
202
|
|
|
203
|
-
@Field(type =>
|
|
203
|
+
@Field(type => Float, { nullable: true })
|
|
204
204
|
packedQty: number
|
|
205
205
|
|
|
206
206
|
@Field({ nullable: true })
|
|
@@ -221,7 +221,7 @@ export class OrderInventoryPatch {
|
|
|
221
221
|
@Field(type => Float, { nullable: true })
|
|
222
222
|
returnUomValue: number
|
|
223
223
|
|
|
224
|
-
@Field(type =>
|
|
224
|
+
@Field(type => Float, { nullable: true })
|
|
225
225
|
actualPackQty: number
|
|
226
226
|
|
|
227
227
|
@Field(type => Int, { nullable: true })
|