@things-factory/worksheet-base 4.3.324 → 4.3.326
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/controllers/outbound/picking-worksheet-controller.js +4 -4
- package/dist-server/controllers/outbound/picking-worksheet-controller.js.map +1 -1
- package/dist-server/controllers/vas/vas-worksheet-controller.js +2 -128
- package/dist-server/controllers/vas/vas-worksheet-controller.js.map +1 -1
- package/dist-server/controllers/worksheet-controller.js +4 -2
- package/dist-server/controllers/worksheet-controller.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/picking/complete-picking.js +356 -353
- package/dist-server/graphql/resolvers/worksheet/picking/complete-picking.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/vas/index.js +1 -2
- package/dist-server/graphql/resolvers/worksheet/vas/index.js.map +1 -1
- package/dist-server/graphql/types/worksheet/index.js +0 -6
- package/dist-server/graphql/types/worksheet/index.js.map +1 -1
- package/package.json +3 -3
- package/server/controllers/outbound/picking-worksheet-controller.ts +4 -4
- package/server/controllers/vas/vas-worksheet-controller.ts +2 -177
- package/server/controllers/worksheet-controller.ts +5 -3
- package/server/graphql/resolvers/worksheet/picking/complete-picking.ts +395 -391
- package/server/graphql/resolvers/worksheet/vas/index.ts +0 -2
- package/server/graphql/types/worksheet/index.ts +0 -6
- package/dist-server/graphql/resolvers/worksheet/vas/edit-vas.js +0 -16
- package/dist-server/graphql/resolvers/worksheet/vas/edit-vas.js.map +0 -1
- package/server/graphql/resolvers/worksheet/vas/edit-vas.ts +0 -25
|
@@ -41,413 +41,416 @@ exports.completePickingResolver = {
|
|
|
41
41
|
};
|
|
42
42
|
async function completePicking(tx, domain, user, releaseGoodNo) {
|
|
43
43
|
var _a, _b, _c, _d;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
'domain',
|
|
50
|
-
'bizplace',
|
|
51
|
-
'bizplace.domain',
|
|
52
|
-
'bizplace.company',
|
|
53
|
-
'bizplace.company.domain',
|
|
54
|
-
'lastMileDelivery',
|
|
55
|
-
'orderPackages',
|
|
56
|
-
'orderPackages.orderPackageItems',
|
|
57
|
-
'orderPackages.orderPackageItems.orderProduct',
|
|
58
|
-
'orderPackages.orderPackageItems.orderProduct.product',
|
|
59
|
-
'orderPackages.orderPackageItems.orderProduct.productDetail',
|
|
60
|
-
'orderProducts',
|
|
61
|
-
'orderProducts.product',
|
|
62
|
-
'orderProducts.productDetail',
|
|
63
|
-
'creator',
|
|
64
|
-
'updater'
|
|
65
|
-
]
|
|
66
|
-
});
|
|
67
|
-
const companyDomain = releaseGood.bizplace.company.domain;
|
|
68
|
-
let marketplaceOrder;
|
|
69
|
-
if (releaseGood.source == auth_base_1.ApplicationType.MMS || releaseGood.lmdOption) {
|
|
70
|
-
marketplaceOrder = await tx.getRepository(marketplace_base_1.MarketplaceOrder).findOne({
|
|
71
|
-
where: { orderNo: releaseGood.refNo, domain: companyDomain },
|
|
44
|
+
try {
|
|
45
|
+
const pickingWSCtrl = new controllers_1.PickingWorksheetController(tx, domain, user);
|
|
46
|
+
const replenishmentPickingWSCtrl = new controllers_1.ReplenishmentWorksheetController(tx, domain, user);
|
|
47
|
+
let releaseGood = await tx.getRepository(sales_base_1.ReleaseGood).findOne({
|
|
48
|
+
where: { domain, name: releaseGoodNo },
|
|
72
49
|
relations: [
|
|
73
|
-
'
|
|
74
|
-
'
|
|
75
|
-
'
|
|
76
|
-
'
|
|
77
|
-
'
|
|
50
|
+
'domain',
|
|
51
|
+
'bizplace',
|
|
52
|
+
'bizplace.domain',
|
|
53
|
+
'bizplace.company',
|
|
54
|
+
'bizplace.company.domain',
|
|
55
|
+
'lastMileDelivery',
|
|
56
|
+
'orderPackages',
|
|
57
|
+
'orderPackages.orderPackageItems',
|
|
58
|
+
'orderPackages.orderPackageItems.orderProduct',
|
|
59
|
+
'orderPackages.orderPackageItems.orderProduct.product',
|
|
60
|
+
'orderPackages.orderPackageItems.orderProduct.productDetail',
|
|
61
|
+
'orderProducts',
|
|
62
|
+
'orderProducts.product',
|
|
63
|
+
'orderProducts.productDetail',
|
|
64
|
+
'creator',
|
|
65
|
+
'updater'
|
|
78
66
|
]
|
|
79
67
|
});
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
68
|
+
const companyDomain = releaseGood.bizplace.company.domain;
|
|
69
|
+
let marketplaceOrder;
|
|
70
|
+
if (releaseGood.source == auth_base_1.ApplicationType.MMS || releaseGood.lmdOption) {
|
|
71
|
+
marketplaceOrder = await tx.getRepository(marketplace_base_1.MarketplaceOrder).findOne({
|
|
72
|
+
where: { orderNo: releaseGood.refNo, domain: companyDomain },
|
|
73
|
+
relations: [
|
|
74
|
+
'marketplaceStore',
|
|
75
|
+
'marketplaceStore.marketplaceDistributors',
|
|
76
|
+
'marketplaceOrderItems',
|
|
77
|
+
'marketplaceOrderItems.marketplaceOrderShippingItems',
|
|
78
|
+
'marketplaceOrderItems.marketplaceOrderShippingItems.marketplaceOrderShipping'
|
|
79
|
+
]
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
if (releaseGood) {
|
|
83
|
+
const worksheet = await pickingWSCtrl.findWorksheetByRefOrder(releaseGood, constants_1.WORKSHEET_TYPE.PICKING, [
|
|
84
|
+
'worksheetDetails',
|
|
85
|
+
'worksheetDetails.targetInventory',
|
|
86
|
+
'worksheetDetails.targetInventory.inventory'
|
|
87
|
+
]);
|
|
88
|
+
const worksheetDetails = worksheet.worksheetDetails;
|
|
89
|
+
const targetInventories = worksheetDetails.map((wsd) => wsd.targetInventory);
|
|
90
|
+
const pickedTargetInventories = targetInventories.filter(targetInventory => targetInventory.status === sales_base_1.ORDER_INVENTORY_STATUS.PICKED);
|
|
91
|
+
if (pickedTargetInventories.length == 0) {
|
|
92
|
+
throw new Error('Something went wrong. Please contact support.');
|
|
91
93
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
94
|
+
const inventories = targetInventories.map((ti) => ti.inventory);
|
|
95
|
+
const warehouseContactPoint = await tx.getRepository(biz_base_1.ContactPoint).findOne({
|
|
96
|
+
where: {
|
|
97
|
+
domain,
|
|
98
|
+
type: 'WAREHOUSE'
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
let foundObsoleteInventories = await pickingWSCtrl.completePicking(releaseGood, worksheet, inventories);
|
|
102
|
+
if (foundObsoleteInventories === null || foundObsoleteInventories === void 0 ? void 0 : foundObsoleteInventories.type) {
|
|
103
|
+
const orderSource = releaseGood.source;
|
|
104
|
+
switch (orderSource) {
|
|
105
|
+
case auth_base_1.ApplicationType.SELLERCRAFT:
|
|
106
|
+
const sellercraft = await tx
|
|
107
|
+
.getRepository(integration_sellercraft_1.Sellercraft)
|
|
108
|
+
.findOne({ domain: releaseGood.bizplace.domain, status: integration_sellercraft_1.SellercraftStatus.ACTIVE });
|
|
109
|
+
if (sellercraft) {
|
|
110
|
+
const initSCOrderShipment = async (sellercraft) => {
|
|
111
|
+
await (0, typeorm_1.getManager)().transaction(async (txMgr) => {
|
|
112
|
+
var _a;
|
|
113
|
+
const sellercraftCtrl = new controllers_1.SellercraftController(txMgr, domain, user);
|
|
114
|
+
if (!((_a = releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.orderPackages) === null || _a === void 0 ? void 0 : _a.length) && !(releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.marketPackCallSuccess)) {
|
|
115
|
+
const orderProducts = await txMgr.getRepository(sales_base_1.OrderProduct).find({
|
|
116
|
+
where: { releaseGood },
|
|
117
|
+
relations: ['product', 'product.productDetails']
|
|
118
|
+
});
|
|
119
|
+
await sellercraftCtrl.packOrder(sellercraft, Object.assign(Object.assign({}, releaseGood), { orderProducts }));
|
|
120
|
+
}
|
|
121
|
+
const rtsTriggerLevel = await txMgr.getRepository(setting_base_1.Setting).findOne({
|
|
122
|
+
where: { domain, category: 'id-rule', name: 'rts-trigger-level' }
|
|
114
123
|
});
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
where: { domain, category: 'id-rule', name: 'rts-trigger-level' }
|
|
124
|
+
if (rtsTriggerLevel && parseInt((rtsTriggerLevel === null || rtsTriggerLevel === void 0 ? void 0 : rtsTriggerLevel.value) || 0) == 1) {
|
|
125
|
+
await sellercraftCtrl.initiateOrderShipment(sellercraft, releaseGood);
|
|
126
|
+
}
|
|
119
127
|
});
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
128
|
+
};
|
|
129
|
+
// asynchronouly call to initiate sellercraft order shipment/ RTS
|
|
130
|
+
initSCOrderShipment(sellercraft);
|
|
131
|
+
}
|
|
132
|
+
break;
|
|
133
|
+
case auth_base_1.ApplicationType.POWRUP:
|
|
134
|
+
const powrup = await tx.getRepository(integration_powrup_1.Powrup).findOne({ active: true, platform: 'POWRUP' });
|
|
135
|
+
if (powrup) {
|
|
136
|
+
const initPowrupShipment = async (powrup) => {
|
|
137
|
+
await (0, typeorm_1.getManager)().transaction(async (txMgr) => {
|
|
138
|
+
var _a;
|
|
139
|
+
const powrupController = new sales_base_1.PowrupController();
|
|
140
|
+
if (!((_a = releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.orderPackages) === null || _a === void 0 ? void 0 : _a.length) && !(releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.marketPackCallSuccess)) {
|
|
141
|
+
const orderProducts = await txMgr.getRepository(sales_base_1.OrderProduct).find({
|
|
142
|
+
where: { releaseGood },
|
|
143
|
+
relations: ['product', 'productDetail']
|
|
144
|
+
});
|
|
145
|
+
await powrupController.packOrder(powrup, Object.assign(Object.assign({}, releaseGood), { orderProducts }), domain, user, txMgr);
|
|
146
|
+
}
|
|
147
|
+
const rtsTriggerLevel = await txMgr.getRepository(setting_base_1.Setting).findOne({
|
|
148
|
+
where: { domain, category: 'id-rule', name: 'rts-trigger-level' }
|
|
140
149
|
});
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
where: { domain, category: 'id-rule', name: 'rts-trigger-level' }
|
|
150
|
+
if (rtsTriggerLevel && parseInt((rtsTriggerLevel === null || rtsTriggerLevel === void 0 ? void 0 : rtsTriggerLevel.value) || 0) == 1) {
|
|
151
|
+
await powrupController.initiateShipment(powrup, releaseGood, domain, user, txMgr);
|
|
152
|
+
}
|
|
145
153
|
});
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
});
|
|
150
|
-
};
|
|
151
|
-
// asynchronouly call to initiate powrup order shipment/ RTS
|
|
152
|
-
initPowrupShipment(powrup);
|
|
153
|
-
}
|
|
154
|
-
break;
|
|
155
|
-
case auth_base_1.ApplicationType.MMS:
|
|
156
|
-
if (marketplaceOrder) {
|
|
157
|
-
const ecommerceCtrl = new ecommerce_1.EcommerceController(tx, domain, user);
|
|
158
|
-
const marketplaceStore = marketplaceOrder.marketplaceStore;
|
|
159
|
-
let eTraxOption;
|
|
160
|
-
if (marketplaceStore === null || marketplaceStore === void 0 ? void 0 : marketplaceStore.isAutoUpdateShipment) {
|
|
161
|
-
await ecommerceCtrl.createOrderComment(marketplaceStore, marketplaceOrder, sales_base_1.ORDER_STATUS.PACKING);
|
|
162
|
-
if (!releaseGood.lmdOption) {
|
|
163
|
-
await ecommerceCtrl.createOrderShip(releaseGood, marketplaceStore, marketplaceOrder, companyDomain);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
if (!marketplaceOrder) {
|
|
167
|
-
throw new Error('Failed to find ecommerce order, kindly contact our support team regarding this issue');
|
|
154
|
+
};
|
|
155
|
+
// asynchronouly call to initiate powrup order shipment/ RTS
|
|
156
|
+
initPowrupShipment(powrup);
|
|
168
157
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
if (
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
where: {
|
|
180
|
-
domain,
|
|
181
|
-
platform: 'eTrax'
|
|
158
|
+
break;
|
|
159
|
+
case auth_base_1.ApplicationType.MMS:
|
|
160
|
+
if (marketplaceOrder) {
|
|
161
|
+
const ecommerceCtrl = new ecommerce_1.EcommerceController(tx, domain, user);
|
|
162
|
+
const marketplaceStore = marketplaceOrder.marketplaceStore;
|
|
163
|
+
let eTraxOption;
|
|
164
|
+
if (marketplaceStore === null || marketplaceStore === void 0 ? void 0 : marketplaceStore.isAutoUpdateShipment) {
|
|
165
|
+
await ecommerceCtrl.createOrderComment(marketplaceStore, marketplaceOrder, sales_base_1.ORDER_STATUS.PACKING);
|
|
166
|
+
if (!releaseGood.lmdOption) {
|
|
167
|
+
await ecommerceCtrl.createOrderShip(releaseGood, marketplaceStore, marketplaceOrder, companyDomain);
|
|
182
168
|
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
pickupPostcode: warehouseContactPoint.postCode,
|
|
201
|
-
pickupState: warehouseContactPoint.state,
|
|
202
|
-
pickupCity: warehouseContactPoint.city,
|
|
203
|
-
pickupPhone: warehouseContactPoint.phone,
|
|
204
|
-
pickupEmail: warehouseContactPoint.email,
|
|
205
|
-
name: (marketplaceOrderShipping === null || marketplaceOrderShipping === void 0 ? void 0 : marketplaceOrderShipping.attentionTo) ? marketplaceOrderShipping.attentionTo.trim() : '',
|
|
206
|
-
address1: (marketplaceOrderShipping === null || marketplaceOrderShipping === void 0 ? void 0 : marketplaceOrderShipping.address1) ? marketplaceOrderShipping === null || marketplaceOrderShipping === void 0 ? void 0 : marketplaceOrderShipping.address1.trim() : '-',
|
|
207
|
-
address2: (marketplaceOrderShipping === null || marketplaceOrderShipping === void 0 ? void 0 : marketplaceOrderShipping.address2) ? marketplaceOrderShipping === null || marketplaceOrderShipping === void 0 ? void 0 : marketplaceOrderShipping.address2.trim() : '-',
|
|
208
|
-
postCode: (marketplaceOrderShipping === null || marketplaceOrderShipping === void 0 ? void 0 : marketplaceOrderShipping.postCode) ? marketplaceOrderShipping === null || marketplaceOrderShipping === void 0 ? void 0 : marketplaceOrderShipping.postCode.trim() : '',
|
|
209
|
-
city: (marketplaceOrderShipping === null || marketplaceOrderShipping === void 0 ? void 0 : marketplaceOrderShipping.city) ? marketplaceOrderShipping === null || marketplaceOrderShipping === void 0 ? void 0 : marketplaceOrderShipping.city.trim() : '',
|
|
210
|
-
state: (marketplaceOrderShipping === null || marketplaceOrderShipping === void 0 ? void 0 : marketplaceOrderShipping.state) ? marketplaceOrderShipping === null || marketplaceOrderShipping === void 0 ? void 0 : marketplaceOrderShipping.state.trim() : '',
|
|
211
|
-
phone: marketplaceOrderShipping.phone1 || '',
|
|
212
|
-
email: marketplaceOrderShipping.email || '',
|
|
213
|
-
attentionTo: marketplaceOrderShipping.attentionTo,
|
|
214
|
-
quantity: marketplaceOrderItems.length
|
|
215
|
-
});
|
|
216
|
-
const delay = (ms) => {
|
|
217
|
-
return new Promise(resolve => setTimeout(resolve, ms));
|
|
218
|
-
};
|
|
219
|
-
if (resp.Status === 'SUCCESS') {
|
|
220
|
-
//Success
|
|
221
|
-
let awbObtained = false;
|
|
222
|
-
let retry = 0;
|
|
223
|
-
while (!awbObtained) {
|
|
224
|
-
const marketplaceOrder2 = await tx.getRepository(marketplace_base_1.MarketplaceOrder).findOne({
|
|
225
|
-
where: { releaseOrderId: releaseGood.id },
|
|
226
|
-
relations: [
|
|
227
|
-
'marketplaceStore',
|
|
228
|
-
'marketplaceOrderItems',
|
|
229
|
-
'marketplaceOrderItems.marketplaceOrderShippingItems',
|
|
230
|
-
'marketplaceOrderItems.marketplaceOrderShippingItems.marketplaceOrderShipping'
|
|
231
|
-
]
|
|
232
|
-
});
|
|
233
|
-
const orderShipping = marketplaceOrder2.marketplaceOrderItems[0].marketplaceOrderShippingItems[0].marketplaceOrderShipping;
|
|
234
|
-
if (orderShipping === null || orderShipping === void 0 ? void 0 : orderShipping.airwayBill) {
|
|
235
|
-
awbObtained = true;
|
|
169
|
+
}
|
|
170
|
+
if (!marketplaceOrder) {
|
|
171
|
+
throw new Error('Failed to find ecommerce order, kindly contact our support team regarding this issue');
|
|
172
|
+
}
|
|
173
|
+
eTraxOption = marketplaceOrder === null || marketplaceOrder === void 0 ? void 0 : marketplaceOrder.marketplaceStore.eTrax;
|
|
174
|
+
// if eTrax option is true
|
|
175
|
+
if (eTraxOption) {
|
|
176
|
+
const marketplaceOrderItems = marketplaceOrder.marketplaceOrderItems;
|
|
177
|
+
// access every marketplaceOrderItems for shipping information you need
|
|
178
|
+
// trigger the controller from integration-lmd that trigger the API, build the parameters needed
|
|
179
|
+
// for etrax didn't support multi awb per order
|
|
180
|
+
const marketplaceOrderShippingItems = marketplaceOrderItems[0].marketplaceOrderShippingItems;
|
|
181
|
+
const marketplaceOrderShipping = marketplaceOrderShippingItems[0].marketplaceOrderShipping;
|
|
182
|
+
const lmd = await tx.getRepository(integration_lmd_1.LastMileDelivery).findOne({
|
|
183
|
+
where: {
|
|
184
|
+
domain,
|
|
185
|
+
platform: 'eTrax'
|
|
236
186
|
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
187
|
+
});
|
|
188
|
+
//Get which transporter to use
|
|
189
|
+
const marketplaceTransporter = await tx
|
|
190
|
+
.getRepository(integration_marketplace_1.MarketplaceTransporter)
|
|
191
|
+
.findOne({
|
|
192
|
+
where: { marketplaceStore: marketplaceOrder.marketplaceStore },
|
|
193
|
+
relations: ['pickupTransporter', 'deliveryTransporter']
|
|
194
|
+
});
|
|
195
|
+
const resp = await integration_lmd_1.LastMileAPI.createShipmentRequest(lmd, {
|
|
196
|
+
orderNo: marketplaceOrder.orderNo,
|
|
197
|
+
clientId: lmd.clientId,
|
|
198
|
+
clientType: lmd.clientType,
|
|
199
|
+
clientName: lmd.clientName,
|
|
200
|
+
transporterId: marketplaceTransporter.pickupTransporter.transporterId,
|
|
201
|
+
pickupName: warehouseContactPoint.name,
|
|
202
|
+
pickupAddress1: warehouseContactPoint.address,
|
|
203
|
+
pickupAddress2: warehouseContactPoint.address2,
|
|
204
|
+
pickupPostcode: warehouseContactPoint.postCode,
|
|
205
|
+
pickupState: warehouseContactPoint.state,
|
|
206
|
+
pickupCity: warehouseContactPoint.city,
|
|
207
|
+
pickupPhone: warehouseContactPoint.phone,
|
|
208
|
+
pickupEmail: warehouseContactPoint.email,
|
|
209
|
+
name: (marketplaceOrderShipping === null || marketplaceOrderShipping === void 0 ? void 0 : marketplaceOrderShipping.attentionTo) ? marketplaceOrderShipping.attentionTo.trim() : '',
|
|
210
|
+
address1: (marketplaceOrderShipping === null || marketplaceOrderShipping === void 0 ? void 0 : marketplaceOrderShipping.address1) ? marketplaceOrderShipping === null || marketplaceOrderShipping === void 0 ? void 0 : marketplaceOrderShipping.address1.trim() : '-',
|
|
211
|
+
address2: (marketplaceOrderShipping === null || marketplaceOrderShipping === void 0 ? void 0 : marketplaceOrderShipping.address2) ? marketplaceOrderShipping === null || marketplaceOrderShipping === void 0 ? void 0 : marketplaceOrderShipping.address2.trim() : '-',
|
|
212
|
+
postCode: (marketplaceOrderShipping === null || marketplaceOrderShipping === void 0 ? void 0 : marketplaceOrderShipping.postCode) ? marketplaceOrderShipping === null || marketplaceOrderShipping === void 0 ? void 0 : marketplaceOrderShipping.postCode.trim() : '',
|
|
213
|
+
city: (marketplaceOrderShipping === null || marketplaceOrderShipping === void 0 ? void 0 : marketplaceOrderShipping.city) ? marketplaceOrderShipping === null || marketplaceOrderShipping === void 0 ? void 0 : marketplaceOrderShipping.city.trim() : '',
|
|
214
|
+
state: (marketplaceOrderShipping === null || marketplaceOrderShipping === void 0 ? void 0 : marketplaceOrderShipping.state) ? marketplaceOrderShipping === null || marketplaceOrderShipping === void 0 ? void 0 : marketplaceOrderShipping.state.trim() : '',
|
|
215
|
+
phone: marketplaceOrderShipping.phone1 || '',
|
|
216
|
+
email: marketplaceOrderShipping.email || '',
|
|
217
|
+
attentionTo: marketplaceOrderShipping.attentionTo,
|
|
218
|
+
quantity: marketplaceOrderItems.length
|
|
219
|
+
});
|
|
220
|
+
const delay = (ms) => {
|
|
221
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
222
|
+
};
|
|
223
|
+
if (resp.Status === 'SUCCESS') {
|
|
224
|
+
//Success
|
|
225
|
+
let awbObtained = false;
|
|
226
|
+
let retry = 0;
|
|
227
|
+
while (!awbObtained) {
|
|
228
|
+
const marketplaceOrder2 = await tx.getRepository(marketplace_base_1.MarketplaceOrder).findOne({
|
|
229
|
+
where: { releaseOrderId: releaseGood.id },
|
|
230
|
+
relations: [
|
|
231
|
+
'marketplaceStore',
|
|
232
|
+
'marketplaceOrderItems',
|
|
233
|
+
'marketplaceOrderItems.marketplaceOrderShippingItems',
|
|
234
|
+
'marketplaceOrderItems.marketplaceOrderShippingItems.marketplaceOrderShipping'
|
|
235
|
+
]
|
|
236
|
+
});
|
|
237
|
+
const orderShipping = marketplaceOrder2.marketplaceOrderItems[0].marketplaceOrderShippingItems[0]
|
|
238
|
+
.marketplaceOrderShipping;
|
|
239
|
+
if (orderShipping === null || orderShipping === void 0 ? void 0 : orderShipping.airwayBill) {
|
|
240
|
+
awbObtained = true;
|
|
241
|
+
}
|
|
242
|
+
await delay(5000);
|
|
243
|
+
//Timeout after 15sec
|
|
244
|
+
if (++retry > 3) {
|
|
245
|
+
break;
|
|
246
|
+
}
|
|
241
247
|
}
|
|
242
248
|
}
|
|
249
|
+
else {
|
|
250
|
+
if ((resp === null || resp === void 0 ? void 0 : resp.AWBurl) && (resp === null || resp === void 0 ? void 0 : resp.TrackingNo))
|
|
251
|
+
await tx
|
|
252
|
+
.getRepository(marketplace_base_1.MarketplaceOrderShipping)
|
|
253
|
+
.update({ id: marketplaceOrderShipping.id }, { airwayBill: resp.AWBurl, trackingNo: resp.TrackingNo });
|
|
254
|
+
else
|
|
255
|
+
throw resp;
|
|
256
|
+
}
|
|
243
257
|
}
|
|
244
|
-
|
|
245
|
-
if ((resp === null || resp === void 0 ? void 0 : resp.AWBurl) && (resp === null || resp === void 0 ? void 0 : resp.TrackingNo))
|
|
246
|
-
await tx
|
|
247
|
-
.getRepository(marketplace_base_1.MarketplaceOrderShipping)
|
|
248
|
-
.update({ id: marketplaceOrderShipping.id }, { airwayBill: resp.AWBurl, trackingNo: resp.TrackingNo });
|
|
249
|
-
else
|
|
250
|
-
throw resp;
|
|
251
|
-
}
|
|
258
|
+
await ecommerceCtrl.createOrderPackage(tx, marketplaceOrder, companyDomain, marketplaceStore, releaseGood);
|
|
252
259
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
transporter: null,
|
|
262
|
-
airwayBill: null,
|
|
263
|
-
status: sales_base_1.ORDER_STATUS.PROCESSING,
|
|
264
|
-
releaseGood,
|
|
265
|
-
domain: releaseGood.domain,
|
|
266
|
-
bizplace: releaseGood.bizplace,
|
|
267
|
-
creator: releaseGood.creator,
|
|
268
|
-
updater: releaseGood.updater
|
|
269
|
-
};
|
|
270
|
-
let savedOrderPackage = await tx.getRepository(sales_base_1.OrderPackage).save(orderPackage);
|
|
271
|
-
const orderPackageItems = releaseGood.orderProducts.map(op => {
|
|
272
|
-
return {
|
|
273
|
-
name: sales_base_1.OrderNoGenerator.orderPackageItem(),
|
|
274
|
-
orderProduct: op,
|
|
260
|
+
break;
|
|
261
|
+
default:
|
|
262
|
+
let orderPackage = {
|
|
263
|
+
name: sales_base_1.OrderNoGenerator.orderPackage(),
|
|
264
|
+
packageId: null,
|
|
265
|
+
trackingNo: null,
|
|
266
|
+
transporter: null,
|
|
267
|
+
airwayBill: null,
|
|
275
268
|
status: sales_base_1.ORDER_STATUS.PROCESSING,
|
|
276
|
-
|
|
277
|
-
orderPackage: savedOrderPackage,
|
|
269
|
+
releaseGood,
|
|
278
270
|
domain: releaseGood.domain,
|
|
279
271
|
bizplace: releaseGood.bizplace,
|
|
280
272
|
creator: releaseGood.creator,
|
|
281
273
|
updater: releaseGood.updater
|
|
282
274
|
};
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
if (account.platform == 'xilnex') {
|
|
296
|
-
try {
|
|
297
|
-
delete releaseGood.orderPackages;
|
|
298
|
-
delete releaseGood.creator;
|
|
299
|
-
delete releaseGood.updater;
|
|
300
|
-
const body = {
|
|
301
|
-
accessToken: account.accessToken,
|
|
302
|
-
appId: account.accountId,
|
|
303
|
-
accountInfo: account.accountInfo,
|
|
304
|
-
req: JSON.stringify({
|
|
305
|
-
releaseGood,
|
|
306
|
-
orderProducts: releaseGood.orderProducts
|
|
307
|
-
})
|
|
275
|
+
let savedOrderPackage = await tx.getRepository(sales_base_1.OrderPackage).save(orderPackage);
|
|
276
|
+
const orderPackageItems = releaseGood.orderProducts.map(op => {
|
|
277
|
+
return {
|
|
278
|
+
name: sales_base_1.OrderNoGenerator.orderPackageItem(),
|
|
279
|
+
orderProduct: op,
|
|
280
|
+
status: sales_base_1.ORDER_STATUS.PROCESSING,
|
|
281
|
+
releaseQty: op.releaseQty,
|
|
282
|
+
orderPackage: savedOrderPackage,
|
|
283
|
+
domain: releaseGood.domain,
|
|
284
|
+
bizplace: releaseGood.bizplace,
|
|
285
|
+
creator: releaseGood.creator,
|
|
286
|
+
updater: releaseGood.updater
|
|
308
287
|
};
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
288
|
+
});
|
|
289
|
+
await tx.getRepository(sales_base_1.OrderPackageItem).save(orderPackageItems);
|
|
290
|
+
orderPackage.orderPackageItems = orderPackageItems;
|
|
291
|
+
releaseGood.orderPackages = [orderPackage];
|
|
292
|
+
break;
|
|
293
|
+
}
|
|
294
|
+
const account = await tx
|
|
295
|
+
.getRepository(integration_accounting_1.Account)
|
|
296
|
+
.findOne({ where: { domain: releaseGood.bizplace.domain, status: 'active' }, relations: ['domain'] });
|
|
297
|
+
// Xilnex Create Sales Order and Post Sales Order to Sales Invoice
|
|
298
|
+
const createSalesOrder = async (account, releaseGood, tx) => {
|
|
299
|
+
if (account) {
|
|
300
|
+
if (account.platform == 'xilnex') {
|
|
301
|
+
try {
|
|
302
|
+
delete releaseGood.orderPackages;
|
|
303
|
+
delete releaseGood.creator;
|
|
304
|
+
delete releaseGood.updater;
|
|
305
|
+
const body = {
|
|
306
|
+
accessToken: account.accessToken,
|
|
307
|
+
appId: account.accountId,
|
|
308
|
+
accountInfo: account.accountInfo,
|
|
309
|
+
req: JSON.stringify({
|
|
310
|
+
releaseGood,
|
|
311
|
+
orderProducts: releaseGood.orderProducts
|
|
312
|
+
})
|
|
313
|
+
};
|
|
314
|
+
await (0, integration_base_1.sqsSendMessage)({
|
|
315
|
+
body,
|
|
316
|
+
deduplicationId: releaseGood.refNo,
|
|
317
|
+
groupId: releaseGood.refNo,
|
|
318
|
+
queueName: 'prototypeQueue.fifo'
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
catch (e) {
|
|
322
|
+
console.log(`[Create Sales Order] SQS Send Message: ${e}`);
|
|
323
|
+
}
|
|
318
324
|
}
|
|
319
325
|
}
|
|
326
|
+
};
|
|
327
|
+
if (releaseGood.type == 'b2c') {
|
|
328
|
+
createSalesOrder(account, releaseGood, tx);
|
|
320
329
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
releaseGood,
|
|
334
|
-
type: constants_1.WORKSHEET_TYPE.LOADING,
|
|
335
|
-
status: constants_1.WORKSHEET_STATUS.DEACTIVATED
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
let orderVas = await tx.getRepository(sales_base_1.OrderVas).find({ where: { domain: domain, releaseGood } });
|
|
339
|
-
if (orderVas) {
|
|
340
|
-
try {
|
|
341
|
-
const vasWorksheet = await tx
|
|
342
|
-
.getRepository(entities_1.Worksheet)
|
|
343
|
-
.findOne({ where: { releaseGood, type: constants_1.WORKSHEET_TYPE.VAS } });
|
|
344
|
-
const vasWorksheetDetails = await tx
|
|
345
|
-
.getRepository(entities_1.WorksheetDetail)
|
|
346
|
-
.find({ where: { domain: domain, worksheet: vasWorksheet.id } });
|
|
330
|
+
if (releaseGood.packingOption) {
|
|
331
|
+
const packingWSCtrl = new controllers_1.PackingWorksheetController(tx, domain, user);
|
|
332
|
+
await packingWSCtrl.generatePackingWorksheet(releaseGoodNo);
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
// Find Existing Loading Worksheet if any
|
|
336
|
+
let existLoadingWorksheet;
|
|
337
|
+
let orderVas = await tx.getRepository(sales_base_1.OrderVas).find({ where: { domain: domain, releaseGood } });
|
|
338
|
+
if ((orderVas === null || orderVas === void 0 ? void 0 : orderVas.length) > 0) {
|
|
339
|
+
const wSCtrl = new worksheet_controller_1.WorksheetController(tx, domain, user);
|
|
340
|
+
let vasWorksheet = await wSCtrl.createWorksheet(releaseGood, constants_1.WORKSHEET_TYPE.VAS);
|
|
341
|
+
let vasWorksheetDetails = await wSCtrl.createWorksheetDetails(vasWorksheet, constants_1.WORKSHEET_TYPE.VAS, orderVas);
|
|
347
342
|
if (vasWorksheet) {
|
|
348
343
|
await (0, activate_vas_1.activateVas)(tx, domain, user, vasWorksheet.name, vasWorksheetDetails);
|
|
349
344
|
}
|
|
350
345
|
}
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
346
|
+
else {
|
|
347
|
+
existLoadingWorksheet = await tx.getRepository(entities_1.Worksheet).findOne({
|
|
348
|
+
where: {
|
|
349
|
+
releaseGood,
|
|
350
|
+
type: constants_1.WORKSHEET_TYPE.LOADING,
|
|
351
|
+
status: constants_1.WORKSHEET_STATUS.DEACTIVATED
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
if (!existLoadingWorksheet && !releaseGood.courierOption && !releaseGood.packingOption) {
|
|
355
|
+
const loadingWSCtrl = new controllers_1.LoadingWorksheetController(tx, domain, user);
|
|
356
|
+
let loadingWorksheet = await loadingWSCtrl.generateLoadingWorksheet(releaseGoodNo, pickedTargetInventories);
|
|
357
|
+
if (!((_a = loadingWorksheet.worksheetDetails) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
358
|
+
loadingWorksheet = await pickingWSCtrl.findWorksheetById(loadingWorksheet.id);
|
|
359
|
+
}
|
|
360
|
+
const loadingWorksheetDetails = loadingWorksheet.worksheetDetails;
|
|
361
|
+
await loadingWSCtrl.activateLoading(loadingWorksheet.name, loadingWorksheetDetails);
|
|
362
|
+
}
|
|
363
|
+
else {
|
|
364
|
+
const loadingWSCtrl = new controllers_1.LoadingWorksheetController(tx, domain, user);
|
|
365
|
+
let loadingWorksheet = await loadingWSCtrl.updateLoadingWorksheet(releaseGoodNo, pickedTargetInventories, existLoadingWorksheet);
|
|
366
|
+
if (!((_b = loadingWorksheet.worksheetDetails) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
367
|
+
loadingWorksheet = await pickingWSCtrl.findWorksheetById(loadingWorksheet.id);
|
|
368
|
+
}
|
|
369
|
+
const loadingWorksheetDetails = loadingWorksheet.worksheetDetails;
|
|
370
|
+
await loadingWSCtrl.activateLoading(loadingWorksheet.name, loadingWorksheetDetails);
|
|
360
371
|
}
|
|
361
|
-
const loadingWorksheetDetails = loadingWorksheet.worksheetDetails;
|
|
362
|
-
await loadingWSCtrl.activateLoading(loadingWorksheet.name, loadingWorksheetDetails);
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
else {
|
|
366
|
-
const loadingWSCtrl = new controllers_1.LoadingWorksheetController(tx, domain, user);
|
|
367
|
-
let loadingWorksheet = await loadingWSCtrl.updateLoadingWorksheet(releaseGoodNo, pickedTargetInventories, existLoadingWorksheet);
|
|
368
|
-
if (!((_b = loadingWorksheet.worksheetDetails) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
369
|
-
loadingWorksheet = await pickingWSCtrl.findWorksheetById(loadingWorksheet.id);
|
|
370
372
|
}
|
|
371
|
-
const loadingWorksheetDetails = loadingWorksheet.worksheetDetails;
|
|
372
|
-
await loadingWSCtrl.activateLoading(loadingWorksheet.name, loadingWorksheetDetails);
|
|
373
373
|
}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
status: integration_sellercraft_1.SellercraftStatus.ACTIVE
|
|
388
|
-
});
|
|
389
|
-
if (sellercraft) {
|
|
390
|
-
const sellercraftCtrl = new controllers_1.SellercraftController(tx, null, null);
|
|
391
|
-
const rtsTriggerLevel = await tx.getRepository(setting_base_1.Setting).findOne({
|
|
392
|
-
where: { domain: releaseGood.domain, category: 'id-rule', name: 'rts-trigger-level' }
|
|
374
|
+
// trigger LMD API to create parcel
|
|
375
|
+
if (((_c = releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.orderPackages) === null || _c === void 0 ? void 0 : _c.length) &&
|
|
376
|
+
releaseGood.lmdOption &&
|
|
377
|
+
releaseGood.lastMileDelivery &&
|
|
378
|
+
((_d = releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.orderPackages) === null || _d === void 0 ? void 0 : _d.some(op => op.parcelId == null))) {
|
|
379
|
+
await (0, utils_1.createLmdParcel)([releaseGood], tx, domain, user, marketplaceOrder);
|
|
380
|
+
// trigger RTS
|
|
381
|
+
try {
|
|
382
|
+
const orderSource = releaseGood.source;
|
|
383
|
+
if (orderSource == auth_base_1.ApplicationType.SELLERCRAFT) {
|
|
384
|
+
const sellercraft = await tx.getRepository(integration_sellercraft_1.Sellercraft).findOne({
|
|
385
|
+
domain: releaseGood.bizplace.domain,
|
|
386
|
+
status: integration_sellercraft_1.SellercraftStatus.ACTIVE
|
|
393
387
|
});
|
|
394
|
-
if (
|
|
395
|
-
sellercraftCtrl.
|
|
388
|
+
if (sellercraft) {
|
|
389
|
+
const sellercraftCtrl = new controllers_1.SellercraftController(tx, null, null);
|
|
390
|
+
const rtsTriggerLevel = await tx.getRepository(setting_base_1.Setting).findOne({
|
|
391
|
+
where: { domain: releaseGood.domain, category: 'id-rule', name: 'rts-trigger-level' }
|
|
392
|
+
});
|
|
393
|
+
if (rtsTriggerLevel && parseInt((rtsTriggerLevel === null || rtsTriggerLevel === void 0 ? void 0 : rtsTriggerLevel.value) || 0) == 1) {
|
|
394
|
+
sellercraftCtrl.initiateOrderShipment(sellercraft, releaseGood);
|
|
395
|
+
}
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
398
|
+
else if (orderSource == auth_base_1.ApplicationType.POWRUP) {
|
|
399
|
+
const powrup = await tx.getRepository(integration_powrup_1.Powrup).findOne({ active: true, platform: 'POWRUP' });
|
|
400
|
+
if (powrup) {
|
|
401
|
+
const powrupController = new sales_base_1.PowrupController();
|
|
402
|
+
const rtsTriggerLevel = await tx.getRepository(setting_base_1.Setting).findOne({
|
|
403
|
+
where: { domain, category: 'id-rule', name: 'rts-trigger-level' }
|
|
404
|
+
});
|
|
405
|
+
if (rtsTriggerLevel && parseInt((rtsTriggerLevel === null || rtsTriggerLevel === void 0 ? void 0 : rtsTriggerLevel.value) || 0) == 1) {
|
|
406
|
+
powrupController.initiateShipment(powrup, releaseGood, domain, user, tx);
|
|
407
|
+
}
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
411
|
+
catch (e) {
|
|
412
|
+
env_1.logger.error(`[get-lmd-awb-sof-trigger]: ${e}`);
|
|
413
|
+
}
|
|
414
|
+
//
|
|
414
415
|
}
|
|
415
416
|
//
|
|
416
417
|
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
.
|
|
427
|
-
//update any orders that is assigned with obsolete inventories
|
|
428
|
-
await tx.getRepository(sales_base_1.ReleaseGood).query(`
|
|
418
|
+
else {
|
|
419
|
+
//update inventories obsolete to true
|
|
420
|
+
await tx.getRepository(warehouse_base_1.Inventory).update({ id: (0, typeorm_1.In)(foundObsoleteInventories) }, { obsolete: true });
|
|
421
|
+
foundObsoleteInventories = foundObsoleteInventories
|
|
422
|
+
.map(inv => {
|
|
423
|
+
return "'" + inv.trim() + "'";
|
|
424
|
+
})
|
|
425
|
+
.join(',');
|
|
426
|
+
//update any orders that is assigned with obsolete inventories
|
|
427
|
+
await tx.getRepository(sales_base_1.ReleaseGood).query(`
|
|
429
428
|
update release_goods rg set status = 'OBSOLETE'
|
|
430
429
|
from order_inventories oi
|
|
431
430
|
where oi.release_good_id = rg.id
|
|
432
431
|
and oi.inventory_id in (${foundObsoleteInventories})
|
|
433
432
|
and rg.status in ('PICKING', 'PENDING_WORKSHEET', 'READY_TO_PICK')`);
|
|
434
|
-
|
|
433
|
+
await tx.getRepository(entities_1.Worksheet).query(`
|
|
435
434
|
update worksheets w set status = 'DEACTIVATED', updater_id = '${user.id}', assignee_id = null
|
|
436
435
|
from worksheet_details wd
|
|
437
436
|
inner join order_inventories oi on oi.id = wd.target_inventory_id
|
|
438
437
|
where wd.worksheet_id = w.id
|
|
439
438
|
and oi.inventory_id in (${foundObsoleteInventories})
|
|
440
439
|
`);
|
|
441
|
-
|
|
440
|
+
return true;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
else {
|
|
444
|
+
let replenishment = await tx.getRepository(sales_base_1.Replenishment).findOne({
|
|
445
|
+
where: { domain, name: releaseGoodNo }
|
|
446
|
+
});
|
|
447
|
+
const worksheet = await pickingWSCtrl.findWorksheetByRefOrder(replenishment, constants_1.WORKSHEET_TYPE.PICKING_REPLENISHMENT, ['worksheetDetails', 'worksheetDetails.targetInventory', 'worksheetDetails.targetInventory.inventory']);
|
|
448
|
+
await replenishmentPickingWSCtrl.completeReplenishmentPicking(replenishment, worksheet);
|
|
449
|
+
await replenishmentPickingWSCtrl.generatePutawayReplenishmentWorksheet(releaseGoodNo);
|
|
442
450
|
}
|
|
443
451
|
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
where: { domain, name: releaseGoodNo }
|
|
447
|
-
});
|
|
448
|
-
const worksheet = await pickingWSCtrl.findWorksheetByRefOrder(replenishment, constants_1.WORKSHEET_TYPE.PICKING_REPLENISHMENT, ['worksheetDetails', 'worksheetDetails.targetInventory', 'worksheetDetails.targetInventory.inventory']);
|
|
449
|
-
await replenishmentPickingWSCtrl.completeReplenishmentPicking(replenishment, worksheet);
|
|
450
|
-
await replenishmentPickingWSCtrl.generatePutawayReplenishmentWorksheet(releaseGoodNo);
|
|
452
|
+
catch (error) {
|
|
453
|
+
throw error;
|
|
451
454
|
}
|
|
452
455
|
}
|
|
453
456
|
exports.completePicking = completePicking;
|