private void btnPagarSaldo_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (txtImportePagado.Text == "") { MessageBox.Show("Debe ingresar un importe", Clases.cMensaje.Mensaje()); return; } double Saldo = fun.ToDouble(txtSaldo.Text); double Importe = fun.ToDouble(txtImportePagado.Text); if (Importe > Saldo) { MessageBox.Show("El saldo es superior al importe", Clases.cMensaje.Mensaje()); return; } Clases.cMovimiento mov = new Clases.cMovimiento(); Clases.cSaldoCuota saldoCuotas = new Clases.cSaldoCuota(); string Descripcion = "PAGO DE SALDO CUOTA" + txtCuota.Text; Descripcion = Descripcion + ", PATENTE " + txtPatente.Text; Int32 Cuota = Convert.ToInt32(txtCuota.Text); Int32 CodGrupo = Convert.ToInt32(txtCodGrupo.Text); Clases.cSaldoCuotasAnteriores salCuotas = new Clases.cSaldoCuotasAnteriores(); Clases.cCuotasAnteriores cuota = new Clases.cCuotasAnteriores(); DateTime Fecha = Convert.ToDateTime(txtFecha.Text); cuota.PagarSaldoCuota(CodGrupo, Cuota, Importe); mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, Importe, 0, 0, 0, 0, Fecha, Descripcion); salCuotas.InsertarSaldoCob(CodGrupo, Cuota, Fecha, Importe); MessageBox.Show("Datos grabados correctamente", Clases.cMensaje.Mensaje()); }
private void btnPagarSaldo_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (txtMontoaPagar.Text == "") { Mensaje("Debe ingresar un monto a cobrar"); return; } double Saldo = fun.ToDouble(txtSaldo.Text); double Importe = fun.ToDouble(txtMontoaPagar.Text); if (Saldo == 0) { Mensaje("No hay saldo para cancelar"); return; } if (Importe > Saldo) { Mensaje("El importe a cobrar es mayor al saldo"); return; } Clases.cSaldoCobranzaGeneral saldoCob = new Clases.cSaldoCobranzaGeneral(); Int32 CodCobranza = Convert.ToInt32(txtCodCobranza.Text); DateTime Fecha = Convert.ToDateTime(txtFechaCobro.Text); string Descripción = "PAGO SALDO " + txtDescripcion.Text; Clases.cCobranzaGeneral cob = new Clases.cCobranzaGeneral(); cob.PagarSaldo(CodCobranza, Importe); saldoCob.InsertarSaldoCob(CodCobranza, Fecha, Importe); Clases.cMovimiento mov = new Clases.cMovimiento(); mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, Importe, 0, 0, 0, 0, Fecha, Descripción); Mensaje("Datos grabados correctamente "); GetCobranzas(CodCobranza); }
private void btnAnular_Click(object sender, EventArgs e) { if (txtCuota.Text == "") { MessageBox.Show("Debe ingresar una cuota para continuar.", Clases.cMensaje.Mensaje()); return; } if (txtImportePagado.Text == "") { MessageBox.Show("Debe ingresar un monto de la cuota.", Clases.cMensaje.Mensaje()); return; } Clases.cFunciones fun = new Clases.cFunciones(); double Importe = fun.ToDouble(txtImporte.Text); double ImportePagado = fun.ToDouble(txtImportePagado.Text); ImportePagado = ImportePagado * (-1); Int32 CodUsuario = Principal.CodUsuarioLogueado; Int32 Cuota = Convert.ToInt32(txtCuota.Text); Int32 CodVenta = Convert.ToInt32(txtCodVenta.Text); GetPunitorio(CodVenta, Cuota); Double Punitorio = fun.ToDouble(txtPunitorio.Text); Punitorio = Punitorio * (-1); Clases.cCuota objCuota = new Clases.cCuota(); if (objCuota.AnularCuota(CodVenta, Cuota, ImportePagado, CodUsuario, txtPatente.Text, Punitorio)) { MessageBox.Show("Datos grabados correctamente.", Clases.cMensaje.Mensaje()); CargarPlandeCuotas(CodVenta); } }
private void btnGrabar_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (fun.ValidarFecha(txtFechaPago.Text) == false) { MessageBox.Show("Debe ingresar una fecha válida", Clases.cMensaje.Mensaje()); return; } double Importe = fun.ToDouble(txtImporte.Text); double Tope = fun.ToDouble(txtTope.Text); double dif = Tope - Importe; string Descrip2 = ""; if (dif > 0) { Descrip2 = "DIFERENCIA POSITVA DE TRANSFERENCIA, PATENTE " + txtPatente.Text; } if (dif < 0) { Descrip2 = "DIFERENCIA NEGATIVA DE TRANSFERENCIA, PATENTE " + txtPatente.Text; } if (dif < 0) { //paga el tope mas la diferencia negativa Importe = Tope; } if (dif > 0) { //paga el tope mas la diferencia negativa Importe = Tope; } string Descripcion = txtDescripcion.Text + " " + txtPatente.Text; Clases.cMovimiento mov = new Clases.cMovimiento(); DateTime Fecha = Convert.ToDateTime(txtFechaPago.Text); Clases.cGastosPagar gasto = new Clases.cGastosPagar(); gasto.ActualizarPago(Convert.ToInt32(Principal.CodigoPrincipalAbm), Fecha); mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, -1 * Importe, 0, 0, 0, 0, Fecha, Descripcion); if (dif != 0) { Int32?CodVenta = null; if (txtCodVenta.Text.Trim() != "") { CodVenta = Convert.ToInt32(txtCodVenta.Text); } //hubo exedente o menor plata mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, dif, 0, 0, 0, 0, Fecha, Descrip2); Clases.cDiferenciaTransferencia obj = new Clases.cDiferenciaTransferencia(); obj.Insertar(CodVenta, dif, Convert.ToInt32(Principal.CodigoPrincipalAbm)); } MessageBox.Show("Datos grabados correctamente", Clases.cMensaje.Mensaje()); btnGrabar.Enabled = false; }
private void GrillaCuotas_CellClick(object sender, DataGridViewCellEventArgs e) { string Cuota = GrillaCuotas.CurrentRow.Cells[1].Value.ToString(); string Importe = GrillaCuotas.CurrentRow.Cells[3].Value.ToString(); string ImportePagado = GrillaCuotas.CurrentRow.Cells[5].Value.ToString(); string Fecha = GrillaCuotas.CurrentRow.Cells[2].Value.ToString(); string CodGrupo = GrillaCuotas.CurrentRow.Cells[0].Value.ToString(); GetPunitorio(Convert.ToInt32(CodGrupo), Convert.ToInt32(Cuota)); Clases.cFunciones fun = new Clases.cFunciones(); if (Cuota != "") { txtCuota.Text = Cuota; txtImporte.Text = Importe; txtImportePagado.Text = ImportePagado; txtFecha.Text = Fecha; if (txtImporte.Text != "") { //string xx = trdo.Rows[0]["Importe"].ToString().Replace (",",".").ToString(); txtImporte.Text = fun.TransformarEntero(Importe); txtImporte.Text = fun.FormatoEnteroMiles(txtImporte.Text); txtCodGrupo.Text = CodGrupo.ToString(); if (txtImportePagado.Text != "") { btnAnular.Enabled = true; btnPagarSaldo.Visible = true; // txtImportePagado.ReadOnly = true; btnGrabar.Enabled = false; txtImportePagado.Text = fun.TransformarEntero(txtImportePagado.Text); txtImportePagado.Text = fun.FormatoEnteroMiles(txtImportePagado.Text); txtSaldo.Text = (fun.ToDouble(txtImporte.Text) - fun.ToDouble(txtImportePagado.Text)).ToString(); } else { btnPagarSaldo.Visible = false; txtSaldo.Text = ""; btnAnular.Enabled = false; btnGrabar.Enabled = true; // txtImportePagado.ReadOnly = false; } } //obtengo la deuda total Clases.cCuotasAnteriores objCuota = new Clases.cCuotasAnteriores(); txtTotalDeuda.Text = objCuota.GetSaldoDeudaCuotas(Convert.ToInt32(CodGrupo)).ToString(); if (txtTotalDeuda.Text != "") { txtTotalDeuda.Text = fun.TransformarEntero(txtTotalDeuda.Text); txtTotalDeuda.Text = fun.FormatoEnteroMiles(txtTotalDeuda.Text); } } }
private void btnGuardar_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (txtMontoaPagar.Text == "") { Mensaje("Debe ingresar un monto a cobrar"); return; } double Saldo = fun.ToDouble(txtSaldo.Text); double Importe = fun.ToDouble(txtMontoaPagar.Text); if (Saldo == 0) { Mensaje("No hay saldo para cancelar"); return; } if (fun.ValidarFecha(txtFechaCobro.Text) == false) { Mensaje("Debe ingresar una fecha de cobro"); return; } if (Importe > Saldo) { Mensaje("El importe a cobrar es mayor al saldo"); return; } if (Saldo > Importe) { var result = MessageBox.Show("El importe es inferior al saldo, desea continuar", "Información", MessageBoxButtons.YesNo, MessageBoxIcon.Question); // If the no button was pressed ... if (result == DialogResult.No) { return; } } Int32 CodCobranza = Convert.ToInt32(txtCodCobranza.Text); DateTime Fecha = Convert.ToDateTime(txtFechaCobro.Text); string Descripción = "COBRANZA GENERAL ,PATENTE " + txtPatente.Text; Clases.cCobranzaGeneral cob = new Clases.cCobranzaGeneral(); cob.RegistrarCobro(CodCobranza, Fecha, Importe); Clases.cMovimiento mov = new Clases.cMovimiento(); mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, Importe, 0, 0, 0, 0, Fecha, Descripción); Mensaje("Datos grabados correctamente "); GetCobranzas(CodCobranza); }
private void btnAnular_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); /* * if (Grilla.Rows.Count < 2) * { * MessageBox.Show("Debe Seleccionar una prenda para continuar ", Clases.cMensaje.Mensaje()); * return; * } * * if (Grilla.CurrentRow == null) * { * MessageBox.Show("Seleccione una fila para continuar.", Clases.cMensaje.Mensaje()); * return; * } * * if (Grilla.CurrentRow.Cells[6].Value.ToString() == "") * { * MessageBox.Show("La prenda no se puede anular debido a que no ha sido cobrada.", Clases.cMensaje.Mensaje()); * return; * } */ string Descripcion = "ANULACION DE COBRO DE PRENDA: Patente " + txtPatente.Text; Descripcion = Descripcion + ", Cliente " + txtNombre.Text; string CodPrenda = Principal.CodigoPrincipalAbm; Double Importe = fun.ToDouble(txtImporte.Text); Int32 CodVenta = Convert.ToInt32(txtCodVenta.Text); Clases.cPrenda prenda = new Clases.cPrenda(); prenda.AnularPagoPrenda(Convert.ToInt32(CodPrenda)); Clases.cMovimiento mov = new Clases.cMovimiento(); if (txtDiferencia.Text != "0") { double Diferencia = fun.ToDouble(txtDiferencia.Text); string TEXTO = "ANULACION DIFERENCIA PRENDA, PATENTE " + txtPatente.Text; // mov.RegistrarMovimientoDescripcion(CodVenta, Principal.CodUsuarioLogueado, (-1) * Diferencia, 0, 0, 0, 0, DateTime.Now, TEXTO); } DateTime Fecha = Convert.ToDateTime(txtFecha.Text); Clases.cCheque cheque = new Clases.cCheque(); cheque.BorrarChequexCodPrenda(Convert.ToInt32(CodPrenda)); Importe = fun.ToDouble(txtTotalCheque.Text); mov.RegistrarMovimientoDescripcion(CodVenta, Principal.CodUsuarioLogueado, (-1) * Importe, 0, 0, 0, 0, Fecha, Descripcion); MessageBox.Show("Datos grabados correctamente", Clases.cMensaje.Mensaje()); GetPrendaxCod(Convert.ToInt32(CodPrenda)); }
private void CalcularPorcentaje() { if (txtPorcentaje.Text != "0" && txtImporte.Text != "0") { Clases.cFunciones fun = new Clases.cFunciones(); double Por = 0; double Monto = 0; double aPagar = 0; if (txtPorcentaje.Text != "") { Por = Convert.ToDouble(txtPorcentaje.Text.Replace(".", ",")); } if (txtImporte.Text != "") { Monto = fun.ToDouble(txtImporte.Text); } aPagar = (Monto * Por) / 100; txtMontoApagar.Text = aPagar.ToString(); if (txtMontoApagar.Text != "") { decimal m = Convert.ToDecimal(aPagar); txtMontoApagar.Text = decimal.Round(m, 0).ToString(); txtMontoApagar.Text = fun.FormatoEnteroMiles(txtMontoApagar.Text); } //txtMontoApagar.Text = fun.FormatoEnteroMiles(txtMontoApagar.Text); } }
private void btnAgregarGasto_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (txtFecha.Text == "") { MessageBox.Show("Debe ingresar una fecha para continuar.", Clases.cMensaje.Mensaje()); return; } if (fun.ValidarFecha(txtFecha.Text) == false) { MessageBox.Show("La fecha ingresada es incorrecta.", Clases.cMensaje.Mensaje()); return; } if (txtCodStock.Text == "") { MessageBox.Show("Debe ingresar un auto para continuar", Clases.cMensaje.Mensaje()); return; } Int32 CodCategoriaGasto = Convert.ToInt32(CmbCategoriaGasto.SelectedValue.ToString()); Clases.cGasto gasto = new Clases.cGasto(); string Nombre = gasto.GetGastoxCodigo(Convert.ToInt32(CodCategoriaGasto)); string sImporte = txtImporteGasto.Text; DateTime Fecha = Convert.ToDateTime(txtFecha.Text); //Clases.cFunciones fun = new Clases.cFunciones(); double Importe = fun.ToDouble(sImporte); gasto.InsertarGasto(Convert.ToInt32(txtCodStock.Text), CodCategoriaGasto, Importe, DateTime.Now); Clases.cMovimiento mov = new Clases.cMovimiento(); mov.RegistrarMovimiento(-1, Principal.CodUsuarioLogueado, -1 * Importe, 0, 0, Importe, 0, Fecha); CargarGrilla(); }
private void btnGrabar_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (fun.ValidarFecha(txtFecha.Text) == false) { MessageBox.Show("La fecha ingresada es incorrecta", Clases.cMensaje.Mensaje()); return; } Int32 CodComision = Convert.ToInt32(txtCodComision.Text); DateTime Fecha = Convert.ToDateTime(txtFecha.Text); Clases.cComisionVendedor com = new Clases.cComisionVendedor(); com.PagoComision(Fecha, CodComision); string Descripcion = "PAGO COMISIÓN " + txtNombre.Text + " " + txtApellido.Text; Descripcion = Descripcion + ", PATENTE " + txtPatente.Text; double Importe = fun.ToDouble(txtImporte.Text); Clases.cMovimiento mov = new Clases.cMovimiento(); mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, -1 * Importe, 0, 0, 0, 0, Fecha, Descripcion); MessageBox.Show("Datos grabados Correctamente", Clases.cMensaje.Mensaje()); btnGrabar.Enabled = false; btnAnular.Enabled = false; }
private void btnRegistrarPago_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (Grilla.CurrentRow == null) { MessageBox.Show("Debe seleccionar un registro para continuar", Clases.cMensaje.Mensaje()); return; } if (fun.ValidarFecha(txtFechaDevolucion.Text) == false) { MessageBox.Show("La fecha de devolución es incorrecta", Clases.cMensaje.Mensaje()); return; } if (Grilla.CurrentRow.Cells[8].Value.ToString() != "") { MessageBox.Show("Ya se ha registrado el pago del préstamo", Clases.cMensaje.Mensaje()); return; } Int32 CodPrestamo = Convert.ToInt32(Grilla.CurrentRow.Cells[0].Value); DateTime FechaPago = Convert.ToDateTime(txtFechaDevolucion.Text); string Nombre = Grilla.CurrentRow.Cells[1].Value.ToString(); string Descripcion = "PAGO PRESTAMO " + Nombre.ToString(); double Importe = fun.ToDouble(Grilla.CurrentRow.Cells[6].Value.ToString()); Clases.cPrestamo prestamo = new Clases.cPrestamo(); prestamo.RegistrarDevolucion(CodPrestamo, FechaPago); Clases.cMovimiento mov = new Clases.cMovimiento(); mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, -1 * Importe, 0, 0, 0, 0, FechaPago, Descripcion); MessageBox.Show("Datos registrados correctametne", Clases.cMensaje.Mensaje()); CargarGrilla(); }
private void btnAnular_Click(object sender, EventArgs e) { if (Grilla.CurrentRow.Cells[8].Value.ToString() == "") { MessageBox.Show("Debe seleccionar una cobranza para continuar", Clases.cMensaje.Mensaje()); return; } if (txtCodCobranza.Text =="") { MessageBox.Show ("Debe ingresar una cobranza",Clases.cMensaje.Mensaje ()); return; } Int32 CodCobranza = Convert.ToInt32 (txtCodCobranza.Text); Clases.cFunciones fun = new Clases.cFunciones (); double Importe = fun.ToDouble(Grilla.CurrentRow.Cells[8].Value.ToString()); Clases.cCobranza cob = new Clases.cCobranza(); cob.AnularCobranza(CodCobranza); string Descripcion = "ANULACION DE COBRANZA " + txtPatente.Text; Clases.cPunitorioCobranza objPun = new Clases.cPunitorioCobranza(); Double Punitorio = objPun.GetImportePunitorio(CodCobranza); objPun.BorrarPunitorio(CodCobranza); // Importe = Importe + Punitorio; Clases.cMovimiento mov = new Clases.cMovimiento(); mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, -1 * Importe, 0, 0, 0, 0, Convert.ToDateTime(txtFecha.Text), Descripcion); //anulo punitorio Descripcion = "ANULACION DE PUNITORIO " + txtPatente.Text; mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, -1 * Punitorio , 0, 0, 0, 0, Convert.ToDateTime(txtFecha.Text), Descripcion); CargarGrilla(); MessageBox.Show("Datos grabados correctamente", Clases.cMensaje.Mensaje()); }
private void btnPagarSaldo_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (fun.ValidarFecha(txtFecha.Text) == false) { MessageBox.Show("La fecha ingresada es incorrecta.", Clases.cMensaje.Mensaje()); return; } if (txtSaldo.Text != "") { double saldo = fun.ToDouble(txtSaldo.Text); if (saldo == 0) { MessageBox.Show("El saldo ya ha sido cancelado", Clases.cMensaje.Mensaje()); return; } Int32 CodCobranza = Convert.ToInt32(txtCodCobranza.Text); double Importe = fun.ToDouble(txtImporte.Text); if (Importe > saldo) { MessageBox.Show("El saldo supera el saldo", Clases.cMensaje.Mensaje()); return; } Clases.cSaldoCobranza saldoCob = new Clases.cSaldoCobranza(); DateTime Fecha = Convert.ToDateTime(txtFecha.Text); Clases.cCobranza cob = new Clases.cCobranza(); cob.PagarSaldo(CodCobranza, Fecha, Importe); string Descripcion = "PAGO DE SALDO PATENTE " + txtPatente.Text; Clases.cMovimiento mov = new Clases.cMovimiento(); mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, Importe, 0, 0, 0, 0, Fecha, Descripcion); saldoCob.InsertarSaldoCob(CodCobranza, Fecha, Importe); Double Punitorio = 0; if (txtPunitorio.Text != "") { Punitorio = fun.ToDouble(txtPunitorio.Text); } Int32 CodVenta = Convert.ToInt32(Grilla.CurrentRow.Cells[1].Value.ToString()); if (Punitorio > 0) { Clases.cPunitorioCobranza objPunitorio = new Clases.cPunitorioCobranza(); Descripcion = "COBRO DE PUNITORIO, PATENTE " + txtPatente.Text; objPunitorio.GrabarPunitorio(CodVenta, CodCobranza, Punitorio, Fecha); mov.RegistrarMovimientoDescripcion(CodVenta, Principal.CodUsuarioLogueado, Punitorio, 0, 0, 0, 0, Fecha, Descripcion); } MessageBox.Show("Datos grabados correctamente", Clases.cMensaje.Mensaje()); } }
private void txtImportePagado_Leave(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); txtImportePagado.Text = fun.FormatoEnteroMiles(txtImportePagado.Text); double Importe = 0; double ImportePagado = 0; double Saldo = 0; if (txtImporte.Text != "") { Importe = fun.ToDouble(txtImporte.Text); } if (txtImportePagado.Text != "") { ImportePagado = fun.ToDouble(txtImportePagado.Text); } Saldo = Importe - ImportePagado; txtSaldo.Text = Saldo.ToString(); }
private void CalcularDiferencias() { Double Importe = 0; Double Cheque = 0; Double Dif = 0; Clases.cFunciones fun = new Clases.cFunciones(); if (txtImporte.Text != "") { Importe = fun.ToDouble(txtImporte.Text); } if (txtTotalCheque.Text != "") { Cheque = fun.ToDouble(txtTotalCheque.Text); } Dif = Cheque - Importe; txtDiferencia.Text = Dif.ToString(); txtDiferencia.Text = fun.FormatoEnteroMiles(txtDiferencia.Text); }
private void btnGuardar_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (fun.ValidarFecha(txtFecha.Text) == false) { Mensaje("La fecha es incorrecta"); return; } if (txtEfectivo.Text == "") { Mensaje("Debe ingresar un importe"); return; } if (cmbConcepto.SelectedIndex == 0) { if (txtDescripcion.Text == "") { Mensaje("Debe ingresar una descripción"); return; } } DateTime Fecha = Convert.ToDateTime(txtFecha.Text); double Importe = fun.ToDouble(txtEfectivo.Text); string Descripcion = txtDescripcion.Text; Int32? CodEntidad = null; string NombreEntidad = ""; if (cmbConcepto.SelectedIndex > 0) { CodEntidad = Convert.ToInt32(cmbConcepto.SelectedValue); Clases.cEntidad ent = new Clases.cEntidad(); NombreEntidad = ent.GetNombrexCodigo(Convert.ToInt32(CodEntidad)); } if (NombreEntidad != "") { Descripcion = NombreEntidad + "," + Descripcion; } Clases.cGastosNegocio gasto = new Clases.cGastosNegocio(); gasto.GrabarGastos(Fecha, CodEntidad, Descripcion, Importe); Clases.cMovimiento mov = new Clases.cMovimiento(); mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, -1 * Importe, 0, 0, 0, 0, Fecha, Descripcion); Mensaje("Datos grabados correctamente"); txtEfectivo.Text = ""; txtDescripcion.Text = ""; txtFecha.Text = ""; if (cmbConcepto.Items.Count > 1) { cmbConcepto.SelectedIndex = 0; } }
private void button2_Click(object sender, EventArgs e) { if (GrillaCheques.CurrentRow == null) { MessageBox.Show("Debe seleccionar una cheque para continuar", Clases.cMensaje.Mensaje()); return; } DataTable tbCheques = new DataTable(); tbCheques.Columns.Add("NroCheque"); tbCheques.Columns.Add("Importe"); tbCheques.Columns.Add("FechaVencimiento"); tbCheques.Columns.Add("CodBanco"); tbCheques.Columns.Add("Banco"); int i = 0; for (i = 0; i < GrillaCheques.Rows.Count - 1; i++) { string Cheque = GrillaCheques.Rows[i].Cells[0].Value.ToString(); string Importe = GrillaCheques.Rows[i].Cells[1].Value.ToString(); string FechaVencimiento = GrillaCheques.Rows[i].Cells[2].Value.ToString(); string CodBanco = GrillaCheques.Rows[i].Cells[3].Value.ToString(); string sBanco = GrillaCheques.Rows[i].Cells[4].Value.ToString(); DataRow r = tbCheques.NewRow(); r[0] = Cheque; r[1] = Importe; r[2] = FechaVencimiento; r[3] = CodBanco; tbCheques.Rows.Add(r); } string ChequeaBorrar = GrillaCheques.CurrentRow.Cells[0].Value.ToString(); for (i = 0; i < tbCheques.Rows.Count; i++) { if (tbCheques.Rows[i]["NroCheque"].ToString() == ChequeaBorrar) { tbCheques.Rows[i].Delete(); tbCheques.AcceptChanges(); i = tbCheques.Rows.Count; } } Clases.cFunciones fun = new Clases.cFunciones(); GrillaCheques.DataSource = tbCheques; double TotalCheques = 0; for (i = 0; i < tbCheques.Rows.Count; i++) { TotalCheques = TotalCheques + fun.ToDouble(tbCheques.Rows[i][1].ToString()); } txtTotalCheque.Text = TotalCheques.ToString(); CalcularDiferencias(); }
private void btnModificar_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (txtMontoModificar.Text == "") { MessageBox.Show("Debe ingresar un monto para continuar ", Clases.cMensaje.Mensaje()); return; } Int32 CodPrestamo = Convert.ToInt32(Principal.CodigoPrincipalAbm); DateTime Fecha = Convert.ToDateTime(txtFechaPago.Text); double Importe = fun.ToDouble(txtMontoModificar.Text); string DescripcionDetalle = "INGRESO PRESTAMO " + Importe.ToString().Replace(",", "."); double MontoAnterio = fun.ToDouble(txtImporte.Text); double MontoModificar = fun.ToDouble(txtMontoModificar.Text); if (CmbOpciones.SelectedIndex == 0) { DescripcionDetalle = "AGREGAR CAPITAL " + Importe.ToString(); } else { MontoModificar = -1 * MontoModificar; DescripcionDetalle = "DESCUENTO DE CAPITAL " + Importe.ToString(); } txtImporte.Text = (fun.ToDouble(txtImporte.Text) + fun.ToDouble(MontoModificar.ToString())).ToString(); txtImporte.Text = fun.FormatoEnteroMiles(txtImporte.Text); CalcularPorcentaje(); Clases.cDetallePrestamo detalle = new Clases.cDetallePrestamo(); detalle.InsertarDetallePrestamo(CodPrestamo, Importe, DescripcionDetalle, Fecha); //cargo el nuevo porcentaje double Por = Convert.ToDouble(txtPorcentaje.Text.Replace(".", ",")); double MontoFinal = fun.ToDouble(txtImporte.Text); double ImporteaPagar = fun.ToDouble(txtMontoApagar.Text); DateTime FechaVencimiento = Convert.ToDateTime(txtFechaVencimiento.Text); Clases.cPrestamo prestamo = new Clases.cPrestamo(); prestamo.ModificarPorcentajePrestamo(CodPrestamo, Por, ImporteaPagar, Fecha, MontoFinal); CargarDetalle(CodPrestamo); string DescripcionMovimiento = ""; if (MontoModificar > 0) { DescripcionMovimiento = " INGRESO PRESTAMO " + txtNombre.Text; } else { DescripcionMovimiento = " RETIRO PRESTAMO " + txtNombre.Text; } Clases.cMovimiento mov = new Clases.cMovimiento(); mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, MontoModificar, 0, 0, 0, 0, Fecha, DescripcionMovimiento); MessageBox.Show("Datos grabados correctamente", Clases.cMensaje.Mensaje()); }
private void btnGrabar_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (fun.ValidarFecha(txtFecha.Text) == false) { MessageBox.Show("La fecha ingresada es incorrecta", Clases.cMensaje.Mensaje()); return; } if (txtImporteAPagar.Text == "") { MessageBox.Show("Debe ingresar un importe a pagar", Clases.cMensaje.Mensaje()); return; } double Importe = fun.ToDouble(txtImporteAPagar.Text); double Saldo = fun.ToDouble(txtSaldo.Text); if (Importe > Saldo) { MessageBox.Show("El monto a pagar supera el sado", Clases.cMensaje.Mensaje()); return; } Int32 CodCheque = Convert.ToInt32(Principal.CodigoPrincipalAbm); Clases.cPagoCheque pagoCheque = new Clases.cPagoCheque(); Clases.cChequesaPagar cheque = new Clases.cChequesaPagar(); Clases.cMovimiento mov = new Clases.cMovimiento(); DateTime Fecha = Convert.ToDateTime(txtFecha.Text); //cheque.PagarCheque(Convert.ToInt32(Principal.CodigoPrincipalAbm), Fecha); pagoCheque.InsertarPagoCheque(CodCheque, Importe, Fecha); string Descripcion = "PAGO DE CHEQUE " + txtCliente.Text.ToUpper(); Descripcion = Descripcion + ", PATENTE " + txtPatente.Text; mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, -1 * Importe, 0, 0, 0, 0, Fecha, Descripcion); MessageBox.Show("Datos grabados correctamente", Clases.cMensaje.Mensaje()); Cargar(CodCheque); }
private void BtnAgregarCheque_Click(object sender, EventArgs e) { if (txtPrecioVenta.Text == "") { MessageBox.Show("Debe ingresar un precio para continuar", Clases.cMensaje.Mensaje()); return; } Clases.cFunciones fun = new Clases.cFunciones(); double Importe = fun.ToDouble(txtPrecioVenta.Text); Int32 CodStock = Convert.ToInt32(Principal.CodigoPrincipalAbm); Clases.cStockAuto stock = new Clases.cStockAuto(); stock.ActualizarPrecioVenta(CodStock, Importe); MessageBox.Show("Datos grabados correctamente", Clases.cMensaje.Mensaje()); }
private void GrabarGastosdeRecepcion(Int32 CodStock) { string CodGastoRecepcion = ""; Double Importe = 0; Clases.cGasto gasto = new Clases.cGasto(); gasto.BorrarGastosRecepcionxCodStock(CodStock); for (int k = 0; k < GrillaGastosRecepcion.Rows.Count - 1; k++) { Clases.cFunciones fun = new Clases.cFunciones(); CodGastoRecepcion = GrillaGastosRecepcion.Rows[k].Cells[0].Value.ToString(); Importe = fun.ToDouble(GrillaGastosRecepcion.Rows[k].Cells[3].Value.ToString()); if (CodGastoRecepcion != "") { gasto.GrabarGastosRecepcionxCodStock(CodStock, Convert.ToInt32(CodGastoRecepcion), Importe, Convert.ToDateTime(txtFecha.Text)); } } }
private void btnAnular_Click(object sender, EventArgs e) { string msj = "Confirma anular el pago"; var result = MessageBox.Show(msj, "Información", MessageBoxButtons.YesNo, MessageBoxIcon.Question); // If the no button was pressed ... if (result == DialogResult.No) { return; } Clases.cFunciones fun = new Clases.cFunciones(); double Importe = fun.ToDouble(txtImporte.Text); string Descripcion = "PAGO ANULADO " + txtDescripcion.Text + " " + txtPatente.Text; Clases.cMovimiento mov = new Clases.cMovimiento(); DateTime Fecha = Convert.ToDateTime(txtFechaPago.Text); Clases.cGastosPagar gasto = new Clases.cGastosPagar(); Clases.cDiferenciaTransferencia objDif = new Clases.cDiferenciaTransferencia(); double ImporteDiferencia = objDif.GetImporteDiferenciaxCodGasto(Convert.ToInt32(Principal.CodigoPrincipalAbm)); int positivo = 0; if (ImporteDiferencia > 0) { positivo = 1; } ImporteDiferencia = -1 * ImporteDiferencia; if (positivo == 1) { Importe = Importe + ImporteDiferencia; } gasto.ActualizarPago(Convert.ToInt32(Principal.CodigoPrincipalAbm), null); mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, Importe, 0, 0, 0, 0, Fecha, Descripcion); //saco el exedente mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, ImporteDiferencia, 0, 0, 0, 0, Fecha, "AJUSTE DE DIFERENCIA"); MessageBox.Show("Datos grabados correctamente", Clases.cMensaje.Mensaje()); objDif.Borrar(Convert.ToInt32(Principal.CodigoPrincipalAbm)); btnAnular.Enabled = false; }
private void btnEliminarGasto_Click(object sender, EventArgs e) { if (Grilla.CurrentRow == null) { MessageBox.Show("Debe seleccionar un registro para continuar", Clases.cMensaje.Mensaje()); return; } Clases.cFunciones fun = new Clases.cFunciones(); Int32 CodCategoriaGasto = Convert.ToInt32(Grilla.CurrentRow.Cells[0].Value); double Importe = fun.ToDouble(Grilla.CurrentRow.Cells[2].Value.ToString()); Clases.cGasto gasto = new Clases.cGasto(); gasto.BorrarGastoxCategoria(Convert.ToInt32(txtCodStock.Text), CodCategoriaGasto); Clases.cMovimiento mov = new Clases.cMovimiento(); DateTime Fecha = Convert.ToDateTime(txtFecha.Text); mov.RegistrarMovimiento(-1, Principal.CodUsuarioLogueado, Importe, 0, 0, -1 * Importe, 0, Fecha); CargarGrilla(); }
private void btnGrabar_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (Grilla.CurrentRow == null) { MessageBox.Show("Debe Seleccionar un cheque para continuar ", Clases.cMensaje.Mensaje()); return; } if (Grilla.Rows.Count < 2) { MessageBox.Show("Debe Seleccionar una prenda para continuar ", Clases.cMensaje.Mensaje()); return; } if (txtFecha.Text == "") { MessageBox.Show("Debe ingresar una fecha para continuar.", Clases.cMensaje.Mensaje()); return; } if (fun.ValidarFecha(txtFecha.Text) == false) { MessageBox.Show("La fecha ingresada es incorrecta.", Clases.cMensaje.Mensaje()); return; } DateTime Fecha = Convert.ToDateTime(txtFecha.Text); Int32 CodVenta = Convert.ToInt32(Grilla.CurrentRow.Cells[0].Value.ToString()); string NroCheque = Grilla.CurrentRow.Cells[1].Value.ToString(); string Descripcion = "COBRO CHEQUE " + txtPatente.Text + " , " + NroCheque.ToString(); Descripcion = Descripcion + ", " + txtEntregado.Text; Double Importe = fun.ToDouble(Grilla.CurrentRow.Cells[2].Value.ToString()); Clases.cCheque cheque = new Clases.cCheque(); cheque.RegistrarCobroCheque(txtFecha.Text, Convert.ToInt32(CodVenta), NroCheque); Clases.cMovimiento mov = new Clases.cMovimiento(); mov.RegistrarMovimientoDescripcion(CodVenta, Principal.CodUsuarioLogueado, Importe, 0, 0, 0, 0, Fecha, Descripcion); CargarGrilla(); MessageBox.Show("Datos grabados correctamente", Clases.cMensaje.Mensaje()); }
private void btnEliminar_Click(object sender, EventArgs e) { if (Grilla.CurrentRow == null) { MessageBox.Show("Debe seleccionar un costo ", Clases.cMensaje.Mensaje()); return; } txtCodCosto.Text = Grilla.CurrentRow.Cells[0].Value.ToString(); if (txtCodCosto.Text == "") { } var resul = MessageBox.Show("Confirma eliminar el costo", Clases.cMensaje.Mensaje(), MessageBoxButtons.YesNo, MessageBoxIcon.Question); Double Importe = 0; string sImporte = ""; if (resul == DialogResult.Yes) { //busco el importe a borrar sImporte = ""; for (int i = 0; i < Grilla.Rows.Count - 1; i++) { if (Grilla.Rows[i].Cells[0].Value.ToString() == txtCodCosto.Text) { sImporte = Grilla.Rows[i].Cells[4].Value.ToString(); } } } Clases.cFunciones fun = new Clases.cFunciones(); if (sImporte != "") { Importe = fun.ToDouble(sImporte); } Clases.cCosto costo = new Clases.cCosto(); Int32 CodCosto = Convert.ToInt32(txtCodCosto.Text); costo.BorrarCosto(CodCosto); DateTime Fecha = Convert.ToDateTime(txtFecha.Text); Clases.cMovimiento mov = new Clases.cMovimiento(); mov.RegistrarMovimiento(-1, Principal.CodUsuarioLogueado, (Importe), 0, 0, (-1) * Importe, 0, Fecha); CargarCostoxstock(Convert.ToInt32(txtCodStock.Text)); }
private void btnAnular_Click(object sender, EventArgs e) { if (Grilla.CurrentRow == null) { MessageBox.Show("Debe seleccionar un registro para continuar", Clases.cMensaje.Mensaje()); return; } Int32 CodPago = Convert.ToInt32(Grilla.CurrentRow.Cells[0].Value.ToString()); Int32 CodCheque = Convert.ToInt32(Grilla.CurrentRow.Cells[1].Value.ToString()); string msj = "Confirma anular el pago "; var result = MessageBox.Show(msj, "Información", MessageBoxButtons.YesNo, MessageBoxIcon.Question); // If the no button was pressed ... if (result == DialogResult.No) { return; } Clases.cFunciones fun = new Clases.cFunciones(); if (fun.ValidarFecha(txtFecha.Text) == false) { MessageBox.Show("La fecha ingresada es incorrecta", Clases.cMensaje.Mensaje()); return; } Clases.cPagoCheque objPago = new Clases.cPagoCheque(); double Importe = fun.ToDouble(Grilla.CurrentRow.Cells[2].Value.ToString()); Clases.cChequesaPagar cheque = new Clases.cChequesaPagar(); Clases.cMovimiento mov = new Clases.cMovimiento(); DateTime Fecha = Convert.ToDateTime(txtFecha.Text); //cheque.AnularPagarCheque (Convert.ToInt32(Principal.CodigoPrincipalAbm)); objPago.AnularPagoCheque(CodPago, CodCheque, Importe); string Descripcion = "ANULACION PAGO DE CHEQUE " + txtCliente.Text.ToUpper(); mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, Importe, 0, 0, 0, 0, Fecha, Descripcion); MessageBox.Show("Datos grabados correctamente", Clases.cMensaje.Mensaje()); btnAnular.Enabled = false; Cargar(CodCheque); }
private void btnGrabar_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (fun.ValidarFecha(txtFechaPago.Text) == false) { MessageBox.Show("La fecha de pago es incorrecta", Clases.cMensaje.Mensaje()); return; } string Descripcion = "PAGO DE INTERÉS " + txtNombre.Text.ToString(); Int32 CodPrestamo = Convert.ToInt32(Principal.CodigoPrincipalAbm); DateTime Fecha = Convert.ToDateTime(txtFechaPago.Text); double Importe = fun.ToDouble(txtMontoApagar.Text); Clases.cMovimiento mov = new Clases.cMovimiento(); Clases.cPagoIntereses pago = new Clases.cPagoIntereses(); pago.RegistrarPago(CodPrestamo, Fecha, Importe); mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, -1 * Importe, 0, 0, 0, 0, Fecha, Descripcion); MessageBox.Show("Datos grabados correctamente", Clases.cMensaje.Mensaje()); CargarGrilla(CodPrestamo); }
private void GrabarGastos() { Clases.cFunciones fun = new Clases.cFunciones(); Int32 CodCategoriaGasto = 0; double Importe = 0; Int32 CodStock = Convert.ToInt32(txtCodStock.Text); Clases.cGasto gasto = new Clases.cGasto(); Clases.cMovimiento mov = new Clases.cMovimiento(); gasto.BorrarGastoxCodStock(CodStock); DateTime Fecha = Convert.ToDateTime(txtFecha.Text); for (int i = 0; i < Grilla.Rows.Count - 1; i++) { CodCategoriaGasto = Convert.ToInt32(Grilla.Rows[i].Cells[0].Value.ToString()); Importe = fun.ToDouble(Grilla.Rows[i].Cells[2].Value.ToString()); CodCategoriaGasto = Convert.ToInt32(Grilla.Rows[i].Cells[0].Value.ToString()); gasto.InsertarGasto(CodStock, CodCategoriaGasto, Importe, DateTime.Now); mov.RegistrarMovimiento(-1, Principal.CodUsuarioLogueado, (-1) * Importe, 0, 0, Importe, 0, Fecha); } }
public void CalcularTotalGeneral() { Clases.cFunciones fun = new Clases.cFunciones(); int i = 0; double Total = 0; double TotalTotal = 0; TotalTotal = fun.ToDouble(txtImporte.Text); for (i = 0; i < Grilla.Rows.Count - 1; i++) { if (Grilla.Rows[i].Cells[4].Value != "") { Total = Total + Convert.ToDouble(Grilla.Rows[i].Cells[4].Value); } } TotalTotal = TotalTotal + Total; txtTotal.Text = Total.ToString(); txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text); txtTotalGeneral.Text = TotalTotal.ToString(); txtTotalGeneral.Text = fun.FormatoEnteroMiles(txtTotalGeneral.Text); }
private void btnGuardar_Click(object sender, EventArgs e) { if (fun.ValidarFecha(txtFecha.Text) == false) { Mensaje("La fecha ingresada es incorrecta"); return; } if (txtEfectivo.Text == "") { Mensaje("Debe ingresar un importe"); return; } if (txtDescripcion.Text == "") { Mensaje("Debe ingresar una descripción"); return; } DateTime Fecha = Convert.ToDateTime(txtFecha.Text); double Importe = fun.ToDouble(txtEfectivo.Text); string Descripcion = txtDescripcion.Text; double? ImporteIngreso = null; double? ImporteEgreso = null; if (cmbTipo.SelectedIndex == 0) { ImporteIngreso = Importe; } else { ImporteEgreso = Importe; } Clases.cAnotacion anotacion = new Clases.cAnotacion(); anotacion.Insertar(Fecha, Descripcion, ImporteIngreso, ImporteEgreso); MessageBox.Show("Datos grabados correctamente"); txtDescripcion.Text = ""; txtEfectivo.Text = ""; }