Exemplo n.º 1
0
 void SumarColumnas()
 {
     LblDebSol.Text = funFlex.FlexSumarCol(FgItems, 3, 2, FgItems.Rows.Count - 1).ToString("0.00");
     LblHabSol.Text = funFlex.FlexSumarCol(FgItems, 4, 2, FgItems.Rows.Count - 1).ToString("0.00");
     LblDebDol.Text = funFlex.FlexSumarCol(FgItems, 5, 2, FgItems.Rows.Count - 1).ToString("0.00");
     LblHabDol.Text = funFlex.FlexSumarCol(FgItems, 6, 2, FgItems.Rows.Count - 1).ToString("0.00");
 }
Exemplo n.º 2
0
        void CargarAsiento()
        {
            //int n_row = 0;
            CN_con_diario funDiario = new CN_con_diario();

            funDiario.mysConec = mysConec;
            funDiario.ConsultaAsiento(n_IdEmpresa, n_AnoTrabajo, n_MesTrabajo, n_IdLibro, c_NumAsiento);
            dtLista = funDiario.dtLista;
            if (dtLista.Rows.Count != 0)
            {
                funFlex.FlexMostrarDatos(FgItems, arrCabeceraFlex1, dtLista, 2, true);
            }

            double n_tot1 = 0;
            double n_tot2 = 0;
            double n_tot3 = 0;
            double n_tot4 = 0;

            n_tot1 = funFlex.FlexSumarCol(FgItems, 4, 2, FgItems.Rows.Count - 1);
            n_tot2 = funFlex.FlexSumarCol(FgItems, 5, 2, FgItems.Rows.Count - 1);
            n_tot3 = funFlex.FlexSumarCol(FgItems, 6, 2, FgItems.Rows.Count - 1);
            n_tot4 = funFlex.FlexSumarCol(FgItems, 7, 2, FgItems.Rows.Count - 1);

            TxtTot1.Text = n_tot1.ToString("0.00");
            TxtTot2.Text = n_tot2.ToString("0.00");
            TxtTot3.Text = n_tot3.ToString("0.00");
            TxtTot4.Text = n_tot4.ToString("0.00");
        }
Exemplo n.º 3
0
        void SumarColumnas()
        {
            double n_tot1 = funFlex.FlexSumarCol(FgItems, 7, 2, FgItems.Rows.Count - 1);
            double n_tot2 = funFlex.FlexSumarCol(FgItems, 9, 2, FgItems.Rows.Count - 1);

            TxtTot1.Text = n_tot1.ToString("0.00");
            TxtTot2.Text = n_tot2.ToString("0.00");
        }
Exemplo n.º 4
0
 void SumarTotales()
 {
     douPrecioTotal       = funFlex.FlexSumarCol(FgDetalle, 5, 1, FgDetalle.Rows.Count - 1);
     douPrecioTotalSinIGV = funFlex.FlexSumarCol(FgDetalle, 8, 1, FgDetalle.Rows.Count - 1);
     LblImpBru.Text       = douPrecioTotalSinIGV.ToString("0.00");
     LblTotal.Text        = douPrecioTotal.ToString("0.00");
     douValorIGV          = (douPrecioTotal - douPrecioTotalSinIGV);
     LblIgv.Text          = douValorIGV.ToString("0.00");
 }
Exemplo n.º 5
0
        void HalarTotalresumen()
        {
            double n_val1 = funFlex.FlexSumarCol(FgRes, 3, 3, FgRes.Rows.Count - 1);
            double n_val2 = funFlex.FlexSumarCol(FgRes, 3, 4, FgRes.Rows.Count - 1);

            FgRes.Rows.Count = FgRes.Rows.Count + 1;
            FgRes.SetData(FgRes.Rows.Count - 1, 2, "TOTAL ==>");
            FgRes.SetData(FgRes.Rows.Count - 1, 3, n_val1.ToString("0.00"));
            FgRes.SetData(FgRes.Rows.Count - 1, 4, n_val2.ToString("0.00"));
        }
Exemplo n.º 6
0
        void SumarColumnas()
        {
            int n_col = 3;

            FgDatos.Rows.Count = FgDatos.Rows.Count + 1;
            FgDatos.SetData(FgDatos.Rows.Count - 1, 1, "T O T A L E S  ==>");
            for (n_col = 2; n_col <= FgDatos.Cols.Count - 1; n_col++)
            {
                double n_valor = funFlex.FlexSumarCol(FgDatos, n_col, 2, FgDatos.Rows.Count - 2);
                FgDatos.SetData(FgDatos.Rows.Count - 1, n_col, n_valor.ToString("0.00"));
            }
            funFlex.Flex_PintarCeldas(FgDatos, FgDatos.Rows.Count - 1, 1, FgDatos.Rows.Count - 1, FgDatos.Cols.Count - 1, Color.Black, Color.Coral);
            funFlex.Flex_PintarCeldas(FgDatos, 2, FgDatos.Cols.Count - 1, FgDatos.Rows.Count - 2, FgDatos.Cols.Count - 1, Color.Black, Color.DarkSeaGreen);
        }
Exemplo n.º 7
0
        void SumarColumnas()
        {
            TxtDato1.Text = funFlex.FlexSumarCol(FgTarea, 7, 2, FgTarea.Rows.Count - 1).ToString("0.00");
            TxtDato2.Text = funFlex.FlexSumarCol(FgTarea, 9, 2, FgTarea.Rows.Count - 1).ToString("0.00");
            double n_dato = 0;

            n_dato        = Convert.ToDouble(funFlex.FlexSumarCol(FgTarea, 11, 2, FgTarea.Rows.Count - 1).ToString());          // EFICIENCICIA TOTAL
            TxtDato3.Text = (n_dato / Convert.ToDouble(TxtDato2.Text)).ToString("0.00");

            n_dato        = Convert.ToDouble(TxtCanPro.Text);
            n_dato        = n_dato / Convert.ToDouble(TxtDato2.Text);
            TxtDato4.Text = n_dato.ToString("0.00");
            TxtDato5.Text = funFlex.FlexSumarCol(FgTarea, 13, 2, FgTarea.Rows.Count - 1).ToString("0.00");
        }
Exemplo n.º 8
0
        void ResumenMostrarTotales()
        {
            double n_total1 = 0;
            double n_total2 = 0;
            double n_total3 = 0;

            n_total1 = funFlex.FlexSumarCol(FgDatos, 3, 3, FgDatos.Rows.Count - 1);
            n_total2 = funFlex.FlexSumarCol(FgDatos, 4, 3, FgDatos.Rows.Count - 1);
            n_total3 = funFlex.FlexSumarCol(FgDatos, 5, 3, FgDatos.Rows.Count - 1);

            FgDatos.Rows.Count = FgDatos.Rows.Count + 1;
            FgDatos.SetData(FgDatos.Rows.Count - 1, 2, "TOTAL ==>");
            funFlex.Flex_PintarCeldas(FgDatos, FgDatos.Rows.Count - 1, 2, FgDatos.Rows.Count - 1, 5, Color.Blue, Color.Transparent);

            FgDatos.SetData(FgDatos.Rows.Count - 1, 3, n_total1.ToString("0.00"));
            FgDatos.SetData(FgDatos.Rows.Count - 1, 4, n_total2.ToString("0.00"));
            FgDatos.SetData(FgDatos.Rows.Count - 1, 5, n_total3.ToString("0.00"));
        }
