@things-factory/sales-base 4.3.105-alpha.0 → 4.3.106
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/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/draft-release-good/draft-release-good.js +40 -0
- package/dist-server/service/draft-release-good/draft-release-good.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 +26 -18
- package/dist-server/service/order-product/order-product-types.js.map +1 -1
- package/dist-server/service/order-product/order-product.js +13 -5
- 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 +176 -188
- 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 +8 -18
- package/dist-server/service/release-good/release-good-mutation.js.map +1 -1
- package/dist-server/service/release-good/release-good-query.js +1 -2
- 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 +41 -3
- package/dist-server/service/release-good/release-good.js.map +1 -1
- package/dist-server/service/return-order/return-order-mutation.js +0 -2
- 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 +102 -33
- package/dist-server/utils/inventory-util.js.map +1 -1
- package/package.json +13 -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/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/draft-release-good/draft-release-good.ts +32 -0
- 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 +12 -6
- package/server/service/order-product/order-product.ts +15 -13
- package/server/service/order-vas/order-vas.ts +1 -6
- package/server/service/others/other-query.ts +218 -224
- 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 +8 -21
- package/server/service/release-good/release-good-query.ts +1 -2
- package/server/service/release-good/release-good-types.ts +3 -4
- package/server/service/release-good/release-good.ts +34 -2
- package/server/service/return-order/return-order-mutation.ts +1 -3
- 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 +147 -67
- 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'
|
|
@@ -676,7 +676,7 @@ export async function generateReleaseGoodFunction(
|
|
|
676
676
|
|
|
677
677
|
const pbSettings: ProductBundleSetting[] = await tx.getRepository(ProductBundleSetting).find({
|
|
678
678
|
where: { productBundle: oi.product.id },
|
|
679
|
-
relations: ['product', 'productBundle'
|
|
679
|
+
relations: ['product', 'productBundle']
|
|
680
680
|
})
|
|
681
681
|
|
|
682
682
|
pbSettings.forEach(pbs => {
|
|
@@ -690,9 +690,6 @@ export async function generateReleaseGoodFunction(
|
|
|
690
690
|
id: pbs.product.id,
|
|
691
691
|
name: pbs.product.name,
|
|
692
692
|
groupType: PRODUCT_GROUP_TYPE.SINGLE
|
|
693
|
-
},
|
|
694
|
-
productDetail: {
|
|
695
|
-
id: pbs.productDetail.id
|
|
696
693
|
}
|
|
697
694
|
}
|
|
698
695
|
splitBundleOIs.push(splitOI)
|
|
@@ -707,10 +704,6 @@ export async function generateReleaseGoodFunction(
|
|
|
707
704
|
newReleaseGood = await tx.getRepository(ReleaseGood).save(newReleaseGood)
|
|
708
705
|
|
|
709
706
|
for (let oi of orderInventories) {
|
|
710
|
-
let productDetail: any = await tx
|
|
711
|
-
.getRepository(ProductDetail)
|
|
712
|
-
.findOne(oi.productDetail.id, { relations: ['product'] })
|
|
713
|
-
|
|
714
707
|
let newOrderInv: OrderInventory = Object.assign({}, oi)
|
|
715
708
|
newOrderInv = {
|
|
716
709
|
...newOrderInv,
|
|
@@ -719,8 +712,7 @@ export async function generateReleaseGoodFunction(
|
|
|
719
712
|
status: ORDER_INVENTORY_STATUS.PENDING,
|
|
720
713
|
name: OrderNoGenerator.orderInventory(),
|
|
721
714
|
releaseGood: newReleaseGood,
|
|
722
|
-
product:
|
|
723
|
-
productDetail,
|
|
715
|
+
product: await tx.getRepository(Product).findOne(oi.product.id),
|
|
724
716
|
creator: user,
|
|
725
717
|
updater: user
|
|
726
718
|
}
|
|
@@ -758,9 +750,9 @@ export async function generateReleaseGoodFunction(
|
|
|
758
750
|
}
|
|
759
751
|
|
|
760
752
|
let assignedOrderInventories: OrderInventory[] = await InventoryUtil.autoAssignInventoryForRelease(
|
|
753
|
+
newOrderInv.product,
|
|
761
754
|
oi,
|
|
762
|
-
|
|
763
|
-
productDetail,
|
|
755
|
+
oi.packingType,
|
|
764
756
|
locationSortingRules,
|
|
765
757
|
bizplace,
|
|
766
758
|
warehouseDomain,
|
|
@@ -1387,17 +1379,12 @@ export async function bulkGenerateReleaseGood(
|
|
|
1387
1379
|
}
|
|
1388
1380
|
}
|
|
1389
1381
|
|
|
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
|
-
}
|
|
1382
|
+
const product: Product = await tx.getRepository(Product).findOne(oi.productId)
|
|
1396
1383
|
|
|
1397
1384
|
let assignedResult = await InventoryUtil.autoAssignInventoryForRelease(
|
|
1398
|
-
oi,
|
|
1399
1385
|
product,
|
|
1400
|
-
|
|
1386
|
+
oi,
|
|
1387
|
+
oi.packingType,
|
|
1401
1388
|
locationSortingRules,
|
|
1402
1389
|
bizplace,
|
|
1403
1390
|
warehouseDomain,
|
|
@@ -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,
|
|
@@ -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
|
|
|
@@ -194,6 +194,18 @@ export class ReleaseGood {
|
|
|
194
194
|
@Field({ nullable: true })
|
|
195
195
|
remark: string
|
|
196
196
|
|
|
197
|
+
@Column({ nullable: true })
|
|
198
|
+
@Field({ nullable: true })
|
|
199
|
+
platformCode: string
|
|
200
|
+
|
|
201
|
+
@Column({ nullable: true })
|
|
202
|
+
@Field({ nullable: true })
|
|
203
|
+
platformCountry: string
|
|
204
|
+
|
|
205
|
+
@Column({ nullable: true })
|
|
206
|
+
@Field({ nullable: true })
|
|
207
|
+
platformName: string
|
|
208
|
+
|
|
197
209
|
@Column({ nullable: true })
|
|
198
210
|
@Field({ nullable: true })
|
|
199
211
|
marketplaceOrderStatus: string
|
|
@@ -382,6 +394,26 @@ export class ReleaseGood {
|
|
|
382
394
|
@Field(type => ShippingOrderInfo, { nullable: true })
|
|
383
395
|
shippingOrderInfo?: ShippingOrderInfo
|
|
384
396
|
|
|
397
|
+
@Column('float', { nullable: true })
|
|
398
|
+
@Field({ nullable: true })
|
|
399
|
+
discountAmount?: number
|
|
400
|
+
|
|
401
|
+
@Column('float', { nullable: true })
|
|
402
|
+
@Field({ nullable: true })
|
|
403
|
+
promotionAmount?: number
|
|
404
|
+
|
|
405
|
+
@Column('float', { nullable: true })
|
|
406
|
+
@Field({ nullable: true })
|
|
407
|
+
taxAmount?: number
|
|
408
|
+
|
|
409
|
+
@Column('float', { nullable: true })
|
|
410
|
+
@Field({ nullable: true })
|
|
411
|
+
shippingFee?: number
|
|
412
|
+
|
|
413
|
+
@Column('float', { nullable: true })
|
|
414
|
+
@Field({ nullable: true })
|
|
415
|
+
paidAmount: number
|
|
416
|
+
|
|
385
417
|
/* Mainly used for rawReleaseGood*/
|
|
386
418
|
@Field({ nullable: true })
|
|
387
419
|
productId: string
|
|
@@ -459,10 +491,10 @@ export class ReleaseGood {
|
|
|
459
491
|
@Field({ nullable: true })
|
|
460
492
|
orderRemark: Boolean
|
|
461
493
|
|
|
462
|
-
@Field({ nullable:true })
|
|
494
|
+
@Field({ nullable: true })
|
|
463
495
|
totalInventoriesByBin: Number
|
|
464
496
|
|
|
465
|
-
@Field({ nullable:true })
|
|
497
|
+
@Field({ nullable: true })
|
|
466
498
|
isOrderInventoryBin: Boolean
|
|
467
499
|
|
|
468
500
|
@Field({ nullable: true })
|
|
@@ -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
|
)
|
|
@@ -100,7 +99,6 @@ export class ReturnOrderMutation {
|
|
|
100
99
|
newOrderInv.name = OrderNoGenerator.orderInventory()
|
|
101
100
|
newOrderInv.returnOrder = createdReturnOrder
|
|
102
101
|
newOrderInv.product = await tx.getRepository(Product).findOne(moi.product.id)
|
|
103
|
-
newOrderInv.productDetail = await tx.getRepository(ProductDetail).findOne(moi.productDetail.id)
|
|
104
102
|
newOrderInv.creator = user
|
|
105
103
|
newOrderInv.updater = user
|
|
106
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
|