Ejemplo n.º 1
0
        private void TxtNumRuc_Validated(object sender, EventArgs e)
        {
            if (TxtNumRuc.Text != "")
            {
                DataTable DtCliente2 = new DataTable();
                //objClientes.mysConec = mysConec;

                //DtCliente2 = objClientes.ClienteBuscar(TxtNumRuc.Text);
                //                Funciones funFunciones = new Funciones();
                //DatosMySql funDatos = new DatosMySql();

                //dtUniMed = funDatos.DataTableFiltrar(dtUniMed, "n_default = 1");

                DtCliente2 = funDatos.DataTableFiltrar(dtClientes, "c_numdoc = '" + TxtNumRuc.Text + "'");

                if ((DtCliente2 != null) && (DtCliente2.Rows.Count != 0))
                {
                    TxtNomCli.Text    = DtCliente2.Rows[0]["c_nombre"].ToString();
                    TxtDireccion.Text = DtCliente2.Rows[0]["c_dir"].ToString();
                    LblIdCliente.Text = DtCliente2.Rows[0]["n_id"].ToString();
                }
                else
                {
                    funFunciones.MensajeMostrarAviso(Mensajes.CRUD_BUSCAR.ToString(), "");
                    TxtNumRuc.Text    = "";
                    LblIdCliente.Text = "";
                    TxtNumRuc.Focus();
                }
            }
        }
Ejemplo n.º 2
0
        private void TxtNumRuc_Validated(object sender, EventArgs e)
        {
            if (TxtNumRuc.Text != "")
            {
                DataTable DtCliente2 = new DataTable();
                DtCliente2 = funGen.DataTableFiltrar(dtClientes, "c_numdoc = '" + TxtNumRuc.Text + "'");

                if ((DtCliente2 != null) && (DtCliente2.Rows.Count != 0))
                {
                    TxtNomCli.Text    = DtCliente2.Rows[0]["c_nombre"].ToString();
                    TxtDireccion.Text = DtCliente2.Rows[0]["c_dir"].ToString();
                    LblIdCliente.Text = DtCliente2.Rows[0]["n_id"].ToString();
                    FgDetalle.Focus();
                    FgDetalle.Select(1, 1);
                }
                else
                {
                    TxtNumRuc.Text    = "";
                    LblIdCliente.Text = "";
                    TxtNumRuc.Focus();
                    TxtNomCli.Text    = "";
                    TxtDireccion.Text = "";
                }
            }
        }
