Formula calcul spor garda

Transpunere a formulei de mai jos in Nexus Sporuri
(salariu tarifar * sporul de garda) / (nr mediu ore luna (136) / 8 (ore norma intreaga)) * 7 (ore norma angajat)


IF @pt_co = 0
SELECT @ret_val = (b.sal_neg*s.procent*8)/(@ore_lun*b.ore_norm*100),
@ret_ore = 0,
@ret_proc = s.procent
FROM blc_linii s
INNER JOIN blc b ON s.pl_blc=b.pct_lcr AND s.id_blc=b.id
WHERE s.anluna=@anluna AND s.pct_lcr=@pl_sp AND s.id=@id_sp
ELSE
SELECT @ret_val = 0,
@ret_ore = 0,
@ret_proc = 0

@ore_lun - orele lucratoare din luna la o norma de 8 ore