29 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
		
		
			
		
	
	
			29 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| 
								 | 
							
								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>();
							 | 
						||
| 
								 | 
							
								        
							 | 
						||
| 
								 | 
							
								        // Saldo real de la cuenta, se muestra al final sin usarse en cálculos intermedios.
							 | 
						||
| 
								 | 
							
								        public decimal SaldoDeCuenta { get; set; }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        // --- 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);
							 | 
						||
| 
								 | 
							
								        public decimal TotalPeriodo => TotalMovimientos + TotalPagos + TotalDebitosCreditos;
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								}
							 |