| | | 1 | | using FAU.Entidades; |
| | | 2 | | using FAU.Logica.DTOs; |
| | | 3 | | |
| | | 4 | | namespace FAU.Logica.Calculadores; |
| | | 5 | | |
| | | 6 | | public class Sit50Calculator : CalculadorHaberesBase |
| | | 7 | | { |
| | | 8 | | // Superior Reincorporado: mismo porcentaje que Personal Superior activo |
| | 3 | 9 | | protected override decimal PorcentajeDedicacionIntegral => 0.50m; |
| | | 10 | | |
| | | 11 | | protected override decimal CalcularItemsBase( |
| | | 12 | | RelacionLaboral funcionario, InsumosPeriodo insumos, Acumuladores acumuladores, ResultadoCalculo resultado) |
| | | 13 | | { |
| | | 14 | | // Usa el grado de reincorporación si existe, si no el grado actual |
| | 3 | 15 | | var gradoId = funcionario.GradoReincorporacionId ?? funcionario.GradoId; |
| | | 16 | | |
| | 3 | 17 | | var rem1 = insumos.ObtenerRemuneracion(gradoId, 11000) |
| | 3 | 18 | | ?? throw new InvalidOperationException($"Sin remuneración para grado {gradoId} cod 11000"); |
| | | 19 | | |
| | | 20 | | // Progresivo de retiro: reduce el sueldo base |
| | 3 | 21 | | decimal progresivo = 0m; |
| | 3 | 22 | | if (funcionario.HaberRetiro.HasValue && funcionario.PorcentajeProgresivo.HasValue) |
| | 1 | 23 | | progresivo = funcionario.HaberRetiro.Value * funcionario.PorcentajeProgresivo.Value; |
| | | 24 | | |
| | 3 | 25 | | var normalLq = rem1.Monto - progresivo; |
| | 3 | 26 | | AgregarItem(11000, normalLq, insumos, acumuladores, resultado); |
| | 3 | 27 | | var wpara53 = normalLq; |
| | | 28 | | |
| | | 29 | | // 042.012 — Compensación al Cargo (opcional para reincorporados) |
| | 3 | 30 | | var rem2 = insumos.ObtenerRemuneracion(gradoId, 42012); |
| | 3 | 31 | | if (rem2 is not null) |
| | | 32 | | { |
| | 2 | 33 | | AgregarItem(42012, rem2.Monto, insumos, acumuladores, resultado); |
| | 2 | 34 | | wpara53 += rem2.Monto; |
| | | 35 | | } |
| | | 36 | | |
| | | 37 | | // 041.003 — Permanencia en el Grado |
| | 3 | 38 | | var meses = CalcularMesesPermanencia(funcionario, insumos); |
| | 3 | 39 | | var riesgoVuelo = funcionario.RiesgoVuelo.HasValue && funcionario.RiesgoVuelo.Value > 0; |
| | 3 | 40 | | var permanencia = insumos.ObtenerPermanencia(funcionario.EscalafonId, gradoId, meses, riesgoVuelo); |
| | 3 | 41 | | if (permanencia is not null) |
| | | 42 | | { |
| | 0 | 43 | | var montoPermanencia = permanencia.Porcentaje.HasValue |
| | 0 | 44 | | ? rem1.Monto * permanencia.Porcentaje.Value |
| | 0 | 45 | | : permanencia.MontoFijo ?? 0m; |
| | 0 | 46 | | if (montoPermanencia > 0) |
| | 0 | 47 | | AgregarItem(41003, montoPermanencia, insumos, acumuladores, resultado); |
| | | 48 | | } |
| | | 49 | | |
| | 3 | 50 | | return wpara53; |
| | | 51 | | } |
| | | 52 | | } |