Sei sulla pagina 1di 2

temp:= salario ;

{Condições para receber valor zero}


{Condição para não calcular quando a data de requerimento foi de 15 dias}
if (AFAPROC = "FALSE") and (QTDEDIASAFASTMES > 15) and (DIASAFASTMESANT > 15) and
(DTAFAST >= "17/06/2015") and (SITCOL = "AFASTADO")
or (AFAPROC = "FALSE") and (QTDEDIASAFASTMES > 15) and (DIASAFASTMESANT > 15) and
(DTAFAST >= "17/06/2015") and (SITCOL = "AFASTADO PREVIDENCIA")
or (AFAPROC = "FALSE") and (QTDEDIASAFASTMES > 15) and (DIASAFASTMESANT > 15) and
(DTAFAST >= "17/06/2015") and (SITCOL = "DOENCA OCUPACIONAL")
or (AFAPROC = "FALSE") and (QTDEDIASAFASTMES > 15) and (DIASAFASTMESANT > 15) and
(DTAFAST >= "17/06/2015") and (SITCOL = "SERVICO MILITAR")
or (AFAPROC = "FALSE") and (QTDEDIASAFASTMES = QTDEDIASAFASTLICMATMES) and (SITCOL
= "LICENCA MATERNIDADE")
{Condição para não calcular quando a data de requerimento foi de 30 dias}
or (AFAPROC = "FALSE") and (QTDEDIASAFASTMES > 15) and (DTAFAST < "17/06/2015") and
(SITCOL = "AFASTADO")
or (AFAPROC = "FALSE") and (QTDEDIASAFASTMES > 15) and (DTAFAST < "17/06/2015") and
(SITCOL = "AFASTADO PREVIDENCIA")
or (AFAPROC = "FALSE") and (QTDEDIASAFASTMES > 15) and (DTAFAST < "17/06/2015") and
(SITCOL = "DOENCA OCUPACIONAL")
or (AFAPROC = "FALSE") and (QTDEDIASAFASTMES > 15) and (DTAFAST < "17/06/2015") and
(SITCOL = "SERVICO MILITAR")
or (AFAPROC = "FALSE") and (QTDEDIASAFASTMES > 15) and (DTAFAST < "17/06/2015") and
(SITCOL = "LICENCA MATERNIDADE")
{Outras situações que o evento não deva ser calculado}
or ((RESPROC = "FALSE") and (SITCOL = "DEMITIDO"))
or ((AFANOPROC = "FALSE") and (QTDEDIASAFASTMES > 15) and ((DIASAFAST -
QTDEDIASAFASTMES ) > 15) and ((SITCOL <> "ATIVO") and (SITCOL <> "DEMITIDO") and
(SITCOL <> "FERIAS"))) then
result := 0
else

{Verifica se houve dias de afastamento dentro do mês}


{Se for afastado por mais de 15 dias no mês de processamento}
if (AFAPROC = "TRUE") and (DIASAFAST >= 15) and ((SITCOL <> "LICENCA MATERNIDADE")
and (SITCOL <> "ATIVO") and ( SITCOL <> "FERIAS" )and ( SITCOL <> "DEMITIDO" ))
then
begin
if ((NDIASTRAB + 15) > 30 ) then
result := (temp / 30 ) * (NDIASTRAB - NFALTASMES )
else
result := (temp / 30 ) * (NDIASTRAB + 15)- ( NFALTASMES );
end
else
{Se for afastado no mês anterior por mais de 15 dias}
if (AFAPROC = "FALSE") and (DIASAFASTMESANT < 15) and ((SITCOL <> "LICENCA
MATERNIDADE") and (SITCOL <> "FERIAS") and (SITCOL <> "ATIVO") and (SITCOL <>
"DEMITIDO")and ( SITCOL <> "ESTABILIDADE" )) then
result := (temp / 30 ) * (15 - DIASAFASTMESANT )- ( NFALTASMES )
else

{Condições para receber valor proporcional aos dias trabalhados com atestados}
if (( AFAPROC = "TRUE" ) and ( DIASAFAST <= 15 ) ) then
result := ( temp / 30 ) * ( NDIASTRAB + NATESTMES - QTDEDIASAFASTLICMATMES )
else

{Condições para receber valor proporcional aos dias trabalhados}


if (RESPROC = "TRUE") or (ADMPROC = "TRUE") or (AFAPROC = "TRUE") or (RETPROC =
"TRUE") or (DIAFERM <> 0) then
result := (temp / 30 ) * ( NDIASTRAB - NFALTASMES )
else

{Caso não entre em nenhuma condição acima, recebe o valor integral}


result := (temp / 30 ) * ( NDIASTRAB - NFALTASMES )

Potrebbero piacerti anche