Exemple #1
0
 private void dgvPagos_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dgvPagos.Rows.Count >= 1 && e.RowIndex != -1 && e.ColumnIndex != -1)
     {
         DataGridViewCell celda = dgvPagos.CurrentCell;
         Int32            itipo = Convert.ToInt32(dgvPagos.Rows[e.RowIndex].Cells[tipo.Name].Value);
         if (celda.Value.ToString() == "Ingresar Pago")
         {
             if (itipo == 5)
             {
                 cuoPreBan.CodCuotaPrestamo = Convert.ToInt32(dgvPagos.Rows[e.RowIndex].Cells[codnota.Name].Value);
                 frmCancelarPago form = new frmCancelarPago();
                 form.codCuota = cuoPreBan.CodCuotaPrestamo;
                 form.tipo     = itipo;
                 form.ShowDialog();
                 CargaLista();
             }
         }
         else if (celda.Value.ToString() == "Muestra Pagos")
         {
             if (itipo == 5)
             {
                 cuoPreBan.CodCuotaPrestamo = Convert.ToInt32(dgvPagos.Rows[e.RowIndex].Cells[codnota.Name].Value);
                 frmMuestraPagos form = new frmMuestraPagos();
                 form.codCuota = cuoPreBan.CodCuotaPrestamo;
                 form.InOut    = false;
                 form.tipo     = itipo;
                 form.ShowDialog();
                 CargaLista();
             }
         }
     }
 }
Exemple #2
0
 private void dgvCobros_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.F3)
     {
         DataGridViewRow row   = dgvCobros.CurrentRow;
         Int32           itipo = Convert.ToInt32(row.Cells[tipo.Name].Value);
         if (row.Cells[accion.Name].Value.ToString() == "Ingresar Pago")
         {
             if (itipo == 3)
             {
                 venta.CodFacturaVenta = row.Cells[codnota.Name].Value.ToString();
                 frmCancelarPago form = new frmCancelarPago();
                 form.CodNota = venta.CodFacturaVenta;
                 form.tipo    = itipo;
                 DialogResult dlgResult = form.ShowDialog();
                 if (dlgResult == DialogResult.Yes)
                 {
                     CargaLista();
                 }
             }
             else if (itipo == 4)
             {
                 let.CodLetra = Convert.ToInt32(row.Cells[codnota.Name].Value);
                 frmCancelarPago form = new frmCancelarPago();
                 form.CodLetra = let.CodLetra;
                 form.tipo     = itipo;
                 DialogResult dlgResult = form.ShowDialog();
                 if (dlgResult == DialogResult.Yes)
                 {
                     CargaLista();
                 }
             }
         }
     }
 }
Exemple #3
0
 private void dgvPagos_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dgvPagos.Rows.Count >= 1 && e.RowIndex != -1 && e.ColumnIndex != -1)
     {
         DataGridViewCell celda = dgvPagos.CurrentCell;
         Int32            itipo = Convert.ToInt32(dgvPagos.Rows[e.RowIndex].Cells[tipo.Name].Value);
         if (celda.Value.ToString() == "Ingresar Pago")
         {
             if (itipo == 1)
             {
                 //MOD7 aca poner la validacion si el pago de detraccion aun no ha sido cancelado no debe permitir cancelar la factura
                 fac.CodFactura   = Convert.ToInt32(dgvPagos.Rows[e.RowIndex].Cells[codnota.Name].Value);
                 fac.CodProveedor = Convert.ToInt32(dgvPagos.Rows[e.RowIndex].Cells[codproveedore.Name].Value.ToString());
                 frmCancelarPago form = new frmCancelarPago();
                 form.CodNota    = fac.CodFactura.ToString();
                 form.tipo       = itipo;
                 form.VentComp   = 2;
                 form.CodCliente = fac.CodProveedor;
                 form.ShowDialog();
                 CargaLista();
             }
             else if (itipo == 2)
             {
                 let.CodLetra = Convert.ToInt32(dgvPagos.Rows[e.RowIndex].Cells[codnota.Name].Value);
                 frmCancelarPago form = new frmCancelarPago();
                 form.CodLetra = let.CodLetra;
                 form.tipo     = itipo;
                 form.ShowDialog();
                 CargaLista();
             }
         }
         else if (celda.Value.ToString() == "Muestra Pagos")
         {
             if (itipo == 1)
             {
                 fac.CodFactura = Convert.ToInt32(dgvPagos.Rows[e.RowIndex].Cells[codnota.Name].Value);
                 frmMuestraPagos form = new frmMuestraPagos();
                 form.CodNota = fac.CodFactura;
                 form.InOut   = false;
                 form.tipo    = 0;
                 form.ShowDialog();
                 CargaLista();
             }
             else if (itipo == 2)
             {
                 let.CodLetra = Convert.ToInt32(dgvPagos.Rows[e.RowIndex].Cells[codnota.Name].Value);
                 frmMuestraPagos form = new frmMuestraPagos();
                 form.CodNota = let.CodLetra;
                 form.InOut   = false;
                 form.tipo    = 1;
                 form.ShowDialog();
                 CargaLista();
             }
         }
     }
 }
