Exemple #1
0
 private void FgDeuda_CellChecked(object sender, RowColEventArgs e)
 {
     if (FgDeuda.Col == 12)
     {
         double n_Saldo = Convert.ToDouble(FgDeuda.GetData(FgDeuda.Row, 8));
         if (n_Saldo == 0)
         {
             FgDeuda.SetData(FgDeuda.Row, 12, false);
         }
     }
 }
Exemple #2
0
 private void FgDeuda_CellChanged(object sender, RowColEventArgs e)
 {
     if (FgDeuda.Col == 13)
     {
         string c_cheked = funFunciones.NulosC(FgDeuda.GetData(FgDeuda.Row, 13)).ToString();
         if ((c_cheked == "False") || (c_cheked == ""))
         {
             FgDeuda.SetData(FgDeuda.Row, 9, "0.00");
         }
         else
         {
             double n_Saldo = Convert.ToDouble(FgDeuda.GetData(FgDeuda.Row, 8));
             FgDeuda.SetData(FgDeuda.Row, 9, n_Saldo.ToString("0.00"));
             if (n_Saldo == 0)
             {
                 FgDeuda.SetData(FgDeuda.Row, 13, false);
             }
         }
     }
     CalcularTotales();
 }
Exemple #3
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    = "";

            TxtTotal.Text      = "";
            TxtTotPag.Text     = "";
            TxtSaldo.Text      = "";
            FgDeuda.Rows.Count = 2;

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

            objCargos.mysConec = mysConec;
            objCargos.Consulta3(Convert.ToInt32(LblIdSoc.Text));
            dtCargosSocio = objCargos.dtLista;

            if (OptSolDeu.Checked == true)
            {
                dtResult = funDatos.DataTableFiltrar(dtCargosSocio, "n_detsal <> 0");           //  FILTRAMOS PARA SABER SI TIENE DOCUMENTOS PENDIENTES DE PAGO
            }
            else
            {
                dtResult = dtCargosSocio;
            }

            if (dtResult.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;
            }

            FgDeuda.Rows.Count = 2;
            if (objCargos.booOcurrioError == false)
            {
                dtResult = funDatos.DataTableOrdenar(dtResult, "n_carmestra");
                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_caranoemi"].ToString();
                    FgDeuda.SetData(FgDeuda.Rows.Count - 1, 1, c_dato);

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

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

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

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

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

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

                    c_dato = Convert.ToDouble(funFunciones.NulosN(dtResult.Rows[n_row]["n_detsal"])).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, 10, null);
                    }
                    else
                    {
                        FgDeuda.SetData(FgDeuda.Rows.Count - 1, 10, c_dato);
                    }

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

                    c_dato = dtResult.Rows[n_row]["c_pagnumdoc"].ToString();
                    FgDeuda.SetData(FgDeuda.Rows.Count - 1, 12, 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_carid"].ToString();
                    FgDeuda.SetData(FgDeuda.Rows.Count - 1, 16, c_dato);

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

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

                    //******
                    c_dato = dtResult.Rows[n_row]["n_detiddocpag"].ToString();
                    FgDeuda.SetData(FgDeuda.Rows.Count - 1, 19, c_dato);

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


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

            CalcularTotales();
            GenerarNumero();
        }
Exemple #4
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");
        }