Exemplo n.º 9
0
        void MostrarDatos()
        {
            int    n_row   = 0;
            string c_dato  = "";
            double n_valor = 0;

            double n_horini = 0;
            double n_horfin = 0;

            LblApeNom.Text = c_apenomtra;
            LblNumDoc.Text = c_numdoc;
            LblFchTra.Text = c_fchtra;

            FgLisPer.Rows.Count = 2;
            if (dtTareas.Rows.Count != 0)
            {
                for (n_row = 0; n_row <= dtTareas.Rows.Count - 1; n_row++)
                {
                    FgLisPer.Rows.Count = FgLisPer.Rows.Count + 1;

                    c_dato = dtTareas.Rows[n_row]["c_des"].ToString();
                    FgLisPer.SetData(FgLisPer.Rows.Count - 1, 1, c_dato);

                    n_valor = Convert.ToDouble(funFunciones.NulosN(dtTareas.Rows[n_row]["n_can"]));
                    FgLisPer.SetData(FgLisPer.Rows.Count - 1, 2, n_valor.ToString("0.00"));

                    c_dato = dtTareas.Rows[n_row]["c_horini"].ToString();
                    FgLisPer.SetData(FgLisPer.Rows.Count - 1, 3, c_dato);

                    c_dato = dtTareas.Rows[n_row]["c_horter"].ToString();
                    FgLisPer.SetData(FgLisPer.Rows.Count - 1, 4, c_dato);

                    n_horini = funCon.HoraEnDecimal(dtTareas.Rows[n_row]["c_horini"].ToString() + ":00");
                    n_horfin = funCon.HoraEnDecimal(dtTareas.Rows[n_row]["c_horter"].ToString() + ":00");
                    n_valor  = n_horfin - n_horini;
                    c_dato   = funCon.DecimalEnHoras(n_valor);
                    FgLisPer.SetData(FgLisPer.Rows.Count - 1, 5, c_dato);

                    n_valor = Convert.ToDouble(funFunciones.NulosN(dtTareas.Rows[n_row]["n_pretar"]));
                    FgLisPer.SetData(FgLisPer.Rows.Count - 1, 6, n_valor);

                    n_valor = Convert.ToDouble(funFunciones.NulosN(dtTareas.Rows[n_row]["n_imptot"]));
                    FgLisPer.SetData(FgLisPer.Rows.Count - 1, 7, n_valor);
                }
            }


            //LblTot1.Text = funFlex.FlexSumarCol(FgLisPer, 6, 2, FgLisPer.Rows.Count - 1).ToString("0.00");
            LblTot2.Text = funFlex.FlexSumarCol(FgLisPer, 7, 2, FgLisPer.Rows.Count - 1).ToString("0.00");
        }
Exemplo n.º 10
0
        void MostrarTotales()
        {
            double n_valor = 0;

            FgDatos.Rows.Count = FgDatos.Rows.Count + 1;
            FgDatos.SetData(FgDatos.Rows.Count - 1, 2, "TOTALES ==>");

            n_valor = funFlex.FlexSumarCol(FgDatos, 4, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 4, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 5, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 5, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 6, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 6, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 7, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 7, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 8, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 8, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 9, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 9, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 10, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 10, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 11, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 11, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 12, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 12, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 13, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 13, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 14, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 14, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 15, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 15, n_valor.ToString("0.00"));

            funFlex.Flex_PintarCeldas(FgDatos, FgDatos.Rows.Count - 1, 1, FgDatos.Rows.Count - 1, FgDatos.Cols.Count - 1, Color.Black, Color.PaleGreen);
            funFlex.Flex_PintarCeldas(FgDatos, 1, FgDatos.Cols.Count - 1, FgDatos.Rows.Count - 1, FgDatos.Cols.Count - 1, Color.Black, Color.Pink);
        }
