@things-factory/sales-base 4.3.113-alpha.0 → 4.3.114
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 +5 -6
- package/dist-server/service/arrival-notice/arrival-notice-mutation.js.map +1 -1
- package/dist-server/service/arrival-notice/arrival-notice-query.js +0 -1
- package/dist-server/service/arrival-notice/arrival-notice-query.js.map +1 -1
- package/dist-server/service/delivery-order/delivery-order-mutation.js +30 -3
- package/dist-server/service/delivery-order/delivery-order-mutation.js.map +1 -1
- package/dist-server/service/draft-release-good/draft-release-good-mutation.js +4 -3
- package/dist-server/service/draft-release-good/draft-release-good-mutation.js.map +1 -1
- package/dist-server/service/draft-release-good/draft-release-good-query.js +15 -11
- package/dist-server/service/draft-release-good/draft-release-good-query.js.map +1 -1
- package/dist-server/service/goods-receival-note/goods-receival-note-mutation.js +32 -4
- package/dist-server/service/goods-receival-note/goods-receival-note-mutation.js.map +1 -1
- package/dist-server/service/invoice-product/invoice-product.js +3 -8
- package/dist-server/service/invoice-product/invoice-product.js.map +1 -1
- package/dist-server/service/order-inventory/order-inventory-query.js +1 -2
- package/dist-server/service/order-inventory/order-inventory-query.js.map +1 -1
- package/dist-server/service/order-inventory/order-inventory-types.js +10 -18
- package/dist-server/service/order-inventory/order-inventory-types.js.map +1 -1
- package/dist-server/service/order-inventory/order-inventory.js +3 -12
- package/dist-server/service/order-inventory/order-inventory.js.map +1 -1
- package/dist-server/service/order-product/order-product-query.js +0 -1
- package/dist-server/service/order-product/order-product-query.js.map +1 -1
- package/dist-server/service/order-product/order-product-types.js +10 -18
- package/dist-server/service/order-product/order-product-types.js.map +1 -1
- package/dist-server/service/order-product/order-product.js +5 -0
- package/dist-server/service/order-product/order-product.js.map +1 -1
- package/dist-server/service/order-vas/order-vas.js +3 -8
- package/dist-server/service/order-vas/order-vas.js.map +1 -1
- package/dist-server/service/others/other-query.js +177 -196
- package/dist-server/service/others/other-query.js.map +1 -1
- package/dist-server/service/others/other-types.js +1 -9
- package/dist-server/service/others/other-types.js.map +1 -1
- package/dist-server/service/purchase-order/purchase-order-mutation.js +2 -10
- package/dist-server/service/purchase-order/purchase-order-mutation.js.map +1 -1
- package/dist-server/service/purchase-order/purchase-order-query.js +0 -1
- package/dist-server/service/purchase-order/purchase-order-query.js.map +1 -1
- package/dist-server/service/release-good/release-good-mutation.js +39 -29
- package/dist-server/service/release-good/release-good-mutation.js.map +1 -1
- package/dist-server/service/release-good/release-good-query.js +11 -10
- package/dist-server/service/release-good/release-good-query.js.map +1 -1
- package/dist-server/service/release-good/release-good-types.js +4 -8
- package/dist-server/service/release-good/release-good-types.js.map +1 -1
- package/dist-server/service/release-good/release-good.js +14 -1
- package/dist-server/service/release-good/release-good.js.map +1 -1
- package/dist-server/service/return-order/return-order-mutation.js +0 -3
- package/dist-server/service/return-order/return-order-mutation.js.map +1 -1
- package/dist-server/service/return-order/return-order-types.js.map +1 -1
- package/dist-server/service/reverse-kitting-order-inventory/reverse-kitting-order-inventory.js +3 -8
- package/dist-server/service/reverse-kitting-order-inventory/reverse-kitting-order-inventory.js.map +1 -1
- package/dist-server/utils/inventory-util.js +104 -39
- package/dist-server/utils/inventory-util.js.map +1 -1
- package/package.json +14 -13
- package/server/service/arrival-notice/arrival-notice-mutation.ts +3 -6
- package/server/service/arrival-notice/arrival-notice-query.ts +0 -1
- package/server/service/delivery-order/delivery-order-mutation.ts +49 -19
- package/server/service/draft-release-good/draft-release-good-mutation.ts +4 -3
- package/server/service/draft-release-good/draft-release-good-query.ts +21 -17
- package/server/service/goods-receival-note/goods-receival-note-mutation.ts +38 -4
- package/server/service/invoice-product/invoice-product.ts +1 -5
- package/server/service/order-inventory/order-inventory-query.ts +0 -2
- package/server/service/order-inventory/order-inventory-types.ts +0 -6
- package/server/service/order-inventory/order-inventory.ts +1 -8
- package/server/service/order-product/order-product-query.ts +0 -1
- package/server/service/order-product/order-product-types.ts +0 -6
- package/server/service/order-product/order-product.ts +4 -0
- package/server/service/order-vas/order-vas.ts +1 -6
- package/server/service/others/other-query.ts +219 -231
- package/server/service/others/other-types.ts +1 -7
- package/server/service/purchase-order/purchase-order-mutation.ts +1 -10
- package/server/service/purchase-order/purchase-order-query.ts +0 -1
- package/server/service/release-good/release-good-mutation.ts +54 -37
- package/server/service/release-good/release-good-query.ts +10 -9
- package/server/service/release-good/release-good-types.ts +3 -4
- package/server/service/release-good/release-good.ts +10 -0
- package/server/service/return-order/return-order-mutation.ts +1 -4
- package/server/service/return-order/return-order-types.ts +0 -1
- package/server/service/reverse-kitting-order-inventory/reverse-kitting-order-inventory.ts +1 -5
- package/server/utils/inventory-util.ts +149 -75
- package/translations/en.json +0 -1
- package/translations/ko.json +1 -2
- package/translations/ms.json +1 -2
- package/translations/zh.json +0 -25
|
@@ -17,7 +17,7 @@ import { MarketplaceStore } from '@things-factory/integration-marketplace'
|
|
|
17
17
|
import { Sellercraft, SellercraftStatus } from '@things-factory/integration-sellercraft'
|
|
18
18
|
import { MarketplaceOrder, MarketplaceProductVariation } from '@things-factory/marketplace-base'
|
|
19
19
|
// import { sendNotification } from '@things-factory/notification'
|
|
20
|
-
import { Product, ProductBundleSetting
|
|
20
|
+
import { Product, ProductBundleSetting } from '@things-factory/product-base'
|
|
21
21
|
import { PartnerSetting, Setting } from '@things-factory/setting-base'
|
|
22
22
|
import { Domain } from '@things-factory/shell'
|
|
23
23
|
import { Inventory } from '@things-factory/warehouse-base'
|
|
@@ -126,17 +126,41 @@ export class ReleaseGoodMutation {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
let confirmedReleaseGoods: ReleaseGood[] = []
|
|
129
|
+
await getConnection().transaction(async (childTx: EntityManager) => {
|
|
130
|
+
if (createdReleaseGoods.length)
|
|
131
|
+
try {
|
|
132
|
+
const bizplace: Bizplace = await childTx.getRepository(Bizplace).findOne({
|
|
133
|
+
where: { id: bizplaceId },
|
|
134
|
+
relations: ['domain']
|
|
135
|
+
})
|
|
129
136
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
const directReceiveSetting: Setting = await childTx.getRepository(Setting).findOne({
|
|
138
|
+
where: { domain, category: 'id-rule', name: 'enable-direct-receive-release-order' }
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
const partnerDirectReceiveSetting: PartnerSetting = await childTx.getRepository(PartnerSetting).findOne({
|
|
142
|
+
where: { setting: directReceiveSetting, domain, partnerDomain: bizplace?.domain }
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
let partnerDirectReceiveSettingValue = parseFloat(partnerDirectReceiveSetting?.value)
|
|
146
|
+
|
|
147
|
+
// If status of create RO is PENDING then directly CONFIRM -> RECEIVE
|
|
148
|
+
if (
|
|
149
|
+
!isNaN(partnerDirectReceiveSetting?.value) &&
|
|
150
|
+
!isNaN(parseFloat(partnerDirectReceiveSetting?.value)) &&
|
|
151
|
+
partnerDirectReceiveSettingValue > 0
|
|
152
|
+
) {
|
|
153
|
+
confirmedReleaseGoods = await bulkConfirmOrReceiveReleaseGoods(
|
|
154
|
+
createdReleaseGoods.map(rg => rg.name),
|
|
155
|
+
domain,
|
|
156
|
+
user,
|
|
157
|
+
context,
|
|
158
|
+
partnerDirectReceiveSettingValue,
|
|
159
|
+
childTx
|
|
160
|
+
)
|
|
161
|
+
}
|
|
162
|
+
} catch (error) {}
|
|
163
|
+
})
|
|
140
164
|
|
|
141
165
|
if (errorsCaught.length)
|
|
142
166
|
throw new ValidationError({
|
|
@@ -628,8 +652,8 @@ export async function generateReleaseGoodFunction(
|
|
|
628
652
|
orderMethod: releaseGood?.orderMethod
|
|
629
653
|
? releaseGood.orderMethod
|
|
630
654
|
: releaseGood.orderInventories[0]?.inventory?.id
|
|
631
|
-
|
|
632
|
-
|
|
655
|
+
? ORDER_METHOD.SELECT_BY_PALLET
|
|
656
|
+
: ORDER_METHOD.SELECT_BY_PRODUCT,
|
|
633
657
|
status: ORDER_STATUS.PENDING,
|
|
634
658
|
packageId: releaseGood?.packageId,
|
|
635
659
|
storeName: releaseGood?.storeName,
|
|
@@ -676,7 +700,7 @@ export async function generateReleaseGoodFunction(
|
|
|
676
700
|
|
|
677
701
|
const pbSettings: ProductBundleSetting[] = await tx.getRepository(ProductBundleSetting).find({
|
|
678
702
|
where: { productBundle: oi.product.id },
|
|
679
|
-
relations: ['product', 'productBundle'
|
|
703
|
+
relations: ['product', 'productBundle']
|
|
680
704
|
})
|
|
681
705
|
|
|
682
706
|
pbSettings.forEach(pbs => {
|
|
@@ -690,9 +714,6 @@ export async function generateReleaseGoodFunction(
|
|
|
690
714
|
id: pbs.product.id,
|
|
691
715
|
name: pbs.product.name,
|
|
692
716
|
groupType: PRODUCT_GROUP_TYPE.SINGLE
|
|
693
|
-
},
|
|
694
|
-
productDetail: {
|
|
695
|
-
id: pbs.productDetail.id
|
|
696
717
|
}
|
|
697
718
|
}
|
|
698
719
|
splitBundleOIs.push(splitOI)
|
|
@@ -707,10 +728,6 @@ export async function generateReleaseGoodFunction(
|
|
|
707
728
|
newReleaseGood = await tx.getRepository(ReleaseGood).save(newReleaseGood)
|
|
708
729
|
|
|
709
730
|
for (let oi of orderInventories) {
|
|
710
|
-
let productDetail: any = await tx
|
|
711
|
-
.getRepository(ProductDetail)
|
|
712
|
-
.findOne(oi.productDetail.id, { relations: ['product'] })
|
|
713
|
-
|
|
714
731
|
let newOrderInv: OrderInventory = Object.assign({}, oi)
|
|
715
732
|
newOrderInv = {
|
|
716
733
|
...newOrderInv,
|
|
@@ -719,8 +736,7 @@ export async function generateReleaseGoodFunction(
|
|
|
719
736
|
status: ORDER_INVENTORY_STATUS.PENDING,
|
|
720
737
|
name: OrderNoGenerator.orderInventory(),
|
|
721
738
|
releaseGood: newReleaseGood,
|
|
722
|
-
product:
|
|
723
|
-
productDetail,
|
|
739
|
+
product: await tx.getRepository(Product).findOne(oi.product.id),
|
|
724
740
|
creator: user,
|
|
725
741
|
updater: user
|
|
726
742
|
}
|
|
@@ -758,9 +774,9 @@ export async function generateReleaseGoodFunction(
|
|
|
758
774
|
}
|
|
759
775
|
|
|
760
776
|
let assignedOrderInventories: OrderInventory[] = await InventoryUtil.autoAssignInventoryForRelease(
|
|
777
|
+
newOrderInv.product,
|
|
761
778
|
oi,
|
|
762
|
-
|
|
763
|
-
productDetail,
|
|
779
|
+
oi.packingType,
|
|
764
780
|
locationSortingRules,
|
|
765
781
|
bizplace,
|
|
766
782
|
warehouseDomain,
|
|
@@ -1387,17 +1403,12 @@ export async function bulkGenerateReleaseGood(
|
|
|
1387
1403
|
}
|
|
1388
1404
|
}
|
|
1389
1405
|
|
|
1390
|
-
|
|
1391
|
-
let product = oi.orderProduct?.product
|
|
1392
|
-
if (!productDetail) {
|
|
1393
|
-
productDetail = await tx.getRepository(ProductDetail).findOne(oi.productDetailId, { relations: ['product'] })
|
|
1394
|
-
product = productDetail.product
|
|
1395
|
-
}
|
|
1406
|
+
const product: Product = await tx.getRepository(Product).findOne(oi.productId)
|
|
1396
1407
|
|
|
1397
1408
|
let assignedResult = await InventoryUtil.autoAssignInventoryForRelease(
|
|
1398
|
-
oi,
|
|
1399
1409
|
product,
|
|
1400
|
-
|
|
1410
|
+
oi,
|
|
1411
|
+
oi.packingType,
|
|
1401
1412
|
locationSortingRules,
|
|
1402
1413
|
bizplace,
|
|
1403
1414
|
warehouseDomain,
|
|
@@ -1476,11 +1487,12 @@ export async function bulkGenerateReleaseGood(
|
|
|
1476
1487
|
}
|
|
1477
1488
|
}
|
|
1478
1489
|
|
|
1479
|
-
export async function
|
|
1490
|
+
export async function bulkConfirmOrReceiveReleaseGoods(
|
|
1480
1491
|
releaseGoodsNo: string[],
|
|
1481
1492
|
domain: Domain,
|
|
1482
1493
|
user: User,
|
|
1483
1494
|
context: any,
|
|
1495
|
+
partnerDirectReceiveSettingValue: Number,
|
|
1484
1496
|
tx?: EntityManager
|
|
1485
1497
|
): Promise<ReleaseGood[]> {
|
|
1486
1498
|
let foundReleaseGoods: ReleaseGood[] = await tx.getRepository(ReleaseGood).find({
|
|
@@ -1495,15 +1507,20 @@ export async function bulkConfirmReleaseGoods(
|
|
|
1495
1507
|
where: { domain, releaseGood: In(foundReleaseGoods.map((rg: ReleaseGood) => rg.id)) }
|
|
1496
1508
|
})
|
|
1497
1509
|
|
|
1510
|
+
let orderStatus =
|
|
1511
|
+
partnerDirectReceiveSettingValue == 1 ? ORDER_STATUS.PENDING_RECEIVE : ORDER_STATUS.PENDING_WORKSHEET
|
|
1512
|
+
|
|
1513
|
+
let orderInventoryStatus = partnerDirectReceiveSettingValue == 1 ? ORDER_INVENTORY_STATUS.PENDING_RECEIVE : ORDER_INVENTORY_STATUS.PENDING_WORKSHEET
|
|
1514
|
+
|
|
1498
1515
|
await tx
|
|
1499
1516
|
.getRepository(ReleaseGood)
|
|
1500
|
-
.update({ id: In(foundReleaseGoods.map(rg => rg.id)) }, { status:
|
|
1517
|
+
.update({ id: In(foundReleaseGoods.map(rg => rg.id)) }, { status: orderStatus, updater: user })
|
|
1501
1518
|
|
|
1502
1519
|
await tx
|
|
1503
1520
|
.getRepository(OrderInventory)
|
|
1504
1521
|
.update(
|
|
1505
1522
|
{ id: In(foundOrderInventories.map(oi => oi.id)) },
|
|
1506
|
-
{ status:
|
|
1523
|
+
{ status: orderInventoryStatus, updater: user }
|
|
1507
1524
|
)
|
|
1508
1525
|
|
|
1509
1526
|
if (context?.state?.type != 'api') {
|
|
@@ -1549,7 +1566,7 @@ export async function bulkConfirmReleaseGoods(
|
|
|
1549
1566
|
return {
|
|
1550
1567
|
...releaseGood,
|
|
1551
1568
|
orderInventories: await tx.getRepository(OrderInventory).find({ where: releaseGood }),
|
|
1552
|
-
status:
|
|
1569
|
+
status: orderStatus,
|
|
1553
1570
|
updater: user
|
|
1554
1571
|
}
|
|
1555
1572
|
})
|
|
@@ -133,6 +133,7 @@ export class ReleaseGoodQuery {
|
|
|
133
133
|
'orderInventories.product',
|
|
134
134
|
'orderInventories.inventory',
|
|
135
135
|
'orderInventories.inventory.product',
|
|
136
|
+
'orderInventories.inventory.product.productDetails',
|
|
136
137
|
'orderVass',
|
|
137
138
|
'orderVass.vas',
|
|
138
139
|
'creator',
|
|
@@ -196,7 +197,6 @@ export class ReleaseGoodQuery {
|
|
|
196
197
|
.createQueryBuilder('oi')
|
|
197
198
|
.leftJoinAndSelect('oi.inventory', 'inventory')
|
|
198
199
|
.leftJoinAndSelect('oi.product', 'product')
|
|
199
|
-
.leftJoinAndSelect('oi.productDetail', 'productDetail')
|
|
200
200
|
.leftJoinAndSelect('inventory.location', 'location')
|
|
201
201
|
.where('oi.domain_id = :domainId', { domainId: domain.id })
|
|
202
202
|
.andWhere('oi.release_good_id = :releaseGoodId', { releaseGoodId: releaseGood.id })
|
|
@@ -227,7 +227,6 @@ export class ReleaseGoodQuery {
|
|
|
227
227
|
batchIdRef: inventory.batchIdRef,
|
|
228
228
|
palletId: inventory.palletId,
|
|
229
229
|
product: orderInv.product,
|
|
230
|
-
productDetail: orderInv.productDetail,
|
|
231
230
|
productIdRef: orderInv.product.id,
|
|
232
231
|
productName: `${orderInv.product.name} (${orderInv.product.description})`,
|
|
233
232
|
packingType: orderInv.packingType,
|
|
@@ -769,7 +768,7 @@ export async function bulkReleaseGoodsAvailableItemsFunction(
|
|
|
769
768
|
sku VARCHAR(150),
|
|
770
769
|
product_info VARCHAR(250),
|
|
771
770
|
packing_type VARCHAR(50),
|
|
772
|
-
packing_size
|
|
771
|
+
packing_size FLOAT,
|
|
773
772
|
uom VARCHAR(10),
|
|
774
773
|
release_qty INT
|
|
775
774
|
);
|
|
@@ -784,18 +783,18 @@ export async function bulkReleaseGoodsAvailableItemsFunction(
|
|
|
784
783
|
js.sku,
|
|
785
784
|
CASE WHEN p.description NOT IN (NULL, '', '-') THEN CONCAT(p.name, '(', p.description, ')')
|
|
786
785
|
ELSE p.name END AS product_info,
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
786
|
+
pd.packing_type,
|
|
787
|
+
pd.packing_size,
|
|
788
|
+
pd.uom
|
|
790
789
|
FROM JSON_POPULATE_RECORDSET(NULL::raw_release_goods, $1) js
|
|
791
790
|
LEFT JOIN products p ON LOWER(js.sku) = LOWER(p.sku) AND p.bizplace_id = $2
|
|
792
791
|
LEFT JOIN product_details pd ON p.id = pd.product_id
|
|
793
792
|
AND CASE WHEN js.packing_type NOTNULL AND js.packing_size NOTNULL AND js.uom NOTNULL
|
|
794
|
-
THEN pd.packing_type = js.packing_type AND pd.packing_size = js.packing_size AND pd.uom = js.uom
|
|
793
|
+
THEN LOWER(pd.packing_type) = LOWER(js.packing_type) AND pd.packing_size = js.packing_size AND LOWER(pd.uom) = LOWER(js.uom)
|
|
795
794
|
WHEN js.packing_type NOTNULL AND js.packing_size NOTNULL AND js.uom ISNULL
|
|
796
|
-
THEN pd.packing_type = js.packing_type AND pd.packing_size = js.packing_size AND pd.is_default IS TRUE
|
|
795
|
+
THEN LOWER(pd.packing_type) = LOWER(js.packing_type) AND pd.packing_size = js.packing_size AND pd.is_default IS TRUE
|
|
797
796
|
WHEN js.packing_type ISNULL AND js.packing_size ISNULL AND js.uom NOTNULL
|
|
798
|
-
THEN pd.uom = js.uom AND pd.is_default IS TRUE ELSE pd.is_default IS TRUE
|
|
797
|
+
THEN LOWER(pd.uom) = LOWER(js.uom) AND pd.is_default IS TRUE ELSE pd.is_default IS TRUE
|
|
799
798
|
END;
|
|
800
799
|
`,
|
|
801
800
|
[json_oi, companyBizplaceId.id]
|
|
@@ -945,6 +944,8 @@ function _extractData(rawData, validatedData) {
|
|
|
945
944
|
? 'backdate is not allowed'
|
|
946
945
|
: !raw.refNo
|
|
947
946
|
? 'ref no is empty'
|
|
947
|
+
: !Number.isInteger(raw.packingSize)
|
|
948
|
+
? 'packing size must be an integer'
|
|
948
949
|
: ''
|
|
949
950
|
}
|
|
950
951
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Field, Float, InputType, Int, ObjectType } from 'type-graphql'
|
|
2
2
|
|
|
3
|
-
import { Product
|
|
3
|
+
import { Product } from '@things-factory/product-base'
|
|
4
4
|
import { ObjectRef } from '@things-factory/shell'
|
|
5
5
|
import { Location } from '@things-factory/warehouse-base'
|
|
6
6
|
|
|
@@ -77,9 +77,6 @@ export class InventoryInfos {
|
|
|
77
77
|
@Field(type => Product, { nullable: true })
|
|
78
78
|
product?: Product
|
|
79
79
|
|
|
80
|
-
@Field(type => ProductDetail, { nullable: true })
|
|
81
|
-
productDetail?: ProductDetail
|
|
82
|
-
|
|
83
80
|
@Field({ nullable: true })
|
|
84
81
|
packingType?: string
|
|
85
82
|
|
|
@@ -188,6 +185,8 @@ export class NewReleaseGood {
|
|
|
188
185
|
@Field({ nullable: true })
|
|
189
186
|
orderMethod: string
|
|
190
187
|
|
|
188
|
+
|
|
189
|
+
|
|
191
190
|
@Field({ nullable: true })
|
|
192
191
|
collectionOrderNo: string
|
|
193
192
|
|
|
@@ -488,6 +488,16 @@ export class ReleaseGood {
|
|
|
488
488
|
@RelationId((releaseGood: ReleaseGood) => releaseGood.manifestedBy)
|
|
489
489
|
manifestedById: string
|
|
490
490
|
|
|
491
|
+
@ManyToOne(type => User)
|
|
492
|
+
@Field(type => User, { nullable: true })
|
|
493
|
+
sortedBy: User
|
|
494
|
+
|
|
495
|
+
@RelationId((releaseGood: ReleaseGood) => releaseGood.sortedBy)
|
|
496
|
+
sortedById: string
|
|
497
|
+
|
|
498
|
+
@Field({ nullable: true })
|
|
499
|
+
sortedByUser: String
|
|
500
|
+
|
|
491
501
|
@Field({ nullable: true })
|
|
492
502
|
orderRemark: Boolean
|
|
493
503
|
|
|
@@ -6,7 +6,7 @@ import { Attachment, createAttachments } from '@things-factory/attachment-base'
|
|
|
6
6
|
import { Role, User } from '@things-factory/auth-base'
|
|
7
7
|
import { Bizplace, getDomainUsers } from '@things-factory/biz-base'
|
|
8
8
|
import { sendNotification } from '@things-factory/notification'
|
|
9
|
-
import { Product
|
|
9
|
+
import { Product } from '@things-factory/product-base'
|
|
10
10
|
import { Domain } from '@things-factory/shell'
|
|
11
11
|
import { Inventory } from '@things-factory/warehouse-base'
|
|
12
12
|
|
|
@@ -59,7 +59,6 @@ export class ReturnOrderMutation {
|
|
|
59
59
|
itm =>
|
|
60
60
|
itm.product.id === curr.product.id &&
|
|
61
61
|
itm.packingType === curr.packingType &&
|
|
62
|
-
itm.productDetailId === curr.product.productDetailId &&
|
|
63
62
|
itm.batchId === curr.batchId &&
|
|
64
63
|
itm.packingSize === curr.packingSize
|
|
65
64
|
)
|
|
@@ -69,7 +68,6 @@ export class ReturnOrderMutation {
|
|
|
69
68
|
} else {
|
|
70
69
|
existingItem.returnQty = existingItem.returnQty + curr.returnQty
|
|
71
70
|
existingItem.returnUomValue = existingItem.returnUomValue + curr.returnUomValue
|
|
72
|
-
existingItem.remark = `${existingItem.remark} | ${curr.remark}`
|
|
73
71
|
}
|
|
74
72
|
|
|
75
73
|
return acc
|
|
@@ -101,7 +99,6 @@ export class ReturnOrderMutation {
|
|
|
101
99
|
newOrderInv.name = OrderNoGenerator.orderInventory()
|
|
102
100
|
newOrderInv.returnOrder = createdReturnOrder
|
|
103
101
|
newOrderInv.product = await tx.getRepository(Product).findOne(moi.product.id)
|
|
104
|
-
newOrderInv.productDetail = await tx.getRepository(ProductDetail).findOne(moi.productDetail.id)
|
|
105
102
|
newOrderInv.creator = user
|
|
106
103
|
newOrderInv.updater = user
|
|
107
104
|
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
|
|
13
13
|
import { User } from '@things-factory/auth-base'
|
|
14
14
|
import { Bizplace } from '@things-factory/biz-base'
|
|
15
|
-
import { Product
|
|
15
|
+
import { Product } from '@things-factory/product-base'
|
|
16
16
|
import { Domain } from '@things-factory/shell'
|
|
17
17
|
import { Inventory } from '@things-factory/warehouse-base'
|
|
18
18
|
|
|
@@ -127,10 +127,6 @@ export class ReverseKittingOrderInventory {
|
|
|
127
127
|
@Field({ nullable: true })
|
|
128
128
|
updatedAt?: Date
|
|
129
129
|
|
|
130
|
-
@ManyToOne(type => ProductDetail, { nullable: true })
|
|
131
|
-
@Field({ nullable: true })
|
|
132
|
-
productDetail: ProductDetail
|
|
133
|
-
|
|
134
130
|
@ManyToOne(type => User, { nullable: true })
|
|
135
131
|
@Field({ nullable: true })
|
|
136
132
|
creator?: User
|