@things-factory/operato-wms 4.3.643 → 4.3.645
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/outbound/loading-v2/loading-execution-base.js +625 -153
- package/client/pages/outbound/loading-v2/loading-execution.js +239 -139
- package/client/pages/outbound/loading-v2/loading.js +297 -179
- package/client/pages/outbound/loading-v2/release-good-info.js +8 -8
- package/client/pages/outbound/picking-v2/picking.js +4 -0
- package/client/pages/outbound/show-ro-list-popup.js +17 -3
- package/client/pages/report/billing-module-report.js +421 -0
- package/client/route.js +4 -0
- package/package.json +4 -4
- package/server/graphql/resolvers/outbound/complete-load.ts +6 -1
- package/server/graphql/resolvers/outbound/find-loadable-release-good-by-bin.ts +154 -0
- package/server/graphql/resolvers/outbound/find-loadable-release-good.ts +82 -16
- package/server/graphql/resolvers/outbound/get-delivery-orders.ts +27 -3
- package/server/graphql/resolvers/outbound/index.ts +2 -0
- package/server/graphql/resolvers/outbound/load-by-qty.ts +19 -7
- package/server/graphql/resolvers/outbound/loading-worksheet-v2.ts +116 -22
- package/server/graphql/resolvers/outbound/sort-item.ts +56 -58
- package/server/graphql/resolvers/reports/billing-module-report.ts +372 -0
- package/server/graphql/resolvers/reports/index.ts +2 -0
- package/server/graphql/resolvers/reports/outbound-order-details-report.ts +5 -8
- package/server/graphql/resolvers/reports/outbound-serial-number-report.ts +1 -1
- package/server/graphql/resolvers/reports/pg-udf-query.ts +15 -13
- package/server/graphql/resolvers/zone-worksheet/zone-picking.ts +3 -3
- package/server/graphql/types/outbound/index.ts +2 -1
- package/server/graphql/types/reports/billing-module-report-list.ts +8 -0
- package/server/graphql/types/reports/billing-module-report.ts +9 -0
- package/server/graphql/types/reports/index.ts +6 -0
- package/things-factory.config.js +4 -0
- package/translations/en.json +7 -0
- package/translations/ko.json +2 -0
- package/translations/ms.json +2 -0
- package/translations/zh.json +2 -0
- package/dist-server/graphql/index.js +0 -33
- package/dist-server/graphql/index.js.map +0 -1
- package/dist-server/graphql/resolvers/board-setting/board-settings.js +0 -78
- package/dist-server/graphql/resolvers/board-setting/board-settings.js.map +0 -1
- package/dist-server/graphql/resolvers/board-setting/index.js +0 -6
- package/dist-server/graphql/resolvers/board-setting/index.js.map +0 -1
- package/dist-server/graphql/resolvers/custom/elccl/elccl-daily-collection-report.js +0 -87
- package/dist-server/graphql/resolvers/custom/elccl/elccl-daily-collection-report.js.map +0 -1
- package/dist-server/graphql/resolvers/custom/elccl/elccl-daily-order-inventory-report.js +0 -138
- package/dist-server/graphql/resolvers/custom/elccl/elccl-daily-order-inventory-report.js.map +0 -1
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-pallet-detail-report.js +0 -124
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-pallet-detail-report.js.map +0 -1
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js +0 -159
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js.map +0 -1
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js +0 -90
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js.map +0 -1
- package/dist-server/graphql/resolvers/custom/elccl/elccl-onhand-inventory-counter.js +0 -34
- package/dist-server/graphql/resolvers/custom/elccl/elccl-onhand-inventory-counter.js.map +0 -1
- package/dist-server/graphql/resolvers/custom/elccl/index.js +0 -11
- package/dist-server/graphql/resolvers/custom/elccl/index.js.map +0 -1
- package/dist-server/graphql/resolvers/custom/kimeda/index.js +0 -6
- package/dist-server/graphql/resolvers/custom/kimeda/index.js.map +0 -1
- package/dist-server/graphql/resolvers/custom/kimeda/kimeda-onhand-inventory-counter.js +0 -40
- package/dist-server/graphql/resolvers/custom/kimeda/kimeda-onhand-inventory-counter.js.map +0 -1
- package/dist-server/graphql/resolvers/dashboard/arrival-notices-by-status.js +0 -36
- package/dist-server/graphql/resolvers/dashboard/arrival-notices-by-status.js.map +0 -1
- package/dist-server/graphql/resolvers/dashboard/collection-orders-by-status.js +0 -24
- package/dist-server/graphql/resolvers/dashboard/collection-orders-by-status.js.map +0 -1
- package/dist-server/graphql/resolvers/dashboard/delivery-orders-by-status.js +0 -24
- package/dist-server/graphql/resolvers/dashboard/delivery-orders-by-status.js.map +0 -1
- package/dist-server/graphql/resolvers/dashboard/index.js +0 -12
- package/dist-server/graphql/resolvers/dashboard/index.js.map +0 -1
- package/dist-server/graphql/resolvers/dashboard/inventory-expiry-monitor.js +0 -65
- package/dist-server/graphql/resolvers/dashboard/inventory-expiry-monitor.js.map +0 -1
- package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js +0 -22
- package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js.map +0 -1
- package/dist-server/graphql/resolvers/dashboard/release-goods-by-status.js +0 -36
- package/dist-server/graphql/resolvers/dashboard/release-goods-by-status.js.map +0 -1
- package/dist-server/graphql/resolvers/dashboard/unit-inbounded-outbounded.js +0 -56
- package/dist-server/graphql/resolvers/dashboard/unit-inbounded-outbounded.js.map +0 -1
- package/dist-server/graphql/resolvers/index.js +0 -58
- package/dist-server/graphql/resolvers/index.js.map +0 -1
- package/dist-server/graphql/resolvers/inventory-comparison/index.js +0 -6
- package/dist-server/graphql/resolvers/inventory-comparison/index.js.map +0 -1
- package/dist-server/graphql/resolvers/inventory-comparison/inventory-comparison-list.js +0 -78
- package/dist-server/graphql/resolvers/inventory-comparison/inventory-comparison-list.js.map +0 -1
- package/dist-server/graphql/resolvers/opa-menu/index.js +0 -6
- package/dist-server/graphql/resolvers/opa-menu/index.js.map +0 -1
- package/dist-server/graphql/resolvers/opa-menu/opa-menus.js +0 -73
- package/dist-server/graphql/resolvers/opa-menu/opa-menus.js.map +0 -1
- package/dist-server/graphql/resolvers/other/add-release-good-products.js +0 -309
- package/dist-server/graphql/resolvers/other/add-release-good-products.js.map +0 -1
- package/dist-server/graphql/resolvers/other/index.js +0 -8
- package/dist-server/graphql/resolvers/other/index.js.map +0 -1
- package/dist-server/graphql/resolvers/other/page-settings.js +0 -135
- package/dist-server/graphql/resolvers/other/page-settings.js.map +0 -1
- package/dist-server/graphql/resolvers/outbound/complete-load.js +0 -109
- package/dist-server/graphql/resolvers/outbound/complete-load.js.map +0 -1
- package/dist-server/graphql/resolvers/outbound/find-loadable-release-good.js +0 -58
- package/dist-server/graphql/resolvers/outbound/find-loadable-release-good.js.map +0 -1
- package/dist-server/graphql/resolvers/outbound/get-delivery-orders.js +0 -29
- package/dist-server/graphql/resolvers/outbound/get-delivery-orders.js.map +0 -1
- package/dist-server/graphql/resolvers/outbound/get-loading-task.js +0 -100
- package/dist-server/graphql/resolvers/outbound/get-loading-task.js.map +0 -1
- package/dist-server/graphql/resolvers/outbound/index.js +0 -16
- package/dist-server/graphql/resolvers/outbound/index.js.map +0 -1
- package/dist-server/graphql/resolvers/outbound/load-by-qty.js +0 -109
- package/dist-server/graphql/resolvers/outbound/load-by-qty.js.map +0 -1
- package/dist-server/graphql/resolvers/outbound/loading-worksheet-v2.js +0 -137
- package/dist-server/graphql/resolvers/outbound/loading-worksheet-v2.js.map +0 -1
- package/dist-server/graphql/resolvers/outbound/my-loading-assignment-status.js +0 -32
- package/dist-server/graphql/resolvers/outbound/my-loading-assignment-status.js.map +0 -1
- package/dist-server/graphql/resolvers/outbound/sort-item.js +0 -65
- package/dist-server/graphql/resolvers/outbound/sort-item.js.map +0 -1
- package/dist-server/graphql/resolvers/outbound/undo-load.js +0 -72
- package/dist-server/graphql/resolvers/outbound/undo-load.js.map +0 -1
- package/dist-server/graphql/resolvers/outbound/warehouse-return.js +0 -101
- package/dist-server/graphql/resolvers/outbound/warehouse-return.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/analysis-picking-packing-report.js +0 -128
- package/dist-server/graphql/resolvers/reports/analysis-picking-packing-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/costing-report.js +0 -166
- package/dist-server/graphql/resolvers/reports/costing-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/cycle-count-report.js +0 -311
- package/dist-server/graphql/resolvers/reports/cycle-count-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +0 -198
- package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js +0 -140
- package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/index.js +0 -20
- package/dist-server/graphql/resolvers/reports/index.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/manifest-report.js +0 -98
- package/dist-server/graphql/resolvers/reports/manifest-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/non-loaded-inventory-report.js +0 -143
- package/dist-server/graphql/resolvers/reports/non-loaded-inventory-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +0 -287
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js +0 -143
- package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/pg-udf-query.js +0 -68
- package/dist-server/graphql/resolvers/reports/pg-udf-query.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/product-label-report.js +0 -57
- package/dist-server/graphql/resolvers/reports/product-label-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/release-inventory-report.js +0 -180
- package/dist-server/graphql/resolvers/reports/release-inventory-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/shortage-report.js +0 -165
- package/dist-server/graphql/resolvers/reports/shortage-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/tote-loading-qc-report.js +0 -129
- package/dist-server/graphql/resolvers/reports/tote-loading-qc-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/vas-report.js +0 -386
- package/dist-server/graphql/resolvers/reports/vas-report.js.map +0 -1
- package/dist-server/graphql/resolvers/shipping-provider/index.js +0 -6
- package/dist-server/graphql/resolvers/shipping-provider/index.js.map +0 -1
- package/dist-server/graphql/resolvers/shipping-provider/shipping-providers.js +0 -24
- package/dist-server/graphql/resolvers/shipping-provider/shipping-providers.js.map +0 -1
- package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/index.js +0 -6
- package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/index.js.map +0 -1
- package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.js +0 -97
- package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.js.map +0 -1
- package/dist-server/graphql/resolvers/zone-worksheet/activate-zone-worksheet.js +0 -91
- package/dist-server/graphql/resolvers/zone-worksheet/activate-zone-worksheet.js.map +0 -1
- package/dist-server/graphql/resolvers/zone-worksheet/assign-sorter.js +0 -36
- package/dist-server/graphql/resolvers/zone-worksheet/assign-sorter.js.map +0 -1
- package/dist-server/graphql/resolvers/zone-worksheet/generate-zone-worksheet.js +0 -106
- package/dist-server/graphql/resolvers/zone-worksheet/generate-zone-worksheet.js.map +0 -1
- package/dist-server/graphql/resolvers/zone-worksheet/get-zone-picking-task.js +0 -108
- package/dist-server/graphql/resolvers/zone-worksheet/get-zone-picking-task.js.map +0 -1
- package/dist-server/graphql/resolvers/zone-worksheet/index.js +0 -12
- package/dist-server/graphql/resolvers/zone-worksheet/index.js.map +0 -1
- package/dist-server/graphql/resolvers/zone-worksheet/zone-picking.js +0 -346
- package/dist-server/graphql/resolvers/zone-worksheet/zone-picking.js.map +0 -1
- package/dist-server/graphql/resolvers/zone-worksheet/zone-worksheet.js +0 -146
- package/dist-server/graphql/resolvers/zone-worksheet/zone-worksheet.js.map +0 -1
- package/dist-server/graphql/types/board-setting/board-setting.js +0 -16
- package/dist-server/graphql/types/board-setting/board-setting.js.map +0 -1
- package/dist-server/graphql/types/board-setting/index.js +0 -9
- package/dist-server/graphql/types/board-setting/index.js.map +0 -1
- package/dist-server/graphql/types/custom/elccl/elccl-daily-collection-report-list.js +0 -14
- package/dist-server/graphql/types/custom/elccl/elccl-daily-collection-report-list.js.map +0 -1
- package/dist-server/graphql/types/custom/elccl/elccl-daily-collection-report.js +0 -30
- package/dist-server/graphql/types/custom/elccl/elccl-daily-collection-report.js.map +0 -1
- package/dist-server/graphql/types/custom/elccl/elccl-daily-order-inventory-report-list.js +0 -14
- package/dist-server/graphql/types/custom/elccl/elccl-daily-order-inventory-report-list.js.map +0 -1
- package/dist-server/graphql/types/custom/elccl/elccl-daily-order-inventory-report.js +0 -25
- package/dist-server/graphql/types/custom/elccl/elccl-daily-order-inventory-report.js.map +0 -1
- package/dist-server/graphql/types/custom/elccl/elccl-inventory-report.js +0 -22
- package/dist-server/graphql/types/custom/elccl/elccl-inventory-report.js.map +0 -1
- package/dist-server/graphql/types/custom/elccl/elccl-inventory-summary-report-list.js +0 -14
- package/dist-server/graphql/types/custom/elccl/elccl-inventory-summary-report-list.js.map +0 -1
- package/dist-server/graphql/types/custom/elccl/elccl-inventory-summary-report.js +0 -23
- package/dist-server/graphql/types/custom/elccl/elccl-inventory-summary-report.js.map +0 -1
- package/dist-server/graphql/types/custom/elccl/elccl-pallet-detail-report.js +0 -22
- package/dist-server/graphql/types/custom/elccl/elccl-pallet-detail-report.js.map +0 -1
- package/dist-server/graphql/types/custom/elccl/index.js +0 -30
- package/dist-server/graphql/types/custom/elccl/index.js.map +0 -1
- package/dist-server/graphql/types/custom/kimeda/index.js +0 -7
- package/dist-server/graphql/types/custom/kimeda/index.js.map +0 -1
- package/dist-server/graphql/types/dashboard/index.js +0 -17
- package/dist-server/graphql/types/dashboard/index.js.map +0 -1
- package/dist-server/graphql/types/dashboard/inventory-expiry-counter.js +0 -16
- package/dist-server/graphql/types/dashboard/inventory-expiry-counter.js.map +0 -1
- package/dist-server/graphql/types/dashboard/inventory-expiry-status.js +0 -14
- package/dist-server/graphql/types/dashboard/inventory-expiry-status.js.map +0 -1
- package/dist-server/graphql/types/dashboard/order-status-counter.js +0 -14
- package/dist-server/graphql/types/dashboard/order-status-counter.js.map +0 -1
- package/dist-server/graphql/types/index.js +0 -70
- package/dist-server/graphql/types/index.js.map +0 -1
- package/dist-server/graphql/types/inventory-comparison/index.js +0 -13
- package/dist-server/graphql/types/inventory-comparison/index.js.map +0 -1
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison-list.js +0 -14
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison-list.js.map +0 -1
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison.js +0 -18
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison.js.map +0 -1
- package/dist-server/graphql/types/opa-menu/index.js +0 -9
- package/dist-server/graphql/types/opa-menu/index.js.map +0 -1
- package/dist-server/graphql/types/opa-menu/opa-menu.js +0 -45
- package/dist-server/graphql/types/opa-menu/opa-menu.js.map +0 -1
- package/dist-server/graphql/types/other/index.js +0 -21
- package/dist-server/graphql/types/other/index.js.map +0 -1
- package/dist-server/graphql/types/other/page-setting.js +0 -37
- package/dist-server/graphql/types/other/page-setting.js.map +0 -1
- package/dist-server/graphql/types/outbound/delivery-order-info-list.js +0 -14
- package/dist-server/graphql/types/outbound/delivery-order-info-list.js.map +0 -1
- package/dist-server/graphql/types/outbound/index.js +0 -23
- package/dist-server/graphql/types/outbound/index.js.map +0 -1
- package/dist-server/graphql/types/outbound/loading-assignment.js +0 -15
- package/dist-server/graphql/types/outbound/loading-assignment.js.map +0 -1
- package/dist-server/graphql/types/outbound/loading-worksheet-type.js +0 -25
- package/dist-server/graphql/types/outbound/loading-worksheet-type.js.map +0 -1
- package/dist-server/graphql/types/reports/analysis-picking-packing-report-list.js +0 -14
- package/dist-server/graphql/types/reports/analysis-picking-packing-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/analysis-picking-packing-report.js +0 -18
- package/dist-server/graphql/types/reports/analysis-picking-packing-report.js.map +0 -1
- package/dist-server/graphql/types/reports/costing-report-list.js +0 -14
- package/dist-server/graphql/types/reports/costing-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/costing-report.js +0 -19
- package/dist-server/graphql/types/reports/costing-report.js.map +0 -1
- package/dist-server/graphql/types/reports/cycle-count-report-list.js +0 -14
- package/dist-server/graphql/types/reports/cycle-count-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/cycle-count-report.js +0 -35
- package/dist-server/graphql/types/reports/cycle-count-report.js.map +0 -1
- package/dist-server/graphql/types/reports/inbound-order-details-report-list.js +0 -14
- package/dist-server/graphql/types/reports/inbound-order-details-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/inbound-order-details-report.js +0 -60
- package/dist-server/graphql/types/reports/inbound-order-details-report.js.map +0 -1
- package/dist-server/graphql/types/reports/inbound-serial-number-report-list.js +0 -14
- package/dist-server/graphql/types/reports/inbound-serial-number-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/inbound-serial-number-report.js +0 -23
- package/dist-server/graphql/types/reports/inbound-serial-number-report.js.map +0 -1
- package/dist-server/graphql/types/reports/index.js +0 -84
- package/dist-server/graphql/types/reports/index.js.map +0 -1
- package/dist-server/graphql/types/reports/loading-qc-report-list.js +0 -14
- package/dist-server/graphql/types/reports/loading-qc-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/loading-qc-report.js +0 -24
- package/dist-server/graphql/types/reports/loading-qc-report.js.map +0 -1
- package/dist-server/graphql/types/reports/manifest-report-list.js +0 -14
- package/dist-server/graphql/types/reports/manifest-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/manifest-report-type.js +0 -23
- package/dist-server/graphql/types/reports/manifest-report-type.js.map +0 -1
- package/dist-server/graphql/types/reports/non-loaded-inventory-report-list.js +0 -14
- package/dist-server/graphql/types/reports/non-loaded-inventory-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/non-loaded-inventory-report.js +0 -23
- package/dist-server/graphql/types/reports/non-loaded-inventory-report.js.map +0 -1
- package/dist-server/graphql/types/reports/outbound-order-details-report-list.js +0 -14
- package/dist-server/graphql/types/reports/outbound-order-details-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/outbound-order-details-report.js +0 -79
- package/dist-server/graphql/types/reports/outbound-order-details-report.js.map +0 -1
- package/dist-server/graphql/types/reports/outbound-serial-number-report-list.js +0 -14
- package/dist-server/graphql/types/reports/outbound-serial-number-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/outbound-serial-number-report.js +0 -25
- package/dist-server/graphql/types/reports/outbound-serial-number-report.js.map +0 -1
- package/dist-server/graphql/types/reports/pg-udf-query-list.js +0 -13
- package/dist-server/graphql/types/reports/pg-udf-query-list.js.map +0 -1
- package/dist-server/graphql/types/reports/product-label-report-list.js +0 -14
- package/dist-server/graphql/types/reports/product-label-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/product-label-report.js +0 -16
- package/dist-server/graphql/types/reports/product-label-report.js.map +0 -1
- package/dist-server/graphql/types/reports/release-inventory-report-list.js +0 -14
- package/dist-server/graphql/types/reports/release-inventory-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/release-inventory-report.js +0 -29
- package/dist-server/graphql/types/reports/release-inventory-report.js.map +0 -1
- package/dist-server/graphql/types/reports/shortage-report-list.js +0 -14
- package/dist-server/graphql/types/reports/shortage-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/shortage-report-type.js +0 -26
- package/dist-server/graphql/types/reports/shortage-report-type.js.map +0 -1
- package/dist-server/graphql/types/reports/vas-report-list.js +0 -20
- package/dist-server/graphql/types/reports/vas-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/vas-report.js +0 -29
- package/dist-server/graphql/types/reports/vas-report.js.map +0 -1
- package/dist-server/graphql/types/shipping-provider/index.js +0 -10
- package/dist-server/graphql/types/shipping-provider/index.js.map +0 -1
- package/dist-server/graphql/types/shipping-provider/shipping-provider-list.js +0 -13
- package/dist-server/graphql/types/shipping-provider/shipping-provider-list.js.map +0 -1
- package/dist-server/graphql/types/shipping-provider/shipping-provider.js +0 -13
- package/dist-server/graphql/types/shipping-provider/shipping-provider.js.map +0 -1
- package/dist-server/graphql/types/warehouse-inventory-adjustment/index.js +0 -9
- package/dist-server/graphql/types/warehouse-inventory-adjustment/index.js.map +0 -1
- package/dist-server/graphql/types/zone-worksheet/index.js +0 -22
- package/dist-server/graphql/types/zone-worksheet/index.js.map +0 -1
- package/dist-server/graphql/types/zone-worksheet/zone-picking-worksheet.js +0 -18
- package/dist-server/graphql/types/zone-worksheet/zone-picking-worksheet.js.map +0 -1
- package/dist-server/graphql/types/zone-worksheet/zone-worksheet-overview-list.js +0 -13
- package/dist-server/graphql/types/zone-worksheet/zone-worksheet-overview-list.js.map +0 -1
- package/dist-server/graphql/types/zone-worksheet/zone-worksheet-overview.js +0 -16
- package/dist-server/graphql/types/zone-worksheet/zone-worksheet-overview.js.map +0 -1
- package/dist-server/index.js +0 -20
- package/dist-server/index.js.map +0 -1
- package/dist-server/migrations/1568858861188-SeedSetting.js +0 -51
- package/dist-server/migrations/1568858861188-SeedSetting.js.map +0 -1
- package/dist-server/migrations/1623308919899-SeedLocationRecommendSetting.js +0 -35
- package/dist-server/migrations/1623308919899-SeedLocationRecommendSetting.js.map +0 -1
- package/dist-server/migrations/1623381200659-SeedStoringRule.js +0 -33
- package/dist-server/migrations/1623381200659-SeedStoringRule.js.map +0 -1
- package/dist-server/migrations/1687413760311-UpdateProductDetailStockQty.js +0 -36
- package/dist-server/migrations/1687413760311-UpdateProductDetailStockQty.js.map +0 -1
- package/dist-server/migrations/1687415141200-InsertNewProductDetailStock.js +0 -32
- package/dist-server/migrations/1687415141200-InsertNewProductDetailStock.js.map +0 -1
- package/dist-server/migrations/index.js +0 -12
- package/dist-server/migrations/index.js.map +0 -1
- package/dist-server/opa-app-setting-constants.js +0 -15
- package/dist-server/opa-app-setting-constants.js.map +0 -1
- package/dist-server/routes.js +0 -3
- package/dist-server/routes.js.map +0 -1
- package/dist-server/utils/index.js +0 -18
- package/dist-server/utils/index.js.map +0 -1
- package/dist-server/utils/report-query-util.js +0 -42
- package/dist-server/utils/report-query-util.js.map +0 -1
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import { EntityManager } from 'typeorm'
|
|
2
|
+
|
|
3
|
+
import { User } from '@things-factory/auth-base'
|
|
4
|
+
import { Bizplace } from '@things-factory/biz-base'
|
|
5
|
+
import { ListParam } from '@things-factory/shell'
|
|
6
|
+
|
|
7
|
+
import { rawProductsQuery } from '../../../utils'
|
|
8
|
+
|
|
9
|
+
export const billingModuleReport = {
|
|
10
|
+
async billingModuleReport(_: any, params: ListParam, context: any) {
|
|
11
|
+
try {
|
|
12
|
+
const { tx }: { tx: EntityManager } = context.state
|
|
13
|
+
let bizplaceFilter = { name: '', operator: '', value: '' }
|
|
14
|
+
let userFilter = params.filters.find(data => data.name === 'user')
|
|
15
|
+
let fromDate = params.filters.find(data => data.name === 'fromDate')
|
|
16
|
+
let toDate = params.filters.find(data => data.name === 'toDate')
|
|
17
|
+
let locationType = params.filters.find(data => data.name === 'locationType')
|
|
18
|
+
|
|
19
|
+
if (userFilter) {
|
|
20
|
+
const user: User = await tx.getRepository(User).findOne({
|
|
21
|
+
where: { id: userFilter.value },
|
|
22
|
+
relations: ['bizplaces']
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const bizplace: Bizplace = user.bizplaces[0]
|
|
26
|
+
|
|
27
|
+
if (!bizplace) throw 'Invalid input'
|
|
28
|
+
|
|
29
|
+
bizplaceFilter = { name: 'bizplace', operator: 'eq', value: bizplace.id }
|
|
30
|
+
} else {
|
|
31
|
+
bizplaceFilter = params.filters.find(data => data.name === 'bizplace')
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (!bizplaceFilter || !fromDate || !toDate) throw 'Invalid input'
|
|
35
|
+
|
|
36
|
+
const bizplace: Bizplace = await tx.getRepository(Bizplace).findOne({
|
|
37
|
+
id: bizplaceFilter.value
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
// Prepare dynamic locationType clause and query params
|
|
41
|
+
const queryParams = [context.state.domain.id,bizplace.id]
|
|
42
|
+
let locationTypeClause = ''
|
|
43
|
+
|
|
44
|
+
if (locationType && locationType.value) {
|
|
45
|
+
locationTypeClause = 'AND l.type = $3'
|
|
46
|
+
queryParams.push(locationType.value)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
console.time('temp')
|
|
50
|
+
await tx.query(
|
|
51
|
+
`
|
|
52
|
+
CREATE TEMP TABLE temp_data_src ON COMMIT DROP AS (
|
|
53
|
+
-- Inventory Histories
|
|
54
|
+
SELECT
|
|
55
|
+
invh.inventory_id,
|
|
56
|
+
UPPER(TRIM(invh.packing_type)) AS packing_type,
|
|
57
|
+
CASE
|
|
58
|
+
WHEN invh.order_no ILIKE 'RTO-%' OR invh.transaction_type = 'RETURN' THEN REPLACE((transaction_type)::text, 'UNLOADING', 'RETURN')
|
|
59
|
+
WHEN invh.transaction_type = 'RETURN' THEN REPLACE((transaction_type)::text, 'RETURN', 'RETURN')
|
|
60
|
+
ELSE invh.transaction_type
|
|
61
|
+
END AS transaction_type,
|
|
62
|
+
invh.status, invh.created_at + INTERVAL '8 hours' AS created_at,
|
|
63
|
+
invh.qty,
|
|
64
|
+
invh.opening_qty,
|
|
65
|
+
pd.volume,
|
|
66
|
+
l."type" as location,
|
|
67
|
+
w."type" as warehouse,
|
|
68
|
+
invh.domain_id,
|
|
69
|
+
invh.bizplace_id
|
|
70
|
+
FROM reduced_inventory_histories invh
|
|
71
|
+
INNER JOIN inventories i on i.id = invh.inventory_id
|
|
72
|
+
INNER JOIN locations l on l.id = i.location_id
|
|
73
|
+
INNER JOIN warehouses w on w.id = l.warehouse_id
|
|
74
|
+
LEFT JOIN product_details pd ON pd.id = i.product_detail_id
|
|
75
|
+
WHERE
|
|
76
|
+
invh.domain_id = $1
|
|
77
|
+
AND invh.bizplace_id = $2
|
|
78
|
+
${locationTypeClause}
|
|
79
|
+
UNION ALL
|
|
80
|
+
|
|
81
|
+
-- VAS Records
|
|
82
|
+
SELECT
|
|
83
|
+
ov.inventory_id,
|
|
84
|
+
UPPER(TRIM(COALESCE(ov.new_packing_type, ov.packing_type))) AS packing_type,
|
|
85
|
+
'VAS' AS transaction_type,
|
|
86
|
+
'VAS' AS status,
|
|
87
|
+
ov.updated_at + interval '8 hours' AS created_at,
|
|
88
|
+
COALESCE(ov.adjusted_output_qty, ov.qty) AS qty,
|
|
89
|
+
'0' as opening_qty,
|
|
90
|
+
COALESCE(p.volume, 0) as volume,
|
|
91
|
+
'-' as location,
|
|
92
|
+
'-' as warehouse,
|
|
93
|
+
ov.domain_id,
|
|
94
|
+
ov.bizplace_id
|
|
95
|
+
FROM order_vass ov
|
|
96
|
+
LEFT JOIN products p ON p.id = ov.target_product_id
|
|
97
|
+
WHERE
|
|
98
|
+
ov.domain_id = $1
|
|
99
|
+
AND ov.bizplace_id = $2
|
|
100
|
+
AND ov.qty IS NOT NULL
|
|
101
|
+
);
|
|
102
|
+
`,
|
|
103
|
+
queryParams
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
console.timeEnd('temp')
|
|
107
|
+
|
|
108
|
+
const result: any = await tx.query(
|
|
109
|
+
`
|
|
110
|
+
WITH RECURSIVE date_series AS (
|
|
111
|
+
SELECT
|
|
112
|
+
CASE
|
|
113
|
+
WHEN $1::DATE < (SELECT MIN(created_at)::DATE FROM temp_data_src)
|
|
114
|
+
THEN (SELECT (MIN(created_at)+ INTERVAL '1 DAY')::DATE FROM temp_data_src)
|
|
115
|
+
ELSE $1 ::DATE
|
|
116
|
+
END AS query_date
|
|
117
|
+
UNION ALL
|
|
118
|
+
SELECT (query_date + INTERVAL '1 DAY')::DATE
|
|
119
|
+
FROM date_series
|
|
120
|
+
WHERE query_date < $2
|
|
121
|
+
),
|
|
122
|
+
distinct_groups AS (
|
|
123
|
+
SELECT DISTINCT
|
|
124
|
+
UPPER(TRIM(packing_type)) AS packing_type,
|
|
125
|
+
warehouse,
|
|
126
|
+
location
|
|
127
|
+
FROM temp_data_src
|
|
128
|
+
WHERE packing_type IS NOT NULL
|
|
129
|
+
),
|
|
130
|
+
date_packing_combinations AS (
|
|
131
|
+
SELECT DISTINCT ds.query_date, pt.packing_type
|
|
132
|
+
FROM date_series ds
|
|
133
|
+
CROSS JOIN distinct_groups pt
|
|
134
|
+
),
|
|
135
|
+
order_number AS(
|
|
136
|
+
SELECT
|
|
137
|
+
rg.name,
|
|
138
|
+
(rg.updated_at + interval '8 hours')::DATE AS query_date
|
|
139
|
+
FROM release_goods rg
|
|
140
|
+
INNER JOIN (SELECT domain_id, bizplace_id FROM temp_data_src src limit 1)src
|
|
141
|
+
ON rg.domain_id = src.domain_id
|
|
142
|
+
AND rg.bizplace_id = src.bizplace_id
|
|
143
|
+
WHERE rg.status = 'DONE'
|
|
144
|
+
),
|
|
145
|
+
inbound AS (
|
|
146
|
+
SELECT
|
|
147
|
+
dpc.query_date,
|
|
148
|
+
SUM(COALESCE(src.opening_qty, 0)) AS qty,
|
|
149
|
+
'Inbound ' || '(' || INITCAP(dpc.packing_type) || ')' AS data_type
|
|
150
|
+
FROM date_packing_combinations dpc
|
|
151
|
+
LEFT JOIN temp_data_src src
|
|
152
|
+
ON dpc.query_date = src.created_at::DATE
|
|
153
|
+
AND src.transaction_type = 'PUTAWAY'
|
|
154
|
+
AND dpc.packing_type = src.packing_type
|
|
155
|
+
GROUP BY dpc.query_date, dpc.packing_type
|
|
156
|
+
ORDER BY dpc.query_date
|
|
157
|
+
),
|
|
158
|
+
outbound AS (
|
|
159
|
+
SELECT
|
|
160
|
+
dpc.query_date,
|
|
161
|
+
SUM(ABS(COALESCE(src.qty, 0))) AS qty,
|
|
162
|
+
'Outbound ' || '(' || INITCAP(dpc.packing_type) || ')' AS data_type
|
|
163
|
+
FROM date_packing_combinations dpc
|
|
164
|
+
LEFT JOIN temp_data_src src
|
|
165
|
+
ON dpc.query_date = src.created_at::DATE
|
|
166
|
+
AND src.transaction_type = 'PICKING'
|
|
167
|
+
AND dpc.packing_type = src.packing_type
|
|
168
|
+
GROUP BY dpc.query_date, dpc.packing_type
|
|
169
|
+
ORDER BY dpc.query_date
|
|
170
|
+
),
|
|
171
|
+
return AS (
|
|
172
|
+
SELECT
|
|
173
|
+
dpc.query_date,
|
|
174
|
+
SUM(COALESCE(src.qty, 0)) AS qty,
|
|
175
|
+
'Return ' || '(' || INITCAP(dpc.packing_type) || ')' AS data_type
|
|
176
|
+
FROM date_packing_combinations dpc
|
|
177
|
+
LEFT JOIN temp_data_src src
|
|
178
|
+
ON dpc.query_date = src.created_at::DATE
|
|
179
|
+
AND src.transaction_type = 'RETURN'
|
|
180
|
+
AND dpc.packing_type = src.packing_type
|
|
181
|
+
GROUP BY dpc.query_date, dpc.packing_type
|
|
182
|
+
ORDER BY dpc.query_date
|
|
183
|
+
),
|
|
184
|
+
vas AS(
|
|
185
|
+
SELECT
|
|
186
|
+
dpc.query_date,
|
|
187
|
+
SUM(COALESCE(src.qty, 0)) AS qty,
|
|
188
|
+
'Vas ' || '(' || INITCAP(dpc.packing_type) || ')' AS data_type
|
|
189
|
+
FROM date_packing_combinations dpc
|
|
190
|
+
LEFT JOIN temp_data_src src
|
|
191
|
+
ON dpc.query_date = src.created_at::DATE
|
|
192
|
+
AND src.transaction_type = 'VAS'
|
|
193
|
+
AND dpc.packing_type = src.packing_type
|
|
194
|
+
GROUP BY dpc.query_date, dpc.packing_type
|
|
195
|
+
ORDER BY dpc.query_date
|
|
196
|
+
),
|
|
197
|
+
orders AS(
|
|
198
|
+
SELECT
|
|
199
|
+
dpc.query_date,
|
|
200
|
+
COUNT(DISTINCT rg.name) AS qty,
|
|
201
|
+
'Total Order Fulfilled' AS data_type
|
|
202
|
+
FROM date_series dpc
|
|
203
|
+
LEFT JOIN order_number rg ON dpc.query_date = rg.query_date
|
|
204
|
+
GROUP BY dpc.query_date
|
|
205
|
+
ORDER BY dpc.query_date
|
|
206
|
+
),
|
|
207
|
+
total_unit_processed AS(
|
|
208
|
+
SELECT
|
|
209
|
+
o.query_date,
|
|
210
|
+
SUM(ABS(qty)) as qty,
|
|
211
|
+
'Total Unit Processed' AS data_type
|
|
212
|
+
FROM outbound o
|
|
213
|
+
GROUP BY o.query_date
|
|
214
|
+
ORDER BY o.query_date
|
|
215
|
+
),
|
|
216
|
+
inbound_volume AS (
|
|
217
|
+
SELECT
|
|
218
|
+
dpc.query_date,
|
|
219
|
+
SUM(COALESCE(src.qty * src.volume, 0)) AS qty,
|
|
220
|
+
'Inbound (CBM)' AS data_type
|
|
221
|
+
FROM date_packing_combinations dpc
|
|
222
|
+
LEFT JOIN temp_data_src src
|
|
223
|
+
ON dpc.query_date = src.created_at::DATE
|
|
224
|
+
AND src.transaction_type IN ('UNLOADING', 'RETURN')
|
|
225
|
+
AND dpc.packing_type = src.packing_type
|
|
226
|
+
GROUP BY dpc.query_date
|
|
227
|
+
),
|
|
228
|
+
outbound_volume AS (
|
|
229
|
+
SELECT
|
|
230
|
+
dpc.query_date,
|
|
231
|
+
SUM(ABS(COALESCE(src.qty * src.volume, 0))) AS qty,
|
|
232
|
+
'Outbound (CBM)' AS data_type
|
|
233
|
+
FROM date_packing_combinations dpc
|
|
234
|
+
LEFT JOIN temp_data_src src
|
|
235
|
+
ON dpc.query_date = src.created_at::DATE
|
|
236
|
+
AND src.transaction_type = 'PICKING'
|
|
237
|
+
AND dpc.packing_type = src.packing_type
|
|
238
|
+
GROUP BY dpc.query_date
|
|
239
|
+
),
|
|
240
|
+
vas_volume AS (
|
|
241
|
+
SELECT
|
|
242
|
+
dpc.query_date,
|
|
243
|
+
SUM(COALESCE(src.qty * src.volume, 0)) AS qty,
|
|
244
|
+
'VAS (CBM)' AS data_type
|
|
245
|
+
FROM date_packing_combinations dpc
|
|
246
|
+
LEFT JOIN temp_data_src src
|
|
247
|
+
ON dpc.query_date = src.created_at::DATE
|
|
248
|
+
AND src.transaction_type = 'VAS'
|
|
249
|
+
AND dpc.packing_type = src.packing_type
|
|
250
|
+
GROUP BY dpc.query_date
|
|
251
|
+
),
|
|
252
|
+
-- Determine the cutoff date from date_series.
|
|
253
|
+
cutoff AS (
|
|
254
|
+
SELECT MIN(query_date) AS cutoff_date
|
|
255
|
+
FROM date_series
|
|
256
|
+
),
|
|
257
|
+
-- For each unique inventory_id, return the row with the latest created_at (before cutoff)
|
|
258
|
+
-- and calculate its effective opening using opening_qty + qty.
|
|
259
|
+
latest_opening AS (
|
|
260
|
+
SELECT DISTINCT ON (inventory_id)
|
|
261
|
+
inventory_id,
|
|
262
|
+
packing_type,
|
|
263
|
+
warehouse,
|
|
264
|
+
location,
|
|
265
|
+
(COALESCE(opening_qty, 0) + COALESCE(qty, 0)) AS effective_opening,
|
|
266
|
+
created_at AS last_record_date
|
|
267
|
+
FROM temp_data_src, cutoff
|
|
268
|
+
WHERE created_at::DATE < cutoff.cutoff_date
|
|
269
|
+
ORDER BY inventory_id, created_at DESC
|
|
270
|
+
),
|
|
271
|
+
---------------group by locations----------------
|
|
272
|
+
-- Aggregate the effective_opening from the latest record (per inventory_id) by group.
|
|
273
|
+
first_count AS (
|
|
274
|
+
SELECT
|
|
275
|
+
cutoff.cutoff_date AS query_date,
|
|
276
|
+
SUM(effective_opening) AS opening_balance,
|
|
277
|
+
0 AS closing_qty,
|
|
278
|
+
packing_type,
|
|
279
|
+
warehouse,
|
|
280
|
+
location
|
|
281
|
+
FROM latest_opening, cutoff
|
|
282
|
+
GROUP BY packing_type, warehouse, location, cutoff.cutoff_date
|
|
283
|
+
),
|
|
284
|
+
day_transaction AS (
|
|
285
|
+
SELECT
|
|
286
|
+
ds.query_date,
|
|
287
|
+
COALESCE(SUM(src.qty), 0) AS qty,
|
|
288
|
+
dg.packing_type, dg.warehouse, dg.location
|
|
289
|
+
FROM date_series ds
|
|
290
|
+
CROSS JOIN distinct_groups dg
|
|
291
|
+
LEFT JOIN temp_data_src src
|
|
292
|
+
ON src.created_at::DATE = ds.query_date
|
|
293
|
+
AND src.packing_type = dg.packing_type
|
|
294
|
+
AND src.warehouse = dg.warehouse
|
|
295
|
+
AND src.location = dg.location
|
|
296
|
+
GROUP BY ds.query_date, dg.packing_type, dg.warehouse, dg.location
|
|
297
|
+
),
|
|
298
|
+
c_transaction AS (
|
|
299
|
+
SELECT
|
|
300
|
+
dt.query_date,
|
|
301
|
+
dt.qty,
|
|
302
|
+
SUM(dt.qty) OVER (PARTITION BY dt.packing_type, dt.warehouse, dt.location ORDER BY dt.query_date) AS c_qty,
|
|
303
|
+
dt.packing_type, dt.warehouse, dt.location
|
|
304
|
+
FROM day_transaction dt
|
|
305
|
+
),
|
|
306
|
+
by_day_qty AS(
|
|
307
|
+
SELECT * from first_count
|
|
308
|
+
UNION ALL
|
|
309
|
+
SELECT
|
|
310
|
+
(ct.query_date + interval '1 day')::DATE as query_date,
|
|
311
|
+
fc.opening_balance + ct.c_qty AS opening_balance,
|
|
312
|
+
0 AS closing_qty,
|
|
313
|
+
ct.packing_type, ct.warehouse, ct.location
|
|
314
|
+
FROM c_transaction ct
|
|
315
|
+
JOIN first_count fc
|
|
316
|
+
ON fc.packing_type = ct.packing_type
|
|
317
|
+
AND ct.warehouse = fc.warehouse
|
|
318
|
+
AND ct.location = fc.location
|
|
319
|
+
WHERE ct.query_date < (SELECT MAX(query_date) FROM date_series)
|
|
320
|
+
ORDER BY packing_type, warehouse, location, query_date
|
|
321
|
+
),
|
|
322
|
+
by_location AS(
|
|
323
|
+
SELECT
|
|
324
|
+
query_date,
|
|
325
|
+
opening_balance as opening_balance,
|
|
326
|
+
INITCAP(SUBSTRING(warehouse FROM 1 FOR 1)) || LOWER(SUBSTRING(warehouse FROM 2)) || ' ' ||
|
|
327
|
+
INITCAP(SUBSTRING(location FROM 1 FOR 1)) || LOWER(SUBSTRING(location FROM 2)) || ' (' ||
|
|
328
|
+
INITCAP(SUBSTRING(packing_type FROM 1 FOR 1)) || LOWER(SUBSTRING(packing_type FROM 2)) || ')' as data_type
|
|
329
|
+
FROM by_day_qty
|
|
330
|
+
ORDER BY data_type, query_date
|
|
331
|
+
)
|
|
332
|
+
|
|
333
|
+
SELECT * FROM inbound
|
|
334
|
+
UNION ALL
|
|
335
|
+
SELECT * FROM outbound
|
|
336
|
+
UNION ALL
|
|
337
|
+
SELECT * FROM return
|
|
338
|
+
UNION ALL
|
|
339
|
+
SELECT * FROM vas
|
|
340
|
+
UNION ALL
|
|
341
|
+
SELECT * FROM orders
|
|
342
|
+
UNION ALL
|
|
343
|
+
SELECT * FROM total_unit_processed
|
|
344
|
+
UNION ALL
|
|
345
|
+
SELECT * FROM by_location
|
|
346
|
+
UNION ALL
|
|
347
|
+
SELECT * FROM inbound_volume
|
|
348
|
+
UNION ALL
|
|
349
|
+
SELECT * FROM outbound_volume
|
|
350
|
+
UNION ALL
|
|
351
|
+
SELECT * FROM vas_volume
|
|
352
|
+
ORDER BY query_date, data_type;
|
|
353
|
+
`,
|
|
354
|
+
[fromDate.value, toDate.value]
|
|
355
|
+
)
|
|
356
|
+
|
|
357
|
+
let items = result.map(itm => {
|
|
358
|
+
return {
|
|
359
|
+
date: itm.query_date,
|
|
360
|
+
packingType: itm.data_type,
|
|
361
|
+
quantity: itm.qty
|
|
362
|
+
}
|
|
363
|
+
})
|
|
364
|
+
|
|
365
|
+
return {
|
|
366
|
+
items
|
|
367
|
+
}
|
|
368
|
+
} catch (error) {
|
|
369
|
+
throw error
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
@@ -11,6 +11,7 @@ import { productLabelReport } from './product-label-report'
|
|
|
11
11
|
import { releaseInventoryReport } from './release-inventory-report'
|
|
12
12
|
import { shortageReport } from './shortage-report'
|
|
13
13
|
import { loadingQcReport } from './tote-loading-qc-report'
|
|
14
|
+
import { billingModuleReport } from './billing-module-report'
|
|
14
15
|
import {
|
|
15
16
|
orderVasReport,
|
|
16
17
|
vasReport
|
|
@@ -33,5 +34,6 @@ export const Query = {
|
|
|
33
34
|
...cycleCountReport,
|
|
34
35
|
...nonLoadedOrderInventoriesReport,
|
|
35
36
|
...manifestReport,
|
|
37
|
+
...billingModuleReport,
|
|
36
38
|
...pgUdfQuery
|
|
37
39
|
}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { EntityManager } from 'typeorm'
|
|
2
|
-
|
|
3
2
|
import { User } from '@things-factory/auth-base'
|
|
4
3
|
import { Bizplace } from '@things-factory/biz-base'
|
|
5
|
-
import {
|
|
6
|
-
Domain,
|
|
7
|
-
ListParam
|
|
8
|
-
} from '@things-factory/shell'
|
|
9
|
-
|
|
4
|
+
import { Domain, ListParam } from '@things-factory/shell'
|
|
10
5
|
import { rawProductsQuery } from '../../../utils'
|
|
11
6
|
|
|
12
7
|
export const outboundOrderDetailsReport = {
|
|
@@ -96,9 +91,11 @@ export const outboundOrderDetailsReport = {
|
|
|
96
91
|
where rg.bizplace_id = $2 and rg.domain_id = $1
|
|
97
92
|
and rg.created_at >= $3 and rg.created_at <= $4
|
|
98
93
|
and oi.status <> 'REPLACED'
|
|
94
|
+
and oi.release_qty > 0
|
|
99
95
|
${status ? `and rg.status = '${status.value}' ` : ``}
|
|
100
96
|
${binLocation ? `and l.name ilike '${binLocation.value}' ` : ``}
|
|
101
97
|
${priorityDelivery ? `and rg.priority_delivery = ${priorityDelivery.value} ` : ``}
|
|
98
|
+
and oi.release_qty > 0
|
|
102
99
|
) src
|
|
103
100
|
where 1=1
|
|
104
101
|
${extraQueryFilters}
|
|
@@ -134,6 +131,7 @@ export const outboundOrderDetailsReport = {
|
|
|
134
131
|
and rg.assigned_inventory = false
|
|
135
132
|
${status ? `and rg.status = '${status.value}' ` : ``}
|
|
136
133
|
and rg.assigned_inventory = false
|
|
134
|
+
and op.release_qty > 0
|
|
137
135
|
) src2
|
|
138
136
|
where 1=1
|
|
139
137
|
${extraQueryFilters}
|
|
@@ -213,8 +211,7 @@ export const outboundOrderDetailsReport = {
|
|
|
213
211
|
? `and wpack.ended_at BETWEEN '${fromDate.value}' and '${toDate.value}' and wpack.status = 'DONE'`
|
|
214
212
|
: ''
|
|
215
213
|
}
|
|
216
|
-
${
|
|
217
|
-
byPackingComplete.value ? `ORDER BY wpack.ended_at DESC` : `ORDER BY order_created_at DESC` }
|
|
214
|
+
${byPackingComplete.value ? `ORDER BY wpack.ended_at DESC` : `ORDER BY order_created_at DESC`}
|
|
218
215
|
offset $1 limit $2
|
|
219
216
|
) src
|
|
220
217
|
`,
|
|
@@ -92,7 +92,7 @@ export const outboundSerialNumberReport = {
|
|
|
92
92
|
inner join temp_products p on p.id = i.product_id
|
|
93
93
|
left join product_details pd on pd.product_id = p.id and pd.packing_type = i.packing_type and pd.packing_size = i.packing_size
|
|
94
94
|
inner join release_goods rg on rg.id = ii.outbound_order_id::uuid
|
|
95
|
-
left join worksheets w on w.
|
|
95
|
+
left join worksheets w on w.release_good_id = rg.id and w.type = 'PICKING'
|
|
96
96
|
where
|
|
97
97
|
i.domain_id = $1 and i.bizplace_id = $2
|
|
98
98
|
and coalesce(w.started_at, ii.created_at) between $3 and $4
|
|
@@ -3,20 +3,25 @@ import { Domain, ListParam } from '@things-factory/shell'
|
|
|
3
3
|
|
|
4
4
|
export const pgUdfQuery = {
|
|
5
5
|
async pgUdfQuery(_: any, params: ListParam, context: any) {
|
|
6
|
-
const { domain, tx }: { domain: Domain
|
|
6
|
+
const { domain, tx }: { domain: Domain; tx: EntityManager } = context.state
|
|
7
7
|
let udfName = params.filters.find(param => param.name === 'udf')
|
|
8
|
+
let domainParam = params.filters.find(param => param.name === 'domain_id')
|
|
8
9
|
|
|
9
10
|
try {
|
|
10
11
|
if (!udfName?.value) {
|
|
11
12
|
throw new Error('UDF name is required')
|
|
12
13
|
}
|
|
13
14
|
|
|
15
|
+
if (!domainParam?.value) {
|
|
16
|
+
params.filters.push({ name: 'domain_id', operator: 'eq', value: domain.id })
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
// Remove the udf filter and convert remaining filters to an object
|
|
15
20
|
const parameters = params.filters
|
|
16
21
|
.filter(f => f.name !== 'udf')
|
|
17
22
|
.map(filter => ({
|
|
18
23
|
[filter.name]: filter.value
|
|
19
|
-
}))
|
|
24
|
+
}))
|
|
20
25
|
|
|
21
26
|
return { items: JSON.stringify(await callPostgresFunction(udfName.value, tx, parameters)) }
|
|
22
27
|
} catch (error) {
|
|
@@ -27,25 +32,24 @@ export const pgUdfQuery = {
|
|
|
27
32
|
|
|
28
33
|
/**
|
|
29
34
|
* Calls a PostgreSQL user-defined function through TypeORM
|
|
30
|
-
*
|
|
35
|
+
*
|
|
31
36
|
* @param functionName - Name of the PostgreSQL UDF to call
|
|
32
37
|
* @param entityManager - EntityManager instance
|
|
33
38
|
* @param parameters - Array of parameters or string to pass to the function
|
|
34
39
|
* @returns Promise with the function result
|
|
35
40
|
*/
|
|
36
|
-
async function callPostgresFunction(
|
|
37
|
-
functionName: string,
|
|
38
|
-
entityManager: EntityManager,
|
|
39
|
-
parameters: any[] | string
|
|
40
|
-
) {
|
|
41
|
+
async function callPostgresFunction(functionName: string, entityManager: EntityManager, parameters: any[] | string) {
|
|
41
42
|
try {
|
|
42
|
-
const exists = await entityManager.query(
|
|
43
|
+
const exists = await entityManager.query(
|
|
44
|
+
`
|
|
43
45
|
SELECT EXISTS (
|
|
44
46
|
SELECT 1 FROM pg_proc p
|
|
45
47
|
JOIN pg_namespace n ON p.pronamespace = n.oid
|
|
46
48
|
WHERE p.proname = $1
|
|
47
49
|
AND n.nspname = 'public'
|
|
48
|
-
)`,
|
|
50
|
+
)`,
|
|
51
|
+
[functionName]
|
|
52
|
+
)
|
|
49
53
|
|
|
50
54
|
if (!exists[0].exists) {
|
|
51
55
|
throw new Error(`PostgreSQL function '${functionName}' does not exist in the database.`)
|
|
@@ -68,9 +72,7 @@ async function callPostgresFunction(
|
|
|
68
72
|
const result = await entityManager.query(query, params)
|
|
69
73
|
|
|
70
74
|
// PostgreSQL functions typically return rows, so we handle both single and multiple results
|
|
71
|
-
return Array.isArray(result) && result.length === 1
|
|
72
|
-
? result[0]
|
|
73
|
-
: result
|
|
75
|
+
return Array.isArray(result) && result.length === 1 ? result[0] : result
|
|
74
76
|
} catch (error) {
|
|
75
77
|
throw new Error(`Error calling PostgreSQL function '${functionName}': ${error.message}`)
|
|
76
78
|
}
|
|
@@ -376,13 +376,13 @@ async function completeZonePicking(worksheetId: string, context: any, isPartial:
|
|
|
376
376
|
await tx.getRepository(OrderInventory).update(
|
|
377
377
|
{ releaseGood: In(roWithLoadingWorksheet), status: ORDER_INVENTORY_STATUS.PICKED },
|
|
378
378
|
{
|
|
379
|
-
status: ORDER_INVENTORY_STATUS.
|
|
379
|
+
status: ORDER_INVENTORY_STATUS.SORTING,
|
|
380
380
|
updater: user,
|
|
381
381
|
updatedAt: new Date()
|
|
382
382
|
}
|
|
383
383
|
)
|
|
384
384
|
const loadingOrderInventories: OrderInventory[] = await tx.getRepository(OrderInventory).find({
|
|
385
|
-
where: { releaseGood: In(roWithLoadingWorksheet), status: ORDER_INVENTORY_STATUS.
|
|
385
|
+
where: { releaseGood: In(roWithLoadingWorksheet), status: ORDER_INVENTORY_STATUS.SORTING }
|
|
386
386
|
})
|
|
387
387
|
//update loading wsd deactivated to executing
|
|
388
388
|
await tx.getRepository(WorksheetDetail).update(
|
|
@@ -446,7 +446,7 @@ async function generateLoadingWorksheets(tx: EntityManager, domain: Domain, user
|
|
|
446
446
|
await tx.getRepository(OrderInventory).update(
|
|
447
447
|
{ id: In(orderInventories.map(oi => oi.id)), status: ORDER_INVENTORY_STATUS.PICKED },
|
|
448
448
|
{
|
|
449
|
-
status: ORDER_INVENTORY_STATUS.
|
|
449
|
+
status: ORDER_INVENTORY_STATUS.SORTING,
|
|
450
450
|
updater: user,
|
|
451
451
|
updatedAt: new Date()
|
|
452
452
|
}
|
|
@@ -3,7 +3,8 @@ import { DeliveryOrderInfoList } from './delivery-order-info-list'
|
|
|
3
3
|
import { LoadingAssignmentStatus } from './loading-assignment'
|
|
4
4
|
|
|
5
5
|
export const Query = `
|
|
6
|
-
findLoadableReleaseGood(orderNo: String!): [ReleaseGood] @transaction
|
|
6
|
+
findLoadableReleaseGood(orderNo: String!, tabName: String!): [ReleaseGood] @transaction
|
|
7
|
+
findLoadableReleaseGoodByBin(orderNo: String!): LoadingWorksheet @transaction
|
|
7
8
|
loadingWorksheetv2(orderNo: String!, filter: String): LoadingWorksheet @transaction
|
|
8
9
|
getDeliveryOrders(releaseGoodNo: String!): DeliveryOrderInfoList
|
|
9
10
|
myLoadingAssignmentStatus: LoadingAssignmentStatus
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
import { AnalysisPickingPackingReport } from './analysis-picking-packing-report'
|
|
2
3
|
import { AnalysisPickingPackingReportList } from './analysis-picking-packing-report-list'
|
|
3
4
|
import { CostingReport } from './costing-report'
|
|
@@ -24,6 +25,8 @@ import { ReleaseInventoryReport } from './release-inventory-report'
|
|
|
24
25
|
import { ReleaseInventoryReportList } from './release-inventory-report-list'
|
|
25
26
|
import { ShortageReportList } from './shortage-report-list'
|
|
26
27
|
import { ShortageReport } from './shortage-report-type'
|
|
28
|
+
import { BillingModuleReport } from './billing-module-report'
|
|
29
|
+
import { BillingModuleReportList } from './billing-module-report-list'
|
|
27
30
|
import { OrderVasReport, VasReport } from './vas-report'
|
|
28
31
|
import { OrderVasReportList, VasReportList } from './vas-report-list'
|
|
29
32
|
import { PgUdfQueryList } from './pg-udf-query-list'
|
|
@@ -44,6 +47,7 @@ export const Query = `
|
|
|
44
47
|
cycleCountReport(filters: [Filter], pagination: Pagination, sortings: [Sorting], name: String!): CycleCountReportList @transaction
|
|
45
48
|
nonLoadedOrderInventories(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): NonLoadedOrderInventoryReportList @transaction
|
|
46
49
|
manifestReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): ManifestReportList @transaction
|
|
50
|
+
billingModuleReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): BillingModuleReportList @transaction
|
|
47
51
|
pgUdfQuery(filters: [Filter!]): PgUdfQueryList @transaction
|
|
48
52
|
`
|
|
49
53
|
|
|
@@ -78,5 +82,7 @@ export const Types = [
|
|
|
78
82
|
NonLoadedOrderInventoryReportList,
|
|
79
83
|
ManifestReport,
|
|
80
84
|
ManifestReportList,
|
|
85
|
+
BillingModuleReport,
|
|
86
|
+
BillingModuleReportList,
|
|
81
87
|
PgUdfQueryList
|
|
82
88
|
]
|
package/things-factory.config.js
CHANGED
package/translations/en.json
CHANGED
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
"button.my_worksheet_list": "my worksheet list",
|
|
75
75
|
"button.next_order": "next order",
|
|
76
76
|
"button.okay": "okay",
|
|
77
|
+
"button.order_list": "order list",
|
|
77
78
|
"button.order_remark": "order remark",
|
|
78
79
|
"button.order_sorted": "order sorted",
|
|
79
80
|
"button.pack": "pack",
|
|
@@ -404,6 +405,7 @@
|
|
|
404
405
|
"field.invoice": "invoice",
|
|
405
406
|
"field.issue": "issue",
|
|
406
407
|
"field.issued_date": "issued date",
|
|
408
|
+
"field.completed_items": "completed items",
|
|
407
409
|
"field.job_sheet": "job sheet no",
|
|
408
410
|
"field.label_id_for_location": "location label id",
|
|
409
411
|
"field.label_id_for_pallet": "pallet label id",
|
|
@@ -621,6 +623,7 @@
|
|
|
621
623
|
"field.resource_type": "resource type",
|
|
622
624
|
"field.resource_url": "resource url",
|
|
623
625
|
"field.retail_outlet": "retail outlet",
|
|
626
|
+
"field.return_items": "return items",
|
|
624
627
|
"field.return_order_no": "return order no",
|
|
625
628
|
"field.return_qty": "return qty",
|
|
626
629
|
"field.return_uom": "return uom",
|
|
@@ -697,6 +700,7 @@
|
|
|
697
700
|
"field.threshold_qty": "threshold qty",
|
|
698
701
|
"field.to": "to",
|
|
699
702
|
"field.to_date": "to date",
|
|
703
|
+
"field.total_order_fulfilled": "total order fulfilled",
|
|
700
704
|
"field.total": "total",
|
|
701
705
|
"field.total_carton": "total carton",
|
|
702
706
|
"field.total_cost": "total cost",
|
|
@@ -716,6 +720,7 @@
|
|
|
716
720
|
"field.total_unit_nett_weight": "total unit nett weight",
|
|
717
721
|
"field.total_uom": "total uom",
|
|
718
722
|
"field.total_uom_value": "total uom value",
|
|
723
|
+
"field.total_unit_processed": "total unit processed",
|
|
719
724
|
"field.total_uom_value_available": "total uom (available qty)",
|
|
720
725
|
"field.total_uom_value_damage": "total uom (damage qty)",
|
|
721
726
|
"field.total_uom_value_draft": "total uom (draft qty)",
|
|
@@ -1570,6 +1575,7 @@
|
|
|
1570
1575
|
"text.kindly_continue_inspect_the_inventory": "kindly continue inspect the inventory",
|
|
1571
1576
|
"text.kindly_inspect_and_relocate_this_inventory": "kindly inspect and relocate this inventory",
|
|
1572
1577
|
"text.loading_completed": "loading completed",
|
|
1578
|
+
"text.loading_completed_partially": "loading completed partially",
|
|
1573
1579
|
"text.location_code_is_empty": "location code is empty",
|
|
1574
1580
|
"text.location_id_is_empty": "location id is empty",
|
|
1575
1581
|
"text.location_is_not_selected": "location is not selected",
|
|
@@ -1957,6 +1963,7 @@
|
|
|
1957
1963
|
"title.awb": "AWB",
|
|
1958
1964
|
"title.batch_picking": "batch picking",
|
|
1959
1965
|
"title.bizplace": "bizplace",
|
|
1966
|
+
"title.billing_module": "billing module",
|
|
1960
1967
|
"title.bizplace_settings": "bizplace settings",
|
|
1961
1968
|
"title.bulk_arrival_notices": "bulk arrival notices",
|
|
1962
1969
|
"title.bulk_b2c_release_orders": "bulk B2C release order",
|
package/translations/ko.json
CHANGED
|
@@ -83,6 +83,7 @@
|
|
|
83
83
|
"button.my_worksheet_list": "내 작업리스트",
|
|
84
84
|
"button.next_order": "[ko]next order",
|
|
85
85
|
"button.okay": "예",
|
|
86
|
+
"button.order_list": "주문 리스트",
|
|
86
87
|
"button.order_remark": "[ko] order remark",
|
|
87
88
|
"button.order_sorted": "[ko] order sorted",
|
|
88
89
|
"button.pack": "팩",
|
|
@@ -413,6 +414,7 @@
|
|
|
413
414
|
"field.invoice": "[ko]invoice",
|
|
414
415
|
"field.issue": "이슈",
|
|
415
416
|
"field.issued_date": "발급일",
|
|
417
|
+
"field.completed_items": "완료 아이템",
|
|
416
418
|
"field.job_sheet": "작업지시서",
|
|
417
419
|
"field.label_id_for_location": "로케이션 라벨 아이디",
|
|
418
420
|
"field.label_id_for_pallet": "파레트 라벨 아이디",
|