Exemplo n.º 11
0
        void MostrarDatosItems()
        {
            int               n_row     = 0;
            int               n_numanos = 0;
            double            n_valor;
            DataTable         dtResult = new DataTable();
            CN_ges_planventas o_plan   = new CN_ges_planventas();

            dtResult = funDatos.DataTableFiltrar(dtItems, "n_id = " + n_IdItem + "");
            if (dtResult.Rows.Count != 0)
            {
                TxtCodPro.Text = dtResult.Rows[0]["c_codpro"].ToString();
                TxtDes.Text    = dtResult.Rows[0]["c_despro"].ToString();
                TxtUniMed.Text = dtResult.Rows[0]["c_abrpre"].ToString();
            }

            o_plan.mysConec = mysConec;
            o_plan.VentasItemxPorAnos(STU_SISTEMA.EMPRESAID, n_IdItem);
            dtResult = o_plan.dtLista;

            FgItems.Rows.Count = 2;

            if (dtResult != null)
            {
                if (dtResult.Rows.Count != 0)
                {
                    funFlex.FlexMostrarDatos(FgItems, arrCabeceraFlex1, dtResult, 2, true);
                    FgItems.SelectionMode = C1.Win.C1FlexGrid.SelectionModeEnum.Row;

                    n_numanos = dtResult.Rows.Count;
                    // CALCULAMOS EL TOTAL
                    double n_totalmes = 0;
                    FgItems.Rows.Count = FgItems.Rows.Count + 1;
                    FgItems.SetData(FgItems.Rows.Count - 1, 1, "TOTAL ==>");
                    n_totalmes = funFlex.FlexSumarCol(FgItems, 2, 2, FgItems.Rows.Count - 1);
                    FgItems.SetData(FgItems.Rows.Count - 1, 2, n_totalmes.ToString("0.00"));
                    n_totalmes = funFlex.FlexSumarCol(FgItems, 3, 2, FgItems.Rows.Count - 1);
                    FgItems.SetData(FgItems.Rows.Count - 1, 3, n_totalmes.ToString("0.00"));
                    n_totalmes = funFlex.FlexSumarCol(FgItems, 4, 2, FgItems.Rows.Count - 1);
                    FgItems.SetData(FgItems.Rows.Count - 1, 4, n_totalmes.ToString("0.00"));
                    n_totalmes = funFlex.FlexSumarCol(FgItems, 5, 2, FgItems.Rows.Count - 1);
                    FgItems.SetData(FgItems.Rows.Count - 1, 5, n_totalmes.ToString("0.00"));
                    n_totalmes = funFlex.FlexSumarCol(FgItems, 6, 2, FgItems.Rows.Count - 1);
                    FgItems.SetData(FgItems.Rows.Count - 1, 6, n_totalmes.ToString("0.00"));
                    n_totalmes = funFlex.FlexSumarCol(FgItems, 7, 2, FgItems.Rows.Count - 1);
                    FgItems.SetData(FgItems.Rows.Count - 1, 7, n_totalmes.ToString("0.00"));
                    n_totalmes = funFlex.FlexSumarCol(FgItems, 8, 2, FgItems.Rows.Count - 1);
                    FgItems.SetData(FgItems.Rows.Count - 1, 8, n_totalmes.ToString("0.00"));
                    n_totalmes = funFlex.FlexSumarCol(FgItems, 9, 2, FgItems.Rows.Count - 1);
                    FgItems.SetData(FgItems.Rows.Count - 1, 9, n_totalmes.ToString("0.00"));
                    n_totalmes = funFlex.FlexSumarCol(FgItems, 10, 2, FgItems.Rows.Count - 1);
                    FgItems.SetData(FgItems.Rows.Count - 1, 10, n_totalmes.ToString("0.00"));
                    n_totalmes = funFlex.FlexSumarCol(FgItems, 11, 2, FgItems.Rows.Count - 1);
                    FgItems.SetData(FgItems.Rows.Count - 1, 11, n_totalmes.ToString("0.00"));
                    n_totalmes = funFlex.FlexSumarCol(FgItems, 12, 2, FgItems.Rows.Count - 1);
                    FgItems.SetData(FgItems.Rows.Count - 1, 12, n_totalmes.ToString("0.00"));
                    n_totalmes = funFlex.FlexSumarCol(FgItems, 13, 2, FgItems.Rows.Count - 1);
                    FgItems.SetData(FgItems.Rows.Count - 1, 13, n_totalmes.ToString("0.00"));
                    n_totalmes = funFlex.FlexSumarCol(FgItems, 14, 2, FgItems.Rows.Count - 1);
                    FgItems.SetData(FgItems.Rows.Count - 1, 14, n_totalmes.ToString("0.00"));

                    //CALCULAMOS EL PROMEDIO
                    FgItems.Rows.Count = FgItems.Rows.Count + 1;
                    FgItems.SetData(FgItems.Rows.Count - 1, 1, "PROMEDIO ==>");
                    double n_total    = 0;
                    Double n_promedio = 0;

                    n_total    = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 2));
                    n_promedio = (n_total / n_numanos);
                    FgItems.SetData(FgItems.Rows.Count - 1, 2, n_promedio.ToString("0.00"));

                    n_total    = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 3));
                    n_promedio = (n_total / n_numanos);
                    FgItems.SetData(FgItems.Rows.Count - 1, 3, n_promedio.ToString("0.00"));

                    n_total    = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 4));
                    n_promedio = (n_total / n_numanos);
                    FgItems.SetData(FgItems.Rows.Count - 1, 4, n_promedio.ToString("0.00"));

                    n_total    = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 5));
                    n_promedio = (n_total / n_numanos);
                    FgItems.SetData(FgItems.Rows.Count - 1, 5, n_promedio.ToString("0.00"));

                    n_total    = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 6));
                    n_promedio = (n_total / n_numanos);
                    FgItems.SetData(FgItems.Rows.Count - 1, 6, n_promedio.ToString("0.00"));

                    n_total    = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 7));
                    n_promedio = (n_total / n_numanos);
                    FgItems.SetData(FgItems.Rows.Count - 1, 7, n_promedio.ToString("0.00"));

                    n_total    = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 8));
                    n_promedio = (n_total / n_numanos);
                    FgItems.SetData(FgItems.Rows.Count - 1, 8, n_promedio.ToString("0.00"));

                    n_total    = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 9));
                    n_promedio = (n_total / n_numanos);
                    FgItems.SetData(FgItems.Rows.Count - 1, 9, n_promedio.ToString("0.00"));

                    n_total    = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 10));
                    n_promedio = (n_total / n_numanos);
                    FgItems.SetData(FgItems.Rows.Count - 1, 10, n_promedio.ToString("0.00"));

                    n_total    = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 11));
                    n_promedio = (n_total / n_numanos);
                    FgItems.SetData(FgItems.Rows.Count - 1, 11, n_promedio.ToString("0.00"));

                    n_total    = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 12));
                    n_promedio = (n_total / n_numanos);
                    FgItems.SetData(FgItems.Rows.Count - 1, 12, n_promedio.ToString("0.00"));

                    n_total    = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 13));
                    n_promedio = (n_total / n_numanos);
                    FgItems.SetData(FgItems.Rows.Count - 1, 13, n_promedio.ToString("0.00"));

                    n_total    = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 14));
                    n_promedio = (n_total / n_numanos);
                    FgItems.SetData(FgItems.Rows.Count - 1, 14, n_promedio.ToString("0.00"));
                }
            }

            string[] c_datos = new string[12];
            int      n_fil   = 0;
            int      n_ele   = 0;
            string   c_dato  = "";

            n_row = 0;

            for (n_row = 2; n_row <= FgItems.Rows.Count - 3; n_row++)
            {
                n_ele = 0;
                for (n_fil = 2; n_fil <= FgItems.Cols.Count - 4; n_fil++)
                {
                    c_datos[n_ele] = Convert.ToDouble(funFunciones.NulosN(FgItems.GetData(n_row, n_fil))).ToString("0.00");
                    n_ele          = n_ele + 1;
                }
                c_dato = HallarPromedio(c_datos).ToString("0.00");

                FgItems.SetData(n_row, FgItems.Cols.Count - 1, c_dato);
            }

            funFlex.Flex_PintarCeldas(FgItems, FgItems.Rows.Count - 2, 1, FgItems.Rows.Count - 1, 14, Color.Black, Color.Coral);
            funFlex.Flex_PintarCeldas(FgItems, 2, FgItems.Cols.Count - 2, FgItems.Rows.Count - 1, FgItems.Cols.Count - 1, Color.Black, Color.LightCoral);
            MostrarPlanVenta();
        }
