Commit 99117297 authored by jshinde's avatar jshinde

Request ID:W15HSUN003 ,pallet request with stock details .


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99445 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 500ffb51
......@@ -365,6 +365,58 @@ and FN_CHK_PRS(SUBSTR(S.LOC_CODE,1,INSTR(S.LOC_CODE,''Q'')-1)) = 0'
--------------------------------------------------------16/12/2015------------------------------------------------------------------
delete from pophelp where mod_name='W_PALLET_REQ_STK' AND field_name='PALLET_NO';
commit;
INSERT INTO POPHELP (FIELD_NAME,MOD_NAME,SQL_STR,MSG_TITLE,WIDTH,HEIGHT,CHG_DATE,CHG_USER,
chg_term,dist_opt,sql_input,help_option)
values ('PALLET_NO','W_PALLET_REQ_STK','select distinct s.loc_code as pallet_no from stock s where
S.INV_STAT IN (''AWMS'') AND S.SITE_CODE=''?'' AND S.QUANTITY > 0 and FN_CHK_PRS(TRIM(S.LOC_CODE),'''') = 0
union all
select distinct substr(s.loc_code,1,instr(s.loc_code,''Q'')-1) from stock s where
s.inv_stat in (''AWMSQ'') and s.site_code=''?'' and s.quantity > 0
and FN_CHK_PRS(SUBSTR(S.LOC_CODE,1,INSTR(S.LOC_CODE,''Q'')-1),'''') = 0'
,'User-defined Type',0,0,sysdate,'BASE','BASE','0',':site_code,:site_code',
'0');
----------------------------------function-----------------------------------------------------
create or replace function fn_chk_prs
(as_loccode location.loc_code%type,as_tranid in pallet_req_hdr.tran_id%type)
return number is
ll_retval number(1) := 0;
ls_tranid pallet_req_hdr.tran_id%type := 0;
begin
ls_tranid := as_tranid;
if ls_tranid is null or ls_tranid = 'null' then
ls_tranid := '@@@@@@@@@@';
end if;
begin
select count(1) into ll_retval from swms_to_awms a
where A.IN_OUT= 'O' AND a.schedule_status = 'N'
and a.pallet_no = as_loccode;
exception when others then
ll_retval := 0;
end;
if ll_retval = 0 then
begin
select count(1) into ll_retval from pallet_req_hdr h, pallet_req_det d
where h.tran_id = d.tran_id
and h.confirmed = 'N'
and d.pallet_no = as_loccode
and h.tran_id <> ls_tranid;
exception when others then
ll_retval := 0;
end;
end if;
return (ll_retval);
end;
/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment