1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| begin
/*initialisation des variables*/
cnt_g_imp= 0;
cnt_g_n_imp= 0;
cnt_r_imp= 0;
cnt_r_n_imp= 0;
base_sal_base= 0;
base_cot= 0.00;
base_irg= 0.00;
/**/
paie_sec= 0;
/* insertion des données master*/
insert into t_paies_mas ( paie_a, paie_m, emp_id, paie_sec, paie_date)
values ( :paie_a, :paie_m, :emp_id, :paie_sec, :paie_date);
/*calculer les gains*/
for select rbq_id, rbq_type, rbq_used, rbq_base, rbq_rate, rbq_imp, rbq_cot
from t_rbqs_paie_det
where rbq_type= 1 and rbq_used= 255
order by rbq_call_ord
into :rbq_id, :rbq_type, :rbq_used, :rbq_base, :rbq_rate, :rbq_imp, :rbq_cot
do
begin
if (rbq_id= '1000') then/*salaire de base*/
begin
execute procedure get_emp_wd(emp_id) returning_values :rbq_cnt;
execute procedure get_emp_scale(emp_id) returning_values :emp_scale;
execute procedure get_base_hw(paie_a, paie_m, emp_scale) returning_values :rbq_base;
rbq_amt= rbq_cnt*rbq_base;
base_sal_base= rbq_amt;
end
/*cumuler les gains*/
if (rbq_imp= 255) then
cnt_g_imp= cnt_g_imp+ rbq_amt;
else
cnt_g_n_imp= cnt_g_n_imp+ rbq_amt;
/* insertion des données détails*/
insert into t_paies_det ( paie_a, paie_m, emp_id, paie_sec, rbq_id, rbq_base, rbq_cnt, rbq_amt, rbq_rate)
values (:paie_a, :paie_m, :emp_id, :paie_sec, :rbq_id, :rbq_base, :rbq_cnt, :rbq_amt, :rbq_rate);
g_imp= cnt_g_imp;
g_n_imp= cnt_g_n_imp;
suspend;
end
end |
Partager