Exemplo n.º 12
0
        void SumarColumnas()
        {
            double n_tot1  = 0;
            double n_tot2  = 0;
            double n_tot3  = 0;
            double n_tot4  = 0;
            double n_tot5  = 0;
            double n_tot6  = 0;
            double n_tot7  = 0;
            double n_tot8  = 0;
            double n_tot9  = 0;
            double n_tot10 = 0;
            double n_tot11 = 0;
            double n_tot12 = 0;
            int    n_row   = 0;

            if (n_Libro == 8)
            {
                for (n_row = 3; n_row <= FgDatos.Rows.Count - 1; n_row++)
                {
                    if (FgDatos.GetData(n_row, 12).ToString() == "07")
                    {
                        n_tot1  = n_tot1 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 12)));
                        n_tot2  = n_tot2 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 13)));
                        n_tot3  = n_tot3 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 14)));
                        n_tot4  = n_tot4 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 15)));
                        n_tot5  = n_tot5 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 16)));
                        n_tot6  = n_tot6 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 17)));
                        n_tot7  = n_tot7 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 18)));
                        n_tot8  = n_tot8 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 19)));
                        n_tot9  = n_tot9 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 20)));
                        n_tot10 = n_tot10 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 21)));
                        n_tot11 = n_tot11 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 22)));
                        n_tot12 = n_tot12 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 23)));
                    }
                    else
                    {
                        n_tot1  = n_tot1 + Convert.ToDouble(FgDatos.GetData(n_row, 12));
                        n_tot2  = n_tot2 + Convert.ToDouble(FgDatos.GetData(n_row, 13));
                        n_tot3  = n_tot3 + Convert.ToDouble(FgDatos.GetData(n_row, 14));
                        n_tot4  = n_tot4 + Convert.ToDouble(FgDatos.GetData(n_row, 15));
                        n_tot5  = n_tot5 + Convert.ToDouble(FgDatos.GetData(n_row, 16));
                        n_tot6  = n_tot6 + Convert.ToDouble(FgDatos.GetData(n_row, 17));
                        n_tot7  = n_tot7 + Convert.ToDouble(FgDatos.GetData(n_row, 18));
                        n_tot8  = n_tot8 + Convert.ToDouble(FgDatos.GetData(n_row, 19));
                        n_tot9  = n_tot9 + Convert.ToDouble(FgDatos.GetData(n_row, 20));
                        n_tot10 = n_tot10 + Convert.ToDouble(FgDatos.GetData(n_row, 21));
                        n_tot11 = n_tot11 + Convert.ToDouble(FgDatos.GetData(n_row, 22));
                        n_tot12 = n_tot12 + Convert.ToDouble(FgDatos.GetData(n_row, 23));
                    }
                }

                FgDatos.Rows.Count = FgDatos.Rows.Count + 1;
                FgDatos.SetData(FgDatos.Rows.Count - 1, 9, "TOTAL ==>");

                FgDatos.SetData(FgDatos.Rows.Count - 1, 12, n_tot1.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 13, n_tot2.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 14, n_tot3.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 15, n_tot4.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 16, n_tot5.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 17, n_tot6.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 18, n_tot7.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 19, n_tot8.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 20, n_tot9.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 21, n_tot10.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 22, n_tot11.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 23, n_tot12.ToString("0.00"));
            }

            if (n_Libro == 32)
            {
                n_tot1 = funFlex.FlexSumarCol(FgDatos, 12, 3, FgDatos.Rows.Count - 1);
                n_tot2 = funFlex.FlexSumarCol(FgDatos, 13, 3, FgDatos.Rows.Count - 1);
                n_tot3 = funFlex.FlexSumarCol(FgDatos, 14, 3, FgDatos.Rows.Count - 1);
                n_tot4 = funFlex.FlexSumarCol(FgDatos, 15, 3, FgDatos.Rows.Count - 1);

                FgDatos.Rows.Count = FgDatos.Rows.Count + 1;
                FgDatos.SetData(FgDatos.Rows.Count - 1, 9, "TOTAL ==>");
                FgDatos.SetData(FgDatos.Rows.Count - 1, 12, n_tot1.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 13, n_tot2.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 14, n_tot3.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 15, n_tot4.ToString("0.00"));
            }

            if (n_Libro == 14)
            {
                for (n_row = 3; n_row <= FgDatos.Rows.Count - 1; n_row++)
                {
                    if (FgDatos.GetData(n_row, 4).ToString() == "07")
                    {
                        n_tot1 = n_tot1 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 12)));
                        n_tot2 = n_tot2 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 13)));
                        n_tot3 = n_tot3 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 14)));
                        n_tot4 = n_tot4 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 15)));
                        n_tot5 = n_tot5 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 16)));
                        n_tot6 = n_tot6 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 18)));
                        n_tot7 = n_tot7 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 19)));
                        n_tot8 = n_tot8 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 20)));
                    }
                    else
                    {
                        n_tot1 = n_tot1 + Convert.ToDouble(FgDatos.GetData(n_row, 12));
                        n_tot2 = n_tot2 + Convert.ToDouble(FgDatos.GetData(n_row, 13));
                        n_tot3 = n_tot3 + Convert.ToDouble(FgDatos.GetData(n_row, 14));
                        n_tot4 = n_tot4 + Convert.ToDouble(FgDatos.GetData(n_row, 15));
                        n_tot5 = n_tot5 + Convert.ToDouble(FgDatos.GetData(n_row, 16));
                        n_tot6 = n_tot6 + Convert.ToDouble(FgDatos.GetData(n_row, 18));
                        n_tot7 = n_tot7 + Convert.ToDouble(FgDatos.GetData(n_row, 19));
                        n_tot8 = n_tot8 + Convert.ToDouble(FgDatos.GetData(n_row, 20));
                    }
                }

                FgDatos.Rows.Count = FgDatos.Rows.Count + 1;
                FgDatos.SetData(FgDatos.Rows.Count - 1, 9, "TOTAL ==>");
                FgDatos.SetData(FgDatos.Rows.Count - 1, 12, n_tot1.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 13, n_tot2.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 14, n_tot3.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 15, n_tot4.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 16, n_tot5.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 18, n_tot6.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 19, n_tot7.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 20, n_tot8.ToString("0.00"));
            }
        }