Ejemplo n.º 3
0
        bool CamposOK()
        {
            bool booEstado = true;

            if (TxtCod.Text == "")
            {
                MessageBox.Show("¡ No ha especificado el codigo de la sunat para este banco !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                TxtCod.Focus();
                return(booEstado);
            }
            if (TxtDes.Text == "")
            {
                MessageBox.Show("¡ No ha especificado la descripcion del banco !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                TxtDes.Focus();
                return(booEstado);
            }
            if (TxtAbr.Text == "")
            {
                MessageBox.Show("¡ No ha especificado la abreviatura del bancos !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                TxtAbr.Focus();
                return(booEstado);
            }
            if (TxtNumRuc.Text == "")
            {
                MessageBox.Show("¡ No ha especificado el numero de ruc del banco!", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                TxtNumRuc.Focus();
                return(booEstado);
            }
            return(booEstado);
        }
Ejemplo n.º 4
0
        private void CboTipDocumento_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (booAgregando == true)
            {
                return;
            }

            LblTipDocumento.Text = CboTipDocumento.Text;

            if (Convert.ToInt32(CboTipDocumento.SelectedValue) == 2)
            {
                TxtNumRuc.ReadOnly = false;
                TxtNumRuc.Focus();
            }
            else
            {
                TxtNumRuc.ReadOnly = true;
                TxtNomCli.Focus();
            }

            LimpiarControles();

            objNumeroDoc.mysConec = mysConec;
            LblNumDoc.Text        = objNumeroDoc.HallaNumeroDocumento(STU_SISTEMA.EMPRESAID, Convert.ToInt32(CboTipDocumento.SelectedValue), LblSerDoc.Text, Constantes.SYS_DOCNUM.NO_GRABAR_NUMERO_GENERADO);
            if (Convert.ToInt32(CboTipDocumento.SelectedValue) == 2)
            {
                TxtNumRuc.Focus();
            }
            if (Convert.ToInt32(CboTipDocumento.SelectedValue) == 4)
            {
                TxtNomCli.Focus();
            }
        }
Ejemplo n.º 5
0
        private void FrmPuntoVenta_Activated(object sender, EventArgs e)
        {
            if (Convert.ToDouble(LblTipCam.Text) == 0)
            {
                funFunciones.MensajeMostrarError("No hay tipo de cambio, registre el tipo de cambio para poder continuar", strTituloFormulario);
                this.Close();
            }

            TxtNumRuc.Focus();
        }
Ejemplo n.º 6
0
        private void CboTipDocumento_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (booAgregando == true)
            {
                return;
            }

            LblTipDocumento.Text = CboTipDocumento.Text;
            LblNumDoc.Text       = objTipDoc.UltimoNumero(STU_SISTEMA.EMPRESAID, Convert.ToInt32(CboTipDocumento.SelectedValue), LblSerDoc.Text);
            TxtNumRuc.Focus();
        }
Ejemplo n.º 7
0
        private void TooNuevo_Click(object sender, EventArgs e)
        {
            LimpiarControles();

            LblNumDoc.Text = objTipDoc.UltimoNumero(STU_SISTEMA.EMPRESAID, Convert.ToInt32(CboTipDocumento.SelectedValue), LblSerDoc.Text);
            if (Convert.ToInt32(CboTipDocumento.SelectedValue) == 2)
            {
                TxtNumRuc.Focus();
            }
            if (Convert.ToInt32(CboTipDocumento.SelectedValue) == 4)
            {
                TxtNomCli.Focus();
            }
        }
Ejemplo n.º 8
0
 void Nuevo()
 {
     n_QueHace = 1;
     Tab1.TabPages[0].Enabled = false;
     Blanquea();
     Bloquea();
     ActivarTool();
     LblTitulo2.Text      = "Agregando Nuevo Registro";
     Tab1.SelectedIndex   = 1;
     CboMon.SelectedValue = 115;
     TxtTc.Text           = STU_SISTEMA.TIPOCAMBIO.ToString("0.000");
     TxtNumSer.Text       = "E001";
     TxtNumRuc.Focus();
 }
Ejemplo n.º 9
0
        private void TooNuevo_Click(object sender, EventArgs e)
        {
            LimpiarControles();

            objNumeroDoc.mysConec = mysConec;
            LblNumDoc.Text        = objNumeroDoc.HallaNumeroDocumento(STU_SISTEMA.EMPRESAID, Convert.ToInt32(CboTipDocumento.SelectedValue), LblSerDoc.Text, Constantes.SYS_DOCNUM.NO_GRABAR_NUMERO_GENERADO);
            if (Convert.ToInt32(CboTipDocumento.SelectedValue) == 2)
            {
                TxtNumRuc.Focus();
            }
            if (Convert.ToInt32(CboTipDocumento.SelectedValue) == 4)
            {
                TxtNomCli.Focus();
            }
        }
Ejemplo n.º 10
0
 void Nuevo()
 {
     n_QueHace = 1;
     Tab1.TabPages[0].Enabled = false;
     Blanquea();
     Bloquea();
     ActivarTool();
     LblTitulo2.Text           = "Agregando Nuevo Registro";
     Tab1.SelectedIndex        = 1;
     TxtFchEmi.Text            = DateTime.Now.ToString("dd/MM/yyyy");
     TxtTipCam.Text            = STU_SISTEMA.TIPOCAMBIO.ToString("0.0000");
     CboMoneda.SelectedValue   = 115;
     CboTipOpe.SelectedValue   = 2;
     CboTipDoc.SelectedValue   = 3;                             // ELEGIMOS POR DEFAULT RECIBO DE HONORARIOS
     FgItems.Cols[1].ComboList = "...";
     TxtNumRuc.Focus();
 }
Ejemplo n.º 11
0
        private void FrmPuntoVenta_Load(object sender, EventArgs e)
        {
            booAgregando = true;
            DataTableCargar();

            funGen.ComboBoxCargarDataTable(CboMoneda, dtMoneda, "n_id", "c_des");
            CboMoneda.SelectedValue = STU_SISTEMA.MONEDA;

            funGen.ComboBoxCargarDataTable(CboTipDocumento, dtTipDocumento, "n_id", "c_des");
            booAgregando = false;

            LblSerDoc.Text = "";
            LblNumDoc.Text = "";

            LblSerDoc.Text     = "0001";
            objTipDoc.mysConec = mysConec;

            LblFchEmi.Text = DateTime.Now.ToString("dd/MM/yyyy");
            LblTipCam.Text = objFunciones.ObtenerTC(dtTC, LblFchEmi.Text).ToString("0.000");

            CboMoneda.SelectedIndex       = 0;
            CboTipDocumento.SelectedIndex = 0;

            if (Convert.ToInt32(CboTipDocumento.SelectedValue) == 2)
            {
                TxtNumRuc.ReadOnly = false;
            }
            else
            {
                TxtNumRuc.ReadOnly = true;
            }

            this.Text = "VENTAS - PUNTO DE VENTA";
            LimpiarControles();
            intFilasCantidad            = 20;
            douIGVTasa                  = 18;
            FgDetalle.Rows.Count        = intFilasCantidad;
            FgDetalle.Cols[6].Width     = 40;                        // ID DEL ITEM
            FgDetalle.Cols[7].Width     = 40;                        // ID DE LA UNIDAD DE MEDIDA
            FgDetalle.Cols[8].Width     = 40;                        // PRECIO UNITARIO SIN IGV
            FgDetalle.Cols[9].Width     = 40;                        // PRECIO TOTAL SIN IGV
            LblIGVTasa.Text             = douIGVTasa.ToString() + "%";
            FgDetalle.Cols[1].ComboList = "...";
            OptForPag1.Checked          = true;
            TxtNumRuc.Focus();
        }
Ejemplo n.º 12
0
        private void FrmPuntoVenta_Load(object sender, EventArgs e)
        {
            booAgregando = true;
            DataTableCargar();

            funFlex.FlexColumnaCombo(FgDetalle, dtItems, "c_despro", 1);

            funDatos.ComboBoxCargarDataTable(CboMoneda, dtMoneda, "n_id", "c_des");
            CboMoneda.SelectedValue = STU_SISTEMA.MONEDA;

            funDatos.ComboBoxCargarDataTable(CboTipDocumento, dtTipDocumento, "n_id", "c_des");
            booAgregando = false;
            CboTipDocumento.SelectedValue = 4;

            LblSerDoc.Text = "";
            LblNumDoc.Text = "";

            LblSerDoc.Text        = "0001";
            objNumeroDoc.mysConec = mysConec;

            LblNumDoc.Text = objNumeroDoc.HallaNumeroDocumento(STU_SISTEMA.EMPRESAID, Convert.ToInt32(CboTipDocumento.SelectedValue), LblSerDoc.Text, Constantes.SYS_DOCNUM.NO_GRABAR_NUMERO_GENERADO);

            if (Convert.ToInt32(CboTipDocumento.SelectedValue) == 2)
            {
                TxtNumRuc.ReadOnly = false;
            }
            else
            {
                TxtNumRuc.ReadOnly = true;
            }

            this.Text = "SIAC - Punto de Venta";
            LimpiarControles();
            TxtNumRuc.Focus();
            intFilasCantidad        = 20;
            douIGVTasa              = 18;
            FgDetalle.Rows.Count    = intFilasCantidad;
            FgDetalle.Cols[6].Width = 0;                            // ID DEL ITEM
            FgDetalle.Cols[7].Width = 0;                            // ID DE LA UNIDAD DE MEDIDA
            FgDetalle.Cols[8].Width = 0;                            // PRECIO UNITARIO SIN IGV
            FgDetalle.Cols[9].Width = 0;                            // PRECIO TOTAL SIN IGV
            LblIGVTasa.Text         = douIGVTasa.ToString() + "%";

            LblTipCam.Text = STU_SISTEMA.TIPOCAMBIO.ToString("0.000");
        }
Ejemplo n.º 13
0
        private void CboTipDocumento_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (booAgregando == true)
            {
                return;
            }

            LblTipDocumento.Text = CboTipDocumento.Text;

            if (Convert.ToInt32(CboTipDocumento.SelectedValue) == 2)
            {
                TxtNumRuc.ReadOnly = false;
                TxtNumRuc.Focus();
            }
            else
            {
                TxtNumRuc.ReadOnly = true;
                TxtNomCli.Focus();
            }
        }
Ejemplo n.º 14
0
        private void TxtNumRuc_Validated(object sender, EventArgs e)
        {
            if (TxtNumRuc.Text != "")
            {
                DataTable DtCliente2 = new DataTable();
                objClientes.mysConec = mysConec;

                DtCliente2 = objClientes.ClienteBuscar(TxtNumRuc.Text);
                if ((DtCliente2 != null) && (DtCliente2.Rows.Count != 0))
                {
                    TxtNomCli.Text    = DtCliente2.Rows[0]["c_nombre"].ToString();
                    TxtDireccion.Text = DtCliente2.Rows[0]["c_dir"].ToString();
                }
                else
                {
                    funFunciones.MensajeMostrarAviso(Mensajes.CRUD_BUSCAR.ToString(), "");
                    TxtNumRuc.Text = "";
                    TxtNumRuc.Focus();
                }
            }
        }
Ejemplo n.º 15
0
        void GrabarVenta()
        {
            if (Convert.ToDouble(funFunciones.NulosN(LblTotal.Text)) == 0)                              // SI EL TOTAL DEL DOCUMENTO ES 0
            {
                funFunciones.MensajeMostrarError("El valor del documento no puede ser 0", strTituloFormulario);
                return;
            }

            if (Convert.ToInt32(CboTipDocumento.SelectedValue) == 2)                // SI EL TIPO DE DOCUMENTO ES FACTURA
            {
                if (funFunciones.NulosC(TxtNumRuc.Text) == "")
                {
                    funFunciones.MensajeMostrarError("No ha indicado el numero de ruc para este documento", strTituloFormulario);
                    return;
                }
            }
            if (Convert.ToInt32(CboTipDocumento.SelectedValue) == 4)                // SI EL TIPO DE DOCUMENTO ES BOLETA
            {
                if (funFunciones.NulosC(TxtNomCli.Text) == "")
                {
                    funFunciones.MensajeMostrarError("No ha indicado el nombre del cliente para este documento", strTituloFormulario);
                    return;
                }
            }

            if (Grabar() == true)
            {
                funFunciones.MensajeMostrarAviso("El documento se guardo con exito", strTituloFormulario);
                LimpiarControles();
                LblNumDoc.Text = objTipDoc.UltimoNumero(STU_SISTEMA.EMPRESAID, Convert.ToInt32(CboTipDocumento.SelectedValue), LblSerDoc.Text);
                if (Convert.ToInt32(CboTipDocumento.SelectedValue) == 2)
                {
                    TxtNumRuc.Focus();
                }
                if (Convert.ToInt32(CboTipDocumento.SelectedValue) == 4)
                {
                    TxtNomCli.Focus();
                }
            }
        }
Ejemplo n.º 16
0
 private void CmdSalHel_Click(object sender, EventArgs e)
 {
     c1Sizer1.Enabled = true;
     PanHelp.Visible  = false;
     TxtNumRuc.Focus();
 }
Ejemplo n.º 17
0
        private void FrmPuntoVenta_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode.ToString() == "F1")
            {
                MostrarAyuda();
            }
            if (e.KeyCode.ToString() == "F2")
            {
                GrabarVenta();
            }
            if (e.KeyCode.ToString() == "F3")
            {
                LimpiarControles();
                LblNumDoc.Text = objTipDoc.UltimoNumero(STU_SISTEMA.EMPRESAID, Convert.ToInt32(CboTipDocumento.SelectedValue), LblSerDoc.Text);
                if (Convert.ToInt32(CboTipDocumento.SelectedValue) == 2)
                {
                    TxtNumRuc.Focus();
                }
                if (Convert.ToInt32(CboTipDocumento.SelectedValue) == 4)
                {
                    TxtNomCli.Focus();
                }
            }
            if (e.KeyCode.ToString() == "F4")
            {
                AgregarRuc();
            }
            if (e.KeyCode.ToString() == "F5")
            {
                BuscarCLientes();
            }
            if (e.KeyCode.ToString() == "F6")
            {
                int n_num = 0;

                n_num = Convert.ToInt32(CboTipDocumento.Items.Count);
                if (Convert.ToInt32(CboTipDocumento.SelectedIndex) < n_num - 1)
                {
                    CboTipDocumento.SelectedIndex = CboTipDocumento.SelectedIndex + 1;
                }
                else
                {
                    CboTipDocumento.SelectedIndex = 0;
                }
            }
            if (e.KeyCode.ToString() == "F7")
            {
                if (OptForPag1.Checked == true)
                {
                    OptForPag2.Checked = true; OptTarCre1.Checked = true; return;
                }
                if (OptForPag2.Checked == true)
                {
                    OptForPag1.Checked = true; return;
                }
            }
            if (e.KeyCode.ToString() == "F8")
            {
                if (OptTarCre1.Checked == true)
                {
                    OptTarCre2.Checked = true; return;
                }
                if (OptTarCre2.Checked == true)
                {
                    OptTarCre3.Checked = true; return;
                }
                if (OptTarCre3.Checked == true)
                {
                    OptTarCre1.Checked = true; return;
                }
            }
            if (e.KeyCode.ToString() == "F8")
            {
                this.Close();
            }
        }