@things-factory/operato-wms 4.3.137 → 4.3.139
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 +14 -6
- package/client/pages/bulk-operation/bulk-operation.js +3 -1
- package/client/pages/components/select-inventory-popup.js +7 -1
- package/client/pages/components/select-product-popup.js +33 -3
- package/client/pages/constants/order.js +3 -1
- package/client/pages/inbound/external-return-worksheet.js +39 -2
- package/client/pages/inbound/undo-putaway-popup.js +5 -9
- package/client/pages/inbound/undo-unload-popup.js +42 -35
- package/client/pages/inbound/unload-product.js +79 -69
- package/client/pages/inventory/inventory-adjustment-approval.js +4 -5
- package/client/pages/inventory/inventory-adjustment.js +56 -2
- package/client/pages/inventory/inventory-by-product-detail.js +23 -17
- package/client/pages/inventory/inventory-by-product.js +7 -0
- package/client/pages/inventory/inventory-history-by-pallet.js +14 -5
- package/client/pages/inventory/inventory-history.js +10 -0
- package/client/pages/inventory-check/check-inventory-popup.js +1 -1
- package/client/pages/inventory-check/create-cycle-count.js +2 -3
- package/client/pages/inventory-check/inspecting-product.js +7 -3
- package/client/pages/manifest/create-loading-manifest.js +8 -1
- package/client/pages/manifest/loading-manifest-detail.js +7 -4
- package/client/pages/master/generate-location-list.js +30 -22
- package/client/pages/master/location-list.js +141 -70
- package/client/pages/master/pallet-list.js +137 -58
- package/client/pages/master/product/product-details-popup.js +3 -3
- package/client/pages/master/tote-list.js +40 -27
- package/client/pages/master/transport-driver.js +48 -41
- package/client/pages/master/transport-vehicle.js +45 -41
- package/client/pages/master/warehouse-list.js +56 -34
- package/client/pages/order/arrival-notice/arrival-notice-detail.js +36 -25
- package/client/pages/order/arrival-notice/create-arrival-notice.js +79 -97
- package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +2 -0
- package/client/pages/order/arrival-notice/edit-product-popup.js +10 -8
- package/client/pages/order/draft-release-good/draft-release-good-detail.js +88 -4
- package/client/pages/order/draft-release-good/draft-release-good-list.js +1 -1
- package/client/pages/order/release-order/create-release-order.js +34 -9
- package/client/pages/order/release-order/release-extra-product-popup.js +4 -1
- package/client/pages/order/release-order/release-order-detail.js +40 -3
- package/client/pages/order/return-order/create-return-order.js +5 -0
- package/client/pages/order/return-order/return-order-inventory-popup.js +1 -0
- package/client/pages/order/return-order/return-order-requests.js +37 -2
- package/client/pages/order/transport-order/delivery-note-popup.js +30 -24
- package/client/pages/order/transport-order/delivery-order-list.js +27 -1
- package/client/pages/outbound/inventory-reassign-popup.js +7 -3
- package/client/pages/outbound/packing-product.js +7 -7
- package/client/pages/outbound/packing-worksheet-list.js +3 -1
- package/client/pages/outbound/picking-product.js +17 -5
- package/client/pages/outbound/serial-number-popup.js +1 -1
- package/client/pages/outbound/show-my-worksheet-list-popup.js +12 -3
- package/client/pages/report/custom-elccl/elccl-daily-collection-report.js +5 -2
- package/client/pages/report/custom-elccl/elccl-daily-order-inventory-report.js +2 -2
- package/client/pages/report/custom-elccl/elccl-delivery-order-summary.js +34 -8
- package/client/pages/report/custom-elccl/elccl-inventory-pallet-detail-report.js +42 -4
- package/client/pages/report/custom-elccl/elccl-inventory-summary-report.js +46 -4
- package/client/pages/report/volume-summary-report.js +8 -3
- package/config.development.js +28 -21
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js +6 -5
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js.map +1 -1
- package/dist-server/graphql/resolvers/other/add-release-good-products.js +7 -11
- package/dist-server/graphql/resolvers/other/add-release-good-products.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/costing-report.js +18 -24
- package/dist-server/graphql/resolvers/reports/costing-report.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +6 -6
- package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js +1 -1
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +8 -9
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/release-inventory-report.js +3 -3
- package/dist-server/graphql/resolvers/reports/release-inventory-report.js.map +1 -1
- package/package.json +24 -24
- package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.ts +6 -5
- package/server/graphql/resolvers/other/add-release-good-products.ts +8 -12
- package/server/graphql/resolvers/reports/costing-report.ts +18 -24
- package/server/graphql/resolvers/reports/inbound-order-details-report.ts +6 -6
- package/server/graphql/resolvers/reports/inbound-serial-number-report.ts +1 -1
- package/server/graphql/resolvers/reports/outbound-order-details-report.ts +8 -9
- package/server/graphql/resolvers/reports/release-inventory-report.ts +6 -4
- package/translations/en.json +28 -3
- package/translations/ko.json +26 -2
- package/translations/ms.json +26 -2
- package/translations/zh.json +26 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"costing-report.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/costing-report.ts"],"names":[],"mappings":";;;AAEA,yDAAgD;AAChD,uDAAmD;AAGnD,0CAAiD;AAEpC,QAAA,aAAa,GAAG;IAC3B,KAAK,CAAC,aAAa,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;QACzD,IAAI;YACF,MAAM,EAAE,EAAE,EAAE,GAA0B,OAAO,CAAC,KAAK,CAAA;YACnD,IAAI,cAAc,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAA;YAC1D,IAAI,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAA;YAClE,IAAI,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,CAAA;YACpE,IAAI,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IA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U,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAClF,CAAA;YAED,IAAI,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;gBAC3B,IAAI,IAAI,GAAG;oBACT,QAAQ,EAAE;wBACR,WAAW,EAAE,QAAQ,CAAC,WAAW;wBACjC,IAAI,EAAE,QAAQ,CAAC,IAAI;qBACpB;oBACD,OAAO,EAAE;wBACP,EAAE,EAAE,GAAG,CAAC,UAAU;wBAClB,GAAG,EAAE,GAAG,CAAC,WAAW;wBACpB,IAAI,EAAE,GAAG,CAAC,YAAY;wBACtB,WAAW,EAAE,GAAG,CAAC,mBAAmB;wBACpC,IAAI,EAAE,GAAG,CAAC,YAAY;qBACvB;oBACD,GAAG,EAAE,GAAG,CAAC,GAAG;oBACZ,GAAG,EAAE,GAAG,CAAC,GAAG;oBACZ,QAAQ,EAAE,GAAG,CAAC,SAAS;oBACvB,mBAAmB,EAAE,GAAG,CAAC,sBAAsB;oBAC/C,SAAS,EAAE,GAAG,CAAC,UAAU;iBAC1B,CAAA;gBAED,OAAO,IAAI,CAAA;YACb,CAAC,CAAC,CAAA;YAEF,OAAO;gBACL,KAAK;gBACL,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK;aACtB,CAAA;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,KAAK,CAAA;SACZ;IACH,CAAC;CACF,CAAA"}
|
|
@@ -72,16 +72,16 @@ exports.inboundOrderDetailsReport = {
|
|
|
72
72
|
ih.unit_cost,
|
|
73
73
|
ih.created_at as "unloaded_at",u2.name as "unloaded_by",
|
|
74
74
|
ih2.created_at as "putaway_at", u3.name as "putaway_by",
|
|
75
|
-
coalesce((select volume from product_details pd where pd.
|
|
75
|
+
coalesce((select volume from product_details pd where pd.id = i.product_detail_id
|
|
76
76
|
order by created_at desc
|
|
77
77
|
fetch first 1 rows only),0) as unit_volume,
|
|
78
|
-
coalesce((select nett_weight from product_details pd where pd.
|
|
78
|
+
coalesce((select nett_weight from product_details pd where pd.id = i.product_detail_id
|
|
79
79
|
order by created_at desc
|
|
80
80
|
fetch first 1 rows only),0) as unit_nett_weight,
|
|
81
|
-
coalesce((select gross_weight from product_details pd where pd.
|
|
81
|
+
coalesce((select gross_weight from product_details pd where pd.id = i.product_detail_id
|
|
82
82
|
order by created_at desc
|
|
83
83
|
fetch first 1 rows only),0) as unit_gross_weight,
|
|
84
|
-
coalesce((select weight_unit from product_details pd where pd.
|
|
84
|
+
coalesce((select weight_unit from product_details pd where pd.id = i.product_detail_id
|
|
85
85
|
order by created_at desc
|
|
86
86
|
fetch first 1 rows only),'') as weight_unit
|
|
87
87
|
from (
|
|
@@ -102,8 +102,8 @@ exports.inboundOrderDetailsReport = {
|
|
|
102
102
|
inner join reduced_inventory_histories ih2 on ih2.inventory_id = oi.inventory_id and ih2.transaction_type ='PUTAWAY' and ih2.ref_order_id = an.id::varchar
|
|
103
103
|
left join users u3 on u3.id = ih2.creator_id
|
|
104
104
|
inner join temp_products p on p.id = ih.product_id
|
|
105
|
-
inner join order_products op on op.arrival_notice_id = an.id and op.actual_pack_qty is not null and op.
|
|
106
|
-
op.batch_id = ih.batch_id
|
|
105
|
+
inner join order_products op on op.arrival_notice_id = an.id and op.actual_pack_qty is not null and op.product_detail_id = ih.product_detail_id and
|
|
106
|
+
op.batch_id = ih.batch_id
|
|
107
107
|
order by an.name, p.sku, ih.batch_id
|
|
108
108
|
) src
|
|
109
109
|
where 1=1
|
|
@@ -69,7 +69,7 @@ exports.inboundSerialNumberReport = {
|
|
|
69
69
|
select * from (
|
|
70
70
|
select
|
|
71
71
|
row_number() over(partition by an."name" order by coalesce(w.started_at, ii.created_at), p.sku ) as "no",
|
|
72
|
-
case when "source" = 'ADJUSTMENT' then 'adjustment' else an."name" end as "order_no",
|
|
72
|
+
case when "ii"."source" = 'ADJUSTMENT' then 'adjustment' else an."name" end as "order_no",
|
|
73
73
|
i.pallet_id, i.carton_id,an.ref_no, an.ref_no_2, an.ref_no_3,
|
|
74
74
|
p.id as "product_id", p.sku as "product_sku", p.brand_sku as "product_brand_sku",
|
|
75
75
|
p.name as "product_name", p.description as "product_description", p."type" as "product_type",
|
|
@@ -47,7 +47,7 @@ exports.outboundOrderDetailsReport = {
|
|
|
47
47
|
select * from (
|
|
48
48
|
select oi.id,
|
|
49
49
|
oi.release_qty AS "release_qty", oi.picked_at, oi.picked_by, oi.packed_at, oi.packed_by, oi.loaded_at, oi.loaded_by,
|
|
50
|
-
oi.release_qty as "qty", oi.release_uom_value as "uom_value", oi.return_to_location_qty, oi.return_to_location_uom_value,
|
|
50
|
+
oi.release_qty as "qty", oi.release_uom_value as "uom_value", oi.return_to_location_qty, oi.return_to_location_uom_value, oi.product_detail_id,
|
|
51
51
|
coalesce(do2.other_driver, td.name) as driver_name,
|
|
52
52
|
coalesce(do2.truck_no, tv.name, rg.truck_no) as vehicle_no,
|
|
53
53
|
do2.name AS "delivery_order_no", do2.delivery_date AS "delivery_order_delivery_date", do2."to", do2.contact_point_ref_id, do2.pallet_qty,
|
|
@@ -58,8 +58,7 @@ exports.outboundOrderDetailsReport = {
|
|
|
58
58
|
rg.export_option, rg.name AS "ro_no", rg."type" as "ro_type", rg.ref_no AS "ref_no_1", rg.ref_no_2 AS "ref_no_2", rg.ref_no_3 AS "ref_no_3", rg.status as "ro_status",
|
|
59
59
|
u1.name as "order_created_by", rg.created_at AS "order_created_at",
|
|
60
60
|
rg.accepted_at, u4.name as accepted_by, rg.checked_remark_by, rg.checked_remark_at, coalesce(do2.own_collection, rg.own_transport) AS own_transport,
|
|
61
|
-
p.id as "product_id", p.sku as "product_sku", p.name AS "product_name", p.description AS "product_description", p.type as "product_type",
|
|
62
|
-
i.packing_type as "pack_type", i.packing_size as "pack_size",
|
|
61
|
+
p.id as "product_id", p.sku as "product_sku", p.name AS "product_name", p.description AS "product_description", p.type as "product_type", oi.packing_type as "packing_type", oi.packing_size as "packing_size",
|
|
63
62
|
i.uom, i.unit_cost,
|
|
64
63
|
i.id as inventory_id, i.pallet_id, i.carton_id, i.batch_id, i.batch_id_ref, i.expiration_date, i.manufacture_date,
|
|
65
64
|
coalesce(ms.name,'') as manifest_no, coalesce(rg.manifested_at, ms.created_at) as manifested_at, coalesce(u6.name, u5.name) as manifested_by
|
|
@@ -109,16 +108,16 @@ exports.outboundOrderDetailsReport = {
|
|
|
109
108
|
wsort.started_at as sorting_start, wsort.ended_at as sorting_complete,
|
|
110
109
|
wload.started_at as loading_start, wload.ended_at as loading_complete,
|
|
111
110
|
coalesce(delivery_address, concat(cp.address, cp.address_2)) as "delivery_address",
|
|
112
|
-
coalesce((select volume from product_details pd where pd.
|
|
111
|
+
coalesce((select volume from product_details pd where pd.id = oi.product_detail_id
|
|
113
112
|
order by created_at desc
|
|
114
113
|
fetch first 1 rows only),0) as unit_volume,
|
|
115
|
-
coalesce((select nett_weight from product_details pd where pd.
|
|
114
|
+
coalesce((select nett_weight from product_details pd where pd.id = oi.product_detail_id
|
|
116
115
|
order by created_at desc
|
|
117
116
|
fetch first 1 rows only),0) as unit_nett_weight,
|
|
118
|
-
coalesce((select gross_weight from product_details pd where pd.
|
|
117
|
+
coalesce((select gross_weight from product_details pd where pd.id = oi.product_detail_id
|
|
119
118
|
order by created_at desc
|
|
120
119
|
fetch first 1 rows only),0) as unit_gross_weight,
|
|
121
|
-
coalesce((select weight_unit from product_details pd where pd.
|
|
120
|
+
coalesce((select weight_unit from product_details pd where pd.id = oi.product_detail_id
|
|
122
121
|
order by created_at desc
|
|
123
122
|
fetch first 1 rows only),'') as weight_unit,
|
|
124
123
|
coalesce((select unit_cost from reduced_inventory_histories rih where
|
|
@@ -179,8 +178,8 @@ exports.outboundOrderDetailsReport = {
|
|
|
179
178
|
description: itm.product_description,
|
|
180
179
|
type: itm.product_type
|
|
181
180
|
},
|
|
182
|
-
packType: itm.
|
|
183
|
-
packSize: itm.
|
|
181
|
+
packType: itm.packing_type,
|
|
182
|
+
packSize: itm.packing_size,
|
|
184
183
|
qty: Math.abs(itm.qty),
|
|
185
184
|
uomValue: Math.abs(itm.uom_value),
|
|
186
185
|
uom: itm.uom,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outbound-order-details-report.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/outbound-order-details-report.ts"],"names":[],"mappings":";;;AAEA,yDAAgD;AAChD,uDAAmD;AAGnD,0CAAiD;AAEpC,QAAA,0BAA0B,GAAG;IACxC,KAAK,CAAC,0BAA0B,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;QACtE,IAAI;YACF,MAAM,EAAE,EAAE,EAAE,GAA0B,OAAO,CAAC,KAAK,CAAA;YACnD,IAAI,cAAc,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAA;YAC1D,IAAI,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAA;YAClE,IAAI,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,CAAA;YACpE,IAAI,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAA;YAChE,IAAI,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAA;YAC5D,IAAI,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAA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AG,GAAG,iBAAiB,iCAAiC,IAAI,CAAC,KAAK,KAAK,CAAA;aACzF;YAED,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YACpB,MAAM,EAAE,CAAC,KAAK,CACZ
|
|
1
|
+
{"version":3,"file":"outbound-order-details-report.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/outbound-order-details-report.ts"],"names":[],"mappings":";;;AAEA,yDAAgD;AAChD,uDAAmD;AAGnD,0CAAiD;AAEpC,QAAA,0BAA0B,GAAG;IACxC,KAAK,CAAC,0BAA0B,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;QACtE,IAAI;YACF,MAAM,EAAE,EAAE,EAAE,GAA0B,OAAO,CAAC,KAAK,CAAA;YACnD,IAAI,cAAc,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAA;YAC1D,IAAI,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAA;YAClE,IAAI,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,CAAA;YACpE,IAAI,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAA;YAChE,IAAI,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAA;YAC5D,IAAI,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAA;YAC5D,IAAI,MAAM,GAAG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;oBAC7B,aAAa,EAAE,GAAG,CAAC,cAAc;oBACjC,SAAS,EAAE,GAAG,CAAC,UAAU;oBACzB,eAAe,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,qBAAqB;oBAC5E,SAAS,EAAE,GAAG,CAAC,UAAU;oBACzB,UAAU,EAAE,GAAG,CAAC,WAAW;iBAC5B,CAAA;YACH,CAAC,CAAC,CAAA;YAEF,OAAO;gBACL,KAAK;gBACL,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK;aACtB,CAAA;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,KAAK,CAAA;SACZ;IACH,CAAC;CACF,CAAA"}
|
|
@@ -94,7 +94,7 @@ exports.releaseInventoryReport = {
|
|
|
94
94
|
where release_good_id is not null
|
|
95
95
|
and od.status in ('PENDING', 'PENDING_RECEIVE', 'PENDING_CANCEL', 'PENDING_WORKSHEET', 'READY_TO_PICK', 'PICKING')
|
|
96
96
|
and od.domain_id = $1
|
|
97
|
-
and oi.status
|
|
97
|
+
and oi.status not in ('REPLACED', 'MISSING')
|
|
98
98
|
group by inventory_id, release_good_id
|
|
99
99
|
) oi
|
|
100
100
|
inner join release_goods od on od.id = oi.release_good_id
|
|
@@ -144,10 +144,10 @@ exports.releaseInventoryReport = {
|
|
|
144
144
|
sku: itm.product_sku,
|
|
145
145
|
name: itm.product_name,
|
|
146
146
|
description: itm.product_description,
|
|
147
|
-
brand: itm.product_brand
|
|
147
|
+
brand: itm.product_brand
|
|
148
148
|
},
|
|
149
149
|
location: {
|
|
150
|
-
name: itm.location_name
|
|
150
|
+
name: itm.location_name
|
|
151
151
|
},
|
|
152
152
|
packingType: itm.packing_type,
|
|
153
153
|
assignedQty: itm.assigned_qty,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-inventory-report.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/release-inventory-report.ts"],"names":[],"mappings":";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
|
|
1
|
+
{"version":3,"file":"release-inventory-report.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/release-inventory-report.ts"],"names":[],"mappings":";;;AAGA,uDAAmD;AAGnD,0CAAiD;AAEpC,QAAA,sBAAsB,GAAG;IACpC,KAAK,CAAC,sBAAsB,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;QAClE,IAAI;YACF,MAAM,EAAE,EAAE,EAAE,GAA0B,OAAO,CAAC,KAAK,CAAA;YACnD,6DAA6D;YAC7D,qEAAqE;YACrE,IAAI,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,CAAA;YAC9D,IAAI,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,CAAC,CAAA;YACtE,IAAI,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAA;YAClE,IAAI,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,CAAA;YACpE,IAAI,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,CAAA;YACpE,IAAI,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,CAAA;YAEpE,oBAAoB;YACpB,8DAA8D;YAC9D,uCAAuC;YACvC,+BAA+B;YAC/B,OAAO;YAEP,iDAAiD;YAEjD,IAAI,CAAC,QAAQ;gBAAE,MAAM,eAAe,CAAA;Y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,GAAG,CAAC,aAAa;qBACxB;oBACD,WAAW,EAAE,GAAG,CAAC,YAAY;oBAC7B,WAAW,EAAE,GAAG,CAAC,YAAY;oBAC7B,gBAAgB,EAAE,GAAG,CAAC,SAAS;oBAC/B,WAAW,EAAE,GAAG,CAAC,GAAG;oBACpB,OAAO,EAAE,GAAG,CAAC,QAAQ;oBACrB,IAAI,EAAE,GAAG,CAAC,IAAI;oBACd,MAAM,EAAE,GAAG,CAAC,MAAM;oBAClB,OAAO,EAAE,GAAG,CAAC,QAAQ;oBACrB,WAAW,EAAE,GAAG,CAAC,YAAY;oBAC7B,QAAQ,EAAE,GAAG,CAAC,SAAS;oBACvB,QAAQ,EAAE,GAAG,CAAC,SAAS;oBACvB,OAAO,EAAE,GAAG,CAAC,QAAQ;oBACrB,UAAU,EAAE,GAAG,CAAC,YAAY;oBAC5B,cAAc,EAAE,GAAG,CAAC,eAAe;oBACnC,eAAe,EAAE,GAAG,CAAC,gBAAgB;iBACtC,CAAA;gBAED,OAAO,IAAI,CAAA;YACb,CAAC,CAAC,CAAA;YAEF,OAAO;gBACL,KAAK;gBACL,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK;aACtB,CAAA;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,KAAK,CAAA;SACZ;IACH,CAAC;CACF,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/operato-wms",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.139",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -63,35 +63,35 @@
|
|
|
63
63
|
"@operato/scene-table": "^0.1.8",
|
|
64
64
|
"@operato/scene-wheel-sorter": "^0.1.8",
|
|
65
65
|
"@things-factory/apptool-ui": "^4.3.131",
|
|
66
|
-
"@things-factory/attachment-ui": "^4.3.
|
|
67
|
-
"@things-factory/auth-ui": "^4.3.
|
|
66
|
+
"@things-factory/attachment-ui": "^4.3.138",
|
|
67
|
+
"@things-factory/auth-ui": "^4.3.138",
|
|
68
68
|
"@things-factory/barcode-ui": "^4.3.131",
|
|
69
|
-
"@things-factory/biz-ui": "^4.3.
|
|
70
|
-
"@things-factory/board-service": "^4.3.
|
|
71
|
-
"@things-factory/board-ui": "^4.3.
|
|
72
|
-
"@things-factory/code-ui": "^4.3.
|
|
69
|
+
"@things-factory/biz-ui": "^4.3.139",
|
|
70
|
+
"@things-factory/board-service": "^4.3.138",
|
|
71
|
+
"@things-factory/board-ui": "^4.3.138",
|
|
72
|
+
"@things-factory/code-ui": "^4.3.138",
|
|
73
73
|
"@things-factory/context-ui": "^4.3.131",
|
|
74
74
|
"@things-factory/export-ui": "^4.3.131",
|
|
75
75
|
"@things-factory/export-ui-csv": "^4.3.131",
|
|
76
76
|
"@things-factory/export-ui-excel": "^4.3.131",
|
|
77
|
-
"@things-factory/fav-base": "^4.3.
|
|
77
|
+
"@things-factory/fav-base": "^4.3.138",
|
|
78
78
|
"@things-factory/form-ui": "^4.3.131",
|
|
79
|
-
"@things-factory/geography": "^4.3.
|
|
80
|
-
"@things-factory/grist-ui": "^4.3.
|
|
79
|
+
"@things-factory/geography": "^4.3.138",
|
|
80
|
+
"@things-factory/grist-ui": "^4.3.138",
|
|
81
81
|
"@things-factory/help": "^4.3.131",
|
|
82
82
|
"@things-factory/i18n-base": "^4.3.131",
|
|
83
|
-
"@things-factory/id-rule-base": "^4.3.
|
|
84
|
-
"@things-factory/import-ui": "^4.3.
|
|
85
|
-
"@things-factory/import-ui-excel": "^4.3.
|
|
86
|
-
"@things-factory/menu-ui": "^4.3.
|
|
83
|
+
"@things-factory/id-rule-base": "^4.3.138",
|
|
84
|
+
"@things-factory/import-ui": "^4.3.138",
|
|
85
|
+
"@things-factory/import-ui-excel": "^4.3.138",
|
|
86
|
+
"@things-factory/menu-ui": "^4.3.138",
|
|
87
87
|
"@things-factory/more-ui": "^4.3.131",
|
|
88
|
-
"@things-factory/notification": "^4.3.
|
|
88
|
+
"@things-factory/notification": "^4.3.138",
|
|
89
89
|
"@things-factory/pdf": "^4.3.131",
|
|
90
90
|
"@things-factory/print-proxy-service": "^4.3.131",
|
|
91
91
|
"@things-factory/print-ui": "^4.3.131",
|
|
92
|
-
"@things-factory/product-base": "^4.3.
|
|
93
|
-
"@things-factory/resource-ui": "^4.3.
|
|
94
|
-
"@things-factory/sales-ui": "^4.3.
|
|
92
|
+
"@things-factory/product-base": "^4.3.138",
|
|
93
|
+
"@things-factory/resource-ui": "^4.3.138",
|
|
94
|
+
"@things-factory/sales-ui": "^4.3.139",
|
|
95
95
|
"@things-factory/scene-data-transform": "^4.3.131",
|
|
96
96
|
"@things-factory/scene-excel": "^4.3.131",
|
|
97
97
|
"@things-factory/scene-firebase": "^4.3.131",
|
|
@@ -103,12 +103,12 @@
|
|
|
103
103
|
"@things-factory/scene-mqtt": "^4.3.131",
|
|
104
104
|
"@things-factory/scene-restful": "^4.3.131",
|
|
105
105
|
"@things-factory/scene-visualizer": "^4.3.131",
|
|
106
|
-
"@things-factory/setting-ui": "^4.3.
|
|
106
|
+
"@things-factory/setting-ui": "^4.3.138",
|
|
107
107
|
"@things-factory/system-ui": "^4.3.131",
|
|
108
|
-
"@things-factory/transport-base": "^4.3.
|
|
109
|
-
"@things-factory/tutorial-ui": "^4.3.
|
|
110
|
-
"@things-factory/warehouse-base": "^4.3.
|
|
111
|
-
"@things-factory/worksheet-base": "^4.3.
|
|
108
|
+
"@things-factory/transport-base": "^4.3.138",
|
|
109
|
+
"@things-factory/tutorial-ui": "^4.3.138",
|
|
110
|
+
"@things-factory/warehouse-base": "^4.3.138",
|
|
111
|
+
"@things-factory/worksheet-base": "^4.3.139"
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@things-factory/builder": "^4.3.131",
|
|
@@ -117,5 +117,5 @@
|
|
|
117
117
|
"cypress-localstorage-commands": "^1.6.1",
|
|
118
118
|
"eslint-plugin-cypress": "^2.12.1"
|
|
119
119
|
},
|
|
120
|
-
"gitHead": "
|
|
120
|
+
"gitHead": "82a27c0caaf2f2c98cd094b92fc603bf768d2513"
|
|
121
121
|
}
|
|
@@ -49,6 +49,8 @@ export const elcclInventoryHistoryReport = {
|
|
|
49
49
|
Lower(prd.name) LIKE ANY(ARRAY[${productValue}])
|
|
50
50
|
OR Lower(prd.sku) LIKE ANY(ARRAY[${productValue}])
|
|
51
51
|
OR Lower(prd.description) LIKE ANY(ARRAY[${productValue}])
|
|
52
|
+
OR Lower(prd.brand) LIKE ANY(ARRAY[${productValue}])
|
|
53
|
+
OR Lower(prd.brand_sku) LIKE ANY(ARRAY[${productValue}])
|
|
52
54
|
)`
|
|
53
55
|
}
|
|
54
56
|
|
|
@@ -57,7 +59,7 @@ export const elcclInventoryHistoryReport = {
|
|
|
57
59
|
create temp table temp_data_src AS
|
|
58
60
|
(
|
|
59
61
|
SELECT prd.sku AS product_sku, prd.name AS product_name, prd.description AS product_description, trim(invh.batch_id) as batch_id, invh.product_id,
|
|
60
|
-
invh.packing_type, invh.bizplace_id, invh.domain_id,
|
|
62
|
+
invh.product_detail_id, invh.packing_type, invh.bizplace_id, invh.domain_id,
|
|
61
63
|
invh.ref_order_id, invh.order_no, invh.order_ref_no, invh.transaction_type, invh.created_at,
|
|
62
64
|
invh.qty, invh.opening_qty, invh.uom_value, invh.opening_uom_value
|
|
63
65
|
FROM reduced_inventory_histories invh
|
|
@@ -86,15 +88,14 @@ export const elcclInventoryHistoryReport = {
|
|
|
86
88
|
0 AS rn,
|
|
87
89
|
$1 AS created_at
|
|
88
90
|
FROM (
|
|
89
|
-
SELECT src.product_sku, src.product_name, src.product_description, src.batch_id, src.product_id, src.packing_type, src.bizplace_id,
|
|
91
|
+
SELECT src.product_sku, src.product_name, src.product_description, src.batch_id, src.product_id, src.product_detail_id, src.packing_type, src.bizplace_id,
|
|
90
92
|
src.domain_id
|
|
91
93
|
FROM temp_data_src src
|
|
92
|
-
GROUP BY src.product_sku, src.product_name, src.product_description, src.batch_id, src.product_id, src.packing_type, src.bizplace_id,
|
|
94
|
+
GROUP BY src.product_sku, src.product_name, src.product_description, src.batch_id, src.product_id, src.product_detail_id, src.packing_type, src.bizplace_id,
|
|
93
95
|
src.domain_id
|
|
94
96
|
) AS src
|
|
95
97
|
LEFT JOIN inventory_histories invh ON src.batch_id = trim(invh.batch_id) AND
|
|
96
|
-
src.
|
|
97
|
-
src.packing_type = invh.packing_type AND
|
|
98
|
+
src.product_detail_id = invh.product_detail_id AND
|
|
98
99
|
src.bizplace_id = invh.bizplace_id AND
|
|
99
100
|
src.domain_id = invh.domain_id AND
|
|
100
101
|
invh.created_at < $1::timestamp AND
|
|
@@ -2,7 +2,7 @@ import { EntityManager, In, Not } from 'typeorm'
|
|
|
2
2
|
|
|
3
3
|
import { User } from '@things-factory/auth-base'
|
|
4
4
|
import { Bizplace } from '@things-factory/biz-base'
|
|
5
|
-
import { Product } from '@things-factory/product-base'
|
|
5
|
+
import { Product, ProductDetail } from '@things-factory/product-base'
|
|
6
6
|
import {
|
|
7
7
|
ORDER_INVENTORY_STATUS,
|
|
8
8
|
ORDER_PRODUCT_STATUS,
|
|
@@ -48,7 +48,7 @@ export const addReleaseGoodProducts = {
|
|
|
48
48
|
curOrderInv.domain = domain
|
|
49
49
|
curOrderInv.bizplace = bizplace
|
|
50
50
|
curOrderInv.releaseGood = releaseGood
|
|
51
|
-
curOrderInv.
|
|
51
|
+
curOrderInv.productDetail = await tx.getRepository(ProductDetail).findOne(oi.productDetail.id)
|
|
52
52
|
|
|
53
53
|
let existingOrderInv: OrderInventory
|
|
54
54
|
|
|
@@ -59,9 +59,8 @@ export const addReleaseGoodProducts = {
|
|
|
59
59
|
existingOrderInv = await tx.getRepository(OrderInventory).findOne({
|
|
60
60
|
where: {
|
|
61
61
|
releaseGood,
|
|
62
|
-
|
|
62
|
+
productDetail: curOrderInv.productDetail,
|
|
63
63
|
batchId: curOrderInv.batchId,
|
|
64
|
-
packingType: curOrderInv.packingType,
|
|
65
64
|
inventory: foundInv
|
|
66
65
|
}
|
|
67
66
|
})
|
|
@@ -204,7 +203,6 @@ export const addReleaseGoodProducts = {
|
|
|
204
203
|
newOrderInv.status = pickingWorksheet ? ORDER_INVENTORY_STATUS.PICKING : ORDER_INVENTORY_STATUS.PENDING
|
|
205
204
|
newOrderInv.name = OrderNoGenerator.orderInventory()
|
|
206
205
|
newOrderInv.releaseGood = releaseGood
|
|
207
|
-
newOrderInv.product = await tx.getRepository(Product).findOne(oi.product.id)
|
|
208
206
|
newOrderInv.creator = user
|
|
209
207
|
newOrderInv.updater = user
|
|
210
208
|
|
|
@@ -215,8 +213,7 @@ export const addReleaseGoodProducts = {
|
|
|
215
213
|
domain,
|
|
216
214
|
releaseGood,
|
|
217
215
|
batchId: oi.batchId,
|
|
218
|
-
|
|
219
|
-
product: newOrderInv.product
|
|
216
|
+
productDetail: newOrderInv.productDetail
|
|
220
217
|
}
|
|
221
218
|
})
|
|
222
219
|
|
|
@@ -232,9 +229,8 @@ export const addReleaseGoodProducts = {
|
|
|
232
229
|
existingOrderInv = await tx.getRepository(OrderInventory).findOne({
|
|
233
230
|
where: {
|
|
234
231
|
releaseGood,
|
|
235
|
-
|
|
232
|
+
productDetail: newOrderInv.productDetail,
|
|
236
233
|
batchId: newOrderInv.batchId,
|
|
237
|
-
packingType: newOrderInv.packingType,
|
|
238
234
|
inventory: foundInv
|
|
239
235
|
}
|
|
240
236
|
})
|
|
@@ -263,9 +259,8 @@ export const addReleaseGoodProducts = {
|
|
|
263
259
|
existingOrderInv = await tx.getRepository(OrderInventory).findOne({
|
|
264
260
|
where: {
|
|
265
261
|
releaseGood,
|
|
266
|
-
|
|
267
|
-
batchId: newOrderInv.batchId
|
|
268
|
-
packingType: newOrderInv.packingType
|
|
262
|
+
productDetail: newOrderInv.productDetail,
|
|
263
|
+
batchId: newOrderInv.batchId
|
|
269
264
|
}
|
|
270
265
|
})
|
|
271
266
|
}
|
|
@@ -325,6 +320,7 @@ export const addReleaseGoodProducts = {
|
|
|
325
320
|
savedOrderInv.packingType = newOrderInv.packingType
|
|
326
321
|
savedOrderInv.uom = newOrderInv.uom
|
|
327
322
|
savedOrderInv.product = newOrderInv.product
|
|
323
|
+
savedOrderInv.productDetail = newOrderInv.productDetail
|
|
328
324
|
savedOrderInv.inventory = newOrderInv.inventory
|
|
329
325
|
savedOrderInv.status = newOrderInv.status
|
|
330
326
|
savedOrderInv.releaseGood = newOrderInv.releaseGood
|
|
@@ -41,18 +41,18 @@ export const costingReport = {
|
|
|
41
41
|
await tx.query(
|
|
42
42
|
`
|
|
43
43
|
create temp table tmp_outbound_ord on commit drop as (
|
|
44
|
-
select p.sku, rih.domain_id, rih.bizplace_id, rih.
|
|
44
|
+
select p.sku, rih.domain_id, rih.bizplace_id, rih.product_detail_id, coalesce(rih.uom, pd.uom, pd2.uom) as uom,
|
|
45
45
|
sum(rih.qty) as total_picked_qty, sum(rih.uom_value) as total_picked_uom_value
|
|
46
46
|
from reduced_inventory_histories rih
|
|
47
47
|
inner join inventories inv on inv.domain_id = rih.domain_id and inv.pallet_id = rih.pallet_id
|
|
48
|
-
left join product_details pd on pd.
|
|
48
|
+
left join product_details pd on pd.id = rih.product_detail_id
|
|
49
49
|
left join product_details pd2 on pd2.product_id = rih.product_id and pd2.is_default = true
|
|
50
50
|
left join products p on p.id = rih.product_id
|
|
51
51
|
where rih.domain_id = $1
|
|
52
52
|
and inv.bizplace_id = $2
|
|
53
53
|
and rih.created_at >= $3 and rih.created_at <= $4
|
|
54
54
|
and rih.transaction_type = 'PICKING'
|
|
55
|
-
group by p.sku, rih.domain_id, rih.bizplace_id, rih.
|
|
55
|
+
group by p.sku, rih.domain_id, rih.bizplace_id, rih.product_detail_id, coalesce(rih.uom, pd.uom, pd2.uom)
|
|
56
56
|
);
|
|
57
57
|
`,
|
|
58
58
|
[context.state.domain.id, bizplace.id, fromDate.value, toDate.value]
|
|
@@ -61,14 +61,14 @@ export const costingReport = {
|
|
|
61
61
|
await tx.query(
|
|
62
62
|
`
|
|
63
63
|
create temp table tmp_stored_inv on commit drop as (
|
|
64
|
-
select src2.sku, src2.domain_id, src2.bizplace_id, src2.pallet_id, src2.
|
|
64
|
+
select src2.sku, src2.domain_id, src2.bizplace_id, src2.pallet_id, src2.product_detail_id, src2.uom,
|
|
65
65
|
to_char(src2.created_at, 'YYYY-MM') as created_year_month, sum(closing_qty) as closing_qty from (
|
|
66
|
-
select distinct on (rih.pallet_id) p.sku, rih.domain_id, rih.bizplace_id, rih.pallet_id, rih.
|
|
66
|
+
select distinct on (rih.pallet_id) p.sku, rih.domain_id, rih.bizplace_id, rih.pallet_id, rih.product_detail_id,
|
|
67
67
|
coalesce(rih.uom, pd.uom, pd2.uom) as uom,
|
|
68
68
|
rih.created_at, rih.transaction_type, rih.status, rih.opening_qty + rih.qty as closing_qty
|
|
69
69
|
from reduced_inventory_histories rih
|
|
70
70
|
inner join inventories i on i.domain_id = rih.domain_id and i.pallet_id = rih.pallet_id
|
|
71
|
-
left join product_details pd on pd.
|
|
71
|
+
left join product_details pd on pd.id = rih.product_detail_id
|
|
72
72
|
left join product_details pd2 on pd2.product_id = rih.product_id and pd2.is_default = true
|
|
73
73
|
left join products p on p.id = rih.product_id
|
|
74
74
|
where rih.domain_id = $1
|
|
@@ -80,12 +80,10 @@ export const costingReport = {
|
|
|
80
80
|
select * from tmp_outbound_ord outboundOrd
|
|
81
81
|
where outboundOrd.domain_id = src2.domain_id
|
|
82
82
|
and outboundOrd.bizplace_id = src2.bizplace_id
|
|
83
|
-
and outboundOrd.
|
|
84
|
-
and outboundOrd.packing_type = src2.packing_type
|
|
85
|
-
and outboundOrd.packing_size = src2.packing_size
|
|
83
|
+
and outboundOrd.product_detail_id = src2.product_detail_id
|
|
86
84
|
and outboundOrd.uom = src2.uom
|
|
87
85
|
)
|
|
88
|
-
group by src2.sku, src2.domain_id, src2.bizplace_id, src2.pallet_id, src2.
|
|
86
|
+
group by src2.sku, src2.domain_id, src2.bizplace_id, src2.pallet_id, src2.product_detail_id, src2.uom, to_char(src2.created_at, 'YYYY-MM')
|
|
89
87
|
);
|
|
90
88
|
`,
|
|
91
89
|
[context.state.domain.id, bizplace.id, toDate.value]
|
|
@@ -95,11 +93,11 @@ export const costingReport = {
|
|
|
95
93
|
`
|
|
96
94
|
create temp table temp_costing_report on commit drop as (
|
|
97
95
|
WITH RECURSIVE cte_forwarded_cost as (
|
|
98
|
-
select src.domain_id, src.bizplace_id, src.product_id, src.
|
|
96
|
+
select src.domain_id, src.bizplace_id, src.product_id, src.product_detail_id, src.uom, TO_DATE(src.created_year_month,'YYYY-MM')::timestamp as running_year_month,
|
|
99
97
|
sum(src.qty) as qty, sum(src.total_cost)/ sum(src.qty) as monthly_avg_cost,
|
|
100
98
|
coalesce(sum(src.qty)) as closing_qty from (
|
|
101
99
|
select distinct on (pallet_id)
|
|
102
|
-
ih.domain_id, ih.bizplace_id, ih.pallet_id, ih.unit_cost, (ih.unit_cost * (ih.opening_qty + ih.qty)) as total_cost, ih.status, ih.transaction_type, ih.product_id, ih.
|
|
100
|
+
ih.domain_id, ih.bizplace_id, ih.pallet_id, ih.unit_cost, (ih.unit_cost * (ih.opening_qty + ih.qty)) as total_cost, ih.status, ih.transaction_type, ih.product_id, ih.product_detail_id, coalesce(ih.uom, pd.uom) as uom,
|
|
103
101
|
ih.created_at, to_char(ih.created_at, 'YYYY-MM') as created_year_month,
|
|
104
102
|
ih.opening_qty,
|
|
105
103
|
ih.qty as transaction_qty,
|
|
@@ -109,7 +107,7 @@ export const costingReport = {
|
|
|
109
107
|
ih.opening_uom_value + ih.uom_value as uom_value
|
|
110
108
|
from reduced_inventory_histories ih
|
|
111
109
|
inner join inventories i on i.domain_id = ih.domain_id and i.pallet_id = ih.pallet_id
|
|
112
|
-
left join product_details pd on pd.
|
|
110
|
+
left join product_details pd on pd.id = ih.product_detail_id
|
|
113
111
|
where ih.domain_id = $1
|
|
114
112
|
and i.bizplace_id = $2
|
|
115
113
|
and ih.created_at <= $3 and ih.unit_cost is not null
|
|
@@ -117,33 +115,29 @@ export const costingReport = {
|
|
|
117
115
|
select * from tmp_outbound_ord outboundOrd
|
|
118
116
|
where outboundOrd.domain_id = ih.domain_id
|
|
119
117
|
and outboundOrd.bizplace_id = ih.bizplace_id
|
|
120
|
-
and outboundOrd.
|
|
121
|
-
and outboundOrd.packing_type = ih.packing_type
|
|
122
|
-
and outboundOrd.packing_size = ih.packing_size
|
|
118
|
+
and outboundOrd.product_detail_id = ih.product_detail_id
|
|
123
119
|
and outboundOrd.uom = ih.uom
|
|
124
120
|
)
|
|
125
121
|
order by ih.pallet_id, ih.seq
|
|
126
122
|
) src
|
|
127
|
-
group by src.domain_id, src.bizplace_id, src.product_id, src.
|
|
123
|
+
group by src.domain_id, src.bizplace_id, src.product_id, src.product_detail_id, src.uom, src.created_year_month
|
|
128
124
|
union all
|
|
129
|
-
select dt1.domain_id, dt1.bizplace_id, dt1.product_id, dt1.
|
|
125
|
+
select dt1.domain_id, dt1.bizplace_id, dt1.product_id, dt1.product_detail_id, dt1.uom,
|
|
130
126
|
dt1.running_year_month + interval '1 month' as running_year_month, dt1.qty, dt1.monthly_avg_cost, dt1.closing_qty
|
|
131
127
|
from cte_forwarded_cost dt1
|
|
132
128
|
where dt1.running_year_month + interval '1 month' < $3
|
|
133
129
|
) select fc.*, -outboundord.total_picked_qty as "qty", -outboundord.total_picked_uom_value as "uom_value", (-outboundord.total_picked_qty * fc.weighted_avg_unit_cost) as "total_cost" from (
|
|
134
130
|
select p.sku as "product_sku", p."name" as "product_name", p.description as "product_description", p."type" as "product_type",
|
|
135
|
-
fc.domain_id, fc.bizplace_id, fc.
|
|
131
|
+
fc.domain_id, fc.bizplace_id, fc.product_detail_id, fc.uom, fc.running_year_month,
|
|
136
132
|
ROUND(cast(sum(fc.monthly_avg_cost * fc.closing_qty) / sum(fc.qty) as numeric),2) as "weighted_avg_unit_cost"
|
|
137
133
|
from cte_forwarded_cost fc
|
|
138
134
|
left join products p on p.id = fc.product_id
|
|
139
135
|
where running_year_month = to_date(to_char($3::date, 'YYYY-MM'),'YYYY-MM')::timestamp
|
|
140
|
-
group by p.sku, p."name", p.description, p."type", fc.domain_id, fc.bizplace_id, fc.
|
|
136
|
+
group by p.sku, p."name", p.description, p."type", fc.domain_id, fc.bizplace_id, fc.product_detail_id, fc.uom, fc.running_year_month
|
|
141
137
|
) fc
|
|
142
138
|
left join tmp_outbound_ord outboundord on outboundord.domain_id = fc.domain_id
|
|
143
139
|
and outboundord.bizplace_id = fc.bizplace_id
|
|
144
|
-
and outboundord.
|
|
145
|
-
and outboundord.packing_type = fc.packing_type
|
|
146
|
-
and outboundord.packing_size = fc.packing_size
|
|
140
|
+
and outboundord.product_detail_id = fc.product_detail_id
|
|
147
141
|
and outboundord.uom = fc.uom
|
|
148
142
|
);
|
|
149
143
|
`,
|
|
@@ -151,7 +145,7 @@ export const costingReport = {
|
|
|
151
145
|
)
|
|
152
146
|
|
|
153
147
|
const total: any = await tx.query(`
|
|
154
|
-
select count(*) from temp_costing_report
|
|
148
|
+
select count(*) from temp_costing_report
|
|
155
149
|
`)
|
|
156
150
|
|
|
157
151
|
const result: any = await tx.query(
|
|
@@ -81,16 +81,16 @@ export const inboundOrderDetailsReport = {
|
|
|
81
81
|
ih.unit_cost,
|
|
82
82
|
ih.created_at as "unloaded_at",u2.name as "unloaded_by",
|
|
83
83
|
ih2.created_at as "putaway_at", u3.name as "putaway_by",
|
|
84
|
-
coalesce((select volume from product_details pd where pd.
|
|
84
|
+
coalesce((select volume from product_details pd where pd.id = i.product_detail_id
|
|
85
85
|
order by created_at desc
|
|
86
86
|
fetch first 1 rows only),0) as unit_volume,
|
|
87
|
-
coalesce((select nett_weight from product_details pd where pd.
|
|
87
|
+
coalesce((select nett_weight from product_details pd where pd.id = i.product_detail_id
|
|
88
88
|
order by created_at desc
|
|
89
89
|
fetch first 1 rows only),0) as unit_nett_weight,
|
|
90
|
-
coalesce((select gross_weight from product_details pd where pd.
|
|
90
|
+
coalesce((select gross_weight from product_details pd where pd.id = i.product_detail_id
|
|
91
91
|
order by created_at desc
|
|
92
92
|
fetch first 1 rows only),0) as unit_gross_weight,
|
|
93
|
-
coalesce((select weight_unit from product_details pd where pd.
|
|
93
|
+
coalesce((select weight_unit from product_details pd where pd.id = i.product_detail_id
|
|
94
94
|
order by created_at desc
|
|
95
95
|
fetch first 1 rows only),'') as weight_unit
|
|
96
96
|
from (
|
|
@@ -111,8 +111,8 @@ export const inboundOrderDetailsReport = {
|
|
|
111
111
|
inner join reduced_inventory_histories ih2 on ih2.inventory_id = oi.inventory_id and ih2.transaction_type ='PUTAWAY' and ih2.ref_order_id = an.id::varchar
|
|
112
112
|
left join users u3 on u3.id = ih2.creator_id
|
|
113
113
|
inner join temp_products p on p.id = ih.product_id
|
|
114
|
-
inner join order_products op on op.arrival_notice_id = an.id and op.actual_pack_qty is not null and op.
|
|
115
|
-
op.batch_id = ih.batch_id
|
|
114
|
+
inner join order_products op on op.arrival_notice_id = an.id and op.actual_pack_qty is not null and op.product_detail_id = ih.product_detail_id and
|
|
115
|
+
op.batch_id = ih.batch_id
|
|
116
116
|
order by an.name, p.sku, ih.batch_id
|
|
117
117
|
) src
|
|
118
118
|
where 1=1
|
|
@@ -79,7 +79,7 @@ export const inboundSerialNumberReport = {
|
|
|
79
79
|
select * from (
|
|
80
80
|
select
|
|
81
81
|
row_number() over(partition by an."name" order by coalesce(w.started_at, ii.created_at), p.sku ) as "no",
|
|
82
|
-
case when "source" = 'ADJUSTMENT' then 'adjustment' else an."name" end as "order_no",
|
|
82
|
+
case when "ii"."source" = 'ADJUSTMENT' then 'adjustment' else an."name" end as "order_no",
|
|
83
83
|
i.pallet_id, i.carton_id,an.ref_no, an.ref_no_2, an.ref_no_3,
|
|
84
84
|
p.id as "product_id", p.sku as "product_sku", p.brand_sku as "product_brand_sku",
|
|
85
85
|
p.name as "product_name", p.description as "product_description", p."type" as "product_type",
|
|
@@ -56,7 +56,7 @@ export const outboundOrderDetailsReport = {
|
|
|
56
56
|
select * from (
|
|
57
57
|
select oi.id,
|
|
58
58
|
oi.release_qty AS "release_qty", oi.picked_at, oi.picked_by, oi.packed_at, oi.packed_by, oi.loaded_at, oi.loaded_by,
|
|
59
|
-
oi.release_qty as "qty", oi.release_uom_value as "uom_value", oi.return_to_location_qty, oi.return_to_location_uom_value,
|
|
59
|
+
oi.release_qty as "qty", oi.release_uom_value as "uom_value", oi.return_to_location_qty, oi.return_to_location_uom_value, oi.product_detail_id,
|
|
60
60
|
coalesce(do2.other_driver, td.name) as driver_name,
|
|
61
61
|
coalesce(do2.truck_no, tv.name, rg.truck_no) as vehicle_no,
|
|
62
62
|
do2.name AS "delivery_order_no", do2.delivery_date AS "delivery_order_delivery_date", do2."to", do2.contact_point_ref_id, do2.pallet_qty,
|
|
@@ -67,8 +67,7 @@ export const outboundOrderDetailsReport = {
|
|
|
67
67
|
rg.export_option, rg.name AS "ro_no", rg."type" as "ro_type", rg.ref_no AS "ref_no_1", rg.ref_no_2 AS "ref_no_2", rg.ref_no_3 AS "ref_no_3", rg.status as "ro_status",
|
|
68
68
|
u1.name as "order_created_by", rg.created_at AS "order_created_at",
|
|
69
69
|
rg.accepted_at, u4.name as accepted_by, rg.checked_remark_by, rg.checked_remark_at, coalesce(do2.own_collection, rg.own_transport) AS own_transport,
|
|
70
|
-
p.id as "product_id", p.sku as "product_sku", p.name AS "product_name", p.description AS "product_description", p.type as "product_type",
|
|
71
|
-
i.packing_type as "pack_type", i.packing_size as "pack_size",
|
|
70
|
+
p.id as "product_id", p.sku as "product_sku", p.name AS "product_name", p.description AS "product_description", p.type as "product_type", oi.packing_type as "packing_type", oi.packing_size as "packing_size",
|
|
72
71
|
i.uom, i.unit_cost,
|
|
73
72
|
i.id as inventory_id, i.pallet_id, i.carton_id, i.batch_id, i.batch_id_ref, i.expiration_date, i.manufacture_date,
|
|
74
73
|
coalesce(ms.name,'') as manifest_no, coalesce(rg.manifested_at, ms.created_at) as manifested_at, coalesce(u6.name, u5.name) as manifested_by
|
|
@@ -126,16 +125,16 @@ export const outboundOrderDetailsReport = {
|
|
|
126
125
|
wsort.started_at as sorting_start, wsort.ended_at as sorting_complete,
|
|
127
126
|
wload.started_at as loading_start, wload.ended_at as loading_complete,
|
|
128
127
|
coalesce(delivery_address, concat(cp.address, cp.address_2)) as "delivery_address",
|
|
129
|
-
coalesce((select volume from product_details pd where pd.
|
|
128
|
+
coalesce((select volume from product_details pd where pd.id = oi.product_detail_id
|
|
130
129
|
order by created_at desc
|
|
131
130
|
fetch first 1 rows only),0) as unit_volume,
|
|
132
|
-
coalesce((select nett_weight from product_details pd where pd.
|
|
131
|
+
coalesce((select nett_weight from product_details pd where pd.id = oi.product_detail_id
|
|
133
132
|
order by created_at desc
|
|
134
133
|
fetch first 1 rows only),0) as unit_nett_weight,
|
|
135
|
-
coalesce((select gross_weight from product_details pd where pd.
|
|
134
|
+
coalesce((select gross_weight from product_details pd where pd.id = oi.product_detail_id
|
|
136
135
|
order by created_at desc
|
|
137
136
|
fetch first 1 rows only),0) as unit_gross_weight,
|
|
138
|
-
coalesce((select weight_unit from product_details pd where pd.
|
|
137
|
+
coalesce((select weight_unit from product_details pd where pd.id = oi.product_detail_id
|
|
139
138
|
order by created_at desc
|
|
140
139
|
fetch first 1 rows only),'') as weight_unit,
|
|
141
140
|
coalesce((select unit_cost from reduced_inventory_histories rih where
|
|
@@ -200,8 +199,8 @@ export const outboundOrderDetailsReport = {
|
|
|
200
199
|
description: itm.product_description,
|
|
201
200
|
type: itm.product_type
|
|
202
201
|
},
|
|
203
|
-
packType: itm.
|
|
204
|
-
packSize: itm.
|
|
202
|
+
packType: itm.packing_type,
|
|
203
|
+
packSize: itm.packing_size,
|
|
205
204
|
qty: Math.abs(itm.qty),
|
|
206
205
|
uomValue: Math.abs(itm.uom_value),
|
|
207
206
|
uom: itm.uom,
|