private void ActualizarPrecio()
        {
            int    cantidadSeleccionada = (int)this.numericUpDownCantidad.Value;
            double nuevoPrecioFinal     = Venta.CalcularPrecioFinal(this.producto.Precio, cantidadSeleccionada);

            this.lblPrecioFinal.Text = String.Format("Precio Final: ${0:0.00}", nuevoPrecioFinal);
        }
Exemplo n.º 2
0
        public override string GenerarComprobante()
        {
            StringBuilder comprobante = new StringBuilder($"Factura {this.tipoFactura}");

            comprobante.AppendLine($"\nFecha emision: {this.fechaEmision}\nFecha vencimiento: {this.fechaVencimiento}\n");
            comprobante.AppendLine($"Producto: {((Producto)this.GetVenta).Descripcion}\n" +
                                   $"Cantidad:{base.GetVenta.GetCantidad}\nPrecio unitario: ${((Producto)this.GetVenta).Precio:#.00}");
            comprobante.AppendLine($"Subtotal: ${((Producto)this.GetVenta).Precio* this.GetVenta.GetCantidad}\n" +
                                   "Importe IVA: 21");
            comprobante.AppendLine($"Importe total:{Venta.CalcularPrecioFinal(((Producto)this.GetVenta).Precio, this.GetVenta.GetCantidad)}");
            return(comprobante.ToString());
        }
Exemplo n.º 3
0
        public override string GenerarComprobante()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat($"FACTURA {this.tipoFactura}\n\n");
            sb.AppendFormat($"Fecha Emision: {this.fechaEmicion}\n");
            sb.AppendFormat($"Fecha Vencimiento: {this.fechaVencimiento}\n\n");
            sb.AppendFormat($"Producto: {this.Venta.ObtenerDescrpcionBreve()}\n");
            sb.AppendFormat($"Cantidad: {this.Venta.Cantidad}\n");
            sb.AppendFormat($"Precio Unitario: ${((Producto)this.Venta).Precio:#.00}\n\n");
            sb.AppendFormat($"Subtotal: ${((Producto)this.Venta).Precio * this.Venta.Cantidad}\n");
            sb.AppendFormat($"{Venta.CalcularPrecioFinal(((Producto)this.Venta).Precio, this.Venta.Cantidad) - ((Producto)this.Venta).Precio * this.Venta.Cantidad}\n");
            sb.AppendFormat($"Precio final con IVA: ${Venta.CalcularPrecioFinal(((Producto)this.Venta).Precio, this.Venta.Cantidad)}\n");

            return(sb.ToString());
        }
Exemplo n.º 4
0
        public override string GenerarComprobante()
        {
            Producto      p     = (Producto)base.Venta;
            StringBuilder texto = new StringBuilder();

            texto.Append($"FACTURA: {this.tipoFactura}\n");
            texto.Append($"Fecha Emisión: {base.fechaEmision}\n");
            texto.Append($"Fecha Vencimiento: {this.fechaVencimiento}\n");
            texto.Append($"Producto: {base.Venta.ObtenerBreveDescripcion()}\n");
            texto.Append($"Cantidad: {base.Venta.Cantidad}\n");
            texto.Append($"Precio Unitario: ${((Producto)base.Venta).Precio}\n");
            texto.Append($"Subtotal: ${ ((Producto)base.Venta).Precio}\n ");
            texto.Append($"Importe IVA: ${p.Precio * 21 / 100}\n");
            texto.Append($"Importe Total: ${Venta.CalcularPrecioFinal(p.Precio,base.Venta.Cantidad)}\n");

            return(texto.ToString());
        }
Exemplo n.º 5
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override string GenerarComprobante()
        {
            double subtotal = (((Producto)Venta).Precio) * Venta.Cantidad;
            double total    = Venta.CalcularPrecioFinal((((Producto)Venta).Precio), Venta.Cantidad);

            StringBuilder retorno = new StringBuilder();

            retorno.AppendFormat("FACTURA: {0}\n\n", tipoFactura);
            retorno.AppendFormat("Fecha Emision: {0}\n", fechaEmisor);
            retorno.AppendFormat("Fecha Vencimiento: {0}\n\n", fechaVencimiento);
            retorno.AppendFormat("Producto: {0}\n", Venta.ObtenerDescripcionBreve());
            retorno.AppendFormat("Cantidad: {0}\n", Venta.Cantidad);
            retorno.AppendFormat("Precio Unitario: ${0}\n\n", ((Producto)Venta).Precio);//ver
            retorno.AppendFormat("Subtotal: ${0}\n", (((Producto)Venta).Precio) * Venta.Cantidad);
            retorno.AppendFormat("Importe IVA: ${0}\n", total - subtotal);
            retorno.AppendFormat("Importe Total: ${0}\n", Venta.CalcularPrecioFinal((((Producto)Venta).Precio), Venta.Cantidad));

            return(retorno.ToString());
        }
Exemplo n.º 6
0
        //un comprobante tiene una venta, esa venta tiene un producto

        /// <summary>
        /// Devuelve un string con los datos de la factura.
        /// </summary>
        /// <returns></returns>
        public override string GenerarComprobante()
        {
            //Esto así no
            Venta    v = this.Venta;
            Producto p = (Producto)v;

            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("- FACTURA: {0}\n", this.tipoFactura);
            sb.AppendFormat("- Fecha emisión: {0}\n", this.fechaEmision);
            sb.AppendFormat("- Fecha vencimiento: {0}\n", this.fechaVencimiento);

            sb.AppendFormat("- Producto {0}\n", p.Descripcion);
            sb.AppendFormat("- Cantidad {0}\n", v.Cantidad);
            sb.AppendFormat("- Precio ${0}\n", p.Precio);

            sb.AppendFormat("- Subtotal ${0}1\n", (p.Precio * v.Cantidad));
            sb.AppendFormat("- Importe IVA ${0}1\n", ((21 * (p.Precio * v.Cantidad)) / 100));
            sb.AppendFormat("- Importe total {0}1\n", Venta.CalcularPrecioFinal(p.Precio, v.Cantidad));

            //sb.AppendFormat("{0}", base.Venta.ObtenerDescripcionBreve());

            return(sb.ToString());
        }
Exemplo n.º 7
0
 private void ActualizarPrecio()
 {
     int    cantidadSeleccionada = Convert.ToInt32(this.NUDCantidad.Value);
     double nuevoPrecioFinal     = Venta.CalcularPrecioFinal(this.productoSeleccionado.Precio, cantidadSeleccionada);
 }
Exemplo n.º 8
0
 private void NumericUpDown1_ValueChanged(object sender, EventArgs e)
 {
     lblPrecioFinal.Text = ("Precio final: " + Venta.CalcularPrecioFinal(productoSeleccionado.Precio, (int)numericUpDown1.Value).ToString());
 }