26 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
		
		
			
		
	
	
			26 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| 
								 | 
							
								using System;
							 | 
						||
| 
								 | 
							
								using System.Collections.Generic;
							 | 
						||
| 
								 | 
							
								using System.Globalization;
							 | 
						||
| 
								 | 
							
								using System.Linq;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								namespace GestionIntegral.Api.Dtos.Reportes.ViewModels
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								    public class LiquidacionCanillaViewModel
							 | 
						||
| 
								 | 
							
								    {
							 | 
						||
| 
								 | 
							
								        // --- Datos de entrada ---
							 | 
						||
| 
								 | 
							
								        public IEnumerable<LiquidacionCanillaDetalleDto> Detalles { get; set; } = new List<LiquidacionCanillaDetalleDto>();
							 | 
						||
| 
								 | 
							
								        public IEnumerable<LiquidacionCanillaGananciaDto> Ganancias { get; set; } = new List<LiquidacionCanillaGananciaDto>();
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        // --- Parámetros del reporte ---
							 | 
						||
| 
								 | 
							
								        public string FechaLiquidacion { get; set; } = string.Empty;
							 | 
						||
| 
								 | 
							
								        
							 | 
						||
| 
								 | 
							
								        // Propiedades calculadas para un acceso más fácil y limpio en la plantilla
							 | 
						||
| 
								 | 
							
								        public string NombreVendedor => Detalles.FirstOrDefault()?.Canilla ?? "N/A";
							 | 
						||
| 
								 | 
							
								        public decimal TotalARendir => Detalles.Sum(d => d.TotalRendir);
							 | 
						||
| 
								 | 
							
								        public decimal TotalComisiones => Ganancias.Sum(g => g.TotalRendir);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        // Propiedad para el título del reporte
							 | 
						||
| 
								 | 
							
								        public string TituloReporte => EsAccionista ? "Liquidación de Accionistas" : "Liquidación Venta de Diarios";
							 | 
						||
| 
								 | 
							
								        public bool EsAccionista { get; set; }
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								}
							 |