Exemple #4
0
 private void dgvNotasCredito_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dgvNotasCredito.Rows.Count >= 1 && e.RowIndex != -1)
     {
         DataGridViewCell celda = dgvNotasCredito.CurrentCell;
         if (celda.Value.ToString() == "DEVOLUCION DE DINERO")
         {
             nota.CodNotaCredito = dgvNotasCredito.Rows[e.RowIndex].Cells[codigo.Name].Value.ToString();
             nota.CodCliente     = Convert.ToInt32(dgvNotasCredito.Rows[e.RowIndex].Cells[codcliente.Name].Value.ToString());
             frmCancelarPago form = new frmCancelarPago();
             form.CodNota    = nota.CodNotaCredito.ToString();
             form.tipo       = 100;
             form.CodCliente = nota.CodCliente;
             form.ShowDialog();
         }
     }
 }
Exemple #5
0
 private void dgvCobros_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dgvCobros.Rows.Count >= 1 && e.RowIndex != -1)
     {
         DataGridViewCell celda = dgvCobros.Rows[e.RowIndex].Cells[e.ColumnIndex];
         Int32            itipo = Convert.ToInt32(dgvCobros.Rows[e.RowIndex].Cells[tipo.Name].Value);
         if (celda.Value.ToString() == "Ingresar Pago")
         {
             if (itipo == 3)
             {
                 venta.CodFacturaVenta = dgvCobros.Rows[e.RowIndex].Cells[codnota.Name].Value.ToString();
                 frmCancelarPago form = new frmCancelarPago();
                 form.CodNota = venta.CodFacturaVenta;
                 form.tipo    = itipo;
                 DialogResult dlgResult = form.ShowDialog();
                 if (dlgResult == DialogResult.Yes)
                 {
                     CargaLista();
                 }
             }
             else if (itipo == 4)
             {
                 let.CodLetra = Convert.ToInt32(dgvCobros.Rows[e.RowIndex].Cells[codnota.Name].Value);
                 frmCancelarPago form = new frmCancelarPago();
                 form.CodLetra = let.CodLetra;
                 form.tipo     = itipo;
                 DialogResult dlgResult = form.ShowDialog();
                 if (dlgResult == DialogResult.Yes)
                 {
                     CargaLista();
                 }
             }
         }
         else if (celda.Value.ToString() == "Muestra Pagos")
         {
             if (itipo == 3)
             {
                 venta.CodFacturaVenta = dgvCobros.Rows[e.RowIndex].Cells[codnota.Name].Value.ToString();
                 frmMuestraPagos2 form = new frmMuestraPagos2();
                 form.CodNota = Convert.ToInt32(venta.CodFacturaVenta);
                 form.InOut   = true;
                 form.tipo    = 0;
                 DialogResult dlgResult = form.ShowDialog();
                 if (dlgResult == DialogResult.Yes)
                 {
                     CargaLista();
                 }
             }
             else if (itipo == 4)
             {
                 let.CodLetra = Convert.ToInt32(dgvCobros.Rows[e.RowIndex].Cells[codnota.Name].Value);
                 frmMuestraPagos2 form = new frmMuestraPagos2();
                 form.CodNota = let.CodLetra;
                 form.InOut   = true;
                 form.tipo    = 1;
                 DialogResult dlgResult = form.ShowDialog();
                 if (dlgResult == DialogResult.Yes)
                 {
                     CargaLista();
                 }
             }
         }
     }
 }
