@things-factory/operato-wms 3.7.2 → 3.7.7
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/client/pages/components/select-product-popup.js +5 -1
- package/client/pages/constants/order.js +10 -0
- package/client/pages/inbound/putaway-product.js +162 -139
- package/client/pages/inventory-check/inspecting-product.js +146 -80
- package/client/pages/manifest/create-loading-manifest.js +314 -0
- package/client/pages/manifest/dispatcher-verification-popup.js +86 -0
- package/client/pages/manifest/loading-manifest-detail.js +345 -0
- package/client/pages/manifest/loading-manifest-list.js +305 -0
- package/client/pages/order/arrival-notice/create-arrival-notice.js +8 -1
- package/client/pages/order/goods-received-note/received-note-list.js +138 -6
- package/client/pages/order/release-order/b2b/b2b-order-list.js +45 -5
- package/client/pages/order/release-order/b2b/b2b-order-requests.js +45 -5
- package/client/pages/order/release-order/b2c/b2c-order-requests.js +181 -21
- package/client/pages/order/release-order/bulk-print-packing-list.js +23 -0
- package/client/pages/order/release-order/create-release-order.js +25 -4
- package/client/pages/order/release-order/receive-release-order-request.js +27 -24
- package/client/pages/order/release-order/release-extra-product-popup.js +189 -56
- package/client/pages/order/release-order/release-order-detail.js +292 -71
- package/client/pages/order/reverse-kitting-order/reverse-kitting-order-detail.js +115 -50
- package/client/pages/order/reverse-kitting-order/reverse-kitting-order-list.js +1 -6
- package/client/pages/order/reverse-kitting-order/reverse-kitting-pallet-label-popup.js +239 -0
- package/client/pages/order/transport-order/delivery-order-list.js +99 -59
- package/client/pages/outbound/loading-product.js +4 -1
- package/client/pages/outbound/merged-outbound-worksheet.js +39 -1
- package/client/pages/outbound/packing-product.js +4 -1
- package/client/pages/outbound/packing-worksheet-list.js +39 -1
- package/client/pages/outbound/picking-product.js +622 -290
- package/client/pages/outbound/serial-number-popup.js +280 -0
- package/client/pages/outbound/worksheet-picking.js +28 -2
- package/client/pages/report/product-label-report.js +401 -0
- package/client/pages/support/inventory-comparison.js +296 -0
- package/client/pages/vas/print-product-label.js +298 -132
- package/client/pages/vas/reverse-kitting/execute-reverse-kitting.js +30 -12
- package/client/pages/vas/reverse-kitting/popup-combination-sets.js +75 -5
- package/client/pages/vas/reverse-kitting/popup-reverse-kitting-template.js +113 -18
- package/client/route.js +23 -0
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js +64 -54
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js.map +1 -1
- package/dist-server/graphql/resolvers/extra/add-release-good-products.js +34 -9
- package/dist-server/graphql/resolvers/extra/add-release-good-products.js.map +1 -1
- package/dist-server/graphql/resolvers/index.js +3 -1
- package/dist-server/graphql/resolvers/index.js.map +1 -1
- package/dist-server/graphql/resolvers/inventory-comparison/index.js +6 -0
- package/dist-server/graphql/resolvers/inventory-comparison/index.js.map +1 -0
- package/dist-server/graphql/resolvers/inventory-comparison/inventory-comparison-list.js +78 -0
- package/dist-server/graphql/resolvers/inventory-comparison/inventory-comparison-list.js.map +1 -0
- package/dist-server/graphql/resolvers/reports/index.js +2 -1
- package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/product-label-report.js +56 -0
- package/dist-server/graphql/resolvers/reports/product-label-report.js.map +1 -0
- package/dist-server/graphql/types/index.js +5 -2
- package/dist-server/graphql/types/index.js.map +1 -1
- package/dist-server/graphql/types/inventory-comparison/index.js +13 -0
- package/dist-server/graphql/types/inventory-comparison/index.js.map +1 -0
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison-list.js +14 -0
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison-list.js.map +1 -0
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison.js +18 -0
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison.js.map +1 -0
- package/dist-server/graphql/types/reports/index.js +6 -1
- package/dist-server/graphql/types/reports/index.js.map +1 -1
- package/dist-server/graphql/types/reports/product-label-report-list.js +14 -0
- package/dist-server/graphql/types/reports/product-label-report-list.js.map +1 -0
- package/dist-server/graphql/types/reports/product-label-report.js +16 -0
- package/dist-server/graphql/types/reports/product-label-report.js.map +1 -0
- package/package.json +65 -65
- package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.ts +75 -65
- package/server/graphql/resolvers/extra/add-release-good-products.ts +57 -15
- package/server/graphql/resolvers/index.ts +3 -1
- package/server/graphql/resolvers/inventory-comparison/index.ts +5 -0
- package/server/graphql/resolvers/inventory-comparison/inventory-comparison-list.ts +99 -0
- package/server/graphql/resolvers/reports/index.ts +3 -1
- package/server/graphql/resolvers/reports/product-label-report.ts +56 -0
- package/server/graphql/types/index.ts +5 -2
- package/server/graphql/types/inventory-comparison/index.ts +11 -0
- package/server/graphql/types/inventory-comparison/inventory-comparison-list.ts +8 -0
- package/server/graphql/types/inventory-comparison/inventory-comparison.ts +12 -0
- package/server/graphql/types/reports/index.ts +6 -1
- package/server/graphql/types/reports/product-label-report-list.ts +8 -0
- package/server/graphql/types/reports/product-label-report.ts +10 -0
- package/things-factory.config.js +24 -0
- package/translations/en.json +64 -12
- package/translations/ko.json +50 -1
- package/translations/ms.json +51 -1
- package/translations/zh.json +50 -1
|
@@ -40,11 +40,6 @@ exports.addReleaseGoodProducts = {
|
|
|
40
40
|
transactionType: warehouse_base_1.INVENTORY_TRANSACTION_TYPE.PICKING
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
-
if (foundPickingHistory) {
|
|
44
|
-
let pickedQty = Number(foundPickingHistory.qty.toString().replace('-', ''));
|
|
45
|
-
if (curOrderInv.releaseQty < pickedQty)
|
|
46
|
-
throw new Error(`${foundPickingHistory.palletId} has picked ${pickedQty}`);
|
|
47
|
-
}
|
|
48
43
|
existingOrderInv = await tx.getRepository(sales_base_1.OrderInventory).findOne({
|
|
49
44
|
where: {
|
|
50
45
|
releaseGood,
|
|
@@ -54,13 +49,22 @@ exports.addReleaseGoodProducts = {
|
|
|
54
49
|
inventory: foundInv
|
|
55
50
|
}
|
|
56
51
|
});
|
|
52
|
+
if (foundInv && foundInv.lockedQty == 0) {
|
|
53
|
+
foundInv.qty += Number(existingOrderInv.releaseQty);
|
|
54
|
+
foundInv.uomValue += Number(existingOrderInv.releaseUomValue);
|
|
55
|
+
foundInv.lockedQty = Number(existingOrderInv.releaseQty);
|
|
56
|
+
foundInv.lockedUomValue = Number(existingOrderInv.releaseUomValue);
|
|
57
|
+
}
|
|
58
|
+
if (curOrderInv.releaseQty < existingOrderInv.pickedQty) {
|
|
59
|
+
throw new Error(`${curOrderInv.inventory.palletId} has already picked ${existingOrderInv.pickedQty}`);
|
|
60
|
+
}
|
|
57
61
|
if (curOrderInv.releaseQty === 0) {
|
|
58
62
|
foundInv.lockedQty = Number(foundInv.lockedQty) - Number(existingOrderInv.releaseQty);
|
|
59
63
|
foundInv.lockedUomValue = Number(foundInv.lockedUomValue) - Number(existingOrderInv.releaseUomValue);
|
|
60
64
|
await tx.getRepository(warehouse_base_1.Inventory).save(foundInv);
|
|
61
65
|
if (existingOrderInv) {
|
|
62
66
|
// if found existing OrderInventory and worksheetDetail then qty, uomValue, and status are updated
|
|
63
|
-
curOrderInv = Object.assign(Object.assign({}, existingOrderInv), { releaseQty: curOrderInv.releaseQty, lockedUomValue: curOrderInv.lockedUomValue, status: sales_base_1.ORDER_INVENTORY_STATUS.CANCELLED });
|
|
67
|
+
curOrderInv = Object.assign(Object.assign({}, existingOrderInv), { releaseQty: curOrderInv.releaseQty, releaseUomValue: curOrderInv.releaseUomValue, lockedUomValue: curOrderInv.lockedUomValue, status: sales_base_1.ORDER_INVENTORY_STATUS.CANCELLED });
|
|
64
68
|
let existingWorksheetDetail = await tx.getRepository(worksheet_base_1.WorksheetDetail).findOne({
|
|
65
69
|
where: {
|
|
66
70
|
worksheet: pickingWorksheet,
|
|
@@ -73,14 +77,28 @@ exports.addReleaseGoodProducts = {
|
|
|
73
77
|
await tx.getRepository(sales_base_1.OrderInventory).save(curOrderInv);
|
|
74
78
|
}
|
|
75
79
|
}
|
|
80
|
+
else if (curOrderInv.releaseQty == existingOrderInv.pickedQty) {
|
|
81
|
+
curOrderInv = Object.assign(Object.assign({}, existingOrderInv), { releaseQty: curOrderInv.releaseQty, releaseUomValue: curOrderInv.releaseUomValue, lockedUomValue: curOrderInv.lockedUomValue, status: sales_base_1.ORDER_INVENTORY_STATUS.PICKED });
|
|
82
|
+
let existingWorksheetDetail = await tx.getRepository(worksheet_base_1.WorksheetDetail).findOne({
|
|
83
|
+
where: {
|
|
84
|
+
targetInventory: curOrderInv
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
existingWorksheetDetail = Object.assign(Object.assign({}, existingWorksheetDetail), { status: worksheet_base_1.WORKSHEET_STATUS.PICKED });
|
|
88
|
+
await tx.getRepository(worksheet_base_1.WorksheetDetail).save(existingWorksheetDetail);
|
|
89
|
+
await tx.getRepository(sales_base_1.OrderInventory).save(curOrderInv);
|
|
90
|
+
}
|
|
76
91
|
else {
|
|
77
|
-
foundInv.lockedQty = Number(curOrderInv.releaseQty);
|
|
78
|
-
foundInv.lockedUomValue = Number(curOrderInv.releaseUomValue);
|
|
79
92
|
foundInv.updater = user;
|
|
93
|
+
foundInv.lockedQty =
|
|
94
|
+
foundInv.lockedQty - Number(existingOrderInv.releaseQty) + Number(curOrderInv.releaseQty);
|
|
95
|
+
foundInv.lockedUomValue =
|
|
96
|
+
foundInv.lockedUomValue - Number(existingOrderInv.releaseUomValue) + Number(curOrderInv.releaseUomValue);
|
|
80
97
|
await tx.getRepository(warehouse_base_1.Inventory).save(foundInv);
|
|
81
98
|
if (existingOrderInv) {
|
|
99
|
+
const orderInvStatus = sales_base_1.ORDER_INVENTORY_STATUS.PICKING;
|
|
82
100
|
// if found existing OrderInventory and worksheetDetail then qty, uomValue, and status are updated
|
|
83
|
-
curOrderInv = Object.assign(Object.assign({}, existingOrderInv), { releaseQty: curOrderInv.releaseQty, releaseUomValue: curOrderInv.releaseUomValue });
|
|
101
|
+
curOrderInv = Object.assign(Object.assign({}, existingOrderInv), { releaseQty: curOrderInv.releaseQty, releaseUomValue: curOrderInv.releaseUomValue, status: orderInvStatus });
|
|
84
102
|
let existingWorksheetDetail = await tx.getRepository(worksheet_base_1.WorksheetDetail).findOne({
|
|
85
103
|
where: {
|
|
86
104
|
worksheet: pickingWorksheet,
|
|
@@ -193,6 +211,13 @@ exports.addReleaseGoodProducts = {
|
|
|
193
211
|
savedOrderInv.domain = domain;
|
|
194
212
|
savedOrderInv.creator = user;
|
|
195
213
|
savedOrderInv.updater = user;
|
|
214
|
+
if (newOrderInv === null || newOrderInv === void 0 ? void 0 : newOrderInv.id) {
|
|
215
|
+
// newOrderInv will have id if it was updated from existingOrderInv
|
|
216
|
+
// this solution will remove ix_order-inventory_0 unique error
|
|
217
|
+
// ** please revise this resolver in future. looks like there's few
|
|
218
|
+
// things that can refactor
|
|
219
|
+
savedOrderInv.id = newOrderInv.id;
|
|
220
|
+
}
|
|
196
221
|
savedOrderInv = await tx.getRepository(sales_base_1.OrderInventory).save(savedOrderInv);
|
|
197
222
|
if (!existingOrderInv && pickingWorksheet) {
|
|
198
223
|
// if this is a new orderInventory and has existing worksheet then generate a new worksheet detail for it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-release-good-products.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/extra/add-release-good-products.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"add-release-good-products.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/extra/add-release-good-products.ts"],"names":[],"mappings":";;;AAIA,+DAAsD;AACtD,2DAAkH;AAElH,mEAAwG;AACxG,mEAMuC;AAE1B,QAAA,sBAAsB,GAAG;IACpC,KAAK,CAAC,sBAAsB,CAAC,CAAM,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,EAAE,OAAY;;QACrG,IAAI;YACF,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAsD,OAAO,CAAC,KAAK,CAAA;YAE7F,IAAI,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ACnE,8DAA8D;4BAC9D,mEAAmE;4BACnE,8BAA8B;4BAC9B,aAAa,CAAC,EAAE,GAAG,WAAW,CAAC,EAAE,CAAA;yBAClC;wBAED,aAAa,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,2BAAc,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;wBAE1E,IAAI,CAAC,gBAAgB,IAAI,gBAAgB,EAAE;4BACzC,yGAAyG;4BACzG,MAAM,IAAA,+CAA8B,EAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,aAAa,CAAC,CAAA;yBACxF;qBACF;iBACF;gBAED,MAAM,EAAE,CAAC,aAAa,CAAC,0BAAS,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;aACzD;YAED,IAAI,gBAAgB,EAAE;gBACpB,yIAAyI;gBACzI,gBAAgB,mCACX,gBAAgB,KACnB,MAAM,EAAE,iCAAgB,CAAC,WAAW,GACrC,CAAA;gBAED,MAAM,EAAE,CAAC,aAAa,CAAC,0BAAS,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;aACzD;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,KAAK,CAAA;SACZ;IACH,CAAC;CACF,CAAA"}
|
|
@@ -27,13 +27,15 @@ const Dashboard = __importStar(require("./dashboard"));
|
|
|
27
27
|
const Extra = __importStar(require("./extra"));
|
|
28
28
|
const OpaMenu = __importStar(require("./opa-menu"));
|
|
29
29
|
const Reports = __importStar(require("./reports"));
|
|
30
|
+
const InventoryComparison = __importStar(require("./inventory-comparison"));
|
|
30
31
|
exports.queries = [
|
|
31
32
|
BoardSetting.Query,
|
|
32
33
|
CustomElccl.Query,
|
|
33
34
|
CustomKimeda.Query,
|
|
34
35
|
Dashboard.Query,
|
|
35
36
|
OpaMenu.Query,
|
|
36
|
-
Reports.Query
|
|
37
|
+
Reports.Query,
|
|
38
|
+
InventoryComparison.Query
|
|
37
39
|
];
|
|
38
40
|
exports.mutations = [Extra.Mutation];
|
|
39
41
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/graphql/resolvers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,8DAA+C;AAC/C,4DAA6C;AAC7C,8DAA+C;AAC/C,uDAAwC;AACxC,+CAAgC;AAChC,oDAAqC;AACrC,mDAAoC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/graphql/resolvers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,8DAA+C;AAC/C,4DAA6C;AAC7C,8DAA+C;AAC/C,uDAAwC;AACxC,+CAAgC;AAChC,oDAAqC;AACrC,mDAAoC;AACpC,4EAA6D;AAEhD,QAAA,OAAO,GAAG;IACrB,YAAY,CAAC,KAAK;IAClB,WAAW,CAAC,KAAK;IACjB,YAAY,CAAC,KAAK;IAClB,SAAS,CAAC,KAAK;IACf,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,KAAK;IACb,mBAAmB,CAAC,KAAK;CAC1B,CAAA;AAEY,QAAA,SAAS,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Query = void 0;
|
|
4
|
+
const inventory_comparison_list_1 = require("./inventory-comparison-list");
|
|
5
|
+
exports.Query = Object.assign({}, inventory_comparison_list_1.inventoryComparisonList);
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/inventory-comparison/index.ts"],"names":[],"mappings":";;;AAAA,2EAAqE;AAExD,QAAA,KAAK,qBACb,mDAAuB,EAC3B"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.inventoryComparisonList = void 0;
|
|
4
|
+
const warehouse_base_1 = require("@things-factory/warehouse-base");
|
|
5
|
+
const elccl_inventory_history_summary_report_1 = require("../custom/elccl/elccl-inventory-history-summary-report");
|
|
6
|
+
exports.inventoryComparisonList = {
|
|
7
|
+
async inventoryComparisonList(_, params, context) {
|
|
8
|
+
try {
|
|
9
|
+
const { tx } = context.state;
|
|
10
|
+
let bizplaceFilter = params.filters.find(data => data.name === 'bizplace');
|
|
11
|
+
if (!bizplaceFilter) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
let toDateFilter = params.filters.find(data => data.name === 'toDate');
|
|
15
|
+
let toDateDate = new Date(toDateFilter.value);
|
|
16
|
+
let fromDate = toDateDate.setDate(toDateDate.getDate() - 1);
|
|
17
|
+
let fromDateISO = new Date(fromDate).toISOString();
|
|
18
|
+
let nonTallyFilter = params.filters.find(data => data.name === 'nonTally').value;
|
|
19
|
+
let productFilter = params.filters.find(data => data.name === 'product');
|
|
20
|
+
params.filters.push({
|
|
21
|
+
name: 'fromDate',
|
|
22
|
+
operator: 'eq',
|
|
23
|
+
value: fromDateISO
|
|
24
|
+
});
|
|
25
|
+
params.filters.push({ name: 'status', operator: 'notin', value: ['INTRANSIT', 'TERMINATED', 'DELETED'] }, { name: 'remainOnly', operator: 'eq', value: true }, { name: 'unlockOnly', operator: 'eq', value: true }, { name: 'created_at', operator: 'eq', value: toDateFilter.value }, { name: 'timezoneOffset', operator: 'eq', value: new Date().getTimezoneOffset() }, { name: 'expiration', operator: 'eq', value: false });
|
|
26
|
+
let productQueryFilter = ``;
|
|
27
|
+
if (productFilter) {
|
|
28
|
+
let products = productFilter.value
|
|
29
|
+
.toLowerCase()
|
|
30
|
+
.split(',')
|
|
31
|
+
.map(prod => {
|
|
32
|
+
return "'%" + prod.trim().replace(/'/g, "''") + "%'";
|
|
33
|
+
})
|
|
34
|
+
.join(',');
|
|
35
|
+
productQueryFilter =
|
|
36
|
+
productQueryFilter +
|
|
37
|
+
`
|
|
38
|
+
${nonTallyFilter ? 'and' : 'where'} (lower(summ.product_name) like any(array[${products}])
|
|
39
|
+
or lower(summ.product_sku) like any(array[${products}]))`;
|
|
40
|
+
}
|
|
41
|
+
await Promise.all([
|
|
42
|
+
(0, elccl_inventory_history_summary_report_1.inventoryHistorySummaryReportQuery)(_, params, context),
|
|
43
|
+
(0, warehouse_base_1.onhandInventories)(params.filters, params.pagination, params.sortings, [], context, false)
|
|
44
|
+
]);
|
|
45
|
+
await tx.query(`
|
|
46
|
+
create temp table tmp_inv_comp on commit drop as (
|
|
47
|
+
select summ."batch_id", summ.product_id, summ.product_name, summ.product_sku, summ.packing_type, summ.closing_qty, coalesce(oh.qty, 0) as "onhand_qty" from temp_inventory_summary summ
|
|
48
|
+
left join (
|
|
49
|
+
select "batch_id" as "batch_id", product_id, sum("qty") as qty from tmp_data group by "batch_id", product_id
|
|
50
|
+
) oh on oh.batch_id = summ.batch_id and oh.product_id = summ.product_id
|
|
51
|
+
${nonTallyFilter ? 'where coalesce(oh.qty, 0) <> summ.closing_qty' : ''}
|
|
52
|
+
${productQueryFilter}
|
|
53
|
+
);
|
|
54
|
+
`);
|
|
55
|
+
let sumData = await tx.query(`
|
|
56
|
+
select * from tmp_inv_comp
|
|
57
|
+
offset $1 limit $2
|
|
58
|
+
`, [(params.pagination.page - 1) * params.pagination.limit, params.pagination.limit]);
|
|
59
|
+
const totalQuery = await tx.query(`select count(*) from tmp_inv_comp `);
|
|
60
|
+
const total = parseInt(totalQuery[0].count);
|
|
61
|
+
const items = sumData.map(item => {
|
|
62
|
+
return {
|
|
63
|
+
productName: item.product_name,
|
|
64
|
+
productSku: item.product_sku,
|
|
65
|
+
packingType: item.packing_type,
|
|
66
|
+
closingQty: item.closing_qty,
|
|
67
|
+
remainQty: item.onhand_qty,
|
|
68
|
+
batchId: item.batch_id
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
return { items, total };
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=inventory-comparison-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inventory-comparison-list.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/inventory-comparison/inventory-comparison-list.ts"],"names":[],"mappings":";;;AAAA,mEAAkE;AAGlE,mHAA2G;AAE9F,QAAA,uBAAuB,GAAG;IACrC,KAAK,CAAC,uBAAuB,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;QACnE,IAAI;YACF,MAAM,EAAE,EAAE,EAAE,GAA0B,OAAO,CAAC,KAAK,CAAA;YAEnD,IAAI,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,CAAA;YAE1E,IAAI,CAAC,cAAc,EAAE;gBACnB,OAAM;aACP;YAED,IAAI,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAA;YACtE,IAAI,UAAU,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;YAC7C,IAAI,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAA;YAC3D,IAAI,WAAW,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAA;YAClD,IAAI,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,KAAK,CAAA;YAChF,IAAI,aAAa,GAAG,MAAM,C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AQ;iBACvB,CAAA;YACH,CAAC,CAAC,CAAA;YAEF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;SAExB;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,KAAK,CAAA;SACZ;IACH,CAAC;CACF,CAAA"}
|
|
@@ -3,5 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Query = void 0;
|
|
4
4
|
const inbound_order_details_report_1 = require("./inbound-order-details-report");
|
|
5
5
|
const outbound_order_details_report_1 = require("./outbound-order-details-report");
|
|
6
|
-
|
|
6
|
+
const product_label_report_1 = require("./product-label-report");
|
|
7
|
+
exports.Query = Object.assign(Object.assign(Object.assign({}, inbound_order_details_report_1.inboundOrderDetailsReport), outbound_order_details_report_1.outboundOrderDetailsReport), product_label_report_1.productLabelReport);
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/index.ts"],"names":[],"mappings":";;;AAAA,iFAA0E;AAC1E,mFAA4E;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/index.ts"],"names":[],"mappings":";;;AAAA,iFAA0E;AAC1E,mFAA4E;AAC5E,iEAA2D;AAE9C,QAAA,KAAK,iDACb,wDAAyB,GACzB,0DAA0B,GAC1B,yCAAkB,EACtB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.productLabelReport = void 0;
|
|
4
|
+
const typeorm_1 = require("typeorm");
|
|
5
|
+
const id_rule_base_1 = require("@things-factory/id-rule-base");
|
|
6
|
+
exports.productLabelReport = {
|
|
7
|
+
async productLabelReport(_, params, context) {
|
|
8
|
+
var _a;
|
|
9
|
+
try {
|
|
10
|
+
const { domain } = context.state;
|
|
11
|
+
// const { domain }: { domain: Domain } = context.state
|
|
12
|
+
const bizplaceId = params.filters.find(data => data.name === 'bizplace').value;
|
|
13
|
+
const type = (_a = params.filters.find(data => data.name === 'type')) === null || _a === void 0 ? void 0 : _a.value;
|
|
14
|
+
const fromDate = params.filters.find(data => data.name === 'fromDate').value;
|
|
15
|
+
const toDate = params.filters.find(data => data.name === 'toDate').value;
|
|
16
|
+
if (!bizplaceId || !fromDate || !toDate)
|
|
17
|
+
throw new Error('Invalid input');
|
|
18
|
+
const items = await (0, typeorm_1.getRepository)(id_rule_base_1.Sequence).query(`
|
|
19
|
+
SELECT "date", "type", "count", "bizplace_id" FROM (
|
|
20
|
+
SELECT
|
|
21
|
+
"sq"."pattern"::JSONB ->> 'type' AS "type",
|
|
22
|
+
"sq"."pattern"::JSONB ->> 'date' AS "date",
|
|
23
|
+
"sq"."pattern"::JSONB ->> 'bizplaceId' AS "bizplace_id",
|
|
24
|
+
"sq"."seq" AS "count"
|
|
25
|
+
FROM "sequences" "sq" WHERE "sq"."type" = '${id_rule_base_1.SEQUENCE_TYPE.PRODUCT_LABEL_COUNTER}'
|
|
26
|
+
AND "sq"."domain_id" = '${domain.id}'
|
|
27
|
+
) AS foo
|
|
28
|
+
WHERE "bizplace_id" = '${bizplaceId}'
|
|
29
|
+
${type ? `AND "type" ilike '%${type}%'` : ''}
|
|
30
|
+
AND "date"::date BETWEEN '${fromDate}' AND '${toDate}'
|
|
31
|
+
`);
|
|
32
|
+
// @farishelmi any usage for this function? If no please remove.
|
|
33
|
+
/*
|
|
34
|
+
need to transform into queryBuilder form
|
|
35
|
+
const qb: SelectQueryBuilder<Sequence> = tx
|
|
36
|
+
.getRepository(Sequence)
|
|
37
|
+
.createQueryBuilder('sq')
|
|
38
|
+
.select(`"sq"."pattern"::JSONB ->> 'type'`, 'type')
|
|
39
|
+
.addSelect(`"sq"."pattern"::JSONB ->> 'date'`, 'date')
|
|
40
|
+
.addSelect(`"sq"."pattern"::JSONB ->> 'bizplaceId'`, 'bizplace_id')
|
|
41
|
+
.addSelect(`"sq"."seq"`, 'count')
|
|
42
|
+
.where('"sq"."type" = :sequenceType', { sequenceType: SEQUENCE_TYPE.PRODUCT_LABEL_COUNTER })
|
|
43
|
+
.andWhere(`"sq"."pattern"::JSONB ->> 'bizplaceId' = :bizplaceId`, { bizplaceId })
|
|
44
|
+
.andWhere(`"sq"."domain_id" = :domainId`, { domainId: domain.id })
|
|
45
|
+
*/
|
|
46
|
+
return {
|
|
47
|
+
items,
|
|
48
|
+
total: 0
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=product-label-report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-label-report.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/product-label-report.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AAEvC,+DAAsE;AAGzD,QAAA,kBAAkB,GAAG;IAChC,KAAK,CAAC,kBAAkB,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;;QAC9D,IAAI;YACF,MAAM,EAAE,MAAM,EAAE,GAAuB,OAAO,CAAC,KAAK,CAAA;YACpD,uDAAuD;YACvD,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,KAAK,CAAA;YAC9E,MAAM,IAAI,GAAG,MAAA,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,0CAAE,KAAK,CAAA;YACrE,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,KAAK,CAAA;YAC5E,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,KAAK,CAAA;YAExE,IAAI,CAAC,UAAU,IAAI,CAAC,QAAQ,IAAI,CAAC,MAAM;gBAAE,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAA;YAEzE,MAAM,KAAK,GAAG,MAAM,IAAA,uBAAa,EAAC,uBAAQ,CAAC,CAAC,KAAK,CAAC;;;;;;;uDAOD,4BAAa,CAAC,qBAAqB;oCACtD,MAAM,CAAC,EAAE;;iCAEZ,UAAU;UACjC,IAAI,CAAC,CAAC,CAAC,sBAAsB,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE;oCAChB,QAAQ,UAAU,MAAM;OACrD,CAAC,CAAA;YAEF,gEAAgE;YAChE;;;;;;;;;;;;cAYE;YAEF,OAAO;gBACL,KAAK;gBACL,KAAK,EAAE,CAAC;aACT,CAAA;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,KAAK,CAAA;SACZ;IACH,CAAC;CACF,CAAA"}
|
|
@@ -27,13 +27,15 @@ const Dashboard = __importStar(require("./dashboard"));
|
|
|
27
27
|
const Extra = __importStar(require("./extra"));
|
|
28
28
|
const OpaMenu = __importStar(require("./opa-menu"));
|
|
29
29
|
const Reports = __importStar(require("./reports"));
|
|
30
|
+
const InventoryComparison = __importStar(require("./inventory-comparison"));
|
|
30
31
|
exports.queries = [
|
|
31
32
|
BoardSetting.Query,
|
|
32
33
|
CustomElccl.Query,
|
|
33
34
|
CustomKimeda.Query,
|
|
34
35
|
Dashboard.Query,
|
|
35
36
|
OpaMenu.Query,
|
|
36
|
-
Reports.Query
|
|
37
|
+
Reports.Query,
|
|
38
|
+
InventoryComparison.Query
|
|
37
39
|
];
|
|
38
40
|
exports.mutations = [Extra.Mutation];
|
|
39
41
|
exports.types = [
|
|
@@ -41,6 +43,7 @@ exports.types = [
|
|
|
41
43
|
...CustomElccl.Types,
|
|
42
44
|
...Dashboard.Types,
|
|
43
45
|
...OpaMenu.Types,
|
|
44
|
-
...Reports.Types
|
|
46
|
+
...Reports.Types,
|
|
47
|
+
...InventoryComparison.Types
|
|
45
48
|
];
|
|
46
49
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/graphql/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,8DAA+C;AAC/C,4DAA6C;AAC7C,8DAA+C;AAC/C,uDAAwC;AACxC,+CAAgC;AAChC,oDAAqC;AACrC,mDAAoC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/graphql/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,8DAA+C;AAC/C,4DAA6C;AAC7C,8DAA+C;AAC/C,uDAAwC;AACxC,+CAAgC;AAChC,oDAAqC;AACrC,mDAAoC;AACpC,4EAA6D;AAEhD,QAAA,OAAO,GAAG;IACrB,YAAY,CAAC,KAAK;IAClB,WAAW,CAAC,KAAK;IACjB,YAAY,CAAC,KAAK;IAClB,SAAS,CAAC,KAAK;IACf,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,KAAK;IACb,mBAAmB,CAAC,KAAK;CAC1B,CAAA;AAEY,QAAA,SAAS,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;AAE5B,QAAA,KAAK,GAAG;IACnB,GAAG,YAAY,CAAC,KAAK;IACrB,GAAG,WAAW,CAAC,KAAK;IACpB,GAAG,SAAS,CAAC,KAAK;IAClB,GAAG,OAAO,CAAC,KAAK;IAChB,GAAG,OAAO,CAAC,KAAK;IAChB,GAAG,mBAAmB,CAAC,KAAK;CAC7B,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Types = exports.Query = void 0;
|
|
4
|
+
const inventory_comparison_1 = require("./inventory-comparison");
|
|
5
|
+
const inventory_comparison_list_1 = require("./inventory-comparison-list");
|
|
6
|
+
exports.Query = `
|
|
7
|
+
inventoryComparisonList(filters: [Filter], pagination: Pagination, sortings: [Sorting]): InventoryComparisonList @privilege(category: "inventory_comparison", privilege: "query") @transaction
|
|
8
|
+
`;
|
|
9
|
+
exports.Types = [
|
|
10
|
+
inventory_comparison_1.InventoryComparison,
|
|
11
|
+
inventory_comparison_list_1.InventoryComparisonList
|
|
12
|
+
];
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/types/inventory-comparison/index.ts"],"names":[],"mappings":";;;AAAA,iEAA6D;AAC7D,2EAAsE;AAEzD,QAAA,KAAK,GAAG;;CAEpB,CAAA;AAEY,QAAA,KAAK,GAAG;IACnB,0CAAmB;IACnB,mDAAuB;CACxB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InventoryComparisonList = void 0;
|
|
7
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
8
|
+
exports.InventoryComparisonList = (0, graphql_tag_1.default) `
|
|
9
|
+
type InventoryComparisonList {
|
|
10
|
+
items: [InventoryComparison]
|
|
11
|
+
total: Int
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
//# sourceMappingURL=inventory-comparison-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inventory-comparison-list.js","sourceRoot":"","sources":["../../../../server/graphql/types/inventory-comparison/inventory-comparison-list.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,uBAAuB,GAAG,IAAA,qBAAG,EAAA;;;;;CAKzC,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InventoryComparison = void 0;
|
|
7
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
8
|
+
exports.InventoryComparison = (0, graphql_tag_1.default) `
|
|
9
|
+
type InventoryComparison {
|
|
10
|
+
productSku: String
|
|
11
|
+
productName: String
|
|
12
|
+
packingType: String
|
|
13
|
+
closingQty: Int
|
|
14
|
+
remainQty: Int
|
|
15
|
+
batchId: String
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
//# sourceMappingURL=inventory-comparison.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inventory-comparison.js","sourceRoot":"","sources":["../../../../server/graphql/types/inventory-comparison/inventory-comparison.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,mBAAmB,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;CASrC,CAAA"}
|
|
@@ -5,14 +5,19 @@ const inbound_order_details_report_1 = require("./inbound-order-details-report")
|
|
|
5
5
|
const inbound_order_details_report_list_1 = require("./inbound-order-details-report-list");
|
|
6
6
|
const outbound_order_details_report_1 = require("./outbound-order-details-report");
|
|
7
7
|
const outbound_order_details_report_list_1 = require("./outbound-order-details-report-list");
|
|
8
|
+
const product_label_report_1 = require("./product-label-report");
|
|
9
|
+
const product_label_report_list_1 = require("./product-label-report-list");
|
|
8
10
|
exports.Query = `
|
|
9
11
|
inboundOrderDetailsReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): InboundOrderDetailsReportList @transaction
|
|
10
12
|
outboundOrderDetailsReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): OutboundOrderDetailsReportList @transaction
|
|
13
|
+
productLabelReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): ProductLabelReportList @transaction
|
|
11
14
|
`;
|
|
12
15
|
exports.Types = [
|
|
13
16
|
inbound_order_details_report_1.InboundOrderDetailsReport,
|
|
14
17
|
inbound_order_details_report_list_1.InboundOrderDetailsReportList,
|
|
15
18
|
outbound_order_details_report_1.OutboundOrderDetailsReport,
|
|
16
|
-
outbound_order_details_report_list_1.OutboundOrderDetailsReportList
|
|
19
|
+
outbound_order_details_report_list_1.OutboundOrderDetailsReportList,
|
|
20
|
+
product_label_report_1.ProductLabelReport,
|
|
21
|
+
product_label_report_list_1.ProductLabelReportList
|
|
17
22
|
];
|
|
18
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/index.ts"],"names":[],"mappings":";;;AAAA,iFAA0E;AAC1E,2FAAmF;AACnF,mFAA4E;AAC5E,6FAAqF;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/index.ts"],"names":[],"mappings":";;;AAAA,iFAA0E;AAC1E,2FAAmF;AACnF,mFAA4E;AAC5E,6FAAqF;AACrF,iEAA2D;AAC3D,2EAAoE;AAEvD,QAAA,KAAK,GAAG;;;;CAIpB,CAAA;AAEY,QAAA,KAAK,GAAG;IACnB,wDAAyB;IACzB,iEAA6B;IAC7B,0DAA0B;IAC1B,mEAA8B;IAC9B,yCAAkB;IAClB,kDAAsB;CACvB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ProductLabelReportList = void 0;
|
|
7
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
8
|
+
exports.ProductLabelReportList = (0, graphql_tag_1.default) `
|
|
9
|
+
type ProductLabelReportList {
|
|
10
|
+
items: [ProductLabelReport]
|
|
11
|
+
total: Int
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
//# sourceMappingURL=product-label-report-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-label-report-list.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/product-label-report-list.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,sBAAsB,GAAG,IAAA,qBAAG,EAAA;;;;;CAKxC,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ProductLabelReport = void 0;
|
|
7
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
8
|
+
exports.ProductLabelReport = (0, graphql_tag_1.default) `
|
|
9
|
+
type ProductLabelReport {
|
|
10
|
+
bizplace: Bizplace
|
|
11
|
+
type: String
|
|
12
|
+
date: String
|
|
13
|
+
count: Int
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
//# sourceMappingURL=product-label-report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-label-report.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/product-label-report.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,kBAAkB,GAAG,IAAA,qBAAG,EAAA;;;;;;;CAOpC,CAAA"}
|