Esempio n. 1
0
 private void FgUniMed_RowColChange(object sender, EventArgs e)
 {
     if (booAgregando == true)
     {
         return;
     }
     funFlex.FlexColumnaCombo(FgUniMed, dtUnidadMedida, "c_abr", 1);
     funFlex.FlexColumnaCombo(FgUniMed, dtUnidadMedida, "c_abr", 3);
 }
Esempio n. 2
0
        private void FgRec_EnterCell(object sender, EventArgs e)
        {
            if (b_Modificar == false)
            {
                FgRec.AllowEditing = false; return;
            }
            if (FgRec.Rows.Count == 2)
            {
                return;
            }

            if (booAgregando == true)
            {
                return;
            }

            DataTable dtResul = new DataTable();

            if (FgRec.Col == 1)                                           // TIPO DE EISTENCIA
            {
                funFlex.FlexColumnaCombo(FgRec, dtTipExi, "c_des", 1);    // ITEMS
            }

            if (FgRec.Col == 2)                                           // CODIGO DEL PRODUCTO
            {
            }

            if (FgRec.Col == 3)                                          // DESCRIPCION DEL PRODUCTO
            {
                if (funFunciones.NulosC(FgRec.GetData(FgRec.Row, 1)).ToString() != "")
                {
                    string c_dato     = FgRec.GetData(FgRec.Row, 1).ToString();
                    int    n_idtipexi = Convert.ToInt32(funDatos.DataTableBuscar(dtTipExi, "c_des", "n_id", c_dato, "C"));
                    dtResul = funDatos.DataTableFiltrar(dtItems, "n_idtipexi = " + n_idtipexi + "");
                    funFlex.FlexColumnaCombo(FgRec, dtResul, "c_despro", 3);     // ITEMS
                }
            }

            if (FgRec.Col == 4)                                          // UNIDAD DE MEDIDA
            {
                funFlex.FlexColumnaCombo(FgRec, dtUniMed, "c_abr", 4);   // ITEMS
            }

            if (FgRec.Col == 5)                                         // CANTIDAD
            {
            }
            if (FgRec.Col == 6)                                         // INSUMO PRINCIPAL
            {
            }
            FgRec.AllowEditing = true;
        }
Esempio n. 3
0
        private void FgItems_RowColChange(object sender, EventArgs e)
        {
            if (n_QueHace == 3)
            {
                FgItems.AllowEditing = false; return;
            }

            if (booAgregando == true)
            {
                return;
            }

            funFlex.FlexColumnaCombo(FgItems, dtTipoExis, "c_des", 1);    // TIPO DE PRODUCTO
        }
Esempio n. 4
0
        private void Form3_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");
        }
Esempio n. 5
0
        private void FgCtto_EnterCell(object sender, EventArgs e)
        {
            if (FgCtto.Rows.Count == 2)
            {
                return;
            }
            if (n_QueHace == 3)
            {
                FgCtto.AllowEditing = false; return;
            }
            if (booAgregando == true)
            {
                return;
            }
            if (FgCtto.Row <= 1)
            {
                return;
            }

            DataTable dtResul  = new DataTable();
            DataTable DtFiltro = new DataTable();

            if (FgCtto.Col == 1)
            {
                FgCtto.AllowEditing = true;
                funFlex.FlexColumnaCombo(FgCtto, dtPuestosHabiles, "c_puesto", 1);
            }
            if (FgCtto.Col == 2)
            {
                FgCtto.AllowEditing = true;
                //funFlex.FlexColumnaCombo(FgCtto, dtPuestosHabiles, "c_puesto", 1);
            }
            if (FgCtto.Col == 5)
            {
                FgCtto.AllowEditing = true;
                funFlex.FlexColumnaCombo(FgCtto, dtDocCom, "c_des", 5);
            }
            if (FgCtto.Col == 10)
            {
                FgCtto.AllowEditing = true;
                //funFlex.FlexColumnaCombo(FgCtto, dtDocCom, "c_des", 5);
            }
        }