Exemple #6
0
 private void dgvCobros_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dgvCobros.Rows.Count >= 1 && e.RowIndex != -1)
     {
         DataGridViewCell celda = dgvCobros.Rows[e.RowIndex].Cells[e.ColumnIndex];
         Int32            itipo = Convert.ToInt32(dgvCobros.Rows[e.RowIndex].Cells[tipo.Name].Value);
         if (celda.Value.ToString() == "Ingresar Pago")
         {
             if (itipo == 3)
             {
                 if (Convert.ToInt32(dgvCobros.Rows[e.RowIndex].Cells[xaprobars.Name].Value) > 0)
                 {
                     MessageBox.Show("PENDIENTE DE APROBACION", "IMPOSIBLE REGISTRAR NUEVO PAGO", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                 }
                 else
                 {
                     if (dgvCobros.Rows[e.RowIndex].Cells[numdocumento.Name].Value.ToString().Length <= 8)
                     {
                         MessageBox.Show("PENDIENTE DE IMPRESIÓN", "IMPOSIBLE REGISTRAR NUEVO PAGO", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                     }
                     else
                     {
                         venta.CodFacturaVenta = dgvCobros.Rows[e.RowIndex].Cells[codnota.Name].Value.ToString();
                         venta.CodCliente      = Convert.ToInt32(dgvCobros.Rows[e.RowIndex].Cells[codcliente.Name].Value.ToString());
                         frmCancelarPago form = new frmCancelarPago();
                         form.CodNota    = venta.CodFacturaVenta;
                         form.CodCliente = venta.CodCliente;
                         form.tipo       = itipo;
                         form.VentComp   = 1;
                         DialogResult dlgResult = form.ShowDialog();
                         //if (dlgResult == DialogResult.Yes)
                         //{
                         //CargaLista();
                         //}
                     }
                 }
             }
             else if (itipo == 4)
             {
                 let.CodLetra = Convert.ToInt32(dgvCobros.Rows[e.RowIndex].Cells[codnota.Name].Value);
                 frmCancelarPago form = new frmCancelarPago();
                 form.CodLetra = let.CodLetra;
                 form.tipo     = itipo;
                 DialogResult dlgResult = form.ShowDialog();
                 if (dlgResult == DialogResult.Yes)
                 {
                     //CargaLista();
                 }
             }
         }
         else if (celda.Value.ToString() == "Muestra Pagos")
         {
             if (itipo == 3)
             {
                 venta.CodFacturaVenta = dgvCobros.Rows[e.RowIndex].Cells[codnota.Name].Value.ToString();
                 venta.Pendiente       = Convert.ToDouble(dgvCobros.Rows[e.RowIndex].Cells[pendiente.Name].Value.ToString());
                 Decimal         totalM = Convert.ToDecimal(dgvCobros.Rows[e.RowIndex].Cells[monto.Name].Value.ToString());
                 frmMuestraPagos form   = new frmMuestraPagos();
                 form.CodNota = Convert.ToInt32(venta.CodFacturaVenta);
                 if (cmbEstado.SelectedIndex == 0)
                 {
                     form.montoTotal = Convert.ToDecimal(venta.Pendiente);
                 }
                 else if (cmbEstado.SelectedIndex == 1)
                 {
                     form.montoTotal = Convert.ToDecimal(totalM);
                 }
                 form.InOut = true;
                 form.tipo  = 0;
                 DialogResult dlgResult = form.ShowDialog();
                 if (dlgResult == DialogResult.Yes)
                 {
                     //CargaLista();
                 }
             }
             else if (itipo == 4)
             {
                 let.CodLetra = Convert.ToInt32(dgvCobros.Rows[e.RowIndex].Cells[codnota.Name].Value);
                 frmMuestraPagos form = new frmMuestraPagos();
                 form.CodNota = let.CodLetra;
                 form.InOut   = true;
                 form.tipo    = 1;
                 DialogResult dlgResult = form.ShowDialog();
                 if (dlgResult == DialogResult.Yes)
                 {
                     //CargaLista();
                 }
             }
         }
     }
 }