



declare  
 	 a number  ;
 	begin
	select nvl((s_ord.total-s_emp.commission_pct)/100,0)
into a
	from s_ord, s_emp
	where s_ord.sales_rep_id=s_emp.id
	 AND s_emp.id=:SALES_REP_ID 
	  AND  S_ORD.ID =:ID ;
	  :s_ord.comm:=A;

	if :s_ord.comm=0 then
		if show_alert('this employee will get no commission') =alert_button1 then
			null;
			end if;
	end if;
exception  when no_data_found then  
		 A:=0;
		 
end;