Esempio n. 6
0
        private void FgItems_RowColChange(object sender, EventArgs e)
        {
            if (n_QueHace == 3)
            {
                FgItems.AllowEditing = false; return;
            }

            if (booAgregando == true)
            {
                return;
            }

            // OBTNEMOS LA DESCRIPCION DEL TIPO DE PRODUCTO
            int       n_idtipproducto = 0;
            DataTable dtResul         = new DataTable();

            n_idtipproducto = Convert.ToInt16(CboTipPro.SelectedValue);

            // FILTRAMOS LOS ITEMS DEL TIPO DE PRODUCTO SELECCIONADO
            dtResul = funDatos.DataTableFiltrar(dtItems, "n_idtipexi = " + n_idtipproducto + "");
            funFlex.FlexColumnaCombo(FgItems, dtResul, "c_despro", 1);    // ITEMS
        }
Esempio n. 7
0
        void DataTableCargar()
        {
            objCho.mysConec = mysConec;
            dtCho           = objCho.Listar(STU_SISTEMA.EMPRESAID);

            objVeh.mysConec = mysConec;
            dtVeh           = objVeh.Listar(STU_SISTEMA.EMPRESAID);

            objEmtra.mysConec = mysConec;
            dtEmpTra          = objEmtra.Listar(STU_SISTEMA.EMPRESAID);

            objPunVen.mysConec = mysConec;
            dtPunVen           = objPunVen.Listar();

            funFlex.FlexColumnaCombo(FgItems, dtEmpTra, "c_nombre", 6);
            funFlex.FlexColumnaCombo(FgItems, dtCho, "c_nomcho", 7);
            funFlex.FlexColumnaCombo(FgItems, dtVeh, "c_numpla", 8);

            objEmlLoc.mysConec = mysConec;
            dtPunPar           = objEmlLoc.Listar(STU_SISTEMA.EMPRESAID, STU_SISTEMA.SYS_UNIBD);

            funDatos.ComboBoxCargarDataTable(CboPunPar, dtPunPar, "n_id", "c_des");
            //CboPunPar.SelectedValue()
        }
Esempio n. 8
0
        private void FgLista_EnterCell(object sender, EventArgs e)
        {
            if (b_Agregando == true)
            {
                return;
            }

            DataTable dtResult = new DataTable();

            if (FgLista.Col == 1)
            {
                if (Convert.ToInt32(CboPue.SelectedValue) == 0)
                {
                    return;
                }
                FgLista.AllowEditing = true;

                if (ChkActivar.Checked == false)
                {
                    dtResult = funDatos.DataTableFiltrar(dtPuestos, "n_id = " + CboPue.SelectedValue.ToString() + "");
                }
                if (ChkActivar.Checked == true)
                {
                    dtResult = funDatos.DataTableFiltrar(dtPuestosNA, "n_id = " + CboPue.SelectedValue.ToString() + "");
                }

                if (Convert.ToInt32(dtResult.Rows[0]["n_idtippue"]) == 1)
                {
                    dtResult = funDatos.DataTableFiltrar(dtConcepto, "c_cod like '" + "70" + "*'");
                }
                else
                {
                    dtResult = funDatos.DataTableFiltrar(dtConcepto, "c_cod like '" + "75" + "*'");
                }
                //if (N_SOCIOTIPO == 1)
                //{
                //    dtResult = funDatos.DataTableFiltrar(dtConcepto, "c_cod like '" + "70" + "*'");
                //}
                //else
                //{
                //    dtResult = funDatos.DataTableFiltrar(dtConcepto, "c_cod like '" + "75" + "*'");
                //}

                dtResult = funDatos.DataTableOrdenar(dtResult, "c_des");
                funFlex.FlexColumnaCombo(FgLista, dtResult, "c_des", 1);    // ITEMS
            }
        }
