@things-factory/operato-wms 4.0.11 → 4.0.16
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/adjustment/transfer-inventory.js +368 -165
- package/client/pages/bulk-operation/bulk-operation.js +316 -0
- package/client/pages/bulk-operation/validate-ro-popup.js +445 -0
- package/client/pages/components/select-product-popup.js +15 -2
- package/client/pages/constants/inventory.js +1 -0
- package/client/pages/constants/location.js +33 -6
- package/client/pages/constants/order.js +10 -0
- package/client/pages/constants/worksheet.js +2 -2
- package/client/pages/inbound/inbound-worksheet.js +78 -9
- package/client/pages/inbound/putaway-product.js +214 -139
- package/client/pages/inbound/putaway-worksheet-generate-popup.js +24 -2
- package/client/pages/inbound/unload-product.js +149 -76
- package/client/pages/inbound/worksheet-putaway-return.js +22 -5
- package/client/pages/inbound/worksheet-putaway.js +21 -8
- package/client/pages/inbound/worksheet-unloading-return.js +22 -5
- package/client/pages/inbound/worksheet-unloading.js +8 -0
- package/client/pages/inventory/inventory-adjustment-approval.js +11 -19
- package/client/pages/inventory/inventory-adjustment.js +136 -101
- package/client/pages/inventory/inventory-by-product-detail.js +3 -5
- package/client/pages/inventory/inventory-by-product.js +8 -0
- package/client/pages/inventory/inventory-history-by-pallet.js +12 -5
- package/client/pages/inventory/inventory-history.js +10 -0
- package/client/pages/inventory/onhand-inventory.js +11 -2
- package/client/pages/inventory-check/create-cycle-count.js +12 -6
- package/client/pages/inventory-check/cycle-count-report.js +8 -0
- package/client/pages/inventory-check/inspecting-product.js +146 -80
- package/client/pages/inventory-check/worksheet-cycle-count.js +14 -0
- 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/master/location-list.js +58 -17
- package/client/pages/master/product/product-detail-bizplace-setting-popup.js +2 -2
- package/client/pages/master/product/product-details-popup.js +2 -2
- package/client/pages/master/product/product-list.js +5 -5
- package/client/pages/order/arrival-notice/arrival-notice-detail.js +134 -115
- package/client/pages/order/arrival-notice/arrival-notice-list.js +87 -6
- package/client/pages/order/arrival-notice/arrival-notice-requests.js +83 -6
- package/client/pages/order/arrival-notice/assign-buffer-location.js +8 -1
- package/client/pages/order/arrival-notice/check-arrived-notice.js +9 -1
- package/client/pages/order/arrival-notice/create-arrival-notice.js +38 -3
- package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +290 -25
- package/client/pages/order/arrival-notice/edit-product-popup.js +36 -5
- package/client/pages/order/arrival-notice/receive-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 +52 -12
- package/client/pages/order/release-order/b2c/b2c-order-requests.js +244 -24
- package/client/pages/order/release-order/bulk-print-packing-list.js +23 -0
- package/client/pages/order/release-order/create-release-order.js +55 -8
- package/client/pages/order/release-order/receive-release-order-request.js +35 -24
- package/client/pages/order/release-order/release-extra-product-popup.js +204 -63
- package/client/pages/order/release-order/release-order-detail.js +301 -74
- package/client/pages/order/return-order/check-return-order.js +9 -1
- package/client/pages/order/return-order/create-return-order.js +14 -2
- package/client/pages/order/return-order/receive-return-order-requests.js +9 -1
- package/client/pages/order/return-order/return-order-detail.js +15 -6
- package/client/pages/order/return-order/return-order-inventory-popup.js +7 -0
- package/client/pages/order/reverse-kitting-order/reverse-kitting-order-detail.js +124 -59
- 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 +102 -59
- package/client/pages/outbound/inventory-assign-popup.js +23 -6
- package/client/pages/outbound/inventory-auto-assign-popup.js +22 -6
- package/client/pages/outbound/loading-product.js +4 -1
- package/client/pages/outbound/merged-outbound-worksheet.js +43 -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 +803 -431
- package/client/pages/outbound/picking-replacement-popup.js +1 -1
- package/client/pages/outbound/serial-number-popup.js +280 -0
- package/client/pages/outbound/single-outbound-worksheet.js +47 -1
- package/client/pages/outbound/worksheet-batch-picking.js +22 -8
- package/client/pages/outbound/worksheet-loading.js +22 -5
- package/client/pages/outbound/worksheet-packing.js +8 -0
- package/client/pages/outbound/worksheet-picking.js +62 -8
- package/client/pages/outbound/worksheet-return.js +9 -1
- package/client/pages/outbound/worksheet-sorting.js +9 -1
- package/client/pages/report/custom-elccl/elccl-inventory-report.js +31 -30
- package/client/pages/report/custom-elccl/elccl-inventory-summary-report.js +23 -26
- package/client/pages/report/inventory-pallet-storage-report.js +11 -10
- package/client/pages/report/inventory-report.js +41 -43
- package/client/pages/report/inventory-summary-report.js +25 -28
- 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 +38 -23
- package/client/pages/vas/reverse-kitting/popup-combination-sets.js +98 -15
- package/client/pages/vas/reverse-kitting/popup-reverse-kitting-template.js +129 -21
- package/client/pages/vas/vas-pallet-label-popup.js +5 -8
- package/client/route.js +28 -0
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js +1 -1
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js.map +1 -1
- 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 +5 -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/resolvers/shipping-provider/index.js +6 -0
- package/dist-server/graphql/resolvers/shipping-provider/index.js.map +1 -0
- package/dist-server/graphql/resolvers/shipping-provider/shipping-providers.js +20 -0
- package/dist-server/graphql/resolvers/shipping-provider/shipping-providers.js.map +1 -0
- package/dist-server/graphql/types/custom/elccl/elccl-inventory-report.js +1 -1
- package/dist-server/graphql/types/index.js +8 -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/dist-server/graphql/types/shipping-provider/index.js +10 -0
- package/dist-server/graphql/types/shipping-provider/index.js.map +1 -0
- package/dist-server/graphql/types/shipping-provider/shipping-provider-list.js +13 -0
- package/dist-server/graphql/types/shipping-provider/shipping-provider-list.js.map +1 -0
- package/dist-server/graphql/types/shipping-provider/shipping-provider.js +13 -0
- package/dist-server/graphql/types/shipping-provider/shipping-provider.js.map +1 -0
- package/package.json +65 -65
- package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.ts +4 -2
- 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 +5 -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/resolvers/shipping-provider/index.ts +5 -0
- package/server/graphql/resolvers/shipping-provider/shipping-providers.ts +20 -0
- package/server/graphql/types/custom/elccl/elccl-inventory-report.ts +1 -1
- package/server/graphql/types/index.ts +8 -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/server/graphql/types/shipping-provider/index.ts +8 -0
- package/server/graphql/types/shipping-provider/shipping-provider-list.ts +7 -0
- package/server/graphql/types/shipping-provider/shipping-provider.ts +7 -0
- package/things-factory.config.js +30 -0
- package/translations/en.json +91 -11
- package/translations/ko.json +109 -11
- package/translations/ms.json +111 -12
- package/translations/zh.json +123 -26
- package/config.development.js +0 -73
- package/config.production.js +0 -113
|
@@ -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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Types = exports.Query = void 0;
|
|
4
|
+
const shipping_provider_list_1 = require("./shipping-provider-list");
|
|
5
|
+
const shipping_provider_1 = require("./shipping-provider");
|
|
6
|
+
exports.Query = `
|
|
7
|
+
shippingProviders: ShippingProviderList @transaction
|
|
8
|
+
`;
|
|
9
|
+
exports.Types = [shipping_provider_list_1.ShippingProviderList, shipping_provider_1.ShippingProvider];
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/types/shipping-provider/index.ts"],"names":[],"mappings":";;;AAAA,qEAA+D;AAC/D,2DAAsD;AAEzC,QAAA,KAAK,GAAG;;CAEpB,CAAA;AAEY,QAAA,KAAK,GAAG,CAAC,6CAAoB,EAAE,oCAAgB,CAAC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
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.ShippingProviderList = void 0;
|
|
7
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
8
|
+
exports.ShippingProviderList = (0, graphql_tag_1.default) `
|
|
9
|
+
type ShippingProviderList {
|
|
10
|
+
items: [ShippingProvider]
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
//# sourceMappingURL=shipping-provider-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shipping-provider-list.js","sourceRoot":"","sources":["../../../../server/graphql/types/shipping-provider/shipping-provider-list.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,oBAAoB,GAAG,IAAA,qBAAG,EAAA;;;;CAItC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
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.ShippingProvider = void 0;
|
|
7
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
8
|
+
exports.ShippingProvider = (0, graphql_tag_1.default) `
|
|
9
|
+
type ShippingProvider {
|
|
10
|
+
transporter: String
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
//# sourceMappingURL=shipping-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shipping-provider.js","sourceRoot":"","sources":["../../../../server/graphql/types/shipping-provider/shipping-provider.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,gBAAgB,GAAG,IAAA,qBAAG,EAAA;;;;CAIlC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/operato-wms",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.16",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -41,72 +41,72 @@
|
|
|
41
41
|
"docker:run": "docker run -p 4000:3000 hatiolab/operato-wms:latest"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@operato/ghost-print": "^0.2.
|
|
45
|
-
"@operato/scene-chartjs": "^0.0.
|
|
46
|
-
"@operato/scene-clock": "^0.0.
|
|
47
|
-
"@operato/scene-clone": "^0.0.
|
|
48
|
-
"@operato/scene-
|
|
49
|
-
"@operato/scene-
|
|
50
|
-
"@operato/scene-
|
|
51
|
-
"@
|
|
52
|
-
"@
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
57
|
-
"@things-factory/
|
|
58
|
-
"@things-factory/
|
|
59
|
-
"@things-factory/
|
|
60
|
-
"@things-factory/
|
|
61
|
-
"@things-factory/
|
|
62
|
-
"@things-factory/
|
|
63
|
-
"@things-factory/
|
|
64
|
-
"@things-factory/
|
|
65
|
-
"@things-factory/
|
|
66
|
-
"@things-factory/
|
|
67
|
-
"@things-factory/
|
|
68
|
-
"@things-factory/
|
|
69
|
-
"@things-factory/
|
|
70
|
-
"@things-factory/
|
|
71
|
-
"@things-factory/
|
|
72
|
-
"@things-factory/
|
|
73
|
-
"@things-factory/
|
|
74
|
-
"@things-factory/
|
|
75
|
-
"@things-factory/
|
|
76
|
-
"@things-factory/
|
|
77
|
-
"@things-factory/
|
|
78
|
-
"@things-factory/
|
|
79
|
-
"@things-factory/
|
|
80
|
-
"@things-factory/
|
|
81
|
-
"@things-factory/
|
|
82
|
-
"@things-factory/
|
|
83
|
-
"@things-factory/
|
|
84
|
-
"@things-factory/
|
|
85
|
-
"@things-factory/
|
|
86
|
-
"@things-factory/
|
|
87
|
-
"@things-factory/scene-
|
|
88
|
-
"@things-factory/scene-
|
|
44
|
+
"@operato/ghost-print": "^0.2.47",
|
|
45
|
+
"@operato/scene-chartjs": "^0.0.20",
|
|
46
|
+
"@operato/scene-clock": "^0.0.20",
|
|
47
|
+
"@operato/scene-clone": "^0.0.20",
|
|
48
|
+
"@operato/scene-compass": "^0.0.20",
|
|
49
|
+
"@operato/scene-gauge": "^0.0.20",
|
|
50
|
+
"@operato/scene-indoor-map": "^0.0.20",
|
|
51
|
+
"@operato/scene-legend": "^0.0.20",
|
|
52
|
+
"@operato/scene-progressbar": "^0.0.20",
|
|
53
|
+
"@operato/scene-random": "^0.0.20",
|
|
54
|
+
"@operato/scene-switch": "^0.0.20",
|
|
55
|
+
"@operato/scene-table": "^0.0.20",
|
|
56
|
+
"@operato/scene-wheel-sorter": "^0.0.20",
|
|
57
|
+
"@things-factory/apptool-ui": "^4.0.16",
|
|
58
|
+
"@things-factory/attachment-ui": "^4.0.16",
|
|
59
|
+
"@things-factory/auth-ui": "^4.0.16",
|
|
60
|
+
"@things-factory/barcode-ui": "^4.0.16",
|
|
61
|
+
"@things-factory/biz-ui": "^4.0.16",
|
|
62
|
+
"@things-factory/board-service": "^4.0.16",
|
|
63
|
+
"@things-factory/board-ui": "^4.0.16",
|
|
64
|
+
"@things-factory/code-ui": "^4.0.16",
|
|
65
|
+
"@things-factory/context-ui": "^4.0.16",
|
|
66
|
+
"@things-factory/export-ui": "^4.0.16",
|
|
67
|
+
"@things-factory/export-ui-csv": "^4.0.16",
|
|
68
|
+
"@things-factory/export-ui-excel": "^4.0.16",
|
|
69
|
+
"@things-factory/fav-base": "^4.0.16",
|
|
70
|
+
"@things-factory/form-ui": "^4.0.16",
|
|
71
|
+
"@things-factory/grist-ui": "^4.0.16",
|
|
72
|
+
"@things-factory/help": "^4.0.16",
|
|
73
|
+
"@things-factory/i18n-ui": "^4.0.16",
|
|
74
|
+
"@things-factory/id-rule-base": "^4.0.16",
|
|
75
|
+
"@things-factory/import-ui": "^4.0.16",
|
|
76
|
+
"@things-factory/import-ui-excel": "^4.0.16",
|
|
77
|
+
"@things-factory/menu-ui": "^4.0.16",
|
|
78
|
+
"@things-factory/more-ui": "^4.0.16",
|
|
79
|
+
"@things-factory/notification": "^4.0.16",
|
|
80
|
+
"@things-factory/pdf": "^4.0.16",
|
|
81
|
+
"@things-factory/print-proxy-service": "^4.0.16",
|
|
82
|
+
"@things-factory/print-service": "^4.0.16",
|
|
83
|
+
"@things-factory/print-ui": "^4.0.16",
|
|
84
|
+
"@things-factory/product-base": "^4.0.16",
|
|
85
|
+
"@things-factory/resource-ui": "^4.0.16",
|
|
86
|
+
"@things-factory/sales-ui": "^4.0.16",
|
|
87
|
+
"@things-factory/scene-data-transform": "^4.0.16",
|
|
88
|
+
"@things-factory/scene-excel": "^4.0.16",
|
|
89
|
+
"@things-factory/scene-firebase": "^4.0.16",
|
|
90
|
+
"@things-factory/scene-form": "^4.0.16",
|
|
91
|
+
"@things-factory/scene-google-map": "^4.0.16",
|
|
92
|
+
"@things-factory/scene-graphql": "^4.0.16",
|
|
89
93
|
"@things-factory/scene-half-roundrect": "^4.0.9",
|
|
90
|
-
"@things-factory/scene-
|
|
91
|
-
"@things-factory/scene-
|
|
92
|
-
"@things-factory/scene-
|
|
93
|
-
"@things-factory/scene-
|
|
94
|
-
"@things-factory/scene-
|
|
95
|
-
"@things-factory/scene-
|
|
96
|
-
"@things-factory/scene-
|
|
97
|
-
"@things-factory/
|
|
98
|
-
"@things-factory/
|
|
99
|
-
"@things-factory/
|
|
100
|
-
"@things-factory/
|
|
101
|
-
"@things-factory/
|
|
102
|
-
"@things-factory/
|
|
103
|
-
"@things-factory/transport-base": "^4.0.11",
|
|
104
|
-
"@things-factory/tutorial-ui": "^4.0.11",
|
|
105
|
-
"@things-factory/warehouse-base": "^4.0.11",
|
|
106
|
-
"@things-factory/worksheet-base": "^4.0.11"
|
|
94
|
+
"@things-factory/scene-label": "^4.0.16",
|
|
95
|
+
"@things-factory/scene-marker": "^4.0.16",
|
|
96
|
+
"@things-factory/scene-mqtt": "^4.0.16",
|
|
97
|
+
"@things-factory/scene-news-ticker": "^4.0.16",
|
|
98
|
+
"@things-factory/scene-restful": "^4.0.16",
|
|
99
|
+
"@things-factory/scene-tab": "^4.0.16",
|
|
100
|
+
"@things-factory/scene-visualizer": "^4.0.16",
|
|
101
|
+
"@things-factory/setting-ui": "^4.0.16",
|
|
102
|
+
"@things-factory/system-ui": "^4.0.16",
|
|
103
|
+
"@things-factory/transport-base": "^4.0.16",
|
|
104
|
+
"@things-factory/tutorial-ui": "^4.0.16",
|
|
105
|
+
"@things-factory/warehouse-base": "^4.0.16",
|
|
106
|
+
"@things-factory/worksheet-base": "^4.0.16"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
|
-
"@things-factory/builder": "^4.0.
|
|
109
|
+
"@things-factory/builder": "^4.0.16"
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "5a56e53e09d5b0a47b7446dbb2fa696232ad5414"
|
|
112
112
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { EntityManager } from 'typeorm'
|
|
2
|
+
|
|
1
3
|
import { Bizplace } from '@things-factory/biz-base'
|
|
2
4
|
import { ListParam } from '@things-factory/shell'
|
|
3
|
-
|
|
5
|
+
|
|
4
6
|
export const elcclInventoryHistoryReport = {
|
|
5
7
|
async elcclInventoryHistoryReport(_: any, params: ListParam, context: any) {
|
|
6
8
|
try {
|
|
@@ -165,7 +167,7 @@ export const elcclInventoryHistoryReport = {
|
|
|
165
167
|
uomValue: itm.uom_value,
|
|
166
168
|
openingQty: itm.opening_qty,
|
|
167
169
|
openingUomValue: itm.opening_uom_value,
|
|
168
|
-
|
|
170
|
+
orderNo: itm.order_name,
|
|
169
171
|
createdAt: itm.created_at
|
|
170
172
|
}
|
|
171
173
|
})
|
|
@@ -8,75 +8,13 @@ export const elcclInventoryHistorySummaryReport = {
|
|
|
8
8
|
try {
|
|
9
9
|
const { tx }: { tx: EntityManager } = context.state
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
await inventoryHistorySummaryReportQuery(_, params, context)
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
let fromDate = params.filters.find(data => data.name === 'fromDate')
|
|
16
|
-
let toDate = params.filters.find(data => data.name === 'toDate')
|
|
17
|
-
|
|
18
|
-
if (!bizplaceFilter || !fromDate || !toDate) throw 'Invalid input'
|
|
19
|
-
|
|
20
|
-
const bizplace: Bizplace = await getRepository(Bizplace).findOne({
|
|
21
|
-
id: bizplaceFilter.value
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
let balanceOnlyQuery = ''
|
|
25
|
-
if (balanceOnlyFilter && balanceOnlyFilter.value) {
|
|
26
|
-
balanceOnlyQuery = 'and (opening_qty + adjustment_qty + total_in_qty + total_out_qty + total_return_qty) > 0 '
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
await tx.query(
|
|
30
|
-
`
|
|
31
|
-
create temp table temp_inv_history on commit drop as (
|
|
32
|
-
select i2.pallet_id, ih.product_id::uuid, ih.packing_type, ih.batch_id,
|
|
33
|
-
ih.id as inventory_history_id, ih.seq, ih.status, ih.transaction_type, ih.qty, ih.opening_qty, ih.weight, ih.opening_weight, ih.created_at,
|
|
34
|
-
ih.ref_order_id::uuid as ref_order_id
|
|
35
|
-
from inventories i2
|
|
36
|
-
inner join reduced_inventory_histories ih on ih.pallet_id = i2.pallet_id and ih.domain_id = i2.domain_id
|
|
37
|
-
where
|
|
38
|
-
i2.domain_id = $1
|
|
39
|
-
and i2.bizplace_id = $2
|
|
40
|
-
and ih.created_at <= $3
|
|
41
|
-
)
|
|
42
|
-
`,
|
|
43
|
-
[context.state.domain.id, bizplace.id, toDate.value]
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
await tx.query(
|
|
47
|
-
`
|
|
48
|
-
create temp table temp_elccl_inventory_summary on commit drop as (
|
|
49
|
-
select src.*,
|
|
50
|
-
opening_qty + adjustment_qty + total_in_qty + total_out_qty + total_return_qty as closing_qty,
|
|
51
|
-
prd.name as product_name, prd.sku as product_sku, prd.description as product_description
|
|
52
|
-
from (
|
|
53
|
-
select ih.batch_id, ih.packing_type,
|
|
54
|
-
min(ih.created_at) as initial_date,
|
|
55
|
-
sum(case when (ih.transaction_type = 'UNLOADING' or ih.transaction_type = 'NEW') and rtn.id is null then qty else 0 end) as initial_qty,
|
|
56
|
-
sum(case when ih.created_at > $1 and ih.transaction_type = 'ADJUSTMENT' then ih.qty else 0 end) as adjustment_qty,
|
|
57
|
-
sum(case when ih.created_at < $1 then ih.qty else 0 end) as opening_qty,
|
|
58
|
-
sum(case when ih.created_at > $1 then case when ih.qty > 0 and ih.transaction_type <> 'ADJUSTMENT' and ih.transaction_type <> 'RETURN' and rtn.id is null then ih.qty else 0 end else 0 end) as total_in_qty,
|
|
59
|
-
sum(case when ih.created_at > $1 then case when (ih.qty < 0 and ih.transaction_type <> 'ADJUSTMENT') or ih.transaction_type = 'RETURN' then ih.qty else 0 end else 0 end) as total_out_qty,
|
|
60
|
-
ih.product_id,
|
|
61
|
-
sum(case when rtn.id is not null and ih.transaction_type <> 'ADJUSTMENT' and ih.created_at > $1 then qty else 0 end) as total_return_qty
|
|
62
|
-
from temp_inv_history ih
|
|
63
|
-
left join return_orders rtn on rtn.id = ih.ref_order_id
|
|
64
|
-
group by ih.batch_id, ih.product_id, ih.packing_type
|
|
65
|
-
order by batch_id
|
|
66
|
-
) src
|
|
67
|
-
inner join products prd on prd.id = src.product_id
|
|
68
|
-
where (opening_qty > 0 or total_in_qty > 0 or adjustment_qty > 0)
|
|
69
|
-
${balanceOnlyQuery}
|
|
70
|
-
)
|
|
71
|
-
`,
|
|
72
|
-
[fromDate.value]
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
const total: any = await tx.query(`select count(*) from temp_elccl_inventory_summary`)
|
|
13
|
+
const total: any = await tx.query(`select count(*) from temp_inventory_summary`)
|
|
76
14
|
|
|
77
15
|
const result: any = await tx.query(
|
|
78
16
|
`
|
|
79
|
-
select * from
|
|
17
|
+
select * from temp_inventory_summary ORDER BY initial_date OFFSET $1 LIMIT $2
|
|
80
18
|
`,
|
|
81
19
|
[(params.pagination.page - 1) * params.pagination.limit, params.pagination.limit]
|
|
82
20
|
)
|
|
@@ -109,3 +47,75 @@ export const elcclInventoryHistorySummaryReport = {
|
|
|
109
47
|
}
|
|
110
48
|
}
|
|
111
49
|
}
|
|
50
|
+
|
|
51
|
+
export async function inventoryHistorySummaryReportQuery(_: any, params: ListParam, context: any): Promise<void> {
|
|
52
|
+
try {
|
|
53
|
+
const { tx }: { tx: EntityManager } = context.state
|
|
54
|
+
|
|
55
|
+
let balanceOnlyFilter = params.filters.find(data => data.name === 'balanceOnly')
|
|
56
|
+
|
|
57
|
+
let bizplaceFilter = params.filters.find(data => data.name === 'bizplace')
|
|
58
|
+
|
|
59
|
+
let fromDate = params.filters.find(data => data.name === 'fromDate')
|
|
60
|
+
let toDate = params.filters.find(data => data.name === 'toDate')
|
|
61
|
+
|
|
62
|
+
if (!bizplaceFilter || !fromDate || !toDate) throw 'Invalid input'
|
|
63
|
+
|
|
64
|
+
const bizplace: Bizplace = await getRepository(Bizplace).findOne({
|
|
65
|
+
id: bizplaceFilter.value
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
let balanceOnlyQuery = ''
|
|
69
|
+
if (balanceOnlyFilter && balanceOnlyFilter.value) {
|
|
70
|
+
balanceOnlyQuery = 'and (opening_qty + adjustment_qty + total_in_qty + total_out_qty + total_return_qty) > 0 '
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
await tx.query(
|
|
74
|
+
`
|
|
75
|
+
create temp table temp_inv_history on commit drop as (
|
|
76
|
+
select i2.pallet_id, ih.product_id::uuid, ih.packing_type, ih.batch_id,
|
|
77
|
+
ih.id as inventory_history_id, ih.seq, ih.status, ih.transaction_type, ih.qty, ih.opening_qty, ih.created_at,
|
|
78
|
+
ih.ref_order_id::uuid as ref_order_id
|
|
79
|
+
from inventories i2
|
|
80
|
+
inner join reduced_inventory_histories ih on ih.pallet_id = i2.pallet_id and ih.domain_id = i2.domain_id
|
|
81
|
+
where
|
|
82
|
+
i2.domain_id = $1
|
|
83
|
+
and i2.bizplace_id = $2
|
|
84
|
+
and ih.created_at <= $3
|
|
85
|
+
)
|
|
86
|
+
`,
|
|
87
|
+
[context.state.domain.id, bizplace.id, toDate.value]
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
await tx.query(
|
|
91
|
+
`
|
|
92
|
+
create temp table temp_inventory_summary on commit drop as (
|
|
93
|
+
select src.*,
|
|
94
|
+
opening_qty + adjustment_qty + total_in_qty + total_out_qty + total_return_qty as closing_qty,
|
|
95
|
+
prd.name as product_name, prd.sku as product_sku, prd.description as product_description
|
|
96
|
+
from (
|
|
97
|
+
select ih.batch_id, ih.packing_type,
|
|
98
|
+
min(ih.created_at) as initial_date,
|
|
99
|
+
sum(case when (ih.transaction_type = 'UNLOADING' or ih.transaction_type = 'NEW') and rtn.id is null then qty else 0 end) as initial_qty,
|
|
100
|
+
sum(case when ih.created_at > $1 and ih.transaction_type = 'ADJUSTMENT' then ih.qty else 0 end) as adjustment_qty,
|
|
101
|
+
sum(case when ih.created_at < $1 then ih.qty else 0 end) as opening_qty,
|
|
102
|
+
sum(case when ih.created_at > $1 then case when ih.qty > 0 and ih.transaction_type <> 'ADJUSTMENT' and ih.transaction_type <> 'RETURN' and rtn.id is null then ih.qty else 0 end else 0 end) as total_in_qty,
|
|
103
|
+
sum(case when ih.created_at > $1 then case when (ih.qty < 0 and ih.transaction_type <> 'ADJUSTMENT') or ih.transaction_type = 'RETURN' then ih.qty else 0 end else 0 end) as total_out_qty,
|
|
104
|
+
ih.product_id,
|
|
105
|
+
sum(case when rtn.id is not null and ih.transaction_type <> 'ADJUSTMENT' and ih.created_at > $1 then qty else 0 end) as total_return_qty
|
|
106
|
+
from temp_inv_history ih
|
|
107
|
+
left join return_orders rtn on rtn.id = ih.ref_order_id
|
|
108
|
+
group by ih.batch_id, ih.product_id, ih.packing_type
|
|
109
|
+
order by batch_id
|
|
110
|
+
) src
|
|
111
|
+
inner join products prd on prd.id = src.product_id
|
|
112
|
+
where (opening_qty > 0 or total_in_qty > 0 or adjustment_qty > 0)
|
|
113
|
+
${balanceOnlyQuery}
|
|
114
|
+
)
|
|
115
|
+
`,
|
|
116
|
+
[fromDate.value]
|
|
117
|
+
)
|
|
118
|
+
} catch (error) {
|
|
119
|
+
throw error
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
import { EntityManager } from 'typeorm'
|
|
2
|
+
|
|
1
3
|
import { User } from '@things-factory/auth-base'
|
|
2
4
|
import { Bizplace } from '@things-factory/biz-base'
|
|
3
5
|
import { Product } from '@things-factory/product-base'
|
|
4
|
-
import { OrderInventory, OrderNoGenerator,
|
|
6
|
+
import { ORDER_INVENTORY_STATUS, OrderInventory, OrderNoGenerator, ReleaseGood } from '@things-factory/sales-base'
|
|
5
7
|
import { Domain } from '@things-factory/shell'
|
|
6
|
-
import { Inventory,
|
|
8
|
+
import { Inventory, INVENTORY_TRANSACTION_TYPE, InventoryHistory } from '@things-factory/warehouse-base'
|
|
7
9
|
import {
|
|
8
10
|
generatePickingWorksheetDetail,
|
|
9
11
|
Worksheet,
|
|
10
|
-
WorksheetDetail,
|
|
11
12
|
WORKSHEET_STATUS,
|
|
12
|
-
WORKSHEET_TYPE
|
|
13
|
+
WORKSHEET_TYPE,
|
|
14
|
+
WorksheetDetail
|
|
13
15
|
} from '@things-factory/worksheet-base'
|
|
14
|
-
import { EntityManager } from 'typeorm'
|
|
15
16
|
|
|
16
17
|
export const addReleaseGoodProducts = {
|
|
17
18
|
async addReleaseGoodProducts(_: any, { name, orderInventories, existingOrderInventories }, context: any) {
|
|
@@ -56,13 +57,6 @@ export const addReleaseGoodProducts = {
|
|
|
56
57
|
}
|
|
57
58
|
})
|
|
58
59
|
|
|
59
|
-
if (foundPickingHistory) {
|
|
60
|
-
let pickedQty = Number(foundPickingHistory.qty.toString().replace('-', ''))
|
|
61
|
-
|
|
62
|
-
if (curOrderInv.releaseQty < pickedQty)
|
|
63
|
-
throw new Error(`${foundPickingHistory.palletId} has picked ${pickedQty}`)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
60
|
existingOrderInv = await tx.getRepository(OrderInventory).findOne({
|
|
67
61
|
where: {
|
|
68
62
|
releaseGood,
|
|
@@ -73,6 +67,17 @@ export const addReleaseGoodProducts = {
|
|
|
73
67
|
}
|
|
74
68
|
})
|
|
75
69
|
|
|
70
|
+
if (foundInv && foundInv.lockedQty == 0) {
|
|
71
|
+
foundInv.qty += Number(existingOrderInv.releaseQty)
|
|
72
|
+
foundInv.uomValue += Number(existingOrderInv.releaseUomValue)
|
|
73
|
+
foundInv.lockedQty = Number(existingOrderInv.releaseQty)
|
|
74
|
+
foundInv.lockedUomValue = Number(existingOrderInv.releaseUomValue)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (curOrderInv.releaseQty < existingOrderInv.pickedQty) {
|
|
78
|
+
throw new Error(`${curOrderInv.inventory.palletId} has already picked ${existingOrderInv.pickedQty}`)
|
|
79
|
+
}
|
|
80
|
+
|
|
76
81
|
if (curOrderInv.releaseQty === 0) {
|
|
77
82
|
foundInv.lockedQty = Number(foundInv.lockedQty) - Number(existingOrderInv.releaseQty)
|
|
78
83
|
foundInv.lockedUomValue = Number(foundInv.lockedUomValue) - Number(existingOrderInv.releaseUomValue)
|
|
@@ -84,6 +89,7 @@ export const addReleaseGoodProducts = {
|
|
|
84
89
|
curOrderInv = {
|
|
85
90
|
...existingOrderInv,
|
|
86
91
|
releaseQty: curOrderInv.releaseQty,
|
|
92
|
+
releaseUomValue: curOrderInv.releaseUomValue,
|
|
87
93
|
lockedUomValue: curOrderInv.lockedUomValue,
|
|
88
94
|
status: ORDER_INVENTORY_STATUS.CANCELLED
|
|
89
95
|
}
|
|
@@ -103,19 +109,46 @@ export const addReleaseGoodProducts = {
|
|
|
103
109
|
await tx.getRepository(WorksheetDetail).save(existingWorksheetDetail)
|
|
104
110
|
await tx.getRepository(OrderInventory).save(curOrderInv)
|
|
105
111
|
}
|
|
112
|
+
} else if (curOrderInv.releaseQty == existingOrderInv.pickedQty) {
|
|
113
|
+
curOrderInv = {
|
|
114
|
+
...existingOrderInv,
|
|
115
|
+
releaseQty: curOrderInv.releaseQty,
|
|
116
|
+
releaseUomValue: curOrderInv.releaseUomValue,
|
|
117
|
+
lockedUomValue: curOrderInv.lockedUomValue,
|
|
118
|
+
status: ORDER_INVENTORY_STATUS.PICKED
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
let existingWorksheetDetail: WorksheetDetail = await tx.getRepository(WorksheetDetail).findOne({
|
|
122
|
+
where: {
|
|
123
|
+
targetInventory: curOrderInv
|
|
124
|
+
}
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
existingWorksheetDetail = {
|
|
128
|
+
...existingWorksheetDetail,
|
|
129
|
+
status: WORKSHEET_STATUS.PICKED
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
await tx.getRepository(WorksheetDetail).save(existingWorksheetDetail)
|
|
133
|
+
await tx.getRepository(OrderInventory).save(curOrderInv)
|
|
106
134
|
} else {
|
|
107
|
-
foundInv.lockedQty = Number(curOrderInv.releaseQty)
|
|
108
|
-
foundInv.lockedUomValue = Number(curOrderInv.releaseUomValue)
|
|
109
135
|
foundInv.updater = user
|
|
136
|
+
foundInv.lockedQty =
|
|
137
|
+
foundInv.lockedQty - Number(existingOrderInv.releaseQty) + Number(curOrderInv.releaseQty)
|
|
138
|
+
foundInv.lockedUomValue =
|
|
139
|
+
foundInv.lockedUomValue - Number(existingOrderInv.releaseUomValue) + Number(curOrderInv.releaseUomValue)
|
|
110
140
|
|
|
111
141
|
await tx.getRepository(Inventory).save(foundInv)
|
|
112
142
|
|
|
113
143
|
if (existingOrderInv) {
|
|
144
|
+
const orderInvStatus = ORDER_INVENTORY_STATUS.PICKING
|
|
145
|
+
|
|
114
146
|
// if found existing OrderInventory and worksheetDetail then qty, uomValue, and status are updated
|
|
115
147
|
curOrderInv = {
|
|
116
148
|
...existingOrderInv,
|
|
117
149
|
releaseQty: curOrderInv.releaseQty,
|
|
118
|
-
releaseUomValue: curOrderInv.releaseUomValue
|
|
150
|
+
releaseUomValue: curOrderInv.releaseUomValue,
|
|
151
|
+
status: orderInvStatus
|
|
119
152
|
}
|
|
120
153
|
|
|
121
154
|
let existingWorksheetDetail: WorksheetDetail = await tx.getRepository(WorksheetDetail).findOne({
|
|
@@ -268,6 +301,15 @@ export const addReleaseGoodProducts = {
|
|
|
268
301
|
savedOrderInv.domain = domain
|
|
269
302
|
savedOrderInv.creator = user
|
|
270
303
|
savedOrderInv.updater = user
|
|
304
|
+
|
|
305
|
+
if (newOrderInv?.id) {
|
|
306
|
+
// newOrderInv will have id if it was updated from existingOrderInv
|
|
307
|
+
// this solution will remove ix_order-inventory_0 unique error
|
|
308
|
+
// ** please revise this resolver in future. looks like there's few
|
|
309
|
+
// things that can refactor
|
|
310
|
+
savedOrderInv.id = newOrderInv.id
|
|
311
|
+
}
|
|
312
|
+
|
|
271
313
|
savedOrderInv = await tx.getRepository(OrderInventory).save(savedOrderInv)
|
|
272
314
|
|
|
273
315
|
if (!existingOrderInv && pickingWorksheet) {
|