Exemple #1
0
        public globalTicket(List <detallesTicket> dt, venta xventa)
        {
            this.xventa   = xventa;
            this.detalles = dt;
            this.codebar  = new cb();
            this.xform    = new Form();
            this.db       = new dbop();
            this.xcliente = this.db.getclientAsobject(this.xventa.idcliente);

            this.xtienda = this.db.getTienda();

            this.myfont = new Font("Lucida Console", 7, FontStyle.Regular);

            this.brush      = new SolidBrush(Color.Black);
            this.marginLeft = 5;
            this.vertical   = 0;
            this.widthDoc   = inchesCM * 100 * 8; // AUTOMATIZAR PARA FORMATOS
            this.heightDoc  = 0;
            this.setAttribs(dt.Count);

            this.nombretienda   = this.xtienda.nombre.ToUpper();
            this.rfc            = "RFC " + this.xtienda.rfc;
            this.direccion      = this.xtienda.calle.ToUpper() + " #" + this.xtienda.numero.ToString().ToUpper();
            this.colonia        = "COL. " + this.xtienda.colonia.ToUpper();
            this.ciudad         = (this.xtienda.ciudad + "," + this.xtienda.estado).ToUpper();
            this.telefono       = "TEL. " + this.xtienda.telefono.ToUpper();
            this.fecha          = ">>FECHA: " + this.xventa.fecha.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture) + " >>HORA: " + this.xventa.hora.ToString();
            this.numticket      = ">>TICKET #: " + this.db.getticketid(this.xventa.idventa).ToString();
            this.clientename    = ">>CLIENTE: " + this.xcliente.nombre.ToUpper();
            this.subtotalletra  = "SUBTOTAL $";
            this.subtotal       = this.xventa.subtotal.ToString("F1").Replace(",", ".");
            this.totalletra     = "TOTAL $";
            this.total          = this.xventa.total.ToString("F2").Replace(",", ".");
            this.descuentoletra = "DESCUENTO $";
            this.descuento      = this.xventa.descuentoextra.ToString("F1").Replace(",", ".");

            this.ivaletra = "IVA $";
            this.iva      = (this.xventa.subtotal / 100 * 16).ToString("F1").Replace(",", ".");

            this.precioletra = "PROXIMAMENTE";
            this.leyenda     = "¡Gracias por su compra!";

            this.cantidad   = "Cant.";
            this.producto   = "Producto";
            this.preciounit = "P.Unit";
            this.importe    = "Importe";

            this.xconvierte  = new convierte();
            this.xtotalletra = this.xconvierte.getstring(this.xventa.total).ToUpper() + "MN.";
        }
        public printTicket(venta xventa, tienda xtienda)
        {
            this.xtienda   = xtienda;
            this.xventa    = xventa;
            this.db        = new dbop();
            this.reporte   = new rptticket();
            this.translate = new convierte();
            this.codbar    = new cb();

            this.xcliente = this.db.getclientAsobject(this.xventa.idcliente);

            this.pathcbar = Path.Combine(genericDefinitions.TICKETLOGOSPATH + @"\logocbar.png");
            this.pathlogo = Path.Combine(genericDefinitions.TICKETLOGOSPATH + @"\logotienda.png");

            this.widthcbar  = (int)(widthcbar * 50 / 2.54);
            this.heightcbar = (int)(heightcbar * 50 / 2.54);
        }