2025-06-24 12:52:37 -03:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
namespace GestionIntegral.Api.Dtos.Reportes.ViewModels
|
|
|
|
|
{
|
|
|
|
|
public class CuentasDistribuidorViewModel
|
|
|
|
|
{
|
|
|
|
|
// --- Datos de entrada ---
|
|
|
|
|
public IEnumerable<BalanceCuentaDistDto> Movimientos { get; set; } = new List<BalanceCuentaDistDto>();
|
|
|
|
|
public IEnumerable<BalanceCuentaPagosDto> Pagos { get; set; } = new List<BalanceCuentaPagosDto>();
|
|
|
|
|
public IEnumerable<BalanceCuentaDebCredDto> DebitosCreditos { get; set; } = new List<BalanceCuentaDebCredDto>();
|
2026-05-07 12:03:26 -03:00
|
|
|
|
|
|
|
|
// Saldo inicial del período: snapshot del último cierre + movimientos netos hasta fechaDesde.
|
|
|
|
|
// 0 si no hay cierre previo.
|
|
|
|
|
public decimal SaldoInicial { get; set; }
|
2025-06-24 12:52:37 -03:00
|
|
|
|
|
|
|
|
// --- Parámetros del reporte ---
|
|
|
|
|
public string NombreDistribuidor { get; set; } = string.Empty;
|
|
|
|
|
public string FechaDesde { get; set; } = string.Empty;
|
|
|
|
|
public string FechaHasta { get; set; } = string.Empty;
|
|
|
|
|
public string FechaReporte { get; set; } = DateTime.Now.ToString("dd/MM/yyyy");
|
|
|
|
|
|
|
|
|
|
// --- Propiedades para el resumen final ---
|
|
|
|
|
public decimal TotalMovimientos => Movimientos.Sum(m => m.Debe - m.Haber);
|
|
|
|
|
public decimal TotalPagos => Pagos.Sum(p => p.Debe - p.Haber);
|
|
|
|
|
public decimal TotalDebitosCreditos => DebitosCreditos.Sum(d => d.Debe - d.Haber);
|
2026-05-07 12:03:26 -03:00
|
|
|
|
|
|
|
|
// Saldo Final = Saldo Inicial + suma neta del período (Debe - Haber por sección).
|
|
|
|
|
public decimal SaldoFinal => SaldoInicial + TotalMovimientos + TotalPagos + TotalDebitosCreditos;
|
2025-06-24 12:52:37 -03:00
|
|
|
}
|
|
|
|
|
}
|