Exemplo n.º 13
0
        private void CmdCargar_Click(object sender, EventArgs e)
        {
            string             c_dato        = "";
            string             c_numser      = "0001";
            int                n_row         = 0;
            int                n_numdoc      = 0;
            int                n_corr        = 0;
            int                n_tipo        = 0;
            double             n_imptot      = 0;
            double             n_impigv      = 0;
            double             n_impbru      = 0;
            DataTable          dtdocumento   = new DataTable();
            CN_est_liquidacion o_Liquidacion = new CN_est_liquidacion(STU_SISTEMA);

            o_Liquidacion.STU_SISTEMA = STU_SISTEMA;
            FgPlacas.Rows.Count       = 2;
            if (OptTipo1.Checked == true)
            {
                n_tipo = 1;
            }
            if (OptTipo2.Checked == true)
            {
                n_tipo = 2;
            }
            o_Liquidacion.Consulta1(STU_SISTEMA.EMPRESAID, Convert.ToInt32(C_IDLOCAL), Convert.ToInt32(C_IDCAJERO), TxtFchIni.Text, TxtFchFin.Text, n_tipo);
            dtdocumento   = o_Liquidacion.dtListar;
            o_Liquidacion = null;

            if (dtdocumento.Rows.Count == 0)
            {
                MessageBox.Show("¡ No hay movimiento para liquidar !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                o_Liquidacion = null;
                return;
            }

            FgPlacas.Rows.Count = 2;
            //n_numdoc = 1;
            n_corr         = 1;
            LblNumRec.Text = (dtdocumento.Rows.Count).ToString();

            if (dtdocumento.Rows.Count != 0)
            {
                for (n_row = 0; n_row <= dtdocumento.Rows.Count - 1; n_row++)
                {
                    FgPlacas.Rows.Count = FgPlacas.Rows.Count + 1;

                    c_dato = dtdocumento.Rows[n_row]["c_clinumdocide"].ToString();
                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 1, c_dato);

                    c_dato = dtdocumento.Rows[n_row]["c_clinom"].ToString();
                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 2, c_dato);

                    c_dato = dtdocumento.Rows[n_row]["c_tipdocdes"].ToString();
                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 3, c_dato);

                    c_dato = dtdocumento.Rows[n_row]["c_numdoc"].ToString();
                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 4, c_dato);

                    c_dato = Convert.ToDouble(dtdocumento.Rows[n_row]["n_impbru"]).ToString();
                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 5, c_dato);

                    c_dato = Convert.ToDouble(dtdocumento.Rows[n_row]["n_impigv"]).ToString();
                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 6, c_dato);

                    c_dato = Convert.ToDouble(dtdocumento.Rows[n_row]["n_imptotven"]).ToString();
                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 7, c_dato);

                    c_dato = Convert.ToInt32(dtdocumento.Rows[n_row]["n_venid"]).ToString();
                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 8, c_dato);

                    c_dato = Convert.ToInt32(dtdocumento.Rows[n_row]["n_idtipdoc"]).ToString();
                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 9, c_dato);

                    c_dato = Convert.ToInt32(dtdocumento.Rows[n_row]["n_tipo"]).ToString();
                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 10, c_dato);

                    c_dato = Convert.ToInt32(dtdocumento.Rows[n_row]["n_iddocori"]).ToString();
                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 11, c_dato);

                    c_dato = funFunciones.NulosC(dtdocumento.Rows[n_row]["c_desser"]).ToString();
                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 12, c_dato);

                    c_dato = Convert.ToDateTime(dtdocumento.Rows[n_row]["d_fchdoc"]).ToString("dd/MM/yyyy");
                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 13, c_dato);

                    n_numdoc = n_numdoc + 1;
                    n_corr   = n_corr + 1;
                }
            }

            n_imptot = funFlex.FlexSumarCol(FgPlacas, 5, 2, FgPlacas.Rows.Count - 1);
            n_impigv = funFlex.FlexSumarCol(FgPlacas, 6, 2, FgPlacas.Rows.Count - 1);
            n_impbru = funFlex.FlexSumarCol(FgPlacas, 7, 2, FgPlacas.Rows.Count - 1);

            TxtImpBru.Text = n_imptot.ToString("0.00");
            txtImpIgv.Text = n_impigv.ToString("0.00");
            TxtImpTot.Text = n_impbru.ToString("0.00");
        }
Exemplo n.º 14
0
        void Totalizar()
        {
            double n_valor = 0;

            FgDatos.Rows.Count = FgDatos.Rows.Count + 1;

            FgDatos.SetData(FgDatos.Rows.Count - 1, 2, "T O T A L E S ==>");

            n_valor = funFlex.FlexSumarCol(FgDatos, 3, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 3, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 4, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 4, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 5, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 5, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 6, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 6, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 7, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 7, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 8, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 8, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 9, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 9, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 10, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 10, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 11, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 11, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 12, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 12, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 13, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 13, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 14, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 14, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 15, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 15, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 16, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 16, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 17, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 17, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 18, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 18, n_valor.ToString("0.00"));

            FgDatos.Rows.Count = FgDatos.Rows.Count + 1;
            FgDatos.SetData(FgDatos.Rows.Count - 1, 2, "R E S U L T A D O S ==>");

            // SUMAS DEL SALDO
            double n_val1 = Convert.ToDouble(FgDatos.GetData(FgDatos.Rows.Count - 2, 9));
            double n_val2 = Convert.ToDouble(FgDatos.GetData(FgDatos.Rows.Count - 2, 10));
            double n_resu = (n_val1 - n_val2);

            if (n_resu < 0)
            {
                FgDatos.SetData(FgDatos.Rows.Count - 1, 9, n_resu.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 10, "0.00");
            }
            else
            {
                FgDatos.SetData(FgDatos.Rows.Count - 1, 9, "0.00");
                FgDatos.SetData(FgDatos.Rows.Count - 1, 10, n_resu.ToString("0.00"));
            }

            // SUMAS CUENTA DEL BALANCE
            n_val1 = Convert.ToDouble(FgDatos.GetData(FgDatos.Rows.Count - 2, 11));
            n_val2 = Convert.ToDouble(FgDatos.GetData(FgDatos.Rows.Count - 2, 12));
            n_resu = (n_val1 - n_val2);
            if (n_resu < 0)
            {
                FgDatos.SetData(FgDatos.Rows.Count - 1, 11, n_resu.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 12, "0.00");
            }
            else
            {
                FgDatos.SetData(FgDatos.Rows.Count - 1, 11, "0.00");
                FgDatos.SetData(FgDatos.Rows.Count - 1, 12, n_resu.ToString("0.00"));
            }

            // SUMAS CUENTA TRANSFERENCIA Y CANC
            n_val1 = Convert.ToDouble(FgDatos.GetData(FgDatos.Rows.Count - 2, 13));
            n_val2 = Convert.ToDouble(FgDatos.GetData(FgDatos.Rows.Count - 2, 14));
            n_resu = (n_val1 - n_val2);
            if (n_resu < 0)
            {
                FgDatos.SetData(FgDatos.Rows.Count - 1, 13, n_resu.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 14, "0.00");
            }
            else
            {
                FgDatos.SetData(FgDatos.Rows.Count - 1, 13, "0.00");
                FgDatos.SetData(FgDatos.Rows.Count - 1, 14, n_resu.ToString("0.00"));
            }

            // SUMAS CUENTA RESULTADOS POR NATURALEZA
            n_val1 = Convert.ToDouble(FgDatos.GetData(FgDatos.Rows.Count - 2, 15));
            n_val2 = Convert.ToDouble(FgDatos.GetData(FgDatos.Rows.Count - 2, 16));
            n_resu = (n_val1 - n_val2);
            if (n_resu < 0)
            {
                FgDatos.SetData(FgDatos.Rows.Count - 1, 15, n_resu.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 16, "0.00");
            }
            else
            {
                FgDatos.SetData(FgDatos.Rows.Count - 1, 15, "0.00");
                FgDatos.SetData(FgDatos.Rows.Count - 1, 16, n_resu.ToString("0.00"));
            }

            // SUMAS CUENTA RESULTADOS POR FUNCION
            n_val1 = Convert.ToDouble(FgDatos.GetData(FgDatos.Rows.Count - 2, 17));
            n_val2 = Convert.ToDouble(FgDatos.GetData(FgDatos.Rows.Count - 2, 18));
            n_resu = (n_val1 - n_val2);
            if (n_resu < 0)
            {
                FgDatos.SetData(FgDatos.Rows.Count - 1, 17, n_resu.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 18, "0.00");
            }
            else
            {
                FgDatos.SetData(FgDatos.Rows.Count - 1, 17, "0.00");
                FgDatos.SetData(FgDatos.Rows.Count - 1, 18, n_resu.ToString("0.00"));
            }


            FgDatos.Rows.Count = FgDatos.Rows.Count + 1;
            FgDatos.SetData(FgDatos.Rows.Count - 1, 2, "S U M A S   I G U A L E S ==>");

            n_valor = funFlex.FlexSumarCol(FgDatos, 9, FgDatos.Rows.Count - 3, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 9, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 10, FgDatos.Rows.Count - 3, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 10, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 11, FgDatos.Rows.Count - 3, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 11, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 12, FgDatos.Rows.Count - 3, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 12, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 13, FgDatos.Rows.Count - 3, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 13, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 14, FgDatos.Rows.Count - 3, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 14, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 15, FgDatos.Rows.Count - 3, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 15, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 16, FgDatos.Rows.Count - 3, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 16, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 17, FgDatos.Rows.Count - 3, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 17, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 18, FgDatos.Rows.Count - 3, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 18, n_valor.ToString("0.00"));

            funFlex.Flex_PintarCeldas(FgDatos, FgDatos.Rows.Count - 3, 1, FgDatos.Rows.Count - 1, 18, Color.Black, Color.LightCoral);
        }