Esempio n. 9
0
        private void FgPer_EnterCell(object sender, EventArgs e)
        {
            if (n_QueHace == 3)
            {
                FgPer.AllowEditing = false; return;
            }
            if (booAgregando == true)
            {
                return;
            }

            if (FgPer.Col == 2)
            {
                FgPer.AllowEditing = true;
                funFlex.FlexColumnaCombo(FgPer, dtPersonal, "c_apenom", 2);
            }
            if ((FgPer.Col == 3) || (FgPer.Col == 4) || (FgPer.Col == 5))
            {
                FgPer.AllowEditing = true;
            }
        }
Esempio n. 10
0
        private void FgItems_CellChanged(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
        {
            if (n_QueHace == 3)
            {
                FgItems.AllowEditing = false; return;
            }
            DataTable dtResul = new DataTable();
            string    c_dato  = "";

            if (b_Agregando == true)
            {
                return;
            }

            if (FgItems.Col == 1)
            {
                // FILTRAMOS LAS PRESENTACIONES DEL ITEM SELECCIONADO
                c_dato  = FgItems.GetData(FgItems.Row, 4).ToString();                       // OBTENEMOS EL ID DEL ITEM
                dtResul = funDatos.DataTableFiltrar(dtUniMed, "n_idite = " + c_dato + "");
                funFlex.FlexColumnaCombo(FgItems, dtResul, "c_abrpre", 2);                  // UNIDADES DEL MEDIDA DEL ITEMS

                FgItems.AllowEditing = true;
                FgItems.Select(FgItems.Row - 1, 2);
                return;
            }
            if (FgItems.Col == 2)
            {
                CalcularTotalFila();
                FgItems.Select(FgItems.Row - 1, 4);

                return;
            }
            if (FgItems.Col == 4)
            {
                FgItems.Select(FgItems.Row - 1, 1);
                FgItems.SetData(FgItems.Row + 1, 1, FgItems.GetData(FgItems.Row, 1));
                return;
            }
        }
Esempio n. 11
0
        private void FgItems_EnterCell(object sender, EventArgs e)
        {
            if (FgItems.Rows.Count == 2)
            {
                return;
            }
            if (n_QueHace == 3)
            {
                FgItems.AllowEditing = false; return;
            }
            if (booAgregando == true)
            {
                return;
            }

            DataTable dtResul = new DataTable();

            if (FgItems.Col == 2)
            {
                funFlex.FlexColumnaCombo(FgItems, dtestado, "c_des", 2);
            }

            FgItems.AllowEditing = true;
        }
Esempio n. 12
0
        private void FgItems_EnterCell(object sender, EventArgs e)
        {
            if (n_QueHace == 3)
            {
                FgItems.AllowEditing = false; return;
            }
            if (booAgregando == true)
            {
                return;
            }

            DataTable dtResul         = new DataTable();
            int       n_idtipproducto = 0;
            string    strDesTipPro    = "";

            if (FgItems.Col == 2)
            {
                // OBTNEMOS LA DESCRIPCION DEL TIPO DE PRODUCTO
                strDesTipPro = funFunciones.NulosC(FgItems.GetData(FgItems.Row, 1));

                if (strDesTipPro == "")
                {
                    FgItems.AllowEditing = false;
                    funFlex.FlexColumnaCombo(FgItems, dtResul, "c_despro", 2);
                    return;
                }
                // OBTENEMOS EL ID DEL TIPO DE PRODUCTO
                dtResul         = funDatos.DataTableFiltrar(dtTipoExis, "c_des = '" + strDesTipPro + "'");
                n_idtipproducto = Convert.ToInt16(dtResul.Rows[0]["n_id"].ToString());

                // FILTRAMOS LOS ITEMS DEL TIPO DE PRODUCTO SELECCIONADO
                dtResul = funDatos.DataTableFiltrar(dtItems, "n_idtipexi = " + n_idtipproducto + "");
                funFlex.FlexColumnaCombo(FgItems, dtResul, "c_despro", 2);    // ITEMS
            }
            if (FgItems.Col == 3)
            {
                // OBTENEMOS LA DESCRIPCIO DEL ITEM
                strDesTipPro = funFunciones.NulosC(FgItems.GetData(FgItems.Row, 2));

                if (strDesTipPro == "")
                {
                    FgItems.AllowEditing = false;
                    funFlex.FlexColumnaCombo(FgItems, dtResul, "c_despro", 2);
                    return;
                }

                // OBTENEMOS EL ID DEL TIPO DE PRODUCTO
                dtResul         = funDatos.DataTableFiltrar(dtItems, "c_despro = '" + strDesTipPro + "'");
                n_idtipproducto = Convert.ToInt16(dtResul.Rows[0]["n_id"].ToString());

                // FILTRAMOS LAS PRESENTACIONES DEL ITEM SELECCIONADO
                dtResul = funDatos.DataTableFiltrar(dtPresentaItem, "n_idite = " + n_idtipproducto + "");
                funFlex.FlexColumnaCombo(FgItems, dtResul, "c_des", 3);    // ITEMS
            }

            if (FgItems.Col == 4)
            {
                // OBTENEMOS LA DESCRIPCIO DEL ITEM
                strDesTipPro = funFunciones.NulosC(FgItems.GetData(FgItems.Row, 3));

                if (strDesTipPro == "")
                {
                    FgItems.AllowEditing = false;
                    return;
                }
            }
            FgItems.AllowEditing = true;
        }
Esempio n. 13
0
        private void FgDetalle_CellChanged(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
        {
            if (booAgregando == true)
            {
                return;
            }
            DataTable dtUniMed      = new DataTable();
            DataTable dtResult      = new DataTable();
            int       intProductoId = 0;
            int       intUniMedId   = 0;

            if (e.Col == 1)             // SI SE HA SELECCIONADO ALGUN ITEM DE LA COLUMNA 1
            {
                string strItemDescripcion = FgDetalle.GetData(e.Row, 1).ToString();
                intProductoId = Convert.ToInt32(funGen.DataTableBuscar(dtItems, "c_despro", "n_id", strItemDescripcion, "C"));    // OBTENEMOS EL ID DEL ITEM SELECCIONADO

                FgDetalle.SetData(e.Row, 6, intProductoId);
                dtUniMed = funGen.DataTableFiltrar(dtUnidadMedida, "n_idite = " + intProductoId + "");                            //  FILTRAMOS POR ID DEL PRODUCTO
                if (dtUniMed.Rows.Count != 0)
                {
                    funFlex.FlexColumnaCombo(FgDetalle, dtUniMed, "c_abrpre", 2);
                }

                dtUniMed = funGen.DataTableFiltrar(dtUniMed, "n_default = 1");                                                    //  FILTRAMOS LA UNIDAD DE MEDIDA POR DEFECTO

                FgDetalle.SetData(e.Row, 2, dtUniMed.Rows[0]["c_abrpre"].ToString());                                             // ESTABLECEMOS LA ABREVIATURA DE LA UNIDAD DE MEDIDA
                FgDetalle.SetData(e.Row, 7, dtUniMed.Rows[0]["n_id"].ToString());                                                 // ESTABLECEMOS EL ID DE LA UNIDAD DE MEDIDA
                FgDetalle.SetData(e.Row, 6, intProductoId.ToString());                                                            // ESTABLECEMOS EL ID DE LA EXISTENCIA

                double doupreuniigv = Convert.ToDouble(dtUniMed.Rows[0]["n_preuniigv"].ToString());
                double doupreuni    = Convert.ToDouble(dtUniMed.Rows[0]["n_preuni"].ToString());
                FgDetalle.SetData(e.Row, 4, doupreuniigv.ToString("0.000000"));                                                     // ESTABLECEMOS EL PRECIO CON IGV DEL ITEM
                FgDetalle.SetData(e.Row, 8, doupreuni.ToString("0.000000"));                                                        // ESTABLECEMOS EL PRECIO SIN IGV DEL ITEM

                CalcularFila(e.Row);
                //FgDetalle.Select(FgDetalle.Row - 1, 3);
            }

            if (e.Col == 2)             // SI SE HA SELECCIONADO ALGUN ITEM DE LA COLUMNA 2
            {
                intProductoId = Convert.ToInt32(FgDetalle.GetData(e.Row, 6));
                string strUnidadMedidaDescripcion = FgDetalle.GetData(e.Row, 2).ToString();

                dtUniMed    = funGen.DataTableFiltrar(dtUnidadMedida, "n_idite = " + intProductoId + ""); //  FILTRAMOS LA UNIDAD DE MEDIDA POR DEFECTO
                intUniMedId = Convert.ToInt32(funGen.DataTableBuscar(dtUniMed, "c_abrpre", "n_id", strUnidadMedidaDescripcion, "C"));
                //intUniMedId = Convert.ToInt32(funDatos.DataTableBuscar(dtUnidadMedida, "c_abrpre", "n_id", intProductoId.ToString(), "N"));
                FgDetalle.SetData(e.Row, 7, intUniMedId);

                dtUniMed = funGen.DataTableFiltrar(dtUniMed, "n_id = " + intUniMedId + " AND n_idite = " + intProductoId + "");   //  FILTRAMOS LA UNIDAD DE MEDIDA POR DEFECTO

                double doupreuniigv = Convert.ToDouble(dtUniMed.Rows[0]["n_preuniigv"].ToString());
                double doupreuni    = Convert.ToDouble(dtUniMed.Rows[0]["n_preuni"].ToString());

                FgDetalle.SetData(e.Row, 2, dtUniMed.Rows[0]["c_abrpre"].ToString());                                               // ESTABLECEMOS LA ABREVIATURA DE LA UNIDAD DE MEDIDA
                FgDetalle.SetData(e.Row, 7, dtUniMed.Rows[0]["n_id"].ToString());                                                   // ESTABLECEMOS EL ID DE LA UNIDAD DE MEDIDA
                FgDetalle.SetData(e.Row, 4, doupreuniigv.ToString("0.000000"));                                                     // ESTABLECEMOS EL PRECIO CON IGV DEL ITEM
                FgDetalle.SetData(e.Row, 8, doupreuni.ToString("0.000000"));                                                        // ESTABLECEMOS EL PRECIO SIN IGV DEL ITEM

                CalcularFila(e.Row);
                FgDetalle.Select(FgDetalle.Row - 1, 3);
                return;
            }

            if ((e.Col == 3) || (e.Col == 4))
            {
                //if (e.Col == 4)
                //{
                double douPreSninIGV   = 0;
                double douTotPreSinIGV = 0;

                if (funFunciones.NulosC(FgDetalle.GetData(FgDetalle.Row, 4)) != "")
                {
                    douPreSninIGV   = (Convert.ToDouble(FgDetalle.GetData(FgDetalle.Row, 4)) / (((douIGVTasa) / 100) + 1));
                    douTotPreSinIGV = (douPreSninIGV * Convert.ToDouble(FgDetalle.GetData(FgDetalle.Row, 3)));
                    FgDetalle.SetData(FgDetalle.Row, 8, douPreSninIGV.ToString("0.000000"));
                    FgDetalle.SetData(FgDetalle.Row, 9, douTotPreSinIGV.ToString("0.000000"));
                    CalcularFila(e.Row);
                }

                if (e.Col == 3)
                {
                    FgDetalle.Select(FgDetalle.Row - 1, 4);
                    return;
                }
                if (e.Col == 4)
                {
                    FgDetalle.Select(e.Row, 1);
                    return;
                }
            }
        }