[lsaveInsObjSlip] insert into T_DERIVERY_PRODUCT ( NO_DERIVERY_PRODUCT ,DT_DERIVERY_PRODUCT ,DTS_YEAR ,DTS_MONTH ,DTS_DAY ,NO_PALLET ,CD_STAFF ,CD_CUSTOMER ,CD_DERIVERY ,CD_PRODUCT ,CD_GREAD ,TM_FINISHED ,WEIGHT_MOIST ,RATIO_MOIST ,WEIGHT_DRY ,UNIT_COST_PRODUCT ,MONEY_COST_PRODUCT ,DT_SHIPSLIP ,CD_PULPER ,NO_BATCH ,NOTE ,DIV_INSPECT ,DIV_SHIP ,FLG_DELETE ,ID_REGIST ,ID_UPDATE ,ID_DELETE ,DT_REGIST ,DT_UPDATE ,DT_DELETE ,NOTE_KEIKOU ,NOTE_KYOUZATSU ,NOTE_ARUMI ,NOTE_SHIROBOTSU ,CD_WAREHOUSE ,DIV_EDIT_WEIGHT_DRY ) values ( &2 ,to_date('&3', 'yyyymmdd') ,&4 ,&5 ,&6 ,&7 ,&8 ,&9 ,&10 ,&11 ,&12 ,to_timestamp('&13', 'yyyymmddhh24mi') ,&14 ,&15 ,&16 ,null ,null ,to_date('&19', 'yyyymmdd') ,&20 ,&21 ,'&22' ,&23 ,0 ,0 ,'&1' ,null ,null ,to_timestamp(to_char(now(), 'yyyymmddhh24:mi:ss'), 'yyyymmddhh24:mi:ss') --問題はなさそうだけど、念のためミリ秒切り捨て ,null ,null ,&24 ,&25 ,&26 ,&27 ,0 ,coalesce(&29, 0) ) [lsaveUpdObjSlip] insert into T_DERIVERY_PRODUCT ( NO_DERIVERY_PRODUCT ,DT_DERIVERY_PRODUCT ,DTS_YEAR ,DTS_MONTH ,DTS_DAY ,NO_PALLET ,CD_STAFF ,CD_CUSTOMER ,CD_DERIVERY ,CD_PRODUCT ,CD_GREAD ,TM_FINISHED ,WEIGHT_MOIST ,RATIO_MOIST ,WEIGHT_DRY ,UNIT_COST_PRODUCT ,MONEY_COST_PRODUCT ,DT_SHIPSLIP ,CD_PULPER ,NO_BATCH ,NOTE ,DIV_INSPECT ,DIV_SHIP ,FLG_DELETE ,ID_REGIST ,ID_UPDATE ,ID_DELETE ,DT_REGIST ,DT_UPDATE ,DT_DELETE ,NOTE_KEIKOU ,NOTE_KYOUZATSU ,NOTE_ARUMI ,NOTE_SHIROBOTSU ,CD_WAREHOUSE ,DIV_EDIT_WEIGHT_DRY ) values ( &2 ,to_date(to_char(&4) || lpad(to_char(&5), 2, '0') || lpad(to_char(&6), 2, '0'), 'yyyymmdd') ,&4 ,&5 ,&6 ,&7 ,&8 ,&9 ,&10 ,&11 ,&12 ,to_timestamp('&13', 'yyyymmddhh24mi') ,&14 ,&15 ,&16 ,null ,null ,to_date('&19', 'yyyymmdd') ,&20 ,&21 ,'&22' ,&23 ,&28 ,0 ,'&29' ,'&1' ,null ,to_timestamp('&30', 'yyyymmddhh24miss') ,to_timestamp(to_char(now(), 'yyyymmddhh24:mi:ss'), 'yyyymmddhh24:mi:ss') --問題はなさそうだけど、念のためミリ秒切り捨て ,null ,&24 ,&25 ,&26 ,&27 ,0 ,coalesce(&32, 0) ) [lsaveResetObjSlip] delete from T_DERIVERY_PRODUCT where NO_DERIVERY_PRODUCT = &2 [lsaveDelObjSlip] update T_DERIVERY_PRODUCT set FLG_DELETE = 1 ,ID_DELETE = '&1' ,DT_DELETE = to_timestamp(to_char(now(), 'yyyymmddhh24:mi:ss'), 'yyyymmddhh24:mi:ss') --問題はなさそうだけど、念のためミリ秒切り捨て where NO_DERIVERY_PRODUCT = &2 [lsaveUpdSameSlips] --#24421 2022.06.17 MOD STT --declare begin -- NSP_PacMain.changeSameDtSIIREDerProd( '&1', '&2' ); -- PRC_UPDATE_MONTHLY('&2','&1'); --end; select changeSameDtSIIREDerProd('&1', '&2'); select PRC_UPDATE_MONTHLY('&2', '&1'); --#24421 2022.06.17 MOD END [lsaveUpdChangeProducts] update T_DERIVERY_PRODUCT set DT_SHIPSLIP = to_date('&3', 'yyyy/mm/dd') ,NO_BATCH = &4 ,ID_UPDATE = '&1' ,DT_UPDATE = sysdate where NO_DERIVERY_PRODUCT = &2 [lsaveExecProcs] --#24421 2022.06.17 MOD STT --declare begin NSP_PacMain.changeDeriveryProduct( '&1', &2, &3 );end; select changeDeriveryProduct('&1', &2, &3); --#24421 2022.06.17 MOD END [lloadObject] select TO_CHAR(m1.DT_DERIVERY_PRODUCT, 'yyyy/mm/dd') DT_DERIVERY_PRODUCT ,m1.DTS_YEAR ,m1.DTS_MONTH ,m1.DTS_DAY ,m1.NO_DERIVERY_PRODUCT ,m1.CD_STAFF ,m1.CD_CUSTOMER ,m1.CD_DERIVERY ,m1.CD_PRODUCT ,m1.CD_WAREHOUSE ,to_char(m1.DT_SHIPSLIP, 'yyyymmdd') AS DT_SHIPSLIP ,m1.NO_BATCH ,to_char(m1.TM_FINISHED, 'yyyy') as TM_FINISHED_YEAR ,to_char(m1.TM_FINISHED, 'mm') as TM_FINISHED_MONTH ,to_char(m1.TM_FINISHED, 'dd') as TM_FINISHED_DAY ,to_char(m1.TM_FINISHED, 'hh24') as TM_FINISHED_HOUR ,to_char(m1.TM_FINISHED, 'mi') as TM_FINISHED_MINUTE ,m1.NO_PALLET ,coalesce(m1.WEIGHT_MOIST, 0) as WEIGHT_MOIST ,m1.NOTE AS CD_NOTE ,m1.NOTE_KEIKOU ,m1.NOTE_KYOUZATSU ,m1.NOTE_ARUMI ,m1.NOTE_SHIROBOTSU --#24303 2022.06.17 MOD STT -- , decode( m1.DIV_INSPECT, 2, null, m1.RATIO_MOIST ) as RATIO_MOIST ,case m1.DIV_INSPECT when 2 then null else m1.RATIO_MOIST end as RATIO_MOIST --#24303 2022.06.17 MOD END ,m1.DIV_INSPECT ,m1.DIV_SHIP ,m1.ID_REGIST ,to_char(m1.DT_REGIST , 'yyyymmddhh24miss ') DT_REGIST ,coalesce(m1.DIV_EDIT_WEIGHT_DRY, 0) DIV_EDIT_WEIGHT_DRY ,m1.WEIGHT_DRY ,m1.RATIO_MOIST as RATIO_MOIST_SUB ,TO_CHAR(m1.DT_DERIVERY_PRODUCT, 'yyyymmdd') as DT_DERIVERY_PRODUCT_NUM from T_DERIVERY_PRODUCT m1 where m1.NO_DERIVERY_PRODUCT = &1 and m1.FLG_DELETE = 0 [lloadObjects] select TO_CHAR(m1.DT_DERIVERY_PRODUCT, 'yyyy/mm/dd') DT_DERIVERY_PRODUCT ,m1.DTS_YEAR ,m1.DTS_MONTH ,m1.DTS_DAY ,m1.NO_DERIVERY_PRODUCT ,m1.CD_CUSTOMER ,m1.CD_DERIVERY ,m1.CD_PRODUCT ,m1.CD_GREAD AS CD_GRADE_PRODUCT ,m1.CD_WAREHOUSE ,to_char(m1.TM_FINISHED, 'hh24:mi') as TM_FINISHED ,to_char(m1.TM_FINISHED, 'hh24') as TM_FINISHED_HOUR ,to_char(m1.TM_FINISHED, 'mi') as TM_FINISHED_MINUTE ,coalesce(m1.WEIGHT_MOIST, 0) as WEIGHT_MOIST --#24303 2022.06.17 MOD STT -- , decode( m1.DIV_INSPECT, 2, null, m1.RATIO_MOIST ) as RATIO_MOIST ,case m1.DIV_INSPECT when 2 then null else m1.RATIO_MOIST end as RATIO_MOIST --#24303 2022.06.17 MOD END ,m1.NOTE ,m1.NOTE AS CD_NOTE ,m1.NOTE_KEIKOU ,m1.NOTE_ZANPORI ,m1.NOTE_IROBUTU ,m1.NOTE_KYOUZATSU ,m1.NOTE_ARUMI ,m1.NOTE_SHIROBOTSU ,m1.NO_PALLET ,m2.NAME_STAFF ,m3.NAME_CUSTOMER ,m4.NAME_DERIVERY ,m5.NAME_PRODUCT ,m6.NAME_WAREHOUSE ,m1.CD_STAFF ,m1.NO_BATCH ,m1.DIV_INSPECT ,m1.DIV_SHIP ,m1.ID_REGIST ,to_char(m1.DT_REGIST , 'yyyymmddhh24miss ') DT_REGIST ,to_char(m1.DT_SHIPSLIP, 'yyyymmdd') AS DT_SHIPSLIP ,to_char(m1.TM_FINISHED, 'yyyy') as TM_FINISHED_YEAR ,to_char(m1.TM_FINISHED, 'mm') as TM_FINISHED_MONTH ,to_char(m1.TM_FINISHED, 'dd') as TM_FINISHED_DAY ,coalesce(m1.DIV_EDIT_WEIGHT_DRY, 0) DIV_EDIT_WEIGHT_DRY ,m1.WEIGHT_DRY --#24303 2022.06.17 MOD STT -- , decode(m1.DIV_SHIP,'1','出荷済','') as TXT_DIV_SHIP -- , decode(m1.CD_GREAD,'1','A','2','B','3','C','4','D','') as TXT_TYPE ,case m1.DIV_SHIP when '1' then '出荷済' else '' end as TXT_DIV_SHIP ,case m1.CD_GREAD when '1' then 'A' when '2' then 'B' when '3' then 'C' when '4' then 'D' else '' end as TXT_TYPE --#24303 2022.06.17 MOD END from T_DERIVERY_PRODUCT m1 , M_STAFF m2 , M_CUSTOMER m3 , M_DERIVERY m4 , M_PRODUCT m5 , M_WAREHOUSE m6 where ((&1 is null) or (m1.DTS_YEAR = &1)) and ((&2 is null) or (m1.DTS_MONTH = &2)) and ((&3 is null) or (m1.DTS_DAY = &3)) and m1.CD_PULPER = &4 and ((&5 is null) or (m1.CD_CUSTOMER = &5)) and ((&6 is null) or (m1.CD_DERIVERY = &6)) and ((&7 is null) or (m1.CD_PRODUCT = &7)) and (&8 = '0' or m1.div_ship = '0') and m1.FLG_DELETE = 0 and m2.CD_STAFF = m1.CD_STAFF and m3.CD_CUSTOMER = m1.CD_CUSTOMER and m3.DT_START <= m1.DT_DERIVERY_PRODUCT and m3.DT_END >= m1.DT_DERIVERY_PRODUCT and m4.CD_DERIVERY = m1.CD_DERIVERY and m4.DT_START <= m1.DT_DERIVERY_PRODUCT and m4.DT_END >= m1.DT_DERIVERY_PRODUCT and m5.CD_PRODUCT = m1.CD_PRODUCT and m5.DT_START <= m1.DT_DERIVERY_PRODUCT and m5.DT_END >= m1.DT_DERIVERY_PRODUCT and m6.CD_WAREHOUSE = m1.CD_WAREHOUSE order by DT_DERIVERY_PRODUCT desc, NO_PALLET desc [lloadSummary] select CD_GRADE ,GRADE ,to_char(sum(WEIGHT_MOIST)) as WEIGHT_MOIST ,to_char(sum(RATIO_MOIST)) as RATIO_MOIST ,to_char(sum(WEIGHT_DRY)) as WEIGHT_DRY from ( select m2.CD_GRADE ,m2.NAME_GREAD as GRADE ,to_number(null) as WEIGHT_MOIST ,to_number(null) as RATIO_MOIST ,to_number(null) as WEIGHT_DRY from M_GREAD m2 union all select m1.CD_GREAD AS CD_GRADE ,m2.NAME_GREAD as GRADE ,sum(m1.WEIGHT_MOIST) as WEIGHT_MOIST ,round(avg(m1.RATIO_MOIST), 1) as RATIO_MOIST ,sum(m1.WEIGHT_DRY) as WEIGHT_DRY from T_DERIVERY_PRODUCT m1 , M_GREAD m2 where m1.DT_DERIVERY_PRODUCT = to_date('&1', 'yyyymmdd') and m1.CD_PULPER = &2 and m1.FLG_DELETE = 0 and m2.CD_GRADE = m1.CD_GREAD group by m1.CD_GREAD , m2.NAME_GREAD ) w group by CD_GRADE , GRADE order by CD_GRADE , GRADE [lloadPalletNo] select max(coalesce(m1.NO_PALLET, 0)) as NO_PALLET from T_DERIVERY_PRODUCT m1 where m1.DT_DERIVERY_PRODUCT = to_date('&1', 'yyyymmdd') and m1.CD_PULPER = &2 [lloadTargetBatchs] select substr(max(to_char(m1.DT_SHIPSLIP, 'yyyymmdd') || ltrim(to_char(m1.NO_BATCH, '000000'))), 1, 8) as DT_SHIPSLIP ,to_number(substr(max(to_char(m1.DT_SHIPSLIP, 'yyyymmdd') || ltrim(to_char(m1.NO_BATCH, '000000'))), 9)) as NO_BATCH ,to_char(max(m1.TM_FINISHED), 'yyyymmddhh24miss') as TM_FINISHED from T_DERIVERY_PRODUCT m1 where m1.CD_PULPER = &1 and m1.FLG_DELETE = 0 [lloadBatchInfos] select to_char(m1.DT_SHIPSLIP, 'yyyymmdd') as DT_SHIPSLIP ,coalesce(m1.NO_BATCH, 0) as NO_BATCH ,coalesce(m1.CD_CUSTOMER, 0) as CD_CUSTOMER ,coalesce(m1.CD_DERIVERY, 0) as CD_DERIVERY ,coalesce(m1.CD_PRODUCT, 0) as CD_PRODUCT from T_SHIP_WP m1 where (('&1' is null) or (m1.DT_SHIPSLIP >= to_date('&1', 'yyyymmdd'))) and m1.FLG_DELETE = 0 and m1.CD_PULPER = &2 and ((&3 is null) or (m1.DT_SHIPSLIP > to_date('&1', 'yyyymmdd')) or (m1.NO_BATCH >= &3)) group by to_char(m1.DT_SHIPSLIP, 'yyyymmdd'), coalesce(m1.NO_BATCH, 0), coalesce(m1.CD_CUSTOMER, 0), coalesce(m1.CD_DERIVERY, 0), coalesce(m1.CD_PRODUCT, 0) order by DT_SHIPSLIP, NO_BATCH [lloadSubWpObjects] select m1.NO_SHIPSLIP ,to_char(m1.DT_SHIPSLIP, 'yyyy/mm/dd') as DT_SHIPSLIP ,m1.NO_BATCH as NO_BATCH ,m1.CD_CUSTOMER as CD_CUSTOMER ,m1.CD_DERIVERY as CD_DERIVERY ,m1.CD_PRODUCT as CD_PRODUCT ,m3.NAME_CUSTOMER ,m4.NAME_DERIVERY ,m5.NAME_PRODUCT ,sum(m1.WEIGHT_WP) as WEIGHT_WP from T_SHIP_WP m1 , M_CUSTOMER m3 , M_DERIVERY m4 , M_PRODUCT m5 where m1.DT_SHIPSLIP >= to_date('&1', 'yyyymmdd') - 1 and m1.DT_SHIPSLIP <= to_date('&1', 'yyyymmdd') + 1 and m1.FLG_DELETE = 0 and m1.CD_PULPER = &2 and m3.CD_CUSTOMER = m1.CD_CUSTOMER and m3.DT_START <= m1.DT_SHIPSLIP and m3.DT_END >= m1.DT_SHIPSLIP and m4.CD_DERIVERY = m1.CD_DERIVERY and m4.DT_START <= m1.DT_SHIPSLIP and m4.DT_END >= m1.DT_SHIPSLIP and m5.CD_PRODUCT = m1.CD_PRODUCT and m5.DT_START <= m1.DT_SHIPSLIP and m5.DT_END >= m1.DT_SHIPSLIP group by m1.NO_SHIPSLIP , to_char(m1.DT_SHIPSLIP, 'yyyy/mm/dd'), m1.NO_BATCH , m1.CD_CUSTOMER , m1.CD_DERIVERY , m1.CD_PRODUCT , m3.NAME_CUSTOMER , m4.NAME_DERIVERY , m5.NAME_PRODUCT order by DT_SHIPSLIP, NO_BATCH [lloadSubProductObjects] select m1.NO_DERIVERY_PRODUCT ,to_char(m1.DT_DERIVERY_PRODUCT, 'yyyy/mm/dd') as DT_DERIVERY_PRODUCT ,to_char(m1.DT_SHIPSLIP, 'yyyy/mm/dd') as DT_SHIPSLIP ,m1.NO_BATCH ,m1.NO_PALLET ,m3.NAME_CUSTOMER ,m4.NAME_DERIVERY ,m5.NAME_PRODUCT ,m6.NAME_WAREHOUSE ,m1.WEIGHT_MOIST from T_DERIVERY_PRODUCT m1 , M_CUSTOMER m3 , M_DERIVERY m4 , M_PRODUCT m5 , M_WAREHOUSE m6 where m1.DT_DERIVERY_PRODUCT >= ( select least(to_date('&1', 'yyyymmdd') - 1, nvl(min(m1.DT_DERIVERY_PRODUCT), to_date('&1', 'yyyymmdd') - 1)) from T_DERIVERY_PRODUCT m1 where m1.FLG_DELETE = 0 and (m1.DT_SHIPSLIP, m1.CD_PULPER, m1.NO_BATCH) IN ( select m1.DT_SHIPSLIP ,m1.CD_PULPER ,m1.NO_BATCH from T_SHIP_WP m1 where m1.DT_SHIPSLIP >= to_date('&1', 'yyyymmdd') - 1 and m1.DT_SHIPSLIP <= to_date('&1', 'yyyymmdd') + 1 and m1.FLG_DELETE = 0 and m1.CD_PULPER = &2 group by m1.DT_SHIPSLIP, m1.CD_PULPER, m1.NO_BATCH)) and m1.DT_DERIVERY_PRODUCT <= ( select greatest(to_date('&1', 'yyyymmdd') + 1, nvl(max(m1.DT_DERIVERY_PRODUCT), to_date('&1', 'yyyymmdd') + 1)) from T_DERIVERY_PRODUCT m1 where m1.FLG_DELETE = 0 and (m1.DT_SHIPSLIP, m1.CD_PULPER, m1.NO_BATCH) IN ( select m1.DT_SHIPSLIP ,m1.CD_PULPER ,m1.NO_BATCH from T_SHIP_WP m1 where m1.DT_SHIPSLIP >= to_date('&1', 'yyyymmdd') - 1 and m1.DT_SHIPSLIP <= to_date('&1', 'yyyymmdd') + 1 and m1.FLG_DELETE = 0 and m1.CD_PULPER = &2 group by m1.DT_SHIPSLIP, m1.CD_PULPER, m1.NO_BATCH)) and m1.CD_PULPER = &2 and m1.FLG_DELETE = 0 and m3.CD_CUSTOMER = m1.CD_CUSTOMER and m3.DT_START <= m1.DT_DERIVERY_PRODUCT and m3.DT_END >= m1.DT_DERIVERY_PRODUCT and m4.CD_DERIVERY = m1.CD_DERIVERY and m4.DT_START <= m1.DT_DERIVERY_PRODUCT and m4.DT_END >= m1.DT_DERIVERY_PRODUCT and m5.CD_PRODUCT = m1.CD_PRODUCT and m5.DT_START <= m1.DT_DERIVERY_PRODUCT and m5.DT_END >= m1.DT_DERIVERY_PRODUCT and m6.CD_WAREHOUSE = m1.CD_WAREHOUSE order by DT_DERIVERY_PRODUCT, NO_PALLET [lloadHead] SELECT MC.NAME_CUSTOMER ,MD.NAME_DERIVERY ,MP.NAME_PRODUCT ,MS.NAME_STAFF FROM --#24303 2022.06.17 MOD STT -- --得意先マスター -- (SELECT CD_CUSTOMER, NAME_CUSTOMER FROM M_CUSTOMER -- WHERE DT_START <= TO_DATE('&1','YYYY/MM/DD') -- AND DT_END >= TO_DATE('&1','YYYY/MM/DD') -- AND FLG_DELETE = 0 ) MC -- --納品先マスター -- ,(SELECT CD_DERIVERY, CD_CUSTOMER, NAME_DERIVERY FROM M_DERIVERY -- WHERE DT_START <= TO_DATE('&1','YYYY/MM/DD') -- AND DT_END >= TO_DATE('&1','YYYY/MM/DD') -- AND FLG_DELETE = 0 ) MD -- --製品マスター -- ,(SELECT CD_PRODUCT, CD_GREAD, NAME_PRODUCT FROM M_PRODUCT -- WHERE DT_START <= TO_DATE('&1','YYYY/MM/DD') -- AND DT_END >= TO_DATE('&1','YYYY/MM/DD') -- AND FLG_DELETE = 0 ) MP -- --社員名マスタ -- ,(SELECT CD_STAFF, NAME_STAFF FROM M_STAFF -- WHERE FLG_DELETE = 0 ) MS -- -- --納品先製品マスター -- ,M_DERIVERY_PRODUCT MDP -- --製品受入データ -- ,T_DERIVERY_PRODUCT TDP --製品受入データ T_DERIVERY_PRODUCT TDP --得意先マスター left join ( SELECT CD_CUSTOMER ,NAME_CUSTOMER FROM M_CUSTOMER --#24422 2022.06.17 MOD STT -- WHERE DT_START <= TO_DATE('&1','YYYY/MM/DD') -- AND DT_END >= TO_DATE('&1','YYYY/MM/DD') WHERE DT_START <= TO_DATE('&1', 'YYYYMMDD') AND DT_END >= TO_DATE('&1', 'YYYYMMDD') --#24422 2022.06.17 MOD END AND FLG_DELETE = 0 ) MC on (TDP.CD_CUSTOMER = MC.CD_CUSTOMER) --納品先マスター left join ( SELECT CD_DERIVERY ,CD_CUSTOMER ,NAME_DERIVERY FROM M_DERIVERY --#24422 2022.06.17 MOD STT -- WHERE DT_START <= TO_DATE('&1','YYYY/MM/DD') -- AND DT_END >= TO_DATE('&1','YYYY/MM/DD') WHERE DT_START <= TO_DATE('&1', 'YYYYMMDD') AND DT_END >= TO_DATE('&1', 'YYYYMMDD') --#24422 2022.06.17 MOD END AND FLG_DELETE = 0 ) MD on (MC.CD_CUSTOMER = MD.CD_CUSTOMER AND TDP.CD_DERIVERY = MD.CD_DERIVERY) --製品マスター left join ( SELECT CD_PRODUCT ,CD_GREAD ,NAME_PRODUCT FROM M_PRODUCT --#24422 2022.06.17 MOD STT -- WHERE DT_START <= TO_DATE('&1','YYYY/MM/DD') -- AND DT_END >= TO_DATE('&1','YYYY/MM/DD') WHERE DT_START <= TO_DATE('&1', 'YYYYMMDD') AND DT_END >= TO_DATE('&1', 'YYYYMMDD') --#24422 2022.06.17 MOD END AND FLG_DELETE = 0 ) MP on (TDP.CD_PRODUCT = MP.CD_PRODUCT) --納品先製品マスター inner join M_DERIVERY_PRODUCT MDP on (MDP.CD_DERIVERY = MD.CD_DERIVERY AND MDP.CD_PRODUCT = MP.CD_PRODUCT) --社員名マスタ left join ( SELECT CD_STAFF ,NAME_STAFF FROM M_STAFF WHERE FLG_DELETE = 0 ) MS on (TDP.CD_STAFF = MS.CD_STAFF) --#24303 2022.06.17 MOD ENDT --#24303 2022.06.17 MOD STT -- WHERE TDP.CD_CUSTOMER = MC.CD_CUSTOMER(+) -- AND TDP.CD_DERIVERY = MD.CD_DERIVERY(+) -- AND TDP.CD_PRODUCT = MP.CD_PRODUCT(+) -- AND MC.CD_CUSTOMER = MD.CD_CUSTOMER -- AND MDP.CD_DERIVERY = MD.CD_DERIVERY -- AND MDP.CD_PRODUCT = MP.CD_PRODUCT -- AND TDP.CD_STAFF = MS.CD_STAFF(+) WHERE 1 = 1 --#24303 2022.06.17 MOD END AND TDP.DT_DERIVERY_PRODUCT = TO_DATE('&1', 'yyyymmdd') AND TDP.NO_PALLET = TO_NUMBER('&2')