Exemplo n.º 15
0
        private void CmdCargar_Click(object sender, EventArgs e)
        {
            string          c_dato    = "";
            string          c_numser  = "0001";
            int             n_row     = 0;
            int             n_numdoc  = 0;
            int             n_corr    = 0;
            double          n_imptot  = 0;
            double          n_impigv  = 0;
            double          n_impbru  = 0;
            DataTable       dtCli     = new DataTable();
            CN_est_clientes o_Cliente = new CN_est_clientes(STU_SISTEMA);

            o_Cliente.STU_SISTEMA = STU_SISTEMA;
            o_Cliente.Consulta1(STU_SISTEMA.EMPRESAID, Convert.ToInt16(CboPla.SelectedValue));
            dtCli = o_Cliente.dtListar;

            CN_est_conecta o_conec = new CN_est_conecta(STU_SISTEMA);

            o_tipdoc.mysConec = o_conec.mysConec;
            string c_numdoc = o_tipdoc.UltimoNumero(STU_SISTEMA.EMPRESAID, 83, "0001");

            n_numdoc = Convert.ToInt32(c_numdoc);
            o_conec  = null;

            FgPlacas.Rows.Count = 2;
            //n_numdoc = 1;
            n_corr         = 1;
            LblNumRec.Text = (dtCli.Rows.Count - 1).ToString();

            if (dtCli.Rows.Count != 0)
            {
                for (n_row = 0; n_row <= dtCli.Rows.Count - 1; n_row++)
                {
                    FgPlacas.Rows.Count = FgPlacas.Rows.Count + 1;

                    c_dato = dtCli.Rows[n_row]["c_numdocide"].ToString();
                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 1, c_dato);

                    c_dato = dtCli.Rows[n_row]["c_nom"].ToString();
                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 2, c_dato);

                    c_dato = funDatos.DataTableBuscar(dtDoc, "n_id", "c_abr", "83", "N").ToString();
                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 3, c_dato);

                    c_dato = c_numser + "-" + n_numdoc.ToString("0000000000");
                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 4, c_dato);

                    n_impbru = 0; n_impigv = 0;
                    n_imptot = Convert.ToDouble(funFunciones.NulosN(dtCli.Rows[n_row]["n_importe"]));
                    if (n_imptot != 0)
                    {
                        n_impbru = (n_imptot / 1.18);
                        n_impigv = (n_imptot - n_impbru);
                    }
                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 5, n_impbru.ToString("0.00"));

                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 6, n_impigv.ToString("0.00"));

                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 7, n_imptot.ToString("0.00"));

                    c_dato = Convert.ToInt16(dtCli.Rows[n_row]["n_id"]).ToString();
                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 8, c_dato);

                    c_dato = Convert.ToInt16(dtCli.Rows[n_row]["n_tipdocfac"]).ToString();
                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 9, c_dato);

                    c_dato = Convert.ToInt16(dtCli.Rows[n_row]["n_idser"]).ToString();
                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 10, c_dato);

                    c_dato = n_corr.ToString();
                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 11, c_dato);

                    c_dato = dtCli.Rows[n_row]["c_docabr"].ToString();
                    FgPlacas.SetData(FgPlacas.Rows.Count - 1, 12, c_dato);

                    n_numdoc = n_numdoc + 1;
                    n_corr   = n_corr + 1;
                }
            }

            n_imptot = funFlex.FlexSumarCol(FgPlacas, 5, 2, FgPlacas.Rows.Count - 1);
            n_impigv = funFlex.FlexSumarCol(FgPlacas, 6, 2, FgPlacas.Rows.Count - 1);
            n_impbru = funFlex.FlexSumarCol(FgPlacas, 7, 2, FgPlacas.Rows.Count - 1);

            TxtImpBru.Text = n_imptot.ToString("0.00");
            txtImpIgv.Text = n_impigv.ToString("0.00");
            TxtImpTot.Text = n_impbru.ToString("0.00");
            o_Cliente      = null;
        }
