Exemple #1
0
        public void AgregarDetalle(Detalle detalle)
        {
            Detalle Detalle = new Detalle
            {
                Tipo       = this.Tipo == "venta" ? "resta" : "aumento",
                Cantidad   = detalle.Cantidad,
                Descuento  = detalle.Descuento,
                IdFactura  = detalle.IdFactura,
                IdProducto = detalle.IdProducto,
                PrecioBase = detalle.PrecioBase,
                Total      = detalle.Total,
            };

            Detalle.ColocarProducto(detalle.ObtenerProducto());
            Detalle.CalcularSubTotal();
            Detalle.CalcularDescontado();
            Detalle.CalcularValorIva();
            Detalle.CalcularTotal();
            Detalles.Add(Detalle);
        }