ID de prestación: F.DESP.AGUINALDO
Código de Servidor:
declare @DiasTrabajadosAño float
declare @VacacionesProp float
DECLARE @UMA float = 80.60
set @DiasTrabajadosAño= 0
if Year(@FechaAlta) = year(getdate())
begin
set @DiasTrabajadosAño = datediff(day, @FechaAlta, isnull(@FechaBaja,getdate()))
end
else
begin
set @DiasTrabajadosAño = datediff(day, convert(datetime, '01/01/' + cast(year(getdate()) as varchar),103), isnull(@FechaBaja,getdate()))
end
set @VacacionesProp = Round(@DiasTrabajadosAño/365,4) * @DiasAguinaldo
set @ConceptoAdic = 'Días Aguinaldo: ' + convert(varchar,cast(@VacacionesProp as money),1)
set @Importe = @VacacionesProp * @SalarioDiario
DECLARE @BaseExento float
set @BaseExento = 30*@UMA
if @Importe > @BaseExento
begin
set @ImporteISRGRavado = @Importe - @BaseExento
set @ImporteIMSSGRavado = @Importe - @BaseExento
set @ImporteIMSSExento = @BaseExento
set @ImporteISRExento = @BaseExento
end
else
begin
set @ImporteISRGRavado = 0
set @ImporteIMSSGRavado = 0
set @ImporteIMSSExento = @Importe
set @ImporteISRExento = @Importe
end
set @Deducciones = 0