@things-factory/warehouse-base 4.3.527 → 4.3.531
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.
|
@@ -49,21 +49,33 @@ class WebspertController {
|
|
|
49
49
|
let productDetailsID = productDetails.map(productDetail => {
|
|
50
50
|
return "'" + (productDetail === null || productDetail === void 0 ? void 0 : productDetail.trim()) + "'";
|
|
51
51
|
}).join(',');
|
|
52
|
-
let rawQb = await
|
|
53
|
-
select
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
52
|
+
let rawQb = await (0, typeorm_1.getRepository)(inventory_1.Inventory).query(`
|
|
53
|
+
select id, sku, ref_code, bizplace_id, domain_id, max("available_qty") as "availableQty" from (
|
|
54
|
+
select pd.id, p.sku, pd.ref_code, b.id as bizplace_id, $2 as domain_id, 0 as available_qty
|
|
55
|
+
from bizplaces b
|
|
56
|
+
inner join companies c on c.id = b.company_id
|
|
57
|
+
inner join domains d on d.id = c.domain_id
|
|
58
|
+
inner join product_details pd on pd.domain_id = d.id
|
|
59
|
+
inner join products p on p.id = pd.product_id
|
|
60
|
+
where b.id = $1 and
|
|
61
|
+
pd.id in (${productDetailsID})
|
|
62
|
+
union all
|
|
63
|
+
select pd.id, p.sku, pd.ref_code, i.bizplace_id, i.domain_id,
|
|
64
|
+
sum(i.qty - coalesce(i.locked_qty,0) - coalesce(i.transfer_qty,0) - coalesce(pds.unassigned_qty,0)) as available_qty
|
|
65
|
+
from inventories i
|
|
66
|
+
inner join locations loc on loc.id = i.location_id
|
|
67
|
+
inner join product_details pd on pd.id = i.product_detail_id
|
|
68
|
+
left join product_detail_stocks pds on pds.product_detail_id = pd.id
|
|
69
|
+
left join products p on p.id = pd.product_id
|
|
70
|
+
where
|
|
71
|
+
loc."type" not in ('QUARANTINE', 'RESERVED') and
|
|
72
|
+
i.status = 'STORED' and
|
|
73
|
+
i.bizplace_id = $1 and
|
|
74
|
+
i.domain_id = $2 and
|
|
75
|
+
i.product_detail_id in (${productDetailsID})
|
|
76
|
+
group by pd.id, p.sku, pd.ref_code, i.bizplace_id, i.domain_id
|
|
77
|
+
) src
|
|
78
|
+
group by id, sku, ref_code, bizplace_id, domain_id
|
|
67
79
|
`, [bizplace.id, domain.id]);
|
|
68
80
|
for (let index = 0; index < rawQb.length; index++) {
|
|
69
81
|
const data = rawQb[index];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webspert-controller.js","sourceRoot":"","sources":["../../../server/controllers/ecommerce/webspert-controller.ts"],"names":[],"mappings":";;;;;;AAAA,qCAAqE;AAGrE,6CAA4C;AAG5C,6CAA4C;AAC5C,uEAAmE;AAEnE,iEAA6D;AAE7D,kDAAyB;AAEzB,IAAI,cAAc,GAAQ,YAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;AAEhD,0EAA0E;AAE1E,MAAa,kBAAkB;IACtB,MAAM,CAAC,KAAK,CAAC,WAAW,CAC7B,cAA+B,EAC/B,QAAkB,EAClB,MAAc,EACd,IAAU,EACV,EAAkB;QAElB,IAAI,EAAE,EAAE;YACN,MAAM,IAAI,CAAC,YAAY,CAAC,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;SACpE;aAAM;YACL,MAAM,IAAA,uBAAa,GAAE,CAAC,WAAW,CAAC,KAAK,EAAE,EAAiB,EAAE,EAAE;gBAC5D,MAAM,IAAI,CAAC,YAAY,CAAC,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;YACrE,CAAC,CAAC,CAAA;SACH;IACH,CAAC;IAEO,MAAM,CAAC,KAAK,CAAC,YAAY,CAC/B,cAA+B,EAC/B,QAAkB,EAClB,MAAc,EACd,IAAU,EACV,EAAiB;QACjB,4CAA4C;QAC5C,MAAM,SAAS,GAAG,GAAG,CAAA;QAErB,2BAA2B;QAC3B,IAAI,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,EAAE;YAC7D,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,aAAa,CAAC,EAAE,CAAC,EAAE;gBAC3C,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,CAAA;aAC3B;YACD,OAAO,GAAG,CAAA;QACZ,CAAC,EAAE,EAAE,CAAC;aACH,MAAM,CAAC,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,EAAE;YACpC,IAAI,GAAG,GAAG,SAAS,KAAK,CAAC,EAAE;gBACzB,OAAO,CAAC,GAAG,GAAG,EAAE,CAAC,eAAe,CAAC,CAAC,CAAA;aACnC;iBAAM;gBACL,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;gBACzC,OAAO,GAAG,CAAA;aACX;QACH,CAAC,EAAE,EAAE,CAAC,CAAA;QAER,sBAAsB;QACtB,uKAAuK;QACvK,OAAO,CAAC,GAAG,CACT,MAAM,CAAC,GAAG,CAAC,KAAK,EAAC,cAAc,EAAC,EAAE;YAChC,IAAI;gBACF,IAAI,gBAAgB,GAAG,cAAc,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE;oBACxD,OAAO,GAAG,IAAG,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI,EAAE,CAAA,GAAG,GAAG,CAAA;gBAC1C,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;gBAEZ,IAAI,KAAK,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"webspert-controller.js","sourceRoot":"","sources":["../../../server/controllers/ecommerce/webspert-controller.ts"],"names":[],"mappings":";;;;;;AAAA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AU;aAC/B,EACD;gBACE,KAAK,EAAE;oBACL,IAAI,EAAE,IAAI;oBACV,MAAM,EAAE,MAAM;iBACf;aACF,CACF,CAAA;SACF;QAED,OAAO,OAAO,CAAA;IAChB,CAAC;CACF;AA9ID,gDA8IC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/warehouse-base",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.531",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"@things-factory/product-base": "^4.3.526",
|
|
33
33
|
"@things-factory/setting-base": "^4.3.526"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "4e810828d958c98980c82e22fb02e6e404ee52ed"
|
|
36
36
|
}
|
|
@@ -66,21 +66,33 @@ export class WebspertController {
|
|
|
66
66
|
return "'" + productDetail?.trim() + "'"
|
|
67
67
|
}).join(',')
|
|
68
68
|
|
|
69
|
-
let rawQb = await
|
|
70
|
-
select
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
69
|
+
let rawQb = await getRepository(Inventory).query(`
|
|
70
|
+
select id, sku, ref_code, bizplace_id, domain_id, max("available_qty") as "availableQty" from (
|
|
71
|
+
select pd.id, p.sku, pd.ref_code, b.id as bizplace_id, $2 as domain_id, 0 as available_qty
|
|
72
|
+
from bizplaces b
|
|
73
|
+
inner join companies c on c.id = b.company_id
|
|
74
|
+
inner join domains d on d.id = c.domain_id
|
|
75
|
+
inner join product_details pd on pd.domain_id = d.id
|
|
76
|
+
inner join products p on p.id = pd.product_id
|
|
77
|
+
where b.id = $1 and
|
|
78
|
+
pd.id in (${productDetailsID})
|
|
79
|
+
union all
|
|
80
|
+
select pd.id, p.sku, pd.ref_code, i.bizplace_id, i.domain_id,
|
|
81
|
+
sum(i.qty - coalesce(i.locked_qty,0) - coalesce(i.transfer_qty,0) - coalesce(pds.unassigned_qty,0)) as available_qty
|
|
82
|
+
from inventories i
|
|
83
|
+
inner join locations loc on loc.id = i.location_id
|
|
84
|
+
inner join product_details pd on pd.id = i.product_detail_id
|
|
85
|
+
left join product_detail_stocks pds on pds.product_detail_id = pd.id
|
|
86
|
+
left join products p on p.id = pd.product_id
|
|
87
|
+
where
|
|
88
|
+
loc."type" not in ('QUARANTINE', 'RESERVED') and
|
|
89
|
+
i.status = 'STORED' and
|
|
90
|
+
i.bizplace_id = $1 and
|
|
91
|
+
i.domain_id = $2 and
|
|
92
|
+
i.product_detail_id in (${productDetailsID})
|
|
93
|
+
group by pd.id, p.sku, pd.ref_code, i.bizplace_id, i.domain_id
|
|
94
|
+
) src
|
|
95
|
+
group by id, sku, ref_code, bizplace_id, domain_id
|
|
84
96
|
`, [bizplace.id, domain.id])
|
|
85
97
|
|
|
86
98
|
|