@things-factory/sales-base 4.3.352 → 4.3.357
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/constants/order.js +22 -1
- package/dist-server/constants/order.js.map +1 -1
- package/dist-server/service/index.js +7 -0
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/inventory-check/inventory-check-query.js +58 -9
- package/dist-server/service/inventory-check/inventory-check-query.js.map +1 -1
- package/dist-server/service/inventory-check/inventory-check-types.js +3 -3
- package/dist-server/service/inventory-check/inventory-check-types.js.map +1 -1
- package/dist-server/service/inventory-check/inventory-check.js +4 -4
- package/dist-server/service/inventory-check/inventory-check.js.map +1 -1
- package/dist-server/service/inventory-check-item/index.js +25 -0
- package/dist-server/service/inventory-check-item/index.js.map +1 -0
- package/dist-server/service/inventory-check-item/inventory-check-item-mutation.js +120 -0
- package/dist-server/service/inventory-check-item/inventory-check-item-mutation.js.map +1 -0
- package/dist-server/service/inventory-check-item/inventory-check-item-query.js +122 -0
- package/dist-server/service/inventory-check-item/inventory-check-item-query.js.map +1 -0
- package/dist-server/service/inventory-check-item/inventory-check-item-types.js +121 -0
- package/dist-server/service/inventory-check-item/inventory-check-item-types.js.map +1 -0
- package/dist-server/service/inventory-check-item/inventory-check-item.js +191 -0
- package/dist-server/service/inventory-check-item/inventory-check-item.js.map +1 -0
- package/dist-server/service/others/other-types.js +8 -0
- package/dist-server/service/others/other-types.js.map +1 -1
- package/dist-server/utils/inventory-util.js +84 -101
- package/dist-server/utils/inventory-util.js.map +1 -1
- package/dist-server/utils/order-no-generator.js +3 -0
- package/dist-server/utils/order-no-generator.js.map +1 -1
- package/package.json +5 -5
- package/server/constants/order.ts +23 -0
- package/server/service/index.ts +9 -2
- package/server/service/inventory-check/inventory-check-query.ts +58 -8
- package/server/service/inventory-check/inventory-check-types.ts +3 -3
- package/server/service/inventory-check/inventory-check.ts +4 -4
- package/server/service/inventory-check-item/index.ts +9 -0
- package/server/service/inventory-check-item/inventory-check-item-mutation.ts +113 -0
- package/server/service/inventory-check-item/inventory-check-item-query.ts +88 -0
- package/server/service/inventory-check-item/inventory-check-item-types.ts +77 -0
- package/server/service/inventory-check-item/inventory-check-item.ts +159 -0
- package/server/service/others/other-types.ts +6 -0
- package/server/utils/inventory-util.ts +85 -101
- package/server/utils/order-no-generator.ts +4 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inventory-check-item-query.js","sourceRoot":"","sources":["../../../server/service/inventory-check-item/inventory-check-item-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAgD;AAChD,iDAA8F;AAC9F,+CAA6E;AAC7E,qCAAuC;AACvC,0BAA2C;AAC3C,iEAA2D;AAGpD,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAE5B,AAAN,KAAK,CAAC,mBAAmB,CAChB,OAAY,EACmC,OAAkB,EACb,UAAuB,EAC1B,QAAoB;QAE5E,MAAM,EAAE,MAAM,EAAE,GAAuB,OAAO,CAAC,KAAK,CAAA;QACpD,MAAM,MAAM,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,CAAA;QACtC,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,aAAa,CAAC,CAAA;QACrE,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,cAAc,CAAC,CAAA;QAEvE,MAAM,EAAE,GAAG,IAAA,uBAAa,EAAC,yCAAkB,CAAC,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAA;QACrF,EAAE,CAAC,kBAAkB,CAAC,mCAAmC,EAAE,gBAAgB,CAAC,CAAA;QAC5E,EAAE,CAAC,kBAAkB,CAAC,8BAA8B,EAAE,WAAW,CAAC,CAAA;QAClE,EAAE,CAAC,iBAAiB,CAAC,mC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,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IACpD,WAAA,IAAA,kBAAG,EAAC,YAAY,EAAE,IAAI,CAAC,EAAE,CAAC,kBAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IACzD,WAAA,IAAA,kBAAG,EAAC,UAAU,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,eAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;;wEADiB,kBAAU,oBAAV,kBAAU;;kEAkDnF;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,yCAAkB,CAAC;IACX,WAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAgB,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;iEAKzD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAqB,yCAAkB;;qDAE1D;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAqB,yCAAkB;;sDAE3D;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAqB,yCAAkB;;sDAE3D;AA9EU,uBAAuB;IADnC,IAAA,uBAAQ,EAAC,yCAAkB,CAAC;GAChB,uBAAuB,CA+EnC;AA/EY,0DAAuB"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var _a, _b, _c, _d, _e, _f;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.InventoryCheckItemPatch = exports.NewInventoryCheckItem = exports.InventoryCheckItemList = void 0;
|
|
14
|
+
const type_graphql_1 = require("type-graphql");
|
|
15
|
+
const product_base_1 = require("@things-factory/product-base");
|
|
16
|
+
const warehouse_base_1 = require("@things-factory/warehouse-base");
|
|
17
|
+
const shell_1 = require("@things-factory/shell");
|
|
18
|
+
const inventory_check_item_1 = require("./inventory-check-item");
|
|
19
|
+
let InventoryCheckItemList = class InventoryCheckItemList {
|
|
20
|
+
};
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, type_graphql_1.Field)(type => [inventory_check_item_1.InventoryCheckItem], { nullable: true }),
|
|
23
|
+
__metadata("design:type", Array)
|
|
24
|
+
], InventoryCheckItemList.prototype, "items", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], InventoryCheckItemList.prototype, "total", void 0);
|
|
29
|
+
InventoryCheckItemList = __decorate([
|
|
30
|
+
(0, type_graphql_1.ObjectType)()
|
|
31
|
+
], InventoryCheckItemList);
|
|
32
|
+
exports.InventoryCheckItemList = InventoryCheckItemList;
|
|
33
|
+
let NewInventoryCheckItem = class NewInventoryCheckItem {
|
|
34
|
+
};
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, type_graphql_1.Field)(),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], NewInventoryCheckItem.prototype, "name", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], NewInventoryCheckItem.prototype, "status", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, type_graphql_1.Field)(type => warehouse_base_1.InventoryPatch, { nullable: true }),
|
|
45
|
+
__metadata("design:type", typeof (_a = typeof warehouse_base_1.InventoryPatch !== "undefined" && warehouse_base_1.InventoryPatch) === "function" ? _a : Object)
|
|
46
|
+
], NewInventoryCheckItem.prototype, "inventory", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, type_graphql_1.Field)(type => product_base_1.NewProduct, { nullable: true }),
|
|
49
|
+
__metadata("design:type", typeof (_b = typeof product_base_1.NewProduct !== "undefined" && product_base_1.NewProduct) === "function" ? _b : Object)
|
|
50
|
+
], NewInventoryCheckItem.prototype, "product", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true }),
|
|
53
|
+
__metadata("design:type", typeof (_c = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _c : Object)
|
|
54
|
+
], NewInventoryCheckItem.prototype, "productDetail", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], NewInventoryCheckItem.prototype, "type", void 0);
|
|
59
|
+
NewInventoryCheckItem = __decorate([
|
|
60
|
+
(0, type_graphql_1.InputType)()
|
|
61
|
+
], NewInventoryCheckItem);
|
|
62
|
+
exports.NewInventoryCheckItem = NewInventoryCheckItem;
|
|
63
|
+
let InventoryCheckItemPatch = class InventoryCheckItemPatch {
|
|
64
|
+
};
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], InventoryCheckItemPatch.prototype, "id", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
71
|
+
__metadata("design:type", String)
|
|
72
|
+
], InventoryCheckItemPatch.prototype, "name", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true }),
|
|
75
|
+
__metadata("design:type", typeof (_d = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _d : Object)
|
|
76
|
+
], InventoryCheckItemPatch.prototype, "inventory", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
79
|
+
__metadata("design:type", String)
|
|
80
|
+
], InventoryCheckItemPatch.prototype, "batchId", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
83
|
+
__metadata("design:type", String)
|
|
84
|
+
], InventoryCheckItemPatch.prototype, "batchIdRef", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
|
87
|
+
__metadata("design:type", Number)
|
|
88
|
+
], InventoryCheckItemPatch.prototype, "inspectedQty", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true }),
|
|
91
|
+
__metadata("design:type", Number)
|
|
92
|
+
], InventoryCheckItemPatch.prototype, "inspectedUomValue", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true }),
|
|
95
|
+
__metadata("design:type", typeof (_e = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _e : Object)
|
|
96
|
+
], InventoryCheckItemPatch.prototype, "inspectedLocation", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
99
|
+
__metadata("design:type", String)
|
|
100
|
+
], InventoryCheckItemPatch.prototype, "inspectedBatchNo", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
(0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true }),
|
|
103
|
+
__metadata("design:type", typeof (_f = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _f : Object)
|
|
104
|
+
], InventoryCheckItemPatch.prototype, "product", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
107
|
+
__metadata("design:type", String)
|
|
108
|
+
], InventoryCheckItemPatch.prototype, "productId", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
111
|
+
__metadata("design:type", String)
|
|
112
|
+
], InventoryCheckItemPatch.prototype, "productDetailId", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
115
|
+
__metadata("design:type", String)
|
|
116
|
+
], InventoryCheckItemPatch.prototype, "status", void 0);
|
|
117
|
+
InventoryCheckItemPatch = __decorate([
|
|
118
|
+
(0, type_graphql_1.InputType)()
|
|
119
|
+
], InventoryCheckItemPatch);
|
|
120
|
+
exports.InventoryCheckItemPatch = InventoryCheckItemPatch;
|
|
121
|
+
//# sourceMappingURL=inventory-check-item-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inventory-check-item-types.js","sourceRoot":"","sources":["../../../server/service/inventory-check-item/inventory-check-item-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAuE;AACvE,+DAAyD;AACzD,mEAA+D;AAC/D,iDAAiD;AACjD,iEAA2D;AAGpD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;CAMlC,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,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,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.InventoryCheckItem = void 0;
|
|
14
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
15
|
+
const biz_base_1 = require("@things-factory/biz-base");
|
|
16
|
+
const shell_1 = require("@things-factory/shell");
|
|
17
|
+
const type_graphql_1 = require("type-graphql");
|
|
18
|
+
const warehouse_base_1 = require("@things-factory/warehouse-base");
|
|
19
|
+
const product_base_1 = require("@things-factory/product-base");
|
|
20
|
+
const typeorm_1 = require("typeorm");
|
|
21
|
+
const __1 = require("..");
|
|
22
|
+
let InventoryCheckItem = class InventoryCheckItem {
|
|
23
|
+
};
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
26
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], InventoryCheckItem.prototype, "id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
31
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true }),
|
|
32
|
+
__metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
|
|
33
|
+
], InventoryCheckItem.prototype, "domain", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.RelationId)((inventoryCheckItem) => inventoryCheckItem.domain),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], InventoryCheckItem.prototype, "domainId", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.ManyToOne)(type => biz_base_1.Bizplace),
|
|
40
|
+
(0, type_graphql_1.Field)(type => biz_base_1.Bizplace, { nullable: true }),
|
|
41
|
+
__metadata("design:type", typeof (_b = typeof biz_base_1.Bizplace !== "undefined" && biz_base_1.Bizplace) === "function" ? _b : Object)
|
|
42
|
+
], InventoryCheckItem.prototype, "bizplace", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.RelationId)((inventoryCheckItem) => inventoryCheckItem.bizplace),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], InventoryCheckItem.prototype, "bizplaceId", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)(),
|
|
49
|
+
(0, type_graphql_1.Field)(),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], InventoryCheckItem.prototype, "name", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
54
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
55
|
+
__metadata("design:type", Number)
|
|
56
|
+
], InventoryCheckItem.prototype, "countNo", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
59
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
60
|
+
__metadata("design:type", Number)
|
|
61
|
+
], InventoryCheckItem.prototype, "originQty", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
64
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
65
|
+
__metadata("design:type", Number)
|
|
66
|
+
], InventoryCheckItem.prototype, "inspectedQty", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, typeorm_1.Column)({ nullable: true, type: 'float' }),
|
|
69
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
70
|
+
__metadata("design:type", Number)
|
|
71
|
+
], InventoryCheckItem.prototype, "originUomValue", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.Column)({ nullable: true, type: 'float' }),
|
|
74
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
75
|
+
__metadata("design:type", Number)
|
|
76
|
+
], InventoryCheckItem.prototype, "inspectedUomValue", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
79
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
80
|
+
__metadata("design:type", String)
|
|
81
|
+
], InventoryCheckItem.prototype, "originBatchNo", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
84
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
85
|
+
__metadata("design:type", String)
|
|
86
|
+
], InventoryCheckItem.prototype, "inspectedBatchNo", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, typeorm_1.ManyToOne)(type => warehouse_base_1.Location, { nullable: true }),
|
|
89
|
+
(0, type_graphql_1.Field)(type => warehouse_base_1.Location, { nullable: true }),
|
|
90
|
+
__metadata("design:type", typeof (_c = typeof warehouse_base_1.Location !== "undefined" && warehouse_base_1.Location) === "function" ? _c : Object)
|
|
91
|
+
], InventoryCheckItem.prototype, "originLocation", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, typeorm_1.RelationId)((inventoryCheckItem) => inventoryCheckItem.originLocation),
|
|
94
|
+
__metadata("design:type", String)
|
|
95
|
+
], InventoryCheckItem.prototype, "originLocationId", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, typeorm_1.ManyToOne)(type => warehouse_base_1.Location, { nullable: true }),
|
|
98
|
+
(0, type_graphql_1.Field)(type => warehouse_base_1.Location, { nullable: true }),
|
|
99
|
+
__metadata("design:type", typeof (_d = typeof warehouse_base_1.Location !== "undefined" && warehouse_base_1.Location) === "function" ? _d : Object)
|
|
100
|
+
], InventoryCheckItem.prototype, "inspectedLocation", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
(0, typeorm_1.RelationId)((inventoryCheckItem) => inventoryCheckItem.inspectedLocation),
|
|
103
|
+
__metadata("design:type", String)
|
|
104
|
+
], InventoryCheckItem.prototype, "inspectedLocationId", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
(0, typeorm_1.Column)(),
|
|
107
|
+
(0, type_graphql_1.Field)(),
|
|
108
|
+
__metadata("design:type", String)
|
|
109
|
+
], InventoryCheckItem.prototype, "status", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, typeorm_1.ManyToOne)(type => __1.InventoryCheck),
|
|
112
|
+
(0, type_graphql_1.Field)(type => __1.InventoryCheck, { nullable: true }),
|
|
113
|
+
__metadata("design:type", __1.InventoryCheck)
|
|
114
|
+
], InventoryCheckItem.prototype, "inventoryCheck", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
(0, typeorm_1.RelationId)((inventoryCheckItem) => inventoryCheckItem.inventoryCheck),
|
|
117
|
+
__metadata("design:type", String)
|
|
118
|
+
], InventoryCheckItem.prototype, "inventoryCheckId", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
(0, typeorm_1.ManyToOne)(type => warehouse_base_1.Inventory, { nullable: true }),
|
|
121
|
+
(0, type_graphql_1.Field)(type => warehouse_base_1.Inventory, { nullable: true }),
|
|
122
|
+
__metadata("design:type", typeof (_e = typeof warehouse_base_1.Inventory !== "undefined" && warehouse_base_1.Inventory) === "function" ? _e : Object)
|
|
123
|
+
], InventoryCheckItem.prototype, "inventory", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, typeorm_1.RelationId)((inventoryCheckItem) => inventoryCheckItem.inventory),
|
|
126
|
+
__metadata("design:type", String)
|
|
127
|
+
], InventoryCheckItem.prototype, "inventoryId", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
(0, typeorm_1.ManyToOne)(type => product_base_1.Product, { nullable: true }),
|
|
130
|
+
(0, type_graphql_1.Field)(type => product_base_1.Product, { nullable: true }),
|
|
131
|
+
__metadata("design:type", typeof (_f = typeof product_base_1.Product !== "undefined" && product_base_1.Product) === "function" ? _f : Object)
|
|
132
|
+
], InventoryCheckItem.prototype, "product", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
(0, typeorm_1.RelationId)((inventoryCheckItem) => inventoryCheckItem.product),
|
|
135
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
136
|
+
__metadata("design:type", String)
|
|
137
|
+
], InventoryCheckItem.prototype, "productId", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
(0, typeorm_1.ManyToOne)(type => product_base_1.ProductDetail, { nullable: true }),
|
|
140
|
+
(0, type_graphql_1.Field)(type => product_base_1.ProductDetail, { nullable: true }),
|
|
141
|
+
__metadata("design:type", typeof (_g = typeof product_base_1.ProductDetail !== "undefined" && product_base_1.ProductDetail) === "function" ? _g : Object)
|
|
142
|
+
], InventoryCheckItem.prototype, "productDetail", void 0);
|
|
143
|
+
__decorate([
|
|
144
|
+
(0, typeorm_1.RelationId)((inventoryCheckItem) => inventoryCheckItem.productDetail),
|
|
145
|
+
__metadata("design:type", String)
|
|
146
|
+
], InventoryCheckItem.prototype, "productDetailId", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
149
|
+
(0, type_graphql_1.Field)(),
|
|
150
|
+
__metadata("design:type", Date)
|
|
151
|
+
], InventoryCheckItem.prototype, "createdAt", void 0);
|
|
152
|
+
__decorate([
|
|
153
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
154
|
+
(0, type_graphql_1.Field)(),
|
|
155
|
+
__metadata("design:type", Date)
|
|
156
|
+
], InventoryCheckItem.prototype, "updatedAt", void 0);
|
|
157
|
+
__decorate([
|
|
158
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User),
|
|
159
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
160
|
+
__metadata("design:type", typeof (_h = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _h : Object)
|
|
161
|
+
], InventoryCheckItem.prototype, "creator", void 0);
|
|
162
|
+
__decorate([
|
|
163
|
+
(0, typeorm_1.RelationId)((inventoryCheckItem) => inventoryCheckItem.creator),
|
|
164
|
+
__metadata("design:type", String)
|
|
165
|
+
], InventoryCheckItem.prototype, "creatorId", void 0);
|
|
166
|
+
__decorate([
|
|
167
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User),
|
|
168
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
169
|
+
__metadata("design:type", typeof (_j = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _j : Object)
|
|
170
|
+
], InventoryCheckItem.prototype, "updater", void 0);
|
|
171
|
+
__decorate([
|
|
172
|
+
(0, typeorm_1.RelationId)((inventoryCheckItem) => inventoryCheckItem.updater),
|
|
173
|
+
__metadata("design:type", String)
|
|
174
|
+
], InventoryCheckItem.prototype, "updaterId", void 0);
|
|
175
|
+
InventoryCheckItem = __decorate([
|
|
176
|
+
(0, typeorm_1.Entity)(),
|
|
177
|
+
(0, typeorm_1.Index)('ix_inventory-check-item_0', (inventoryCheckItem) => [inventoryCheckItem.domain, inventoryCheckItem.name], {
|
|
178
|
+
unique: true
|
|
179
|
+
}),
|
|
180
|
+
(0, typeorm_1.Index)('ix_inventory-check-item_1', (inventoryCheckItem) => [
|
|
181
|
+
inventoryCheckItem.bizplace,
|
|
182
|
+
inventoryCheckItem.inventoryCheck,
|
|
183
|
+
inventoryCheckItem.inventory,
|
|
184
|
+
inventoryCheckItem.countNo
|
|
185
|
+
], {
|
|
186
|
+
unique: true
|
|
187
|
+
}),
|
|
188
|
+
(0, type_graphql_1.ObjectType)({ description: 'Entity for InventoryCheckItem' })
|
|
189
|
+
], InventoryCheckItem);
|
|
190
|
+
exports.InventoryCheckItem = InventoryCheckItem;
|
|
191
|
+
//# sourceMappingURL=inventory-check-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inventory-check-item.js","sourceRoot":"","sources":["../../../server/service/inventory-check-item/inventory-check-item.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yDAAgD;AAChD,uDAAmD;AACnD,iDAA8C;AAC9C,+CAAoD;AACpD,mEAAoE;AACpE,+DAAqE;AACrE,qCASgB;AAChB,0BAAmC;AAuB5B,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAuH9B,CAAA;AAtHC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;8CACC;AAEnB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDAClC,cAAM,oBAAN,cAAM;kDAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,kBAAsC,EAAE,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC;;oDAClE;AAEhB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,mBAAQ,CAAC;IAC3B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,mBAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI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,EAAE,IAAI,EAAE,CAAC;kDAC/B,gBAAI,oBAAJ,gBAAI;mDAAA;AAEb;IAAC,IAAA,oBAAU,EAAC,CAAC,kBAAsC,EAAE,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC;;qDAClE;AAEjB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACvB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDAC/B,gBAAI,oBAAJ,gBAAI;mDAAA;AAEb;IAAC,IAAA,oBAAU,EAAC,CAAC,kBAAsC,EAAE,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC;;qDAClE;AAtHN,kBAAkB;IArB9B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,2BAA2B,EAC3B,CAAC,kBAAsC,EAAE,EAAE,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,CAAC,IAAI,CAAC,EAChG;QACE,MAAM,EAAE,IAAI;KACb,CACF;IACA,IAAA,eAAK,EACJ,2BAA2B,EAC3B,CAAC,kBAAsC,EAAE,EAAE,CAAC;QAC1C,kBAAkB,CAAC,QAAQ;QAC3B,kBAAkB,CAAC,cAAc;QACjC,kBAAkB,CAAC,SAAS;QAC5B,kBAAkB,CAAC,OAAO;KAC3B,EACD;QACE,MAAM,EAAE,IAAI;KACb,CACF;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;GAChD,kBAAkB,CAuH9B;AAvHY,gDAAkB"}
|
|
@@ -106,6 +106,14 @@ __decorate([
|
|
|
106
106
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
107
107
|
__metadata("design:type", String)
|
|
108
108
|
], InventoryProductGroup.prototype, "remainUomValueWithUom", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true }),
|
|
111
|
+
__metadata("design:type", Number)
|
|
112
|
+
], InventoryProductGroup.prototype, "lockedQty", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true }),
|
|
115
|
+
__metadata("design:type", Number)
|
|
116
|
+
], InventoryProductGroup.prototype, "unassignedQty", void 0);
|
|
109
117
|
__decorate([
|
|
110
118
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
111
119
|
__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"other-types.js","sourceRoot":"","sources":["../../../server/service/others/other-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAA4D;AAC5D,+DAAqE;AACrE,iDAAkD;AAG3C,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;CAMrC,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,qBAAqB,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDAC7B;AAE9B;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDAC1B;AALF,yBAAyB;IADrC,IAAA,yBAAU,GAAE;GACA,yBAAyB,CAMrC;AANY,8DAAyB;AAS/B,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;
|
|
1
|
+
{"version":3,"file":"other-types.js","sourceRoot":"","sources":["../../../server/service/others/other-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAA4D;AAC5D,+DAAqE;AACrE,iDAAkD;AAG3C,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;CAMrC,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,qBAAqB,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDAC7B;AAE9B;IAAC,IAA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AA;AArGjB,qBAAqB;IADjC,IAAA,yBAAU,GAAE;GACA,qBAAqB,CAsGjC;AAtGY,sDAAqB"}
|
|
@@ -217,110 +217,89 @@ exports.InventoryUtil = {
|
|
|
217
217
|
let queryStrings = `
|
|
218
218
|
CREATE TEMP TABLE temp_inventory_product_group AS (
|
|
219
219
|
SELECT * FROM (
|
|
220
|
-
WITH oi as (
|
|
221
220
|
SELECT
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
AND oi.batch_id NOTNULL
|
|
240
|
-
AND oi.product_id NOTNULL
|
|
241
|
-
AND oi.packing_type NOTNULL
|
|
242
|
-
AND oi.packing_size NOTNULL
|
|
243
|
-
AND oi.inventory_id IS NULL
|
|
244
|
-
GROUP BY
|
|
245
|
-
oi.batch_id,
|
|
246
|
-
oi.batch_id_ref,
|
|
247
|
-
oi.product_id,
|
|
248
|
-
oi.packing_type,
|
|
249
|
-
oi.packing_size,
|
|
250
|
-
oi.uom,
|
|
251
|
-
p.name
|
|
252
|
-
)
|
|
253
|
-
SELECT
|
|
254
|
-
i.batch_id AS "batchId",
|
|
255
|
-
i.batch_id_ref AS "batchIdRef",
|
|
256
|
-
i.packing_type AS "packingType",
|
|
257
|
-
i.packing_size AS "packingSize",
|
|
258
|
-
i.uom AS "uom",
|
|
259
|
-
concat(p.name, ' (', p.description, ')') AS "productName",
|
|
260
|
-
coalesce(p.sku, '') AS "productSKU",
|
|
261
|
-
coalesce(p.brand, '') AS "productBrand",
|
|
262
|
-
p.id AS "productId",
|
|
263
|
-
i.product_detail_id AS "productDetailId",
|
|
264
|
-
SUM(COALESCE(i.qty, 0)) - GREATEST(SUM(COALESCE(i.locked_qty, 0)), 0) - MAX(COALESCE(oi.release_qty, 0)) - MAX(COALESCE(bp.bundle_product_release_qty, 0)) - GREATEST(SUM(COALESCE(pds.unassigned_qty, 0)), 0) AS "remainQty",
|
|
265
|
-
(
|
|
266
|
-
CASE WHEN (SUM(COALESCE(i.uom_value, 0)) - GREATEST(SUM(COALESCE(i.locked_uom_value, 0)), 0) - MAX(COALESCE(oi.release_uom_value, 0)) - MAX(COALESCE(bp.bundle_product_release_uom_value, 0)) - GREATEST(SUM(COALESCE(pds.unassigned_uom_value, 0)), 0)) < 0 THEN 0
|
|
267
|
-
ELSE SUM(COALESCE(i.uom_value, 0)) - GREATEST(SUM(COALESCE(i.locked_uom_value, 0)), 0) - MAX(COALESCE(oi.release_uom_value, 0)) - MAX(COALESCE(bp.bundle_product_release_uom_value, 0)) - GREATEST(SUM(COALESCE(pds.unassigned_uom_value, 0)), 0) END
|
|
268
|
-
) AS "remainUomValue",
|
|
269
|
-
(
|
|
270
|
-
CASE WHEN (SUM(COALESCE(i.uom_value, 0)) - GREATEST(SUM(COALESCE(i.locked_uom_value, 0)), 0) - MAX(COALESCE(oi.release_uom_value, 0)) - MAX(COALESCE(bp.bundle_product_release_uom_value, 0)) - GREATEST(SUM(COALESCE(pds.unassigned_uom_value, 0)), 0)) < 0 THEN concat(0, ' ', i.uom)
|
|
271
|
-
ELSE concat(SUM(COALESCE(i.uom_value, 0)) - GREATEST(SUM(COALESCE(i.locked_uom_value, 0)), 0) - MAX(COALESCE(oi.release_uom_value, 0)) - MAX(COALESCE(bp.bundle_product_release_uom_value, 0)) - GREATEST(SUM(COALESCE(pds.unassigned_uom_value, 0)), 0), ' ', i.uom) END
|
|
272
|
-
) AS "remainUomValueWithUom",
|
|
273
|
-
'SINGLE' AS "groupType"
|
|
274
|
-
FROM
|
|
275
|
-
inventories i
|
|
221
|
+
i.batch_id AS "batchId",
|
|
222
|
+
i.batch_id_ref AS "batchIdRef",
|
|
223
|
+
i.packing_type AS "packingType",
|
|
224
|
+
i.packing_size AS "packingSize",
|
|
225
|
+
i.uom AS "uom",
|
|
226
|
+
CONCAT(p.name, ' (', p.description, ')') AS "productName",
|
|
227
|
+
COALESCE(p.sku, '') AS "productSKU",
|
|
228
|
+
COALESCE(p.brand, '') AS "productBrand",
|
|
229
|
+
p.id AS "productId",
|
|
230
|
+
i.product_detail_id AS "productDetailId",
|
|
231
|
+
SUM(COALESCE(i.qty, 0)) - SUM(COALESCE(i.locked_qty, 0)) - MAX(COALESCE(bp.bundle_product_release_qty, 0)) - SUM(COALESCE(pds.unassigned_qty, 0)) AS "remainQty",
|
|
232
|
+
SUM(COALESCE(i.uom_value, 0)) - SUM(COALESCE(i.locked_uom_value, 0)) - MAX(COALESCE(bp.bundle_product_release_uom_value, 0)) - SUM(COALESCE(pds.unassigned_uom_value, 0)) AS "remainUomValue",
|
|
233
|
+
SUM(COALESCE(i.locked_qty, 0)) AS "lockedQty",
|
|
234
|
+
CONCAT(SUM(COALESCE(i.uom_value, 0)) - SUM(COALESCE(i.locked_uom_value, 0)) - MAX(COALESCE(bp.bundle_product_release_uom_value, 0)) - SUM(COALESCE(pds.unassigned_uom_value, 0)), ' ', i.uom) AS "remainUomValueWithUom",
|
|
235
|
+
'SINGLE' AS "groupType",
|
|
236
|
+
SUM(COALESCE(pds.unassigned_qty, 0)) AS "unassignedQty"
|
|
237
|
+
FROM inventories i
|
|
276
238
|
LEFT JOIN products p ON i.product_id = p.id
|
|
277
239
|
LEFT JOIN product_detail_stocks pds ON pds.product_detail_id = i.product_detail_id
|
|
278
|
-
LEFT JOIN oi ON i.batch_id = oi.batch_id AND p.name = oi.product_name AND i.packing_type = oi.packing_type AND i.packing_size = oi.packing_size AND i.uom = oi.uom
|
|
279
|
-
LEFT JOIN locations l2 ON i.location_id = l2.id AND i.domain_id = l2.domain_id
|
|
280
240
|
LEFT JOIN (
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
241
|
+
SELECT
|
|
242
|
+
pbs.product_id,
|
|
243
|
+
SUM(pbs.bundle_qty * src.release_qty) AS bundle_product_release_qty,
|
|
244
|
+
SUM(pbs.bundle_qty * src.release_uom_value) AS bundle_product_release_uom_value
|
|
245
|
+
FROM product_bundle_settings pbs
|
|
246
|
+
INNER JOIN json_populate_recordset(NULL::order_inventories,'${batchBundle}') src ON src.product_id = pbs.product_bundle_id
|
|
247
|
+
GROUP BY pbs.product_id
|
|
248
|
+
) bp ON i.product_id = bp.product_id
|
|
249
|
+
LEFT JOIN locations l2 ON i.location_id = l2.id AND i.domain_id = l2.domain_id
|
|
250
|
+
WHERE i.domain_id = $1
|
|
251
|
+
AND l2.type NOT IN ('${warehouse_base_1.LOCATION_TYPE.QUARANTINE}', '${warehouse_base_1.LOCATION_TYPE.RESERVE}', '${warehouse_base_1.LOCATION_TYPE.DAMAGE}')
|
|
252
|
+
AND i.obsolete = false
|
|
253
|
+
AND i.transfer_qty <= 0
|
|
254
|
+
AND i.transfer_uom_value <= 0
|
|
255
|
+
AND CASE WHEN i.expiration_date IS NOT NULL AND p.min_outbound_shelf_life IS NOT NULL THEN CURRENT_DATE < i.expiration_date - p.min_outbound_shelf_life ELSE true END
|
|
256
|
+
${productWhereClause}
|
|
257
|
+
GROUP BY
|
|
258
|
+
i.product_detail_id,
|
|
259
|
+
i.batch_id,
|
|
260
|
+
i.batch_id_ref,
|
|
261
|
+
p.id,
|
|
262
|
+
i.packing_type,
|
|
263
|
+
i.packing_size,
|
|
264
|
+
i.uom
|
|
265
|
+
UNION
|
|
266
|
+
SELECT
|
|
267
|
+
'BUNDLE' AS "batchId",
|
|
268
|
+
NULL AS "batchIdRef",
|
|
269
|
+
pb.packing_type,
|
|
270
|
+
pb.packing_size,
|
|
271
|
+
'UNIT' AS "uom",
|
|
272
|
+
pb.name AS "productName",
|
|
273
|
+
pb.sku AS "productSKU",
|
|
274
|
+
'brand' AS "productBrand",
|
|
275
|
+
id AS "productId",
|
|
276
|
+
pbs.product_detail_id AS "productDetailId",
|
|
277
|
+
MIN(FLOOR(pbs."availableQty")) AS "remainQty",
|
|
278
|
+
MIN(FLOOR(pbs."availableUomValue")) AS "remainUomValue",
|
|
279
|
+
MIN(FLOOR(pbs."releaseQty")) AS "lockedQty",
|
|
280
|
+
CONCAT(MIN(FLOOR(pbs."availableUomValue")), ' UNIT') AS "remainUomValueWithUom",
|
|
281
|
+
'BUNDLE' AS "groupType",
|
|
282
|
+
0 AS "unassignedQty"
|
|
283
|
+
FROM product_bundles pb
|
|
284
|
+
INNER JOIN (
|
|
285
|
+
SELECT
|
|
286
|
+
pbs.product_id,
|
|
287
|
+
pbs.product_bundle_id,
|
|
288
|
+
MIN(pbs.bundle_qty),
|
|
289
|
+
(SUM(COALESCE(i2.qty, 0)) - GREATEST(SUM(COALESCE(i2.locked_qty, 0)), 0)) / MIN(pbs.bundle_qty) AS "availableQty",
|
|
290
|
+
(SUM(COALESCE(i2.uom_value, 0)) - GREATEST(SUM(COALESCE(i2.locked_uom_value, 0)), 0)) / MIN(pbs.bundle_qty) AS "availableUomValue",
|
|
291
|
+
(SUM(COALESCE(i2.locked_qty, 0))) / min(pbs.bundle_qty) AS "releaseQty",
|
|
292
|
+
pbs.product_detail_id
|
|
293
|
+
FROM product_bundle_settings pbs
|
|
294
|
+
LEFT JOIN inventories i2 ON i2.product_id = pbs.product_id
|
|
295
|
+
AND i2.domain_id = $1
|
|
296
|
+
AND i2.bizplace_id IN (${bizplaceIds})
|
|
297
|
+
AND i2.status = 'STORED'
|
|
298
|
+
GROUP BY pbs.product_id, pbs.product_bundle_id, pbs.product_detail_id
|
|
299
|
+
) pbs ON pbs.product_bundle_id = pb.id
|
|
300
|
+
${bundleWhereClause}
|
|
301
|
+
GROUP BY pb.packing_type, pb.packing_size, pb.name, pb.sku, pb.id, pbs.product_detail_id
|
|
302
|
+
) AS inv_prod_grp
|
|
324
303
|
${whereClause}
|
|
325
304
|
)
|
|
326
305
|
`;
|
|
@@ -674,7 +653,11 @@ async function getConditions(bizplaces, filters, trxMgr, hasRemainingQty = true)
|
|
|
674
653
|
let bundleWhereClause = `
|
|
675
654
|
WHERE pb.status = 'ACTIVATED'
|
|
676
655
|
`;
|
|
677
|
-
|
|
656
|
+
// Find the showAllInventory filter
|
|
657
|
+
const showAllInventoryFilter = filters.find(filter => filter.name === 'showAllInventory');
|
|
658
|
+
const showAllInventory = showAllInventoryFilter ? showAllInventoryFilter.value : false;
|
|
659
|
+
// Set the whereClause based on the showAllInventory value
|
|
660
|
+
let whereClause = showAllInventory ? ` WHERE 1 = 1 ` : hasRemainingQty ? ` WHERE "remainQty" > 0 ` : ` WHERE 1 = 1 `;
|
|
678
661
|
let productDetailWhereClause = ``;
|
|
679
662
|
let batchBundle;
|
|
680
663
|
if (filters === null || filters === void 0 ? void 0 : filters.length) {
|