| | | 1 | | using FAU.Entidades; |
| | | 2 | | using FAU.Logica.DTOs; |
| | | 3 | | using FAU.Logica.Exceptions; |
| | | 4 | | using FAU.Logica.Services; |
| | | 5 | | using Microsoft.AspNetCore.Authorization; |
| | | 6 | | using Microsoft.AspNetCore.Mvc; |
| | | 7 | | |
| | | 8 | | namespace FAU.API.Controllers; |
| | | 9 | | |
| | | 10 | | [ApiController] |
| | | 11 | | [Route("api/liquidacion/[controller]")] |
| | | 12 | | [Authorize] |
| | | 13 | | [Produces("application/json")] |
| | | 14 | | public class PeriodosController : ControllerBase |
| | | 15 | | { |
| | | 16 | | private readonly IPeriodoService _periodoService; |
| | | 17 | | private readonly ILiquidacionService _liquidacionService; |
| | | 18 | | private readonly ILogger<PeriodosController> _logger; |
| | | 19 | | private readonly IServiceScopeFactory _scopeFactory; |
| | | 20 | | private readonly ICurrentUserContext _currentUser; |
| | | 21 | | |
| | 19 | 22 | | public PeriodosController( |
| | 19 | 23 | | IPeriodoService periodoService, |
| | 19 | 24 | | ILiquidacionService liquidacionService, |
| | 19 | 25 | | ILogger<PeriodosController> logger, |
| | 19 | 26 | | IServiceScopeFactory scopeFactory, |
| | 19 | 27 | | ICurrentUserContext currentUser) |
| | | 28 | | { |
| | 19 | 29 | | _periodoService = periodoService; |
| | 19 | 30 | | _liquidacionService = liquidacionService; |
| | 19 | 31 | | _logger = logger; |
| | 19 | 32 | | _scopeFactory = scopeFactory; |
| | 19 | 33 | | _currentUser = currentUser; |
| | 19 | 34 | | } |
| | | 35 | | |
| | | 36 | | [HttpPost] |
| | | 37 | | [Authorize(Roles = "Administrador,Supervisor,Usuario")] |
| | | 38 | | [ProducesResponseType(typeof(ApiResponse<PeriodoDto>), StatusCodes.Status201Created)] |
| | | 39 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status400BadRequest)] |
| | | 40 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status409Conflict)] |
| | | 41 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status500InternalServerError)] |
| | | 42 | | public async Task<IActionResult> AbrirPeriodo([FromBody] AbrirPeriodoRequest request) |
| | | 43 | | { |
| | | 44 | | try |
| | | 45 | | { |
| | 3 | 46 | | if (!ModelState.IsValid) |
| | | 47 | | { |
| | 0 | 48 | | return BadRequest(ApiResponse<string>.ErrorResult("Solicitud de apertura de período inválida")); |
| | | 49 | | } |
| | | 50 | | |
| | 3 | 51 | | var (success, periodo, error) = await _periodoService.AbrirPeriodoAsync(request.Anio, request.Mes); |
| | | 52 | | |
| | 3 | 53 | | if (!success) |
| | | 54 | | { |
| | 2 | 55 | | if (error?.Contains("Ya existe un período activo", StringComparison.OrdinalIgnoreCase) == true) |
| | | 56 | | { |
| | 1 | 57 | | return Conflict(ApiResponse<string>.ErrorResult(error)); |
| | | 58 | | } |
| | | 59 | | |
| | 1 | 60 | | return BadRequest(ApiResponse<string>.ErrorResult(error ?? "Error al abrir el período")); |
| | | 61 | | } |
| | | 62 | | |
| | 1 | 63 | | var periodoFinal = await _periodoService.ObtenerPorIdAsync(periodo!.Id); |
| | 1 | 64 | | return CreatedAtAction(nameof(GetPeriodo), new { id = periodo.Id }, ApiResponse<PeriodoDto>.SuccessResult(Ma |
| | | 65 | | } |
| | 0 | 66 | | catch (Exception ex) |
| | | 67 | | { |
| | 0 | 68 | | _logger.LogError(ex, "Error al abrir período"); |
| | 0 | 69 | | return StatusCode(500, ApiResponse<string>.ErrorResult("Error interno del servidor")); |
| | | 70 | | } |
| | 3 | 71 | | } |
| | | 72 | | |
| | | 73 | | [HttpGet] |
| | | 74 | | [Authorize(Roles = "Administrador,Supervisor,Usuario")] |
| | | 75 | | [ProducesResponseType(typeof(ApiResponse<List<PeriodoDto>>), StatusCodes.Status200OK)] |
| | | 76 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status500InternalServerError)] |
| | | 77 | | public async Task<IActionResult> GetUltimos([FromQuery] int cantidad = 6) |
| | | 78 | | { |
| | | 79 | | try |
| | | 80 | | { |
| | 0 | 81 | | var periodos = await _periodoService.ObtenerUltimosAsync(Math.Min(cantidad, 12)); |
| | 0 | 82 | | return Ok(ApiResponse<List<PeriodoDto>>.SuccessResult(periodos.Select(MapearPeriodo).ToList())); |
| | | 83 | | } |
| | 0 | 84 | | catch (Exception ex) |
| | | 85 | | { |
| | 0 | 86 | | _logger.LogError(ex, "Error al obtener últimos períodos"); |
| | 0 | 87 | | return StatusCode(500, ApiResponse<string>.ErrorResult("Error interno del servidor")); |
| | | 88 | | } |
| | 0 | 89 | | } |
| | | 90 | | |
| | | 91 | | [HttpGet("activo")] |
| | | 92 | | [Authorize(Roles = "Administrador,Supervisor,Usuario")] |
| | | 93 | | [ProducesResponseType(typeof(ApiResponse<PeriodoDto>), StatusCodes.Status200OK)] |
| | | 94 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status404NotFound)] |
| | | 95 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status500InternalServerError)] |
| | | 96 | | public async Task<IActionResult> GetPeriodoActivo() |
| | | 97 | | { |
| | | 98 | | try |
| | | 99 | | { |
| | 2 | 100 | | var periodo = await _periodoService.ObtenerEnCursoAsync(); |
| | 2 | 101 | | if (periodo == null) |
| | | 102 | | { |
| | 1 | 103 | | return NotFound(ApiResponse<string>.ErrorResult("No hay un período activo")); |
| | | 104 | | } |
| | | 105 | | |
| | 1 | 106 | | return Ok(ApiResponse<PeriodoDto>.SuccessResult(MapearPeriodo(periodo))); |
| | | 107 | | } |
| | 0 | 108 | | catch (Exception ex) |
| | | 109 | | { |
| | 0 | 110 | | _logger.LogError(ex, "Error al obtener período activo"); |
| | 0 | 111 | | return StatusCode(500, ApiResponse<string>.ErrorResult("Error interno del servidor")); |
| | | 112 | | } |
| | 2 | 113 | | } |
| | | 114 | | |
| | | 115 | | [HttpGet("{id}")] |
| | | 116 | | [Authorize(Roles = "Administrador,Supervisor,Usuario")] |
| | | 117 | | [ProducesResponseType(typeof(ApiResponse<PeriodoDto>), StatusCodes.Status200OK)] |
| | | 118 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status404NotFound)] |
| | | 119 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status500InternalServerError)] |
| | | 120 | | public async Task<IActionResult> GetPeriodo(long id) |
| | | 121 | | { |
| | | 122 | | try |
| | | 123 | | { |
| | 2 | 124 | | var periodo = await _periodoService.ObtenerPorIdAsync(id); |
| | 2 | 125 | | if (periodo == null) |
| | | 126 | | { |
| | 1 | 127 | | return NotFound(ApiResponse<string>.ErrorResult("Período no encontrado")); |
| | | 128 | | } |
| | | 129 | | |
| | 1 | 130 | | return Ok(ApiResponse<PeriodoDto>.SuccessResult(MapearPeriodo(periodo))); |
| | | 131 | | } |
| | 0 | 132 | | catch (Exception ex) |
| | | 133 | | { |
| | 0 | 134 | | _logger.LogError(ex, "Error al obtener período {Id}", id); |
| | 0 | 135 | | return StatusCode(500, ApiResponse<string>.ErrorResult("Error interno del servidor")); |
| | | 136 | | } |
| | 2 | 137 | | } |
| | | 138 | | |
| | | 139 | | [HttpGet("{id}/precondiciones")] |
| | | 140 | | [Authorize(Roles = "Administrador,Supervisor,Usuario")] |
| | | 141 | | [ProducesResponseType(typeof(ApiResponse<PrecondicionesDto>), StatusCodes.Status200OK)] |
| | | 142 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status404NotFound)] |
| | | 143 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status500InternalServerError)] |
| | | 144 | | public async Task<IActionResult> GetPrecondiciones(long id) |
| | | 145 | | { |
| | | 146 | | try |
| | | 147 | | { |
| | 0 | 148 | | var precondiciones = await _periodoService.ObtenerPrecondicionesAsync(id); |
| | 0 | 149 | | if (precondiciones == null) |
| | 0 | 150 | | return NotFound(ApiResponse<string>.ErrorResult("Período no encontrado")); |
| | 0 | 151 | | return Ok(ApiResponse<PrecondicionesDto>.SuccessResult(precondiciones)); |
| | | 152 | | } |
| | 0 | 153 | | catch (Exception ex) |
| | | 154 | | { |
| | 0 | 155 | | _logger.LogError(ex, "Error al obtener precondiciones del período {Id}", id); |
| | 0 | 156 | | return StatusCode(500, ApiResponse<string>.ErrorResult("Error interno del servidor")); |
| | | 157 | | } |
| | 0 | 158 | | } |
| | | 159 | | |
| | | 160 | | [HttpGet("{id}/validar-insumos")] |
| | | 161 | | [Authorize(Roles = "Administrador,Supervisor,Usuario")] |
| | | 162 | | [ProducesResponseType(typeof(ApiResponse<ValidacionInsumosDto>), StatusCodes.Status200OK)] |
| | | 163 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status404NotFound)] |
| | | 164 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status500InternalServerError)] |
| | | 165 | | public async Task<IActionResult> ValidarInsumos(long id) |
| | | 166 | | { |
| | | 167 | | try |
| | | 168 | | { |
| | 0 | 169 | | var validacion = await _periodoService.ValidarInsumosAsync(id); |
| | 0 | 170 | | if (validacion == null) |
| | 0 | 171 | | return NotFound(ApiResponse<string>.ErrorResult("Período no encontrado")); |
| | 0 | 172 | | return Ok(ApiResponse<ValidacionInsumosDto>.SuccessResult(validacion)); |
| | | 173 | | } |
| | 0 | 174 | | catch (Exception ex) |
| | | 175 | | { |
| | 0 | 176 | | _logger.LogError(ex, "Error al validar insumos del período {Id}", id); |
| | 0 | 177 | | return StatusCode(500, ApiResponse<string>.ErrorResult("Error interno del servidor")); |
| | | 178 | | } |
| | 0 | 179 | | } |
| | | 180 | | |
| | | 181 | | [HttpPost("{id}/cerrar-insumos")] |
| | | 182 | | [Authorize(Roles = "Administrador,Supervisor,Usuario")] |
| | | 183 | | [ProducesResponseType(typeof(ApiResponse<PeriodoDto>), StatusCodes.Status200OK)] |
| | | 184 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status404NotFound)] |
| | | 185 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status409Conflict)] |
| | | 186 | | [ProducesResponseType(typeof(ValidacionInsumosDto), StatusCodes.Status422UnprocessableEntity)] |
| | | 187 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status500InternalServerError)] |
| | | 188 | | public async Task<IActionResult> CerrarInsumos(long id, [FromBody] CerrarInsumosRequest? request = null) |
| | | 189 | | { |
| | | 190 | | try |
| | | 191 | | { |
| | 4 | 192 | | var (success, periodo, validacion, error) = |
| | 4 | 193 | | await _periodoService.CerrarInsumosAsync(id, request?.Confirmaciones); |
| | | 194 | | |
| | 4 | 195 | | if (!success) |
| | | 196 | | { |
| | 3 | 197 | | if (error?.Contains("no encontrado", StringComparison.OrdinalIgnoreCase) == true) |
| | 1 | 198 | | return NotFound(ApiResponse<string>.ErrorResult(error)); |
| | 2 | 199 | | if (error?.Contains("Solo se puede", StringComparison.OrdinalIgnoreCase) == true) |
| | 1 | 200 | | return Conflict(ApiResponse<string>.ErrorResult(error)); |
| | 1 | 201 | | if (validacion != null) |
| | 1 | 202 | | return UnprocessableEntity(validacion); |
| | 0 | 203 | | return UnprocessableEntity(ApiResponse<string>.ErrorResult(error ?? "Error al cerrar insumos")); |
| | | 204 | | } |
| | | 205 | | |
| | 1 | 206 | | var periodoFinal = await _periodoService.ObtenerPorIdAsync(id); |
| | 1 | 207 | | return Ok(ApiResponse<PeriodoDto>.SuccessResult(MapearPeriodo(periodoFinal!), "Insumos cerrados. Período lis |
| | | 208 | | } |
| | 0 | 209 | | catch (Exception ex) |
| | | 210 | | { |
| | 0 | 211 | | _logger.LogError(ex, "Error al cerrar insumos del período {Id}", id); |
| | 0 | 212 | | return StatusCode(500, ApiResponse<string>.ErrorResult("Error interno del servidor")); |
| | | 213 | | } |
| | 4 | 214 | | } |
| | | 215 | | |
| | | 216 | | [HttpPost("{id}/reabrir-insumos")] |
| | | 217 | | [Authorize(Roles = "Administrador,Supervisor")] |
| | | 218 | | [ProducesResponseType(typeof(ApiResponse<PeriodoDto>), StatusCodes.Status200OK)] |
| | | 219 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status404NotFound)] |
| | | 220 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status409Conflict)] |
| | | 221 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status500InternalServerError)] |
| | | 222 | | public async Task<IActionResult> ReabrirInsumos(long id) |
| | | 223 | | { |
| | | 224 | | try |
| | | 225 | | { |
| | 2 | 226 | | var (success, periodo, error) = await _periodoService.ReabrirInsumosAsync(id); |
| | | 227 | | |
| | 2 | 228 | | if (!success) |
| | | 229 | | { |
| | 1 | 230 | | if (error?.Contains("no encontrado", StringComparison.OrdinalIgnoreCase) == true) |
| | 0 | 231 | | return NotFound(ApiResponse<string>.ErrorResult(error)); |
| | 1 | 232 | | return Conflict(ApiResponse<string>.ErrorResult(error ?? "Error al reabrir insumos")); |
| | | 233 | | } |
| | | 234 | | |
| | 1 | 235 | | var periodoFinal = await _periodoService.ObtenerPorIdAsync(id); |
| | 1 | 236 | | return Ok(ApiResponse<PeriodoDto>.SuccessResult(MapearPeriodo(periodoFinal!), "Insumos reabiertos. Período e |
| | | 237 | | } |
| | 0 | 238 | | catch (Exception ex) |
| | | 239 | | { |
| | 0 | 240 | | _logger.LogError(ex, "Error al reabrir insumos del período {Id}", id); |
| | 0 | 241 | | return StatusCode(500, ApiResponse<string>.ErrorResult("Error interno del servidor")); |
| | | 242 | | } |
| | 2 | 243 | | } |
| | | 244 | | |
| | | 245 | | [HttpPost("{id}/reabrir")] |
| | | 246 | | [Authorize(Roles = "Administrador,Supervisor")] |
| | | 247 | | [ProducesResponseType(typeof(ApiResponse<PeriodoDto>), StatusCodes.Status200OK)] |
| | | 248 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status404NotFound)] |
| | | 249 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status409Conflict)] |
| | | 250 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status500InternalServerError)] |
| | | 251 | | public async Task<IActionResult> ReabrirDesdeCalculada(long id) |
| | | 252 | | { |
| | | 253 | | try |
| | | 254 | | { |
| | 0 | 255 | | var (success, periodo, error) = await _periodoService.ReabrirDesdeCalculadaAsync(id); |
| | | 256 | | |
| | 0 | 257 | | if (!success) |
| | | 258 | | { |
| | 0 | 259 | | if (error?.Contains("no encontrado", StringComparison.OrdinalIgnoreCase) == true) |
| | 0 | 260 | | return NotFound(ApiResponse<string>.ErrorResult(error)); |
| | 0 | 261 | | return Conflict(ApiResponse<string>.ErrorResult(error ?? "Error al reabrir período")); |
| | | 262 | | } |
| | | 263 | | |
| | 0 | 264 | | var periodoFinal = await _periodoService.ObtenerPorIdAsync(id); |
| | 0 | 265 | | return Ok(ApiResponse<PeriodoDto>.SuccessResult( |
| | 0 | 266 | | MapearPeriodo(periodoFinal!), |
| | 0 | 267 | | "Período reabierto. Realizá las correcciones y volvé a calcular. El próximo cálculo generará una nueva v |
| | | 268 | | } |
| | 0 | 269 | | catch (Exception ex) |
| | | 270 | | { |
| | 0 | 271 | | _logger.LogError(ex, "Error al reabrir período {Id}", id); |
| | 0 | 272 | | return StatusCode(500, ApiResponse<string>.ErrorResult("Error interno del servidor")); |
| | | 273 | | } |
| | 0 | 274 | | } |
| | | 275 | | |
| | | 276 | | [HttpPost("{id}/calcular")] |
| | | 277 | | [Authorize(Roles = "Administrador,Supervisor,Usuario")] |
| | | 278 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status202Accepted)] |
| | | 279 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status404NotFound)] |
| | | 280 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status409Conflict)] |
| | | 281 | | public async Task<IActionResult> Calcular(long id) |
| | | 282 | | { |
| | 3 | 283 | | var (success, _, error) = await _periodoService.IniciarCalculoAsync(id); |
| | 3 | 284 | | if (!success) |
| | | 285 | | { |
| | 2 | 286 | | if (error?.Contains("no encontrado", StringComparison.OrdinalIgnoreCase) == true) |
| | 1 | 287 | | return NotFound(ApiResponse<string>.ErrorResult(error)); |
| | 1 | 288 | | return Conflict(ApiResponse<string>.ErrorResult(error ?? "Error al iniciar cálculo")); |
| | | 289 | | } |
| | | 290 | | |
| | | 291 | | // Capturar antes de que el HttpContext desaparezca (el Task.Run corre sin request) |
| | 1 | 292 | | var usuarioId = _currentUser.UserId; |
| | 1 | 293 | | var host = _currentUser.Host; |
| | | 294 | | |
| | | 295 | | // ponytail: fire-and-forget con scope propio; los servicios scoped se disponen al terminar el request |
| | 1 | 296 | | _ = Task.Run(async () => |
| | 1 | 297 | | { |
| | 1 | 298 | | using var scope = _scopeFactory.CreateScope(); |
| | 1 | 299 | | var liquidacionService = scope.ServiceProvider.GetRequiredService<ILiquidacionService>(); |
| | 0 | 300 | | var periodoService = scope.ServiceProvider.GetRequiredService<IPeriodoService>(); |
| | 1 | 301 | | try |
| | 1 | 302 | | { |
| | 0 | 303 | | var (exito, _, __) = await liquidacionService.GenerarLiquidacionAsync(id, usuarioId, host); |
| | 0 | 304 | | await periodoService.FinalizarCalculoAsync(id, exito); |
| | 0 | 305 | | } |
| | 0 | 306 | | catch (Exception ex) |
| | 1 | 307 | | { |
| | 0 | 308 | | _logger.LogError(ex, "Error en cálculo background del período {Id}", id); |
| | 0 | 309 | | await periodoService.FinalizarCalculoAsync(id, exitoso: false); |
| | 1 | 310 | | } |
| | 1 | 311 | | }); |
| | | 312 | | |
| | 1 | 313 | | return Accepted(ApiResponse<string>.SuccessResult("en_proceso", "Cálculo iniciado. Consultá el estado del períod |
| | 3 | 314 | | } |
| | | 315 | | |
| | | 316 | | [HttpPost("{id}/cerrar")] |
| | | 317 | | [Authorize(Roles = "Administrador,Supervisor")] |
| | | 318 | | [ProducesResponseType(typeof(ApiResponse<PeriodoDto>), StatusCodes.Status200OK)] |
| | | 319 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status404NotFound)] |
| | | 320 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status409Conflict)] |
| | | 321 | | [ProducesResponseType(typeof(ApiResponse<string>), StatusCodes.Status500InternalServerError)] |
| | | 322 | | public async Task<IActionResult> Cerrar(long id) |
| | | 323 | | { |
| | | 324 | | try |
| | | 325 | | { |
| | 3 | 326 | | var (success, periodo, error) = await _periodoService.CerrarAsync(id); |
| | | 327 | | |
| | 3 | 328 | | if (!success) |
| | | 329 | | { |
| | 2 | 330 | | if (error?.Contains("no encontrado", StringComparison.OrdinalIgnoreCase) == true) |
| | 1 | 331 | | return NotFound(ApiResponse<string>.ErrorResult(error)); |
| | 1 | 332 | | return Conflict(ApiResponse<string>.ErrorResult(error ?? "Error al cerrar período")); |
| | | 333 | | } |
| | | 334 | | |
| | 1 | 335 | | var periodoFinal = await _periodoService.ObtenerPorIdAsync(id); |
| | 1 | 336 | | return Ok(ApiResponse<PeriodoDto>.SuccessResult(MapearPeriodo(periodoFinal!), "Período cerrado definitivamen |
| | | 337 | | } |
| | 0 | 338 | | catch (Exception ex) |
| | | 339 | | { |
| | 0 | 340 | | _logger.LogError(ex, "Error al cerrar período {Id}", id); |
| | 0 | 341 | | return StatusCode(500, ApiResponse<string>.ErrorResult("Error interno del servidor")); |
| | | 342 | | } |
| | 3 | 343 | | } |
| | | 344 | | |
| | | 345 | | private static PeriodoDto MapearPeriodo(Periodo periodo) |
| | | 346 | | { |
| | 6 | 347 | | return new PeriodoDto |
| | 6 | 348 | | { |
| | 6 | 349 | | Id = periodo.Id, |
| | 6 | 350 | | Anio = periodo.Anio, |
| | 6 | 351 | | Mes = periodo.Mes, |
| | 6 | 352 | | Estado = periodo.Estado, |
| | 6 | 353 | | SnapshotId = periodo.SnapshotId, |
| | 6 | 354 | | FechaApertura = periodo.FechaApertura, |
| | 6 | 355 | | UsuarioApertura = periodo.UsuarioAperturaUsername, |
| | 6 | 356 | | HashSnapshot = periodo.HashSnapshot, |
| | 6 | 357 | | FechaCierreInsumos = periodo.FechaCierreInsumos, |
| | 6 | 358 | | UsuarioCierreInsumos = periodo.UsuarioCierreInsumos?.Username, |
| | 6 | 359 | | FechaCalculo = periodo.FechaCalculo, |
| | 6 | 360 | | UsuarioCalculo = periodo.UsuarioCalculo?.Username, |
| | 6 | 361 | | FechaCierre = periodo.FechaCierre, |
| | 6 | 362 | | UsuarioCierre = periodo.UsuarioCierre?.Username |
| | 6 | 363 | | }; |
| | | 364 | | } |
| | | 365 | | } |