Exemplo n.º 16
0
        private void CmdMostrarDeuda_Click(object sender, EventArgs e)
        {
            int           n_row     = 0;
            DataTable     dtResult  = new DataTable();
            CN_coo_cargos objCargos = new CN_coo_cargos();
            string        c_dato    = "";

            TxtNomSoc.Text = "";
            TxtSer.Text    = "";
            TxtTotal.Text  = "";
            funControl.dtpBlanquea(TxtFchIng);
            FgDeuda.Rows.Count = 2;

            LblIdPuesto.Text = "";
            LblIdPuesto.Text = funDatos.DataTableBuscar(dtPuestoSocio, "c_puesto", "n_id", TxtCodPue.Text, "C").ToString();
            LblIdSoc.Text    = funDatos.DataTableBuscar(dtPuestoSocio, "c_puesto", "n_idsoc", TxtCodPue.Text, "C").ToString();
            if (LblIdPuesto.Text != "0")
            {
                MostrarDatosSocio(Convert.ToInt32(LblIdSoc.Text));
            }
            else
            {
                MessageBox.Show("¡ No se ha encontrado el puesto indicado !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                TxtCodPue.Text   = "";
                LblIdPuesto.Text = "";
                LblIdSoc.Text    = "";
                TxtCodPue.Focus();
                return;
            }

            // MOSTRAMOS LA DEUDA DEL PUESTO
            DataTable dtCargosSocio = new DataTable();

            objCargos.mysConec = mysConec;
            objCargos.Consulta1(Convert.ToInt32(LblIdPuesto.Text));
            dtCargosSocio = objCargos.dtLista;

            dtResult = funDatos.DataTableFiltrar(dtCargosSocio, "n_impsal <> 0");           //  FILTRAMOS PARA SABER SI TIENE DOCUMENTOS PENDIENTES DE PAGO

            if (dtCargosSocio.Rows.Count == 0)
            {
                MessageBox.Show("¡ EL puesto indicado no tiene cargos generados  !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                TxtCodPue.Text     = "";
                TxtNomSoc.Text     = "";
                TxtSer.Text        = "";
                TxtTotal.Text      = "";
                FgDeuda.Rows.Count = 2;
                LblIdPuesto.Text   = "";
                LblIdSoc.Text      = "";
                funControl.dtpBlanquea(TxtFchIng);
                return;
            }

            if (dtResult.Rows.Count == 0)
            {
                // SI NO HAY DOCUMENTOS PENDIENTES DE PAGO MOSTRAMOS LOS DOCUMENTOS PAGADOS
                dtResult       = dtCargosSocio;
                OptTod.Checked = true;
            }

            FgDeuda.Rows.Count = 2;
            if (objCargos.booOcurrioError == false)
            {
                if (OptSolDeu.Checked == true)
                {
                    dtResult = funDatos.DataTableFiltrar(dtResult, "n_impsal <> 0");
                }
                else
                {
                    dtResult = dtCargosSocio;
                }

                for (n_row = 0; n_row <= dtResult.Rows.Count - 1; n_row++)
                {
                    FgDeuda.Rows.Count = FgDeuda.Rows.Count + 1;

                    c_dato = dtResult.Rows[n_row]["n_anotra"].ToString();
                    FgDeuda.SetData(FgDeuda.Rows.Count - 1, 1, c_dato);

                    c_dato = dtResult.Rows[n_row]["c_mesdes"].ToString();
                    FgDeuda.SetData(FgDeuda.Rows.Count - 1, 2, c_dato);

                    c_dato = dtResult.Rows[n_row]["c_tipdocdes"].ToString();
                    FgDeuda.SetData(FgDeuda.Rows.Count - 1, 3, c_dato);

                    c_dato = dtResult.Rows[n_row]["c_numdoc"].ToString();
                    FgDeuda.SetData(FgDeuda.Rows.Count - 1, 4, c_dato);

                    c_dato = dtResult.Rows[n_row]["d_fchdoc"].ToString();
                    FgDeuda.SetData(FgDeuda.Rows.Count - 1, 5, c_dato);

                    c_dato = dtResult.Rows[n_row]["d_fchven"].ToString();
                    FgDeuda.SetData(FgDeuda.Rows.Count - 1, 6, c_dato);

                    c_dato = Convert.ToDouble(dtResult.Rows[n_row]["n_imptotven"]).ToString("0.00");
                    FgDeuda.SetData(FgDeuda.Rows.Count - 1, 7, c_dato);

                    c_dato = Convert.ToDouble(dtResult.Rows[n_row]["n_impsal"]).ToString("0.00");
                    FgDeuda.SetData(FgDeuda.Rows.Count - 1, 8, c_dato);

                    c_dato = dtResult.Rows[n_row]["c_pagfchdoc"].ToString();
                    if (c_dato == "")
                    {
                        FgDeuda.SetData(FgDeuda.Rows.Count - 1, 9, null);
                    }
                    else
                    {
                        FgDeuda.SetData(FgDeuda.Rows.Count - 1, 9, c_dato);
                    }
                    c_dato = dtResult.Rows[n_row]["c_pagtipdoc"].ToString();
                    FgDeuda.SetData(FgDeuda.Rows.Count - 1, 10, c_dato);

                    c_dato = dtResult.Rows[n_row]["c_pagnumdoc"].ToString();
                    FgDeuda.SetData(FgDeuda.Rows.Count - 1, 11, c_dato);

                    c_dato = dtResult.Rows[n_row]["n_impbru"].ToString();
                    FgDeuda.SetData(FgDeuda.Rows.Count - 1, 13, c_dato);

                    c_dato = dtResult.Rows[n_row]["n_impigv"].ToString();
                    FgDeuda.SetData(FgDeuda.Rows.Count - 1, 14, c_dato);

                    c_dato = dtResult.Rows[n_row]["n_id"].ToString();
                    FgDeuda.SetData(FgDeuda.Rows.Count - 1, 15, c_dato);

                    if (Convert.ToDouble(dtResult.Rows[n_row]["n_impsal"]) == 0)
                    {
                        PintarCelda(FgDeuda, FgDeuda.Rows.Count - 1, 1, FgDeuda.Rows.Count - 1, 11, Color.Blue);
                    }
                    else
                    {
                        PintarCelda(FgDeuda, FgDeuda.Rows.Count - 1, 1, FgDeuda.Rows.Count - 1, 11, Color.Red);
                    }
                }
            }

            double n_Valor = 0;

            n_Valor       = funFlex.FlexSumarCol(FgDeuda, 8, 2, FgDeuda.Rows.Count - 1);
            TxtTotal.Text = n_Valor.ToString("0.00");
        }
Exemplo n.º 17
0
        void MostrarPago(DataTable dtPagos)
        {
            double n_total   = 0;
            int    n_row     = 0;
            int    n_fil     = 2;
            string c_dato    = "";
            int    n_col     = 0;
            int    n_numdias = Convert.ToInt32((Convert.ToDateTime(TxtFchFin.Text) - Convert.ToDateTime(TxtFchIni.Text)).ToString(@"dd"));

            n_numdias = n_numdias + 1;
            DateTime d_fecha = Convert.ToDateTime(TxtFchIni.Text);

            FgLisPer.Cols.Count = 5;

            for (n_col = 1; n_col <= n_numdias; n_col++)
            {
                FgLisPer.Cols.Count = FgLisPer.Cols.Count + 1;
                FgLisPer.Cols[FgLisPer.Cols.Count - 1].DataType = typeof(Double);
                FgLisPer.Cols[FgLisPer.Cols.Count - 1].Format   = "0.00";
                FgLisPer.Cols[FgLisPer.Cols.Count - 1].Width    = 70;
                c_dato = d_fecha.ToString("yyy-MM-dd");
                FgLisPer.SetData(0, FgLisPer.Cols.Count - 1, "Dia " + n_col.ToString());
                FgLisPer.SetData(1, FgLisPer.Cols.Count - 1, c_dato);
                d_fecha = d_fecha.AddDays(1);
            }

            //MOSTRAMOS EL IMPORTE A PAGAR
            for (n_row = 0; n_row <= dtPagos.Rows.Count - 1; n_row++)
            {
                FgLisPer.Rows.Count = FgLisPer.Rows.Count + 1;

                c_dato = dtPagos.Rows[n_row]["n_idper"].ToString();
                FgLisPer.SetData(n_fil, 1, c_dato);

                c_dato = (n_fil - 1).ToString();
                FgLisPer.SetData(n_fil, 2, c_dato);

                c_dato = dtPagos.Rows[n_row]["c_numdocide"].ToString();
                FgLisPer.SetData(n_fil, 3, c_dato);

                c_dato = dtPagos.Rows[n_row]["c_apenom"].ToString();
                FgLisPer.SetData(n_fil, 4, c_dato);

                int n_col2 = 5;
                for (n_col2 = 5; n_col2 <= FgLisPer.Cols.Count - 1; n_col2++)
                {
                    c_dato = FgLisPer.GetData(1, n_col2).ToString();
                    if (ExisteColumna(c_dato, dtPagos) == true)
                    {
                        c_dato = Convert.ToDouble(funFunciones.NulosN(dtPagos.Rows[n_row][c_dato])).ToString("0.00");
                        FgLisPer.SetData(n_fil, n_col2, c_dato);
                    }
                }

                n_fil = n_fil + 1;
            }

            FgLisPer.Cols.Count = FgLisPer.Cols.Count + 1;
            FgLisPer.Cols[FgLisPer.Cols.Count - 1].DataType = typeof(Double);
            FgLisPer.Cols[FgLisPer.Cols.Count - 1].Format   = "0.00";
            funFlex.Flex_FixUnirFilas(FgLisPer, FgLisPer.Cols.Count - 1, 0, 1, "Total", 70);

            for (n_row = 2; n_row <= FgLisPer.Rows.Count - 1; n_row++)
            {
                n_total = 0;
                n_total = funFlex.FlexSumarRow(FgLisPer, n_row, 5, FgLisPer.Cols.Count - 2);
                FgLisPer.SetData(n_row, FgLisPer.Cols.Count - 1, n_total.ToString("0.00"));
            }

            n_total = funFlex.FlexSumarCol(FgLisPer, FgLisPer.Cols.Count - 1, 2, FgLisPer.Rows.Count - 1);

            FgLisPer.Rows.Count = FgLisPer.Rows.Count + 1;
            FgLisPer.SetData(FgLisPer.Rows.Count - 1, FgLisPer.Cols.Count - 2, "TOTAL ==>");
            FgLisPer.SetData(FgLisPer.Rows.Count - 1, FgLisPer.Cols.Count - 1, n_total.ToString("0.00"));
            FgLisPer.AllowSorting = C1.Win.C1FlexGrid.AllowSortingEnum.SingleColumn;
        }
Exemplo n.º 18
0
        void HallarTotalItem(int intFila)
        {
            // HALLAMOS EL TOTAL DEL ITEM
            double intImpAfe   = Convert.ToDouble(FgItems.GetData(intFila, 4));
            double intImpNoAfe = Convert.ToDouble(FgItems.GetData(intFila, 5));
            double intCantidad = Convert.ToDouble(FgItems.GetData(intFila, 3));
            double intTotal    = 0;

            intTotal = ((intCantidad * intImpAfe) + (intCantidad * intImpNoAfe));
            FgItems.SetData(intFila, 6, intTotal.ToString("0.00"));

            // DISTRIBUIMOS EL IMPORTE Y EL IGV DEL ITEM
            double intValorIGV = 0;

            if (funFunciones.NulosC(FgItems.GetData(intFila, 13)) != "")
            {
                intTotal    = (intImpAfe * intCantidad);
                intValorIGV = (intTotal * (intTasaIGV / 100));

                if (FgItems.GetData(intFila, 13).ToString() == "1")
                {
                    FgItems.SetData(intFila, 7, intTotal.ToString("0.00"));
                    FgItems.SetData(intFila, 10, intValorIGV.ToString("0.00"));
                }
                if (FgItems.GetData(intFila, 13).ToString() == "2")
                {
                    FgItems.SetData(intFila, 8, intTotal.ToString("0.00"));
                    FgItems.SetData(intFila, 11, intValorIGV.ToString("0.00"));
                }
                if (FgItems.GetData(intFila, 13).ToString() == "3")
                {
                    FgItems.SetData(intFila, 9, intTotal.ToString("0.00"));
                    FgItems.SetData(intFila, 12, intValorIGV.ToString("0.00"));
                }
            }

            // MOSTRAMOS LOS TOTALES DEL DOCUMENTO
            double intTot1 = 0;
            double intTot2 = 0;
            double intTot3 = 0;
            double intTot4 = 0;

            double intIGV1 = 0;
            double intIGV2 = 0;
            double intIGV3 = 0;

            double intTotDoc = 0;

            intTot1 = funFlex.FlexSumarCol(FgItems, 7, 2, FgItems.Rows.Count - 1);
            intTot2 = funFlex.FlexSumarCol(FgItems, 8, 2, FgItems.Rows.Count - 1);
            intTot3 = funFlex.FlexSumarCol(FgItems, 9, 2, FgItems.Rows.Count - 1);
            intTot4 = funFlex.FlexSumarCol(FgItems, 5, 2, FgItems.Rows.Count - 1);

            intIGV1 = funFlex.FlexSumarCol(FgItems, 10, 2, FgItems.Rows.Count - 1);
            intIGV2 = funFlex.FlexSumarCol(FgItems, 11, 2, FgItems.Rows.Count - 1);
            intIGV3 = funFlex.FlexSumarCol(FgItems, 12, 2, FgItems.Rows.Count - 1);

            TxtImp1.Text = intTot1.ToString("0.00");
            TxtImp2.Text = intTot2.ToString("0.00");
            TxtImp3.Text = intTot3.ToString("0.00");
            TxtImp4.Text = intTot4.ToString("0.00");

            TxtIgv1.Text = intIGV1.ToString("0.00");
            TxtIgv2.Text = intIGV2.ToString("0.00");
            TxtIgv3.Text = intIGV3.ToString("0.00");

            intTotDoc = (intTot1 + intTot2 + intTot3 + intTot4);  // SUMAMOS LOS IMPORTES DEL DOCUMENTO
            intTotDoc = intTotDoc + (intIGV1 + intIGV2 + intIGV3);

            TxtTotal.Text = intTotDoc.ToString("0.00");
        }