Esempio n. 1
0
 public List <string> IsOk()
 {
     Errores = new List <string>();
     if (Detalles == null)
     {
         Errores.Add("La venta debe tener mínimo un producto.");
     }
     else
     {
         double total = 0;
         Detalles.ForEach(x => total += x.Total);
         if (Abonado > total)
         {
             Errores.Add("El abono no puede ser mayor al total de la factura.");
         }
     }
     if (Detalles.Count < 1)
     {
         Errores.Add("La venta debe tener mínimo un producto");
     }
     if (Comprobante == null)
     {
         Errores.Add("El comprobante no debe estar vacío.");
     }
     return(Errores);
 }