@things-factory/worksheet-base 4.3.122 → 4.3.125

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.
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SortingWorksheetController = void 0;
4
4
  const typeorm_1 = require("typeorm");
5
- const vas_worksheet_controller_1 = require("../vas/vas-worksheet-controller");
6
- const warehouse_base_1 = require("@things-factory/warehouse-base");
7
5
  const sales_base_1 = require("@things-factory/sales-base");
8
- const entities_1 = require("../../entities");
6
+ const warehouse_base_1 = require("@things-factory/warehouse-base");
9
7
  const constants_1 = require("../../constants");
8
+ const entities_1 = require("../../entities");
9
+ const vas_worksheet_controller_1 = require("../vas/vas-worksheet-controller");
10
10
  class SortingWorksheetController extends vas_worksheet_controller_1.VasWorksheetController {
11
11
  async generateSortingWorksheet(batchPickingWorksheet, targetInventories) {
12
12
  const worksheet = await this.generateBatchWorksheet(constants_1.WORKSHEET_TYPE.SORTING, batchPickingWorksheet, targetInventories, sales_base_1.ORDER_INVENTORY_STATUS.READY_TO_SORT);
@@ -37,137 +37,159 @@ class SortingWorksheetController extends vas_worksheet_controller_1.VasWorksheet
37
37
  await this.updateOrderTargets(targetInventories);
38
38
  return await this.activateWorksheet(worksheet, worksheetDetails, sortingWorksheetDetails);
39
39
  }
40
- async scanProductSorting(taskNo, releaseGoodNo, productBarcode, serialNumber, toteNo) {
41
- const worksheet = await this.trxMgr.getRepository(entities_1.Worksheet).findOne({
42
- where: {
43
- domain: this.domain,
44
- taskNo,
45
- type: constants_1.WORKSHEET_TYPE.SORTING,
46
- status: constants_1.WORKSHEET_STATUS.EXECUTING
47
- },
48
- relations: [
49
- 'worksheetDetails',
50
- 'worksheetDetails.targetInventory',
51
- 'worksheetDetails.targetInventory.product',
52
- 'worksheetDetails.targetInventory.orderProduct',
53
- 'worksheetDetails.targetInventory.bizplace',
54
- 'worksheetDetails.targetInventory.inventory',
55
- 'worksheetDetails.targetInventory.inventory.product',
56
- 'worksheetDetails.targetInventory.inventory.product.productDetails',
57
- 'worksheetDetails.targetInventory.inventory.product.productDetails.product',
58
- 'worksheetDetails.targetInventory.releaseGood'
59
- ]
60
- });
61
- this.checkRecordValidity(worksheet, { status: constants_1.WORKSHEET_STATUS.EXECUTING });
40
+ async scanProductSorting(releaseGoodNo, taskNo, productBarcode, serialNumber, toteNo, sortingQty) {
41
+ const worksheet = await this.trxMgr
42
+ .getRepository(entities_1.Worksheet)
43
+ .createQueryBuilder('worksheet')
44
+ .innerJoinAndSelect('worksheet.worksheetDetails', 'worksheetDetails')
45
+ .innerJoinAndSelect('worksheetDetails.targetInventory', 'targetInventory')
46
+ .innerJoinAndSelect('targetInventory.product', 'product')
47
+ .innerJoinAndSelect('product.productDetails', 'productDetails')
48
+ .leftJoinAndSelect('productDetails.childProductDetail', 'childProductDetail')
49
+ .leftJoinAndSelect('targetInventory.orderProduct', 'orderProduct')
50
+ .leftJoinAndSelect('targetInventory.bizplace', 'bizplace')
51
+ .leftJoinAndSelect('targetInventory.inventory', 'inventory')
52
+ .leftJoinAndSelect('targetInventory.releaseGood', 'releaseGood')
53
+ .where('worksheet.domain_id = :domainId', { domainId: this.domain.id })
54
+ .andWhere('worksheet.task_no = :taskNo', { taskNo })
55
+ .andWhere('worksheet.type = :type', { type: constants_1.WORKSHEET_TYPE.SORTING })
56
+ .andWhere('worksheet.status = :status', { status: constants_1.WORKSHEET_STATUS.EXECUTING })
57
+ .andWhere('releaseGood.name = :rg', { rg: releaseGoodNo })
58
+ .andWhere('productDetails.gtin = :gtin', { gtin: productBarcode })
59
+ .getOne();
60
+ if (!worksheet) {
61
+ throw new Error(this.ERROR_MSG.FIND.NO_RESULT(productBarcode));
62
+ }
62
63
  const worksheetDetails = worksheet.worksheetDetails;
63
- const orderInventories = worksheetDetails
64
- .map((wsd) => wsd.targetInventory)
65
- .filter((oi) => oi.releaseGood.name === releaseGoodNo);
66
- if (productBarcode) {
67
- let productDetails = [];
68
- orderInventories.map((oi) => {
69
- const foundPDs = oi.inventory && oi.inventory.product && oi.inventory.product.productDetails;
70
- foundPDs.map(productDetail => {
71
- productDetails.push(productDetail);
72
- });
73
- });
74
- const matchingProductDetail = productDetails.find((productDetail) => productDetail.gtin === productBarcode);
75
- if (!matchingProductDetail)
76
- throw new Error('Unable to find product barcode.');
77
- const packingType = matchingProductDetail.packingType;
78
- const packingSize = matchingProductDetail.packingSize;
79
- if (!matchingProductDetail)
80
- throw new Error(this.ERROR_MSG.PRODUCT.BARCODE_NOT_EXIST(productBarcode, packingType, packingSize));
81
- let matchingOIs = orderInventories.filter((oi) => {
82
- var _a, _b;
83
- return oi.packingType === packingType &&
84
- oi.packingSize === packingSize &&
85
- ((_a = oi.product) === null || _a === void 0 ? void 0 : _a.id) === ((_b = matchingProductDetail.product) === null || _b === void 0 ? void 0 : _b.id);
86
- });
87
- let sortedQty = 1;
88
- if (!(matchingOIs === null || matchingOIs === void 0 ? void 0 : matchingOIs.length)) {
89
- throw new Error(this.ERROR_MSG.ORDER_ITEM.NO_MATCHING_RESULT(packingType, packingSize));
64
+ const orderInventories = worksheetDetails.map((wsd) => wsd.targetInventory);
65
+ const productDetails = orderInventories[0].product.productDetails;
66
+ const scannedProductDetail = productDetails.find(itm => itm.gtin == productBarcode);
67
+ const scannedChildProductDetail = scannedProductDetail.childProductDetail;
68
+ //find matching order inventories based on scanned product detail
69
+ let matchingOIs = orderInventories.filter(oi => oi.packingType == scannedProductDetail.packingType &&
70
+ oi.packingSize == scannedProductDetail.packingSize &&
71
+ oi.uom == scannedProductDetail.uom);
72
+ let productDetail = scannedProductDetail;
73
+ //if no order inventories found then find based on child product detail of scanned product detail
74
+ //if found then user is scanning parent product detail
75
+ if (!(matchingOIs === null || matchingOIs === void 0 ? void 0 : matchingOIs.length)) {
76
+ if (!scannedChildProductDetail) {
77
+ throw new Error(this.ERROR_MSG.FIND.NO_RESULT(productBarcode));
90
78
  }
91
- else {
92
- await Promise.all(matchingOIs.map(async (matchingOI) => {
93
- const releaseQty = matchingOI.releaseQty;
94
- const inventory = matchingOI.inventory;
95
- const releaseGood = matchingOI.releaseGood;
96
- const product = inventory.product;
97
- if (releaseQty != (matchingOI === null || matchingOI === void 0 ? void 0 : matchingOI.sortedQty) && sortedQty == 1) {
98
- // Serial Number scanning for batch picking
99
- if (matchingOI === null || matchingOI === void 0 ? void 0 : matchingOI.refWorksheetId) {
100
- if (product === null || product === void 0 ? void 0 : product.isRequireSerialNumberScanningOutbound) {
101
- if (!serialNumber || serialNumber == '') {
102
- throw new Error(this.ERROR_MSG.VALIDITY.CANT_PROCEED_STEP_BY('sorting', `require serial number`));
103
- }
104
- let foundSerialNumber = await this.trxMgr
105
- .getRepository(warehouse_base_1.InventoryItem)
106
- .findOne({ where: { domain: this.domain, serialNumber: serialNumber, product } });
107
- if (foundSerialNumber) {
108
- if (foundSerialNumber.inventoryId !== inventory.id) {
109
- throw new Error('Serial Number scanned is in another inventory');
110
- }
111
- if (foundSerialNumber.outboundOrderId) {
112
- let releaseGood = await this.trxMgr
113
- .getRepository(sales_base_1.ReleaseGood)
114
- .findOne({ where: { id: foundSerialNumber.outboundOrderId } });
115
- throw new Error(`Inventory Item is already picked/sorted in ${releaseGood.name}`);
116
- }
117
- foundSerialNumber.status = warehouse_base_1.INVENTORY_STATUS.SORTING;
118
- foundSerialNumber.updater = this.user;
119
- foundSerialNumber.outboundOrderId = releaseGood.id;
120
- await this.trxMgr.getRepository(warehouse_base_1.InventoryItem).save(foundSerialNumber);
121
- }
122
- else {
123
- let inventoryItem = new warehouse_base_1.InventoryItem();
124
- inventoryItem.name = warehouse_base_1.InventoryNoGenerator.inventoryItemName();
125
- inventoryItem.serialNumber = serialNumber;
126
- inventoryItem.status = warehouse_base_1.INVENTORY_STATUS.SORTING;
127
- inventoryItem.outboundOrderId = releaseGood.id;
128
- inventoryItem.source = warehouse_base_1.INVENTORY_ITEM_SOURCE.OUTBOUND;
129
- inventoryItem.product = product;
130
- inventoryItem.inventory = inventory;
131
- inventoryItem.domain = this.domain;
132
- await this.trxMgr.getRepository(warehouse_base_1.InventoryItem).save(inventoryItem);
133
- }
134
- }
79
+ matchingOIs = orderInventories.filter(oi => oi.packingType == scannedChildProductDetail.packingType &&
80
+ oi.packingSize == scannedChildProductDetail.packingSize &&
81
+ oi.uom == scannedChildProductDetail.uom);
82
+ productDetail = scannedChildProductDetail;
83
+ if (!(matchingOIs === null || matchingOIs === void 0 ? void 0 : matchingOIs.length) || matchingOIs[0].product.isRequireSerialNumberScanningOutbound) {
84
+ throw new Error(this.ERROR_MSG.FIND.NO_RESULT(productBarcode));
85
+ }
86
+ }
87
+ const packingType = productDetail.packingType;
88
+ const packingSize = productDetail.packingSize;
89
+ let matchingProduct = await this.getDirectQty(Object.assign({}, productDetail), productBarcode, sortingQty ? sortingQty : 1);
90
+ // validate matching product details based on scanned barcode
91
+ if (!matchingProduct)
92
+ throw new Error(this.ERROR_MSG.FIND.NO_RESULT(productBarcode));
93
+ let sortedQty = matchingProduct.qty;
94
+ const releaseGood = matchingOIs[0].releaseGood;
95
+ //update order inventories
96
+ await Promise.all(matchingOIs.map(async (matchingOI, index) => {
97
+ //if sortedQty is more than 0, then logic will run
98
+ //this validation is to handle multiple ois with multiple release qty
99
+ if (sortedQty > 0) {
100
+ const releaseQty = matchingOI.releaseQty;
101
+ const inventory = matchingOI.inventory;
102
+ const product = matchingOI.product;
103
+ // Serial Number scanning for batch picking
104
+ if (matchingOI === null || matchingOI === void 0 ? void 0 : matchingOI.refWorksheetId) {
105
+ if (product === null || product === void 0 ? void 0 : product.isRequireSerialNumberScanningOutbound) {
106
+ if (!serialNumber || serialNumber == '') {
107
+ throw new Error(this.ERROR_MSG.VALIDITY.CANT_PROCEED_STEP_BY('sorting', `require serial number`));
135
108
  }
136
- matchingOI.sortedQty = Boolean(matchingOI === null || matchingOI === void 0 ? void 0 : matchingOI.sortedQty) ? matchingOI.sortedQty + sortedQty : sortedQty;
137
- sortedQty -= 1;
138
- if (matchingOI.sortedQty == releaseQty) {
139
- matchingOI.status = sales_base_1.ORDER_INVENTORY_STATUS.SORTED;
140
- await this.updateOrderTargets([matchingOI]);
141
- await this.transactionInventory(inventory, releaseGood, 0, 0, warehouse_base_1.INVENTORY_TRANSACTION_TYPE.SORTING);
142
- let worksheetDetail = worksheetDetails.find(wsd => wsd.targetInventory.id === matchingOI.id);
143
- worksheetDetail.status = constants_1.WORKSHEET_STATUS.DONE;
144
- worksheetDetail.updater = this.user;
145
- await this.trxMgr.getRepository(entities_1.WorksheetDetail).save(worksheetDetail);
146
- let inventoryItems = await this.trxMgr
147
- .getRepository(warehouse_base_1.InventoryItem)
148
- .find({ where: { outboundOrderId: releaseGood.id } });
149
- if (inventoryItems.length > 0) {
150
- inventoryItems.forEach((itm) => {
151
- itm.status = warehouse_base_1.INVENTORY_STATUS.SORTED;
152
- itm.updater = this.user;
153
- });
154
- await this.trxMgr.getRepository(warehouse_base_1.InventoryItem).save(inventoryItems);
109
+ let foundSerialNumber = await this.trxMgr
110
+ .getRepository(warehouse_base_1.InventoryItem)
111
+ .findOne({ where: { domain: this.domain, serialNumber: serialNumber, product } });
112
+ if (foundSerialNumber) {
113
+ if (foundSerialNumber.inventoryId !== inventory.id) {
114
+ throw new Error('Serial Number scanned is in another inventory');
155
115
  }
156
- }
157
- else if ((matchingOI === null || matchingOI === void 0 ? void 0 : matchingOI.sortedQty) > releaseQty) {
158
- const product = matchingOI.inventory.product;
159
- throw new Error(this.ERROR_MSG.ORDER_ITEM.EXCESS_QTY(product.sku, packingType, packingSize));
116
+ if (foundSerialNumber.outboundOrderId) {
117
+ let releaseGood = await this.trxMgr
118
+ .getRepository(sales_base_1.ReleaseGood)
119
+ .findOne({ where: { id: foundSerialNumber.outboundOrderId } });
120
+ throw new Error(`Inventory Item is already picked/sorted in ${releaseGood.name}`);
121
+ }
122
+ foundSerialNumber.status = warehouse_base_1.INVENTORY_STATUS.SORTING;
123
+ foundSerialNumber.updater = this.user;
124
+ foundSerialNumber.outboundOrderId = releaseGood.id;
125
+ await this.trxMgr.getRepository(warehouse_base_1.InventoryItem).save(foundSerialNumber);
160
126
  }
161
127
  else {
162
- await this.updateOrderTargets([matchingOI]);
163
- }
164
- if (toteNo) {
165
- await this.toteScanning(toteNo, matchingOI.orderProduct, matchingOI, 1, releaseGood, matchingOI.bizplace);
128
+ let inventoryItem = new warehouse_base_1.InventoryItem();
129
+ inventoryItem.name = warehouse_base_1.InventoryNoGenerator.inventoryItemName();
130
+ inventoryItem.serialNumber = serialNumber;
131
+ inventoryItem.status = warehouse_base_1.INVENTORY_STATUS.SORTING;
132
+ inventoryItem.outboundOrderId = releaseGood.id;
133
+ inventoryItem.source = warehouse_base_1.INVENTORY_ITEM_SOURCE.OUTBOUND;
134
+ inventoryItem.product = product;
135
+ inventoryItem.inventory = inventory;
136
+ inventoryItem.domain = this.domain;
137
+ await this.trxMgr.getRepository(warehouse_base_1.InventoryItem).save(inventoryItem);
166
138
  }
167
139
  }
168
- }));
140
+ }
141
+ let tempSortedQty = 0;
142
+ //when sortedQty is more than releaseQty, check if the loop is running the last order inventory
143
+ //if yes then throw error
144
+ if (sortedQty > releaseQty && index == orderInventories.length - 1) {
145
+ throw new Error(this.ERROR_MSG.ORDER_ITEM.EXCESS_QTY(product.sku, packingType, packingSize));
146
+ }
147
+ else {
148
+ //if not proceed to sorting
149
+ if (sortedQty < releaseQty) {
150
+ tempSortedQty = sortedQty;
151
+ }
152
+ else {
153
+ //if sortedQty is more than releaseQty then releaseQty - previous sorted qty will be the qty that needs to be sorted for current oi
154
+ //overflow qty will be sorted to next oi
155
+ tempSortedQty = Boolean(matchingOI === null || matchingOI === void 0 ? void 0 : matchingOI.sortedQty) ? releaseQty - matchingOI.sortedQty : releaseQty;
156
+ }
157
+ sortedQty -= tempSortedQty;
158
+ }
159
+ matchingOI.sortedQty = Boolean(matchingOI === null || matchingOI === void 0 ? void 0 : matchingOI.sortedQty) ? tempSortedQty + matchingOI.sortedQty : tempSortedQty;
160
+ if (matchingOI.sortedQty == releaseQty) {
161
+ matchingOI.status = sales_base_1.ORDER_INVENTORY_STATUS.SORTED;
162
+ await this.updateOrderTargets([matchingOI]);
163
+ await this.transactionInventory(inventory, releaseGood, 0, 0, warehouse_base_1.INVENTORY_TRANSACTION_TYPE.SORTING);
164
+ let worksheetDetail = worksheetDetails.find(wd => (wd.targetInventory.id = matchingOI.id));
165
+ await this.trxMgr
166
+ .getRepository(entities_1.WorksheetDetail)
167
+ .update({ id: worksheetDetail.id }, { status: constants_1.WORKSHEET_STATUS.DONE, updater: this.user });
168
+ let inventoryItems = await this.trxMgr
169
+ .getRepository(warehouse_base_1.InventoryItem)
170
+ .find({ where: { outboundOrderId: releaseGood.id } });
171
+ if (inventoryItems.length > 0) {
172
+ inventoryItems.forEach((itm) => {
173
+ itm.status = warehouse_base_1.INVENTORY_STATUS.SORTED;
174
+ itm.updater = this.user;
175
+ });
176
+ await this.trxMgr.getRepository(warehouse_base_1.InventoryItem).save(inventoryItems);
177
+ }
178
+ }
179
+ else if ((matchingOI === null || matchingOI === void 0 ? void 0 : matchingOI.sortedQty) > releaseQty) {
180
+ const product = matchingOI.product;
181
+ throw new Error(this.ERROR_MSG.ORDER_ITEM.EXCESS_QTY(product.sku, packingType, packingSize));
182
+ }
183
+ else {
184
+ await this.updateOrderTargets([matchingOI]);
185
+ }
186
+ if (toteNo) {
187
+ await this.toteScanning(toteNo, matchingOI.orderProduct, matchingOI, 1, releaseGood, matchingOI.bizplace);
188
+ }
169
189
  }
170
- }
190
+ }));
191
+ await this.trxMgr.getRepository(sales_base_1.ReleaseGood).update({ id: releaseGood.id }, { sortedBy: this.user });
192
+ console.timeEnd('scanProductSorting');
171
193
  }
172
194
  async sortingProduct(taskNo, releaseGoodNo, productId, sortingQty, serialNumber, toteNo) {
173
195
  const worksheet = await this.trxMgr.getRepository(entities_1.Worksheet).findOne({
@@ -281,11 +303,10 @@ class SortingWorksheetController extends vas_worksheet_controller_1.VasWorksheet
281
303
  }
282
304
  async completeOrderSorting(releaseGoodNo) {
283
305
  try {
284
- let releaseGood = await this.findRefOrder(sales_base_1.ReleaseGood, {
285
- domain: this.domain,
286
- name: releaseGoodNo,
287
- status: sales_base_1.ORDER_STATUS.SORTING
288
- }, ['bizplace', 'orderInventories']);
306
+ let releaseGood = await this.trxMgr.getRepository(sales_base_1.ReleaseGood).findOne({
307
+ where: { domain: this.domain, name: releaseGoodNo, status: sales_base_1.ORDER_STATUS.SORTING },
308
+ relations: ['bizplace', 'orderInventories']
309
+ });
289
310
  if (!releaseGood) {
290
311
  throw new Error('Order is already sorted');
291
312
  }
@@ -361,7 +382,7 @@ class SortingWorksheetController extends vas_worksheet_controller_1.VasWorksheet
361
382
  let foundOrderTote = await this.trxMgr
362
383
  .getRepository(sales_base_1.OrderTote)
363
384
  .findOne({ where: { domain: this.domain, name: toteNo, releaseGood } });
364
- //if order tote not found the create one, if tote not found means it's tote box
385
+ //if order tote not found then create one, if tote not found means it's tote box
365
386
  //create order tote item
366
387
  if (!foundOrderTote) {
367
388
  const orderTote = await this.trxMgr.getRepository(sales_base_1.OrderTote).save({
@@ -1 +1 @@
1
- {"version":3,"file":"sorting-worksheet-controller.js","sourceRoot":"","sources":["../../../server/controllers/outbound/sorting-worksheet-controller.ts"],"names":[],"mappings":";;;AAAA,qCAAoC;AAEpC,8EAAwE;AAExE,mEASuC;AACvC,2DAQmC;AACnC,6CAA2D;AAC3D,+CAAkE;AAGlE,MAAa,0BAA2B,SAAQ,iDAAsB;IACpE,KAAK,CAAC,wBAAwB,CAC5B,qBAAgC,EAChC,iBAA4C;QAE5C,MAAM,SAAS,GAAc,MAAM,IAAI,CAAC,sBAAsB,CAC5D,0BAAc,CAAC,OAAO,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,mCAAsB,CAAC,aAAa,CACrC,CAAA;QAED,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,WAAmB,EAAE,uBAA0C;QACnF,MAAM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,CAAC,MAAM;oBACnB,IAAI,EAAE,6BAAgB,CAAC,aAAa,EAAE;oBACtC,YAAY,EAAE,aAAa;oBAC3B,cAAc,EAAE,eAAe;oBAC/B,SAAS,EAAE,cAAc;oBACzB,GAAG,EAAE,SAAS;oBACd,OAAO,EAAE,IAAI,CAAC,IAAI;iBACnB,CAAC,CAAA;aACH;iBAAM;gBACL,sDAAsD;gBACtD,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,0BAAa,CAAC,CAAC,IAAI,iCACpE,kBAAkB,KACrB,GAAG,EAAE,kBAAkB,CAAC,GAAG,GAAG,SAAS,IACvC,CAAA;aACH;SACF;IACH,CAAC;CACF;AAjgBD,gEAigBC"}
1
+ {"version":3,"file":"sorting-worksheet-controller.js","sourceRoot":"","sources":["../../../server/controllers/outbound/sorting-worksheet-controller.ts"],"names":[],"mappings":";;;AAAA,qCAGgB;AAMhB,2DAQmC;AACnC,mEASuC;AAEvC,+CAGwB;AACxB,6CAGuB;AACvB,8EAAwE;AAExE,MAAa,0BAA2B,SAAQ,iDAAsB;IACpE,KAAK,CAAC,wBAAwB,CAC5B,qBAAgC,EAChC,iBAA4C;QAE5C,MAAM,SAAS,GAAc,MAAM,IAAI,CAAC,sBAAsB,CAC5D,0BAAc,CAAC,OAAO,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,mCAAsB,CAAC,aAAa,CACrC,CAAA;QAED,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,WAAmB,EAAE,uBAA0C;QACnF,MAAM,SAAS,GAAc,MAAM,IAAI,CAAC,wBAAwB,CAAC,WAAW,EAAE,0BAAc,CAAC,OAAO,EAAE;YACpG,kBAAkB;YAClB,kCAAkC;YAClC,8CAA8C;SAC/C,CAAC,CAAA;QAEF,MAAM,gBAAgB,GAAsB,SAAS,CAAC,gBAAgB,CAAA;QACtE,IAAI,iBAAiB,GAAqB,gBAAgB,CAAC,GAAG,CA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,CAAC;gBAC/F,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,YAAY,EAAE,aAAa;gBAC3B,cAAc,EAAE,eAAe;gBAC/B,SAAS,EAAE,cAAc;aAC1B,CAAC,CAAA;YAEF,qDAAqD;YACrD,IAAI,CAAC,kBAAkB,EAAE;gBACvB,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,0BAAa,CAAC,CAAC,IAAI,CAAC;oBACxE,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,IAAI,EAAE,6BAAgB,CAAC,aAAa,EAAE;oBACtC,YAAY,EAAE,aAAa;oBAC3B,cAAc,EAAE,eAAe;oBAC/B,SAAS,EAAE,cAAc;oBACzB,GAAG,EAAE,SAAS;oBACd,OAAO,EAAE,IAAI,CAAC,IAAI;iBACnB,CAAC,CAAA;aACH;iBAAM;gBACL,sDAAsD;gBACtD,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,0BAAa,CAAC,CAAC,IAAI,iCACpE,kBAAkB,KACrB,GAAG,EAAE,kBAAkB,CAAC,GAAG,GAAG,SAAS,IACvC,CAAA;aACH;SACF;IACH,CAAC;CACF;AA3hBD,gEA2hBC"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.findSortingReleaseOrdersByTaskNoResolver = void 0;
4
4
  const sales_base_1 = require("@things-factory/sales-base");
5
5
  const shell_1 = require("@things-factory/shell");
6
+ const auth_base_1 = require("@things-factory/auth-base");
6
7
  const warehouse_base_1 = require("@things-factory/warehouse-base");
7
8
  const constants_1 = require("../../../constants");
8
9
  const entities_1 = require("../../../entities");
@@ -49,19 +50,23 @@ exports.findSortingReleaseOrdersByTaskNoResolver = {
49
50
  .createQueryBuilder('ws')
50
51
  .select('rg.id as id')
51
52
  .addSelect('rg.name as name')
53
+ .addSelect('rg.refNo as "refNo"')
54
+ .addSelect('rg.refNo2 as "refNo2"')
52
55
  .addSelect('rg.status as status')
56
+ .addSelect('user.name as "sortedByUser"')
53
57
  .innerJoin(shell_1.Domain, 'domain', 'ws.domain_id = domain.id')
54
58
  .innerJoin(entities_1.WorksheetDetail, 'wsd', 'ws.id = wsd.worksheet_id')
55
59
  .innerJoin(sales_base_1.OrderInventory, 'oi', 'oi.id = wsd.target_inventory_id')
56
60
  .innerJoin(sales_base_1.ReleaseGood, 'rg', 'rg.id = oi.release_good_id')
61
+ .leftJoin(auth_base_1.User, 'user', 'rg.sorted_by_id = user.id')
57
62
  .where('domain.id = :domainId', { domainId: domain.id })
58
63
  .andWhere('ws.taskNo = :taskNo', { taskNo: taskNo })
59
64
  .andWhere('ws.type = :worksheetType', { worksheetType: constants_1.WORKSHEET_TYPE.SORTING })
60
65
  .andWhere('ws.status = :worksheetStatus', { worksheetStatus: constants_1.WORKSHEET_STATUS.EXECUTING })
61
- .andWhere('rg.status = :roStatus', { roStatus: sales_base_1.ORDER_STATUS.SORTING })
62
66
  .groupBy('rg.id')
63
67
  .addGroupBy('rg.name')
64
68
  .addGroupBy('rg.status')
69
+ .addGroupBy('user.name')
65
70
  .orderBy('rg.createdAt', 'ASC');
66
71
  const releaseGoods = await qb.getRawMany();
67
72
  return { releaseGoods, taskNo };
@@ -1 +1 @@
1
- {"version":3,"file":"find-sorting-release-orders-by-task-no.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/worksheet/find-sorting-release-orders-by-task-no.ts"],"names":[],"mappings":";;;AAEA,2DAKmC;AACnC,iDAA8C;AAC9C,mEAAyD;AAEzD,kDAAqE;AACrE,gDAA0G;AAE7F,QAAA,wCAAwC,GAAG;IACtD,KAAK,CAAC,gCAAgC,CAAC,CAAM,EAAE,EAAE,MAAM,EAAE,EAAE,OAAY;QACrE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,GAA0C,OAAO,CAAC,KAAK,CAAA;QAC3E,IAAI,IAAI,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,oBAAe,CAAC,CAAC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AE,CAAC;aACrE,OAAO,CAAC,OAAO,CAAC;aAChB,UAAU,CAAC,SAAS,CAAC;aACrB,UAAU,CAAC,WAAW,CAAC;aACvB,OAAO,CAAC,cAAc,EAAE,KAAK,CAAC,CAAA;QAEjC,MAAM,YAAY,GAAwB,MAAM,EAAE,CAAC,UAAU,EAAE,CAAA;QAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,CAAA;IACjC,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"find-sorting-release-orders-by-task-no.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/worksheet/find-sorting-release-orders-by-task-no.ts"],"names":[],"mappings":";;;AAEA,2DAKmC;AACnC,iDAA8C;AAC9C,yDAAgD;AAChD,mEAAyD;AAEzD,kDAAqE;AACrE,gDAA0G;AAE7F,QAAA,wCAAwC,GAAG;IACtD,KAAK,CAAC,gCAAgC,CAAC,CAAM,EAAE,EAAE,MAAM,EAAE,EAAE,OAAY;QACrE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,GAA0C,OAAO,CAAC,KAAK,CAAA;QAC3E,IAAI,IAAI,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,oBAAe,CAAC,CAAC,OAAO,CAAC;YACzD,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,4BAAgB,CAAC,SAAS,EAAE,IAAI,EAAE,0BAAc,CAAC,OAAO,EAAE;SACpF,CAAC,CAAA;QAEF,yBAAyB;QACzB,IAAI,CAAC,IAAI,EAAE;YACT,MAAM,WAAW,GAAa,MAAM,EAAE,CAAC,aAAa,CAAC,yBAAQ,CAAC,CAAC,OAAO,CAAC;gBACrE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE;aAChC,CAAC,CAAA;YAEF,MAAM,EAAE,GAA6C,EAAE;iBACpD,aAAa,CAAC,2BAAoB,CAAC;iBACnC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;YAEvC,EAAE,CAAC,kBAAkB,C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CAAC,IAAI,CAAC;aACxB,MAAM,CAAC,aAAa,CAAC;aACrB,SAAS,CAAC,iBAAiB,CAAC;aAC5B,SAAS,CAAC,qBAAqB,CAAC;aAChC,SAAS,CAAC,uBAAuB,CAAC;aAClC,SAAS,CAAC,qBAAqB,CAAC;aAChC,SAAS,CAAC,6BAA6B,CAAC;aACxC,SAAS,CAAC,cAAM,EAAE,QAAQ,EAAE,0BAA0B,CAAC;aACvD,SAAS,CAAC,0BAAqB,EAAE,KAAK,EAAE,0BAA0B,CAAC;aACnE,SAAS,CAAC,2BAAoB,EAAE,IAAI,EAAE,iCAAiC,CAAC;aACxE,SAAS,CAAC,wBAAiB,EAAE,IAAI,EAAE,4BAA4B,CAAC;aAChE,QAAQ,CAAC,gBAAI,EAAE,MAAM,EAAE,2BAA2B,CAAC;aACnD,KAAK,CAAC,uBAAuB,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC;aACvD,QAAQ,CAAC,qBAAqB,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;aACnD,QAAQ,CAAC,0BAA0B,EAAE,EAAE,aAAa,EAAE,0BAAc,CAAC,OAAO,EAAE,CAAC;aAC/E,QAAQ,CAAC,8BAA8B,EAAE,EAAE,eAAe,EAAE,4BAAgB,CAAC,SAAS,EAAE,CAAC;aACzF,OAAO,CAAC,OAAO,CAAC;aAChB,UAAU,CAAC,SAAS,CAAC;aACrB,UAAU,CAAC,WAAW,CAAC;aACvB,UAAU,CAAC,WAAW,CAAC;aACvB,OAAO,CAAC,cAAc,EAAE,KAAK,CAAC,CAAA;QAEjC,MAAM,YAAY,GAAwB,MAAM,EAAE,CAAC,UAAU,EAAE,CAAA;QAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,CAAA;IACjC,CAAC;CACF,CAAA"}
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.scanProductSorting = exports.scanProductSortingResolver = void 0;
4
4
  const controllers_1 = require("../../../../controllers");
5
5
  exports.scanProductSortingResolver = {
6
- async scanProductSorting(_, { taskNo, releaseGoodNo, productBarcode, serialNumber, toteNo }, context) {
6
+ async scanProductSorting(_, { releaseGoodNo, taskNo, productBarcode, serialNumber, toteNo, sortingQty }, context) {
7
7
  const { tx, domain, user } = context.state;
8
- await scanProductSorting(tx, domain, user, taskNo, releaseGoodNo, productBarcode, serialNumber, toteNo);
8
+ await scanProductSorting(tx, domain, user, releaseGoodNo, taskNo, productBarcode, serialNumber, toteNo, sortingQty);
9
9
  }
10
10
  };
11
- async function scanProductSorting(tx, domain, user, taskNo, releaseGoodNo, productBarcode, serialNumber, toteNo) {
11
+ async function scanProductSorting(tx, domain, user, releaseGoodNo, taskNo, productBarcode, serialNumber, toteNo, sortingQty) {
12
12
  const worksheetController = new controllers_1.SortingWorksheetController(tx, domain, user);
13
- await worksheetController.scanProductSorting(taskNo, releaseGoodNo, productBarcode, serialNumber, toteNo);
13
+ await worksheetController.scanProductSorting(releaseGoodNo, taskNo, productBarcode, serialNumber, toteNo, sortingQty);
14
14
  }
15
15
  exports.scanProductSorting = scanProductSorting;
16
16
  //# sourceMappingURL=scan-product-sorting.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scan-product-sorting.js","sourceRoot":"","sources":["../../../../../server/graphql/resolvers/worksheet/sorting/scan-product-sorting.ts"],"names":[],"mappings":";;;AAGA,yDAAoE;AAEvD,QAAA,0BAA0B,GAAG;IACxC,KAAK,CAAC,kBAAkB,CAAC,CAAM,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,OAAY;QAC5G,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAsD,OAAO,CAAC,KAAK,CAAA;QAC7F,MAAM,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,CAAC,CAAA;IACzG,CAAC;CACF,CAAA;AAEM,KAAK,UAAU,kBAAkB,CACtC,EAAiB,EACjB,MAAc,EACd,IAAU,EACV,MAAc,EACd,aAAqB,EACrB,cAAuB,EACvB,YAAqB,EACrB,MAAe;IAEf,MAAM,mBAAmB,GAA+B,IAAI,wCAA0B,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;IACxG,MAAM,mBAAmB,CAAC,kBAAkB,CAAC,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,CAAC,CAAA;AAC3G,CAAC;AAZD,gDAYC"}
1
+ {"version":3,"file":"scan-product-sorting.js","sourceRoot":"","sources":["../../../../../server/graphql/resolvers/worksheet/sorting/scan-product-sorting.ts"],"names":[],"mappings":";;;AAGA,yDAAoE;AAEvD,QAAA,0BAA0B,GAAG;IACxC,KAAK,CAAC,kBAAkB,CACtB,CAAM,EACN,EAAE,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,EAC3E,OAAY;QAEZ,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAsD,OAAO,CAAC,KAAK,CAAA;QAC7F,MAAM,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,CAAC,CAAA;IACrH,CAAC;CACF,CAAA;AAEM,KAAK,UAAU,kBAAkB,CACtC,EAAiB,EACjB,MAAc,EACd,IAAU,EACV,aAAqB,EACrB,MAAc,EACd,cAAuB,EACvB,YAAqB,EACrB,MAAe,EACf,UAAmB;IAEnB,MAAM,mBAAmB,GAA+B,IAAI,wCAA0B,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;IACxG,MAAM,mBAAmB,CAAC,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,CAAC,CAAA;AACvH,CAAC;AAbD,gDAaC"}
@@ -11,7 +11,7 @@ exports.sortingWorksheetResolver = {
11
11
  const { domain } = context.state;
12
12
  const releaseGood = await (0, typeorm_1.getRepository)(sales_base_1.ReleaseGood).findOne({
13
13
  where: { domain, name: releaseGoodNo, status: sales_base_1.ORDER_STATUS.SORTING },
14
- relations: ['bizplace', 'bizplace.domain']
14
+ relations: ['bizplace', 'bizplace.domain', 'bizplace.company', 'bizplace.company.domain']
15
15
  });
16
16
  if (!releaseGood)
17
17
  throw new Error(`Couldn't find sorting worksheet by order no (${releaseGoodNo})`);
@@ -49,6 +49,7 @@ exports.sortingWorksheetResolver = {
49
49
  worksheetInfo: {
50
50
  bizplaceName: releaseGood.bizplace.name,
51
51
  partnerDomainId: (_a = releaseGood.bizplace) === null || _a === void 0 ? void 0 : _a.domain.id,
52
+ customerCompanyDomainId: releaseGood.bizplace.company.domain.id,
52
53
  startedAt: worksheet.startedAt,
53
54
  refNo: releaseGood.refNo,
54
55
  refNo2: releaseGood.refNo2,
@@ -1 +1 @@
1
- {"version":3,"file":"sorting-worksheet.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/worksheet/sorting-worksheet.ts"],"names":[],"mappings":";;;AAAA,qCAA2D;AAE3D,2DAA8G;AAG9G,kDAAmD;AACnD,0CAA6D;AAEhD,QAAA,wBAAwB,GAAG;IACtC,KAAK,CAAC,gBAAgB,CAAC,CAAM,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,OAAY;;QACpE,MAAM,EAAE,MAAM,EAAE,GAAuB,OAAO,CAAC,KAAK,CAAA;QACpD,MAAM,WAAW,GAAgB,MAAM,IAAA,uBAAa,EAAC,wBAAW,CAAC,CAAC,OAAO,CAAC;YACxE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,yBAAY,CAAC,OAAO,EAAE;YACpE,SAAS,EAAE,CAAC,UAAU,EAAE,iB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AJ,IAAI,CAAE,cAAc;oBACpC,WAAW,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW;oBAC9B,WAAW,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW;oBAC9B,UAAU,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU;oBAC5B,WAAW;iBACZ,CAAA;YACH,CAAC,CAAC;SACH,CAAA;IACH,CAAC;CACF,CAAA"}
@@ -353,6 +353,7 @@ exports.Mutation = `
353
353
  productBarcode: String!
354
354
  serialNumber: String
355
355
  toteNo: String
356
+ sortingQty: Int
356
357
  ): Boolean @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
357
358
 
358
359
  packing (
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/types/worksheet/index.ts"],"names":[],"mappings":";;;AAAA,iEAA4D;AAC5D,yEAAmE;AACnE,6DAAuD;AACvD,mEAA6D;AAC7D,mDAA8C;AAC9C,+DAAyD;AACzD,2DAAqD;AACrD,6DAAwD;AACxD,+DAA0D;AAC1D,qFAA4E;AAC5E,+DAAyD;AACzD,2EAAqE;AACrE,uEAAiE;AACjE,iFAA0E;AAC1E,mDAA8C;AAC9C,2EAAqE;AACrE,yDAAoD;AACpD,qEAA+D;AAC/D,qEAA+D;AAC/D,+DAAyD;AACzD,2CAAuC;AACvC,mEAA6D;AAC7D,qDAAgD;AAChD,qDAAgD;AAChD,uDAAkD;AAClD,2EAAqE;AACrE,2EAAmE;AACnE,uFAAgF;AAEnE,QAAA,QAAQ,GAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+hBrC,CAAA;AAEY,QAAA,KAAK,GAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgJlC,CAAA;AAEY,QAAA,KAAK,GAAiB;IACjC,qBAAS;IACT,0CAAmB;IACnB,4BAAY;IACZ,gCAAc;IACd,8BAAa;IACb,iDAAsB;IACtB,6CAAoB;IACpB,2CAAmB;IACnB,6CAAoB;IACpB,mDAAuB;IACvB,uCAAiB;IACjB,uCAAiB;IACjB,qCAAgB;IAChB,uCAAiB;IACjB,8BAAa;IACb,4BAAY;IACZ,sCAAiB;IACjB,2CAAmB;IACnB,wCAAkB;IAClB,+CAAqB;IACrB,kCAAe;IACf,mDAAuB;IACvB,mDAAuB;IACvB,wDAAyB;IACzB,0DAAyB;IACzB,mCAAe;IACf,iDAAqB;IACrB,8DAA4B;CAC7B,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/types/worksheet/index.ts"],"names":[],"mappings":";;;AAAA,iEAA4D;AAC5D,yEAAmE;AACnE,6DAAuD;AACvD,mEAA6D;AAC7D,mDAA8C;AA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;CAgJlC,CAAA;AAEY,QAAA,KAAK,GAAiB;IACjC,qBAAS;IACT,0CAAmB;IACnB,4BAAY;IACZ,gCAAc;IACd,8BAAa;IACb,iDAAsB;IACtB,6CAAoB;IACpB,2CAAmB;IACnB,6CAAoB;IACpB,mDAAuB;IACvB,uCAAiB;IACjB,uCAAiB;IACjB,qCAAgB;IAChB,uCAAiB;IACjB,8BAAa;IACb,4BAAY;IACZ,sCAAiB;IACjB,2CAAmB;IACnB,wCAAkB;IAClB,+CAAqB;IACrB,kCAAe;IACf,mDAAuB;IACvB,mDAAuB;IACvB,wDAAyB;IACzB,0DAAyB;IACzB,mCAAe;IACf,iDAAqB;IACrB,8DAA4B;CAC7B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/worksheet-base",
3
- "version": "4.3.122",
3
+ "version": "4.3.125",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -27,19 +27,19 @@
27
27
  "@things-factory/auth-base": "^4.3.122",
28
28
  "@things-factory/biz-base": "^4.3.122",
29
29
  "@things-factory/document-template-base": "^4.3.122",
30
- "@things-factory/id-rule-base": "^4.3.122",
31
- "@things-factory/integration-accounting": "^4.3.122",
32
- "@things-factory/integration-lmd": "^4.3.122",
33
- "@things-factory/integration-marketplace": "^4.3.122",
34
- "@things-factory/integration-sellercraft": "^4.3.122",
35
- "@things-factory/integration-sftp": "^4.3.122",
36
- "@things-factory/marketplace-base": "^4.3.122",
30
+ "@things-factory/id-rule-base": "^4.3.123",
31
+ "@things-factory/integration-accounting": "^4.3.123",
32
+ "@things-factory/integration-lmd": "^4.3.123",
33
+ "@things-factory/integration-marketplace": "^4.3.123",
34
+ "@things-factory/integration-sellercraft": "^4.3.123",
35
+ "@things-factory/integration-sftp": "^4.3.123",
36
+ "@things-factory/marketplace-base": "^4.3.123",
37
37
  "@things-factory/notification": "^4.3.122",
38
- "@things-factory/sales-base": "^4.3.122",
38
+ "@things-factory/sales-base": "^4.3.125",
39
39
  "@things-factory/setting-base": "^4.3.122",
40
40
  "@things-factory/shell": "^4.3.122",
41
41
  "@things-factory/transport-base": "^4.3.122",
42
- "@things-factory/warehouse-base": "^4.3.122"
42
+ "@things-factory/warehouse-base": "^4.3.125"
43
43
  },
44
- "gitHead": "3edd80e6ca68480b22ee0e25eba34d13ab0e49f1"
44
+ "gitHead": "9befff87defc2a9ce88074f203ac8c4fb221355b"
45
45
  }
@@ -1,29 +1,41 @@
1
- import { IsNull, In } from 'typeorm'
1
+ import {
2
+ In,
3
+ IsNull
4
+ } from 'typeorm'
2
5
 
3
- import { VasWorksheetController } from '../vas/vas-worksheet-controller'
4
- import { Product, ProductDetail } from '@things-factory/product-base'
6
+ import {
7
+ Product,
8
+ ProductDetail
9
+ } from '@things-factory/product-base'
10
+ import {
11
+ ORDER_INVENTORY_STATUS,
12
+ ORDER_STATUS,
13
+ OrderInventory,
14
+ OrderNoGenerator,
15
+ OrderTote,
16
+ OrderToteItem,
17
+ ReleaseGood
18
+ } from '@things-factory/sales-base'
5
19
  import {
6
20
  Inventory,
21
+ INVENTORY_ITEM_SOURCE,
22
+ INVENTORY_STATUS,
7
23
  INVENTORY_TRANSACTION_TYPE,
8
24
  InventoryItem,
9
- INVENTORY_STATUS,
10
25
  InventoryNoGenerator,
11
- INVENTORY_ITEM_SOURCE,
12
26
  Tote,
13
27
  TOTE_STATUS
14
28
  } from '@things-factory/warehouse-base'
29
+
15
30
  import {
16
- ReleaseGood,
17
- OrderInventory,
18
- ORDER_INVENTORY_STATUS,
19
- ORDER_STATUS,
20
- OrderTote,
21
- OrderToteItem,
22
- OrderNoGenerator
23
- } from '@things-factory/sales-base'
24
- import { Worksheet, WorksheetDetail } from '../../entities'
25
- import { WORKSHEET_STATUS, WORKSHEET_TYPE } from '../../constants'
26
- import { temporaryGetRemainInventoryAmount } from 'server/graphql/resolvers/worksheet/vas-transactions/common-utils'
31
+ WORKSHEET_STATUS,
32
+ WORKSHEET_TYPE
33
+ } from '../../constants'
34
+ import {
35
+ Worksheet,
36
+ WorksheetDetail
37
+ } from '../../entities'
38
+ import { VasWorksheetController } from '../vas/vas-worksheet-controller'
27
39
 
28
40
  export class SortingWorksheetController extends VasWorksheetController {
29
41
  async generateSortingWorksheet(
@@ -72,170 +84,201 @@ export class SortingWorksheetController extends VasWorksheetController {
72
84
  }
73
85
 
74
86
  async scanProductSorting(
75
- taskNo: string,
76
87
  releaseGoodNo: string,
88
+ taskNo: string,
77
89
  productBarcode: string,
78
90
  serialNumber: string,
79
- toteNo: string
91
+ toteNo: string,
92
+ sortingQty: number
80
93
  ): Promise<void> {
81
- const worksheet: Worksheet = await this.trxMgr.getRepository(Worksheet).findOne({
82
- where: {
83
- domain: this.domain,
84
- taskNo,
85
- type: WORKSHEET_TYPE.SORTING,
86
- status: WORKSHEET_STATUS.EXECUTING
87
- },
88
- relations: [
89
- 'worksheetDetails',
90
- 'worksheetDetails.targetInventory',
91
- 'worksheetDetails.targetInventory.product',
92
- 'worksheetDetails.targetInventory.orderProduct',
93
- 'worksheetDetails.targetInventory.bizplace',
94
- 'worksheetDetails.targetInventory.inventory',
95
- 'worksheetDetails.targetInventory.inventory.product',
96
- 'worksheetDetails.targetInventory.inventory.product.productDetails',
97
- 'worksheetDetails.targetInventory.inventory.product.productDetails.product',
98
- 'worksheetDetails.targetInventory.releaseGood'
99
- ]
100
- })
94
+ const worksheet: Worksheet = await this.trxMgr
95
+ .getRepository(Worksheet)
96
+ .createQueryBuilder('worksheet')
97
+ .innerJoinAndSelect('worksheet.worksheetDetails', 'worksheetDetails')
98
+ .innerJoinAndSelect('worksheetDetails.targetInventory', 'targetInventory')
99
+ .innerJoinAndSelect('targetInventory.product', 'product')
100
+ .innerJoinAndSelect('product.productDetails', 'productDetails')
101
+ .leftJoinAndSelect('productDetails.childProductDetail', 'childProductDetail')
102
+ .leftJoinAndSelect('targetInventory.orderProduct', 'orderProduct')
103
+ .leftJoinAndSelect('targetInventory.bizplace', 'bizplace')
104
+ .leftJoinAndSelect('targetInventory.inventory', 'inventory')
105
+ .leftJoinAndSelect('targetInventory.releaseGood', 'releaseGood')
106
+ .where('worksheet.domain_id = :domainId', { domainId: this.domain.id })
107
+ .andWhere('worksheet.task_no = :taskNo', { taskNo })
108
+ .andWhere('worksheet.type = :type', { type: WORKSHEET_TYPE.SORTING })
109
+ .andWhere('worksheet.status = :status', { status: WORKSHEET_STATUS.EXECUTING })
110
+ .andWhere('releaseGood.name = :rg', { rg: releaseGoodNo })
111
+ .andWhere('productDetails.gtin = :gtin', { gtin: productBarcode })
112
+ .getOne()
113
+
114
+ if (!worksheet) {
115
+ throw new Error(this.ERROR_MSG.FIND.NO_RESULT(productBarcode))
116
+ }
101
117
 
102
- this.checkRecordValidity(worksheet, { status: WORKSHEET_STATUS.EXECUTING })
118
+ const worksheetDetails = worksheet.worksheetDetails
119
+ const orderInventories: OrderInventory[] = worksheetDetails.map((wsd: WorksheetDetail) => wsd.targetInventory)
120
+ const productDetails: ProductDetail[] = orderInventories[0].product.productDetails
121
+ const scannedProductDetail: ProductDetail = productDetails.find(itm => itm.gtin == productBarcode)
122
+ const scannedChildProductDetail: ProductDetail = scannedProductDetail.childProductDetail
123
+
124
+ //find matching order inventories based on scanned product detail
125
+ let matchingOIs = orderInventories.filter(
126
+ oi =>
127
+ oi.packingType == scannedProductDetail.packingType &&
128
+ oi.packingSize == scannedProductDetail.packingSize &&
129
+ oi.uom == scannedProductDetail.uom
130
+ )
103
131
 
104
- const worksheetDetails: WorksheetDetail[] = worksheet.worksheetDetails
105
- const orderInventories: OrderInventory[] = worksheetDetails
106
- .map((wsd: WorksheetDetail) => wsd.targetInventory)
107
- .filter((oi: OrderInventory) => oi.releaseGood.name === releaseGoodNo)
108
-
109
- if (productBarcode) {
110
- let productDetails: ProductDetail[] = []
111
- orderInventories.map((oi: OrderInventory) => {
112
- const foundPDs: ProductDetail[] = oi.inventory && oi.inventory.product && oi.inventory.product.productDetails
113
- foundPDs.map(productDetail => {
114
- productDetails.push(productDetail)
115
- })
116
- })
132
+ let productDetail = scannedProductDetail
117
133
 
118
- const matchingProductDetail: ProductDetail = productDetails.find(
119
- (productDetail: ProductDetail) => productDetail.gtin === productBarcode
120
- )
121
- if (!matchingProductDetail) throw new Error('Unable to find product barcode.')
122
- const packingType: string = matchingProductDetail.packingType
123
- const packingSize: number = matchingProductDetail.packingSize
124
- if (!matchingProductDetail)
125
- throw new Error(this.ERROR_MSG.PRODUCT.BARCODE_NOT_EXIST(productBarcode, packingType, packingSize))
126
-
127
- let matchingOIs: OrderInventory[] = orderInventories.filter(
128
- (oi: OrderInventory) =>
129
- oi.packingType === packingType &&
130
- oi.packingSize === packingSize &&
131
- oi.product?.id === matchingProductDetail.product?.id
134
+ //if no order inventories found then find based on child product detail of scanned product detail
135
+ //if found then user is scanning parent product detail
136
+ if (!matchingOIs?.length) {
137
+ if (!scannedChildProductDetail) {
138
+ throw new Error(this.ERROR_MSG.FIND.NO_RESULT(productBarcode))
139
+ }
140
+ matchingOIs = orderInventories.filter(
141
+ oi =>
142
+ oi.packingType == scannedChildProductDetail.packingType &&
143
+ oi.packingSize == scannedChildProductDetail.packingSize &&
144
+ oi.uom == scannedChildProductDetail.uom
132
145
  )
133
146
 
134
- let sortedQty: number = 1
147
+ productDetail = scannedChildProductDetail
135
148
 
136
- if (!matchingOIs?.length) {
137
- throw new Error(this.ERROR_MSG.ORDER_ITEM.NO_MATCHING_RESULT(packingType, packingSize))
138
- } else {
139
- await Promise.all(
140
- matchingOIs.map(async (matchingOI: OrderInventory) => {
141
- const releaseQty: number = matchingOI.releaseQty
142
- const inventory: Inventory = matchingOI.inventory
143
- const releaseGood: ReleaseGood = matchingOI.releaseGood
144
- const product: Product = inventory.product
145
-
146
- if (releaseQty != matchingOI?.sortedQty && sortedQty == 1) {
147
- // Serial Number scanning for batch picking
148
- if (matchingOI?.refWorksheetId) {
149
- if (product?.isRequireSerialNumberScanningOutbound) {
150
- if (!serialNumber || serialNumber == '') {
151
- throw new Error(this.ERROR_MSG.VALIDITY.CANT_PROCEED_STEP_BY('sorting', `require serial number`))
152
- }
153
-
154
- let foundSerialNumber: InventoryItem = await this.trxMgr
155
- .getRepository(InventoryItem)
156
- .findOne({ where: { domain: this.domain, serialNumber: serialNumber, product } })
157
-
158
- if (foundSerialNumber) {
159
- if (foundSerialNumber.inventoryId !== inventory.id) {
160
- throw new Error('Serial Number scanned is in another inventory')
161
- }
162
-
163
- if (foundSerialNumber.outboundOrderId) {
164
- let releaseGood: ReleaseGood = await this.trxMgr
165
- .getRepository(ReleaseGood)
166
- .findOne({ where: { id: foundSerialNumber.outboundOrderId } })
167
- throw new Error(`Inventory Item is already picked/sorted in ${releaseGood.name}`)
168
- }
169
-
170
- foundSerialNumber.status = INVENTORY_STATUS.SORTING
171
- foundSerialNumber.updater = this.user
172
- foundSerialNumber.outboundOrderId = releaseGood.id
173
-
174
- await this.trxMgr.getRepository(InventoryItem).save(foundSerialNumber)
175
- } else {
176
- let inventoryItem: InventoryItem = new InventoryItem()
177
- inventoryItem.name = InventoryNoGenerator.inventoryItemName()
178
- inventoryItem.serialNumber = serialNumber
179
- inventoryItem.status = INVENTORY_STATUS.SORTING
180
- inventoryItem.outboundOrderId = releaseGood.id
181
- inventoryItem.source = INVENTORY_ITEM_SOURCE.OUTBOUND
182
- inventoryItem.product = product
183
- inventoryItem.inventory = inventory
184
- inventoryItem.domain = this.domain
185
-
186
- await this.trxMgr.getRepository(InventoryItem).save(inventoryItem)
187
- }
188
- }
149
+ if (!matchingOIs?.length || matchingOIs[0].product.isRequireSerialNumberScanningOutbound) {
150
+ throw new Error(this.ERROR_MSG.FIND.NO_RESULT(productBarcode))
151
+ }
152
+ }
153
+
154
+ const packingType: string = productDetail.packingType
155
+ const packingSize: number = productDetail.packingSize
156
+
157
+ let matchingProduct = await this.getDirectQty(
158
+ {
159
+ ...productDetail
160
+ },
161
+ productBarcode,
162
+ sortingQty ? sortingQty : 1
163
+ )
164
+
165
+ // validate matching product details based on scanned barcode
166
+ if (!matchingProduct) throw new Error(this.ERROR_MSG.FIND.NO_RESULT(productBarcode))
167
+
168
+ let sortedQty: number = matchingProduct.qty
169
+ const releaseGood: ReleaseGood = matchingOIs[0].releaseGood
170
+
171
+ //update order inventories
172
+ await Promise.all(
173
+ matchingOIs.map(async (matchingOI, index) => {
174
+ //if sortedQty is more than 0, then logic will run
175
+ //this validation is to handle multiple ois with multiple release qty
176
+ if (sortedQty > 0) {
177
+ const releaseQty: number = matchingOI.releaseQty
178
+ const inventory: Inventory = matchingOI.inventory
179
+ const product: Product = matchingOI.product
180
+
181
+ // Serial Number scanning for batch picking
182
+ if (matchingOI?.refWorksheetId) {
183
+ if (product?.isRequireSerialNumberScanningOutbound) {
184
+ if (!serialNumber || serialNumber == '') {
185
+ throw new Error(this.ERROR_MSG.VALIDITY.CANT_PROCEED_STEP_BY('sorting', `require serial number`))
189
186
  }
190
187
 
191
- matchingOI.sortedQty = Boolean(matchingOI?.sortedQty) ? matchingOI.sortedQty + sortedQty : sortedQty
192
- sortedQty -= 1
193
- if (matchingOI.sortedQty == releaseQty) {
194
- matchingOI.status = ORDER_INVENTORY_STATUS.SORTED
195
- await this.updateOrderTargets([matchingOI])
196
- await this.transactionInventory(inventory, releaseGood, 0, 0, INVENTORY_TRANSACTION_TYPE.SORTING)
197
-
198
- let worksheetDetail: WorksheetDetail = worksheetDetails.find(
199
- wsd => wsd.targetInventory.id === matchingOI.id
200
- )
201
- worksheetDetail.status = WORKSHEET_STATUS.DONE
202
- worksheetDetail.updater = this.user
203
- await this.trxMgr.getRepository(WorksheetDetail).save(worksheetDetail)
204
-
205
- let inventoryItems: InventoryItem = await this.trxMgr
206
- .getRepository(InventoryItem)
207
- .find({ where: { outboundOrderId: releaseGood.id } })
208
-
209
- if (inventoryItems.length > 0) {
210
- inventoryItems.forEach((itm: InventoryItem) => {
211
- itm.status = INVENTORY_STATUS.SORTED
212
- itm.updater = this.user
213
- })
214
-
215
- await this.trxMgr.getRepository(InventoryItem).save(inventoryItems)
188
+ let foundSerialNumber: InventoryItem = await this.trxMgr
189
+ .getRepository(InventoryItem)
190
+ .findOne({ where: { domain: this.domain, serialNumber: serialNumber, product } })
191
+
192
+ if (foundSerialNumber) {
193
+ if (foundSerialNumber.inventoryId !== inventory.id) {
194
+ throw new Error('Serial Number scanned is in another inventory')
216
195
  }
217
- } else if (matchingOI?.sortedQty > releaseQty) {
218
- const product: Product = matchingOI.inventory.product
219
- throw new Error(this.ERROR_MSG.ORDER_ITEM.EXCESS_QTY(product.sku, packingType, packingSize))
196
+
197
+ if (foundSerialNumber.outboundOrderId) {
198
+ let releaseGood: ReleaseGood = await this.trxMgr
199
+ .getRepository(ReleaseGood)
200
+ .findOne({ where: { id: foundSerialNumber.outboundOrderId } })
201
+ throw new Error(`Inventory Item is already picked/sorted in ${releaseGood.name}`)
202
+ }
203
+
204
+ foundSerialNumber.status = INVENTORY_STATUS.SORTING
205
+ foundSerialNumber.updater = this.user
206
+ foundSerialNumber.outboundOrderId = releaseGood.id
207
+
208
+ await this.trxMgr.getRepository(InventoryItem).save(foundSerialNumber)
220
209
  } else {
221
- await this.updateOrderTargets([matchingOI])
210
+ let inventoryItem: InventoryItem = new InventoryItem()
211
+ inventoryItem.name = InventoryNoGenerator.inventoryItemName()
212
+ inventoryItem.serialNumber = serialNumber
213
+ inventoryItem.status = INVENTORY_STATUS.SORTING
214
+ inventoryItem.outboundOrderId = releaseGood.id
215
+ inventoryItem.source = INVENTORY_ITEM_SOURCE.OUTBOUND
216
+ inventoryItem.product = product
217
+ inventoryItem.inventory = inventory
218
+ inventoryItem.domain = this.domain
219
+
220
+ await this.trxMgr.getRepository(InventoryItem).save(inventoryItem)
222
221
  }
222
+ }
223
+ }
223
224
 
224
- if (toteNo) {
225
- await this.toteScanning(
226
- toteNo,
227
- matchingOI.orderProduct,
228
- matchingOI,
229
- 1,
230
- releaseGood,
231
- matchingOI.bizplace
232
- )
233
- }
225
+ let tempSortedQty = 0
226
+
227
+ //when sortedQty is more than releaseQty, check if the loop is running the last order inventory
228
+ //if yes then throw error
229
+ if (sortedQty > releaseQty && index == orderInventories.length - 1) {
230
+ throw new Error(this.ERROR_MSG.ORDER_ITEM.EXCESS_QTY(product.sku, packingType, packingSize))
231
+ } else {
232
+ //if not proceed to sorting
233
+ if (sortedQty < releaseQty) {
234
+ tempSortedQty = sortedQty
235
+ } else {
236
+ //if sortedQty is more than releaseQty then releaseQty - previous sorted qty will be the qty that needs to be sorted for current oi
237
+ //overflow qty will be sorted to next oi
238
+ tempSortedQty = Boolean(matchingOI?.sortedQty) ? releaseQty - matchingOI.sortedQty : releaseQty
234
239
  }
235
- })
236
- )
237
- }
238
- }
240
+ sortedQty -= tempSortedQty
241
+ }
242
+
243
+ matchingOI.sortedQty = Boolean(matchingOI?.sortedQty) ? tempSortedQty + matchingOI.sortedQty : tempSortedQty
244
+
245
+ if (matchingOI.sortedQty == releaseQty) {
246
+ matchingOI.status = ORDER_INVENTORY_STATUS.SORTED
247
+ await this.updateOrderTargets([matchingOI])
248
+ await this.transactionInventory(inventory, releaseGood, 0, 0, INVENTORY_TRANSACTION_TYPE.SORTING)
249
+
250
+ let worksheetDetail = worksheetDetails.find(wd => (wd.targetInventory.id = matchingOI.id))
251
+ await this.trxMgr
252
+ .getRepository(WorksheetDetail)
253
+ .update({ id: worksheetDetail.id }, { status: WORKSHEET_STATUS.DONE, updater: this.user })
254
+
255
+ let inventoryItems: InventoryItem = await this.trxMgr
256
+ .getRepository(InventoryItem)
257
+ .find({ where: { outboundOrderId: releaseGood.id } })
258
+
259
+ if (inventoryItems.length > 0) {
260
+ inventoryItems.forEach((itm: InventoryItem) => {
261
+ itm.status = INVENTORY_STATUS.SORTED
262
+ itm.updater = this.user
263
+ })
264
+
265
+ await this.trxMgr.getRepository(InventoryItem).save(inventoryItems)
266
+ }
267
+ } else if (matchingOI?.sortedQty > releaseQty) {
268
+ const product: Product = matchingOI.product
269
+ throw new Error(this.ERROR_MSG.ORDER_ITEM.EXCESS_QTY(product.sku, packingType, packingSize))
270
+ } else {
271
+ await this.updateOrderTargets([matchingOI])
272
+ }
273
+
274
+ if (toteNo) {
275
+ await this.toteScanning(toteNo, matchingOI.orderProduct, matchingOI, 1, releaseGood, matchingOI.bizplace)
276
+ }
277
+ }
278
+ })
279
+ )
280
+ await this.trxMgr.getRepository(ReleaseGood).update({ id: releaseGood.id }, { sortedBy: this.user })
281
+ console.timeEnd('scanProductSorting')
239
282
  }
240
283
 
241
284
  async sortingProduct(
@@ -380,15 +423,10 @@ export class SortingWorksheetController extends VasWorksheetController {
380
423
 
381
424
  async completeOrderSorting(releaseGoodNo: string): Promise<ReleaseGood> {
382
425
  try {
383
- let releaseGood: ReleaseGood = await this.findRefOrder(
384
- ReleaseGood,
385
- {
386
- domain: this.domain,
387
- name: releaseGoodNo,
388
- status: ORDER_STATUS.SORTING
389
- },
390
- ['bizplace', 'orderInventories']
391
- )
426
+ let releaseGood: ReleaseGood = await this.trxMgr.getRepository(ReleaseGood).findOne({
427
+ where: { domain: this.domain, name: releaseGoodNo, status: ORDER_STATUS.SORTING },
428
+ relations: ['bizplace', 'orderInventories']
429
+ })
392
430
 
393
431
  if (!releaseGood) {
394
432
  throw new Error('Order is already sorted')
@@ -485,7 +523,7 @@ export class SortingWorksheetController extends VasWorksheetController {
485
523
  .getRepository(OrderTote)
486
524
  .findOne({ where: { domain: this.domain, name: toteNo, releaseGood } })
487
525
 
488
- //if order tote not found the create one, if tote not found means it's tote box
526
+ //if order tote not found then create one, if tote not found means it's tote box
489
527
  //create order tote item
490
528
  if (!foundOrderTote) {
491
529
  const orderTote = await this.trxMgr.getRepository(OrderTote).save({
@@ -7,6 +7,7 @@ import {
7
7
  ReleaseGood as ReleaseGoodEntity
8
8
  } from '@things-factory/sales-base'
9
9
  import { Domain } from '@things-factory/shell'
10
+ import { User } from '@things-factory/auth-base'
10
11
  import { Location } from '@things-factory/warehouse-base'
11
12
 
12
13
  import { WORKSHEET_STATUS, WORKSHEET_TYPE } from '../../../constants'
@@ -59,22 +60,27 @@ export const findSortingReleaseOrdersByTaskNoResolver = {
59
60
  .createQueryBuilder('ws')
60
61
  .select('rg.id as id')
61
62
  .addSelect('rg.name as name')
63
+ .addSelect('rg.refNo as "refNo"')
64
+ .addSelect('rg.refNo2 as "refNo2"')
62
65
  .addSelect('rg.status as status')
66
+ .addSelect('user.name as "sortedByUser"')
63
67
  .innerJoin(Domain, 'domain', 'ws.domain_id = domain.id')
64
68
  .innerJoin(WorksheetDetailEntity, 'wsd', 'ws.id = wsd.worksheet_id')
65
69
  .innerJoin(OrderInventoryEntity, 'oi', 'oi.id = wsd.target_inventory_id')
66
70
  .innerJoin(ReleaseGoodEntity, 'rg', 'rg.id = oi.release_good_id')
71
+ .leftJoin(User, 'user', 'rg.sorted_by_id = user.id')
67
72
  .where('domain.id = :domainId', { domainId: domain.id })
68
73
  .andWhere('ws.taskNo = :taskNo', { taskNo: taskNo })
69
74
  .andWhere('ws.type = :worksheetType', { worksheetType: WORKSHEET_TYPE.SORTING })
70
75
  .andWhere('ws.status = :worksheetStatus', { worksheetStatus: WORKSHEET_STATUS.EXECUTING })
71
- .andWhere('rg.status = :roStatus', { roStatus: ORDER_STATUS.SORTING })
72
76
  .groupBy('rg.id')
73
77
  .addGroupBy('rg.name')
74
78
  .addGroupBy('rg.status')
79
+ .addGroupBy('user.name')
75
80
  .orderBy('rg.createdAt', 'ASC')
76
81
 
77
82
  const releaseGoods: ReleaseGoodEntity[] = await qb.getRawMany()
83
+
78
84
  return { releaseGoods, taskNo }
79
85
  }
80
86
  }
@@ -4,9 +4,13 @@ import { EntityManager } from 'typeorm'
4
4
  import { SortingWorksheetController } from '../../../../controllers'
5
5
 
6
6
  export const scanProductSortingResolver = {
7
- async scanProductSorting(_: any, { taskNo, releaseGoodNo, productBarcode, serialNumber, toteNo }, context: any) {
7
+ async scanProductSorting(
8
+ _: any,
9
+ { releaseGoodNo, taskNo, productBarcode, serialNumber, toteNo, sortingQty },
10
+ context: any
11
+ ) {
8
12
  const { tx, domain, user }: { tx: EntityManager; domain: Domain; user: User } = context.state
9
- await scanProductSorting(tx, domain, user, taskNo, releaseGoodNo, productBarcode, serialNumber, toteNo)
13
+ await scanProductSorting(tx, domain, user, releaseGoodNo, taskNo, productBarcode, serialNumber, toteNo, sortingQty)
10
14
  }
11
15
  }
12
16
 
@@ -14,12 +18,13 @@ export async function scanProductSorting(
14
18
  tx: EntityManager,
15
19
  domain: Domain,
16
20
  user: User,
17
- taskNo: string,
18
21
  releaseGoodNo: string,
22
+ taskNo: string,
19
23
  productBarcode?: string,
20
24
  serialNumber?: string,
21
- toteNo?: string
25
+ toteNo?: string,
26
+ sortingQty?: number
22
27
  ) {
23
28
  const worksheetController: SortingWorksheetController = new SortingWorksheetController(tx, domain, user)
24
- await worksheetController.scanProductSorting(taskNo, releaseGoodNo, productBarcode, serialNumber, toteNo)
29
+ await worksheetController.scanProductSorting(releaseGoodNo, taskNo, productBarcode, serialNumber, toteNo, sortingQty)
25
30
  }
@@ -11,7 +11,7 @@ export const sortingWorksheetResolver = {
11
11
  const { domain }: { domain: Domain } = context.state
12
12
  const releaseGood: ReleaseGood = await getRepository(ReleaseGood).findOne({
13
13
  where: { domain, name: releaseGoodNo, status: ORDER_STATUS.SORTING },
14
- relations: ['bizplace', 'bizplace.domain']
14
+ relations: ['bizplace', 'bizplace.domain', 'bizplace.company', 'bizplace.company.domain']
15
15
  })
16
16
  if (!releaseGood) throw new Error(`Couldn't find sorting worksheet by order no (${releaseGoodNo})`)
17
17
 
@@ -58,6 +58,7 @@ export const sortingWorksheetResolver = {
58
58
  worksheetInfo: {
59
59
  bizplaceName: releaseGood.bizplace.name,
60
60
  partnerDomainId: releaseGood.bizplace?.domain.id,
61
+ customerCompanyDomainId: releaseGood.bizplace.company.domain.id,
61
62
  startedAt: worksheet.startedAt,
62
63
  refNo: releaseGood.refNo,
63
64
  refNo2: releaseGood.refNo2,
@@ -351,6 +351,7 @@ export const Mutation = /* GraphQL */ `
351
351
  productBarcode: String!
352
352
  serialNumber: String
353
353
  toteNo: String
354
+ sortingQty: Int
354
355
  ): Boolean @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
355
356
 
356
357
  packing (