Example #1
0
        public void MyTicket()
        {
            try
            {
                SqlCommand ticke = new SqlCommand("tick", connect_BD);
                ticke.CommandType = CommandType.StoredProcedure;
                ticke.Parameters.AddWithValue("@hora", Convert.ToDateTime(horaText.Text));
                ticke.Parameters.AddWithValue("@fecha", Convert.ToDateTime(dateTimePicker1.Text));
                ticke.ExecuteNonQuery();

                SqlDataAdapter adaptador = new SqlDataAdapter();
                DataTable      tabla     = new DataTable();
                adaptador.SelectCommand = ticke;
                adaptador.Fill(tabla);
                dataGridView1.DataSource = tabla;
                Ticket.TextLeft("          ");
                Ticket.TextLeft("          ");
                Ticket.TextoCentro("Velia Perez Zavala");
                Ticket.TextLeft("     R.F.C. PEZV-690103-270");
                Ticket.TextLeft("     Aquiles Serdan #105 OTE");
                Ticket.TextLeft("     Colonia Centro");
                Ticket.TextLeft("     Gpe. Victoria,DGO C.P 34700");
                Ticket.TextLeft("Folio: " + folioTick.Text);
                CrearImpresion.lineasSeparacion();//-----------------------------------------
                Ticket.TextoCentro("Fecha: " + DateTime.Today.Day + "/" + DateTime.Today.Month + "/" + DateTime.Today.Year);
                Ticket.TextLeft(" Hora:       " + horaText.Text);
                Ticket.TextLeft(" Le atendio:   " + "Fam: Rocha Pérez");
                CrearImpresion.lineasSeparacion();//-----------------------------------------
                CrearImpresion.EncabezadoTicket();
                foreach (DataGridViewRow fila in dataGridView1.Rows)
                {
                    int desc = Convert.ToInt32(fila.Cells[5].Value);

                    if (desc == 0)
                    {
                        Ticket.TextLeft(fila.Cells[0].Value.ToString());
                        Ticket.TextLeft(fila.Cells[1].Value.ToString());
                        Ticket.TextLeft("                 " + "      " + fila.Cells[3].Value.ToString() + "      " + fila.Cells[4].Value.ToString() + "      " + fila.Cells[7].Value.ToString());
                    }
                    else
                    {
                        Ticket.TextLeft(fila.Cells[0].Value.ToString());
                        Ticket.TextLeft(fila.Cells[1].Value.ToString() + "  -" + fila.Cells[5].Value.ToString() + " %");
                        Ticket.TextLeft("                        " + "p.u $" + fila.Cells[4].Value.ToString() + "   -" + fila.Cells[6].Value.ToString());//total-descuento
                        Ticket.TextLeft("                 " + "      " + fila.Cells[3].Value.ToString() + "      " + fila.Cells[4].Value.ToString() + "      " + fila.Cells[7].Value.ToString());
                    }
                }
            }
            catch {}
            finally { connect_BD.Close(); }
        }
Example #2
0
        private void imprimirComprobante()
        {
            Conversion con    = new Conversion();
            string     numero = "";

            CrearImpresion.TextoCentro("        ");
            CrearImpresion.TextoCentro("        ");
            CrearImpresion.TextLeft(" Velia Perez Zavala");
            CrearImpresion.TextLeft(" R.F.C. PEZV-690103-270");
            CrearImpresion.TextLeft(" Aquiles Serdan #105 OTE");
            CrearImpresion.TextLeft(" Colonia centro");
            CrearImpresion.TextLeft(" Gpe. Victoria,DGO C.P 34700");
            CrearImpresion.lineasSeparacion();//---------------------------------------------------------------------
            CrearImpresion.TextoCentro("Nota de Apartado");
            CrearImpresion.TextoCentro("Fecha: " + DateTime.Today.Day + "/" + DateTime.Today.Month + "/" + DateTime.Today.Year);
            CrearImpresion.TextLeft("Nombre: " + nombreClientetxt.Text);
            CrearImpresion.lineasSeparacion();//---------------------------------------------------------------------
            CrearImpresion.EncabezadoTicket();
            int    found = 0;
            string data;

            foreach (DataGridViewRow celda in tablaProductos.Rows)
            {
                data  = celda.Cells[6].Value.ToString();
                found = data.IndexOf(".");
                CrearImpresion.TextLeft(celda.Cells[0].Value.ToString());
                CrearImpresion.TextLeft(celda.Cells[2].Value.ToString());
                CrearImpresion.TextLeft("                 " + "      " + celda.Cells[1].Value.ToString() + "      " + celda.Cells[3].Value.ToString() + "      " + celda.Cells[6].Value.ToString().Substring(0, found + 3));
            }


            CrearImpresion.lineasSeparacion();//----------------------------------------------------------
            numero = totalSumapts.Text.Trim();
            CrearImpresion.TextoDerecha("Total:      $" + totalSumapts.Text);
            CrearImpresion.TextoDerecha("Pago:   $" + importe.Text);
            CrearImpresion.TextoDerecha("Anticipo:   $" + cajaAnticipotxt.Text);
            CrearImpresion.TextoDerecha("Cambio:   $" + cambioLabel.Text);
            CrearImpresion.TextoDerecha("Restan:   $" + Convert.ToString(cantidadRestante.Text));
            CrearImpresion.TextLeft("(" + con.enletras(numero).ToLower());
            CrearImpresion.lineasSeparacion();//---------------------------------------------------------------------
            CrearImpresion.TextoCentro("Apartado a un mes de plazo");
            CrearImpresion.TextoCentro("No se aceptan cambios en apartado");
            CrearImpresion.lineasSeparacion();//---------------------------------------------------------------------
            CrearImpresion.TextoCentro("****Gracias por su compra****");
        }
Example #3
0
        private void imprimir_Click(object sender, EventArgs e)
        {
            CrearImpresion Ticket = new CrearImpresion();
            Conversion     letras = new Conversion();

            Ticket.TextLeft("          ");
            Ticket.TextLeft("          ");
            Ticket.TextoCentro("Velia Perez Zavala");
            Ticket.TextLeft("     R.F.C. PEZV-690103-270");
            Ticket.TextLeft("     Aquiles Serdan #105 OTE");
            Ticket.TextLeft("     Colonia Centro");
            Ticket.TextLeft("     Gpe. Victoria,DGO C.P 34700");
            CrearImpresion.lineasSeparacion();                             //-----------------------------------------
            Ticket.TextoCentro("Corte del día");
            Ticket.TextLeft("Fecha: " + dateTimePicker1.Value.ToString()); //DateTime.Today.Day + "/" + DateTime.Today.Month + "/" + DateTime.Today.Year);
            CrearImpresion.lineasSeparacion();                             //-----------------------------------------
            CrearImpresion.EncabezadoTicket();

            foreach (DataGridViewRow fila in dataGridView1.Rows)
            {
                int desc = Convert.ToInt32(fila.Cells[6].Value);
                if (desc == 0)
                {
                    Ticket.TextLeft(fila.Cells[3].Value.ToString()); //Codigo producto
                    Ticket.TextLeft(fila.Cells[4].Value.ToString()); // Nombre producto

                    //                                                      cantidad                             Precio unitario                             Precio*cantidad
                    Ticket.TextLeft("                 " + "      " + fila.Cells[8].Value.ToString() + "      " + fila.Cells[5].Value.ToString() + "      " + fila.Cells[9].Value.ToString());
                }
                else
                {
                    Ticket.TextLeft(fila.Cells[3].Value.ToString()); // codigo producto
                    //              Nombre producto                   MENOS         tanto porciento
                    Ticket.TextLeft(fila.Cells[4].Value.ToString() + "  -" + fila.Cells[6].Value.ToString() + " %");
                    //                                                      precio unitario - lo que es de porcentaje
                    Ticket.TextLeft("                        " + "p.u $" + fila.Cells[5].Value.ToString() + "   -" + fila.Cells[7].Value.ToString());//total-descuento

                    //                                                      cantidad                             Precio unitario                             Precio*cantidad
                    Ticket.TextLeft("                 " + "      " + fila.Cells[8].Value.ToString() + "      " + fila.Cells[5].Value.ToString() + "      " + fila.Cells[9].Value.ToString());
                }
            }

            if (labelAnticipos.Text != "0")
            {
                Ticket.TextoCentro("-------------APARTADOS------------");
                foreach (DataGridViewRow item in totalApartados.Rows)
                {
                    string celdaCodigo = item.Cells[0].Value.ToString();

                    if (celdaCodigo != null)
                    {
                        //Ticket.TextLeft(item.Cells[0].Value.ToString()); //Codigo Apartado
                        Ticket.TextLeft(item.Cells[2].Value.ToString()); // Nombre cliente

                        //Ticket.TextLeft("                 " + "      " + "Anticipo: " + "      " + item.Cells[3].Value.ToString() + "      " + "---");
                        Ticket.TextLeft("Anticipo: " + "      " + item.Cells[3].Value.ToString() + "      " + "---");
                    }
                }
            }
            if (labelPagoText.Text != "0")
            {
                foreach (DataGridViewRow fila in pagosDiarios.Rows)
                {
                    string celdaCodigo = fila.Cells[0].Value.ToString();

                    if (celdaCodigo != null)
                    {
                        //Ticket.TextLeft(fila.Cells[0].Value.ToString()); //Codigo Pago
                        Ticket.TextLeft(fila.Cells[1].Value.ToString()); // Nombre cliente

                        //Ticket.TextLeft("                 " + "      " + "Anticipo: " + "      " + item.Cells[3].Value.ToString() + "      " + "---");
                        Ticket.TextLeft("Pago: " + "      " + fila.Cells[4].Value.ToString() + "      " + "---");
                    }
                }
            }

            CrearImpresion.lineasSeparacion();                     //-------------------------------------------
            Ticket.TextLeft("Ventas: $" + totalEnTexto.Text);      //nombre
            Ticket.TextLeft("Anticipos: $" + labelAnticipos.Text); //nombre
            Ticket.TextLeft("Pagos: $" + labelPagoText.Text);      //nombre
            Ticket.TextLeft("TOTAL DÍA: $" + totalDiario.Text);    //nombre
            Ticket.TextLeft("(" + letras.enletras(totalDiario.Text).ToLower());
            Ticket.ImprimirTiket();
        }