@rytass/wms-module-core 0.10.0 → 0.10.1
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/index.cjs.js +11 -3
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -3513,7 +3513,10 @@ exports.StockService = class StockService {
|
|
|
3513
3513
|
.addSelect('b."vendorId"', 'vendorId')
|
|
3514
3514
|
.addSelect('b."customerId"', 'customerId')
|
|
3515
3515
|
.from(tablePathOf(this.dataSource, this.stockEntity), 's')
|
|
3516
|
-
|
|
3516
|
+
// The entity, not its table path: a schema-qualified path such as
|
|
3517
|
+
// `shuttle.wms_batches` reads to TypeORM as `<alias>.<relation>`
|
|
3518
|
+
// in a join and fails with `"shuttle" alias was not found`.
|
|
3519
|
+
.innerJoin(this.entities.batch, 'b', 's."batchId" = b.id'), 'stock_status', `stock_status."stockId" = ${alias}.id`)
|
|
3517
3520
|
.addSelect('stock_status.status', 'status')
|
|
3518
3521
|
.addSelect('stock_status."transferId"', 'transferId')
|
|
3519
3522
|
.addSelect('stock_status.held', 'held')
|
|
@@ -3727,7 +3730,8 @@ exports.StockService = class StockService {
|
|
|
3727
3730
|
if (options.limit !== undefined && options.limit > 0)
|
|
3728
3731
|
queryBuilder.take(options.limit);
|
|
3729
3732
|
if (aggregated) {
|
|
3730
|
-
|
|
3733
|
+
// The entity, not its table path — see `selectQueryBuilder`.
|
|
3734
|
+
queryBuilder.innerJoin(this.entities.batch, 'b', 'stock."batchId" = b.id');
|
|
3731
3735
|
queryBuilder.select('stock."materialId"', 'materialId');
|
|
3732
3736
|
queryBuilder.addSelect('stock."batchId"', 'batchId');
|
|
3733
3737
|
queryBuilder.addSelect('stock."locationId"', 'locationId');
|
|
@@ -5290,7 +5294,11 @@ exports.ShipInventoryOrderService = class ShipInventoryOrderService {
|
|
|
5290
5294
|
.select('i."orderId"', 'orderid')
|
|
5291
5295
|
.addSelect(`SUM(CASE WHEN CAST(c."quantityChanged" AS NUMERIC) < 0 THEN ABS(CAST(c."quantityChanged" AS NUMERIC)) ELSE 0 END)`, 'shippedsum')
|
|
5292
5296
|
.from(tablePathOf(this.dataSource, exports.ShipInventoryOrderChangeEntityClass), 'c')
|
|
5293
|
-
|
|
5297
|
+
// The entity, not its table path: a schema-qualified path
|
|
5298
|
+
// reads to TypeORM as `<alias>.<relation>` in a join.
|
|
5299
|
+
// `.target` only narrows `EntityTarget` to the class (or,
|
|
5300
|
+
// for an EntitySchema, its name) that `innerJoin` accepts.
|
|
5301
|
+
.innerJoin(this.dataSource.getMetadata(this.shipInventoryOrderItemEntity).target, 'i', 'c."itemId" = i.id')
|
|
5294
5302
|
.groupBy('i."orderId"'), 'change_sums', 'change_sums.orderid = o.id'), 'order_status', `${alias}.id = order_status.orderid`)
|
|
5295
5303
|
.select('orders.id', 'id')
|
|
5296
5304
|
.addSelect('orders.key', 'key')
|