Only one Schedule/Vassel Approval by Party

 



Setp-1 :
=======

Create Interactive Report 

SQL Query : For Check Box

APEX_ITEM.CHECKBOX(1,ID,'UNCHECKED')    SELECTED


Setp-2 :
======

Processes : VASSEL_APPROVAL

Declare 
v_count         number:= 0;
v_appCont    number ;


begin
FOR i in 1..apex_application.g_f01.count 
LOOP
select count(APPROVE_STUTAS) 
into v_appCont 
from SHIP_PLAN_VESSEL 
where SHIP_PLAN_MST_ID in 
                         (select SHIP_PLAN_MST_ID from SHIP_PLAN_VESSEL
                          where id=apex_application.g_f01(i)) ;

if v_appCont > 0 then
raise_application_error(-20111,'You can not select more then one Vessel');
end if ;


if  v_count = 0 then 

if apex_application.g_f01(i) is not null then  

update SHIP_PLAN_VESSEL set

APPROVE_BY=:GUSER_ID,

APPROVE_DATE=SYSDATE, 

APPROVE_STUTAS=1

WHERE ID=apex_application.g_f01(i);

v_count:= v_count+i;

end if;

else raise_application_error(-20111,'You can not select more then one Vessel');

end if;

end loop;

------update for buyer

update SHIP_PLAN_MST set

APPROVE_BY=:GUSER_ID,

APPROVE_DATE=SYSDATE, 

APPROVE_STUTAS=1

WHERE ID=:P299_ID;


------- Tracking update buyer approvel

UPDATE SEAEXPORT_MST SET 

BUYER_PLAN_APPROVAL =1,

BUYER_PLAN_APPROVAL_BY=:GUSER_ID,

BUYER_PLAN_APPROVAL_DATE = SYSDATE

WHERE ID in 

(select c.SEAEXPORT_MST_ID

From 

SHIP_PLAN_MST a, SHIP_PLAN_cont b, SHIP_PLAN_goods c

where a.id=B.SHIP_PLAN_MST_ID

and b.id=C.SHIP_PLAN_CONT_ID

and a.id=:P299_ID);

commit;

end;


==============================================================


Processes : UNAPPROVED_VASSEL


Begin

FOR i in 1..apex_application.g_f01.count 

LOOP

if apex_application.g_f01(i) is not null then 

update SHIP_PLAN_VESSEL set

APPROVE_BY=NULL,

APPROVE_DATE=NULL, 

APPROVE_STUTAS=NULL,

UNAPPROVED_BY=:GUSER_ID, 

UNAPPROVED_DATE=SYSDATE

WHERE ID=apex_application.g_f01(i);

end if;

end loop;

commit;

end;


Post a Comment

Previous Post Next Post