summaryrefslogtreecommitdiff
path: root/calculate_leadtime_po_to_mr.ktr
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2025-07-30 15:13:33 +0700
committerstephanchrst <stephanchrst@gmail.com>2025-07-30 15:13:33 +0700
commit93a37ac4003393066187b10300a75964a24becbb (patch)
treecc9d8d6978c7cf8a6d846ca6b33e7d426389da40 /calculate_leadtime_po_to_mr.ktr
parentde1604c3079cdb6d5495e69ce71bf03aca171fed (diff)
change to 24 hour and exclude sunday and holiday
Diffstat (limited to 'calculate_leadtime_po_to_mr.ktr')
-rw-r--r--calculate_leadtime_po_to_mr.ktr14
1 files changed, 7 insertions, 7 deletions
diff --git a/calculate_leadtime_po_to_mr.ktr b/calculate_leadtime_po_to_mr.ktr
index 282cf26..5067a75 100644
--- a/calculate_leadtime_po_to_mr.ktr
+++ b/calculate_leadtime_po_to_mr.ktr
@@ -1098,7 +1098,7 @@ else{
<connection>dw bi indoteknik (localhost)</connection>
<sql>select po_confirm_date, received_good_date, purchase_line_id, purchase_id, received_id
from mv_leadtime_po_to_received
---where purchase_id = 25089 and purchase_line_id = 141455 and received_id in (78477, 78910)</sql>
+--where purchase_id = 24864 and purchase_line_id = 140704 and received_id in (76715)</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
@@ -1263,12 +1263,12 @@ hours AS (
filtered_hours AS (
SELECT ts
FROM hours
- WHERE
- EXTRACT(HOUR FROM ts) BETWEEN 8 AND 17
- AND (
- EXTRACT(HOUR FROM ts) > 8 OR EXTRACT(MINUTE FROM ts) >= 30
- )
- --AND EXTRACT(DOW FROM ts) NOT IN (0)
+ WHERE 1=1
+ --AND EXTRACT(HOUR FROM ts) BETWEEN 8 AND 17
+ --AND (
+ -- EXTRACT(HOUR FROM ts) > 8 OR EXTRACT(MINUTE FROM ts) >= 30
+ --)
+ AND EXTRACT(DOW FROM ts) NOT IN (0)
AND DATE(ts) NOT IN (SELECT holiday_date FROM holidays)
)
SELECT COUNT(*) AS new_po_to_arrival, ? as purchase_line_id, ? as purchase_id, ? as received_id