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 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 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 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 (fun.ValidarFecha(txtFecha.Text) == false) { Mensaje("La fecha ingresada es incorrecta"); return; } DateTime Fecha = Convert.ToDateTime(txtFecha.Text); Int32 CodRegistro = Convert.ToInt32(Principal.CodigoPrincipalAbm); Clases.cEfectivoaPagar obj = new Clases.cEfectivoaPagar(); string Descripcion = "ANULACION DE PAGO A " + txtCliente.Text; Descripcion = Descripcion + ", PATENTE " + txtPatente.Text; double Total = fun.ToDouble(txtImporte.Text); double Saldo = fun.ToDouble(txtSaldo.Text); double Pagado = Total - Saldo; if (Total == Saldo) { Mensaje("No hay registros para anular"); return; } Clases.cSaldoEfectivoPagar saldoEf = new Clases.cSaldoEfectivoPagar(); obj.Anular(CodRegistro); saldoEf.Borrar(CodRegistro); Clases.cMovimiento mov = new Clases.cMovimiento(); mov.RegistrarMovimientoDescripcion(-1, Convert.ToInt32(Principal.CodigoPrincipalAbm), Pagado, 0, 0, 0, 0, Fecha, Descripcion); Mensaje("Datos grabados correctamente"); btnAnular.Enabled = false; btnGrabar.Enabled = false; }
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 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 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 btnAgregarCosto_Click(object sender, EventArgs e) { if (txtCodStock.Text == "") { MessageBox.Show("Debe ingresar un vehículo para continuar", Clases.cMensaje.Mensaje()); return; } Clases.cFunciones fun = new Clases.cFunciones(); if (txtCodAuto.Text == "") { MessageBox.Show("Debe ingresar un auto válido", 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; } Double Importe = 0; if (txtCosto.Text != "") { Importe = Convert.ToDouble(txtCosto.Text); } Int32 CodAuto = Convert.ToInt32(txtCodAuto.Text); string Descripcion = txtDescripcionCosto.Text + ", PATENTE " + txtPatente.Text; string Fecha = txtFecha.Text; string Patente = txtPatente.Text; Int32? CodStock = -1; if (txtCodStock.Text != "") { CodStock = Convert.ToInt32(txtCodStock.Text); } Clases.cCosto costo = new Clases.cCosto(); costo.InsertarCosto(CodAuto, Patente, Importe, Fecha, Descripcion.ToUpper(), CodStock); CargarCostoxstock(Convert.ToInt32(CodStock)); DateTime FechaCosto = Convert.ToDateTime(txtFecha.Text); Clases.cMovimiento mov = new Clases.cMovimiento(); mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, (-1) * (Importe), 0, 0, Importe, 0, FechaCosto, Descripcion.ToUpper()); txtCosto.Text = ""; txtDescripcionCosto.Text = ""; txtCodCosto.Text = ""; // Clases.cGrilla.FormatoColumnasMiles(Grilla, "Importe"); }
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 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 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 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 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 btnGrabar_Click(object sender, EventArgs e) { if (fun.ValidarFecha(txtFecha.Text) == false) { Mensaje("La fecha ingresada es incorrecta"); return; } if (txtIngresarImporte.Text == "") { Mensaje("Debe ingresar un importe para continuar"); return; } DateTime Fecha = Convert.ToDateTime(txtFecha.Text); Int32 CodRegistro = Convert.ToInt32(Principal.CodigoPrincipalAbm); double Importe = fun.ToDouble(txtIngresarImporte.Text); double Saldo = fun.ToDouble(txtSaldo.Text); double aPagar = fun.ToDouble(txtIngresarImporte.Text); double ImporteInicial = fun.ToDouble(txtImporte.Text); if (aPagar > Saldo) { Mensaje("El Importe a pagar supera el saldo"); return; } Clases.cSaldoEfectivoPagar objSaldo = new Clases.cSaldoEfectivoPagar(); Clases.cEfectivoaPagar obj = new Clases.cEfectivoaPagar(); obj.ActualizarPago(CodRegistro, Fecha, Importe); string Descripcion = "PAGO EFECTIVO " + txtCliente.Text; objSaldo.InsertarSaldo(CodRegistro, Fecha, Importe); Descripcion = Descripcion + ", PATENTE " + txtPatente.Text; Clases.cMovimiento mov = new Clases.cMovimiento(); mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, -1 * Importe, 0, 0, 0, 0, Fecha, Descripcion); Mensaje("Datos grabados correctamente"); txtImporte.Text = ""; btnGrabar.Enabled = false; }
private void btnAnular_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (fun.ValidarFecha(txtFecha.Text) == false) { Mensaje("La fecha ingresada es incorrecta"); return; } double ImporteAnular = fun.ToDouble(txtTotalCobrado.Text); Int32 CodCobranza = Convert.ToInt32(txtCodCobranza.Text); Clases.cMovimiento mov = new Clases.cMovimiento(); Clases.cCobranzaGeneral cob = new Clases.cCobranzaGeneral(); DateTime fecha = Convert.ToDateTime(txtFecha.Text); cob.AnularCobranza(CodCobranza); string descrip = "ANULACIÓN " + txtDescripcion.Text; mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, -1 * ImporteAnular, 0, 0, 0, 0, fecha, descrip); GetCobranzas(CodCobranza); Mensaje("Datos grabados correctamente"); }
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 btnEliminar_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(txtFechaPago.Text) == false) { MessageBox.Show("La fecha de Pago Ingresada es incorrecta", Clases.cMensaje.Mensaje()); return; } string msj = "Confirma eliminar el Pago "; var result = MessageBox.Show(msj, "Información", MessageBoxButtons.YesNo, MessageBoxIcon.Question); // If the no button was pressed ... if (result == DialogResult.No) { return; } DateTime Fecha = Convert.ToDateTime(txtFechaPago.Text); Int32 CodPago = Convert.ToInt32(Grilla.CurrentRow.Cells[0].Value); double Importe = fun.ToDouble(Grilla.CurrentRow.Cells[2].Value.ToString()); Clases.cPagoIntereses Pago = new Clases.cPagoIntereses(); Pago.BorrarPago(CodPago); string Descripcion = "ANULACION PAGO " + txtNombre.Text; Clases.cMovimiento mov = new Clases.cMovimiento(); mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, Importe, 0, 0, 0, 0, Fecha, Descripcion); MessageBox.Show("Datos grabados correctamente", Clases.cMensaje.Mensaje()); }
private void btnAnular_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); string msj = "Confirma anular el pago de la comisión "; var result = MessageBox.Show(msj, "Información", MessageBoxButtons.YesNo, MessageBoxIcon.Question); // If the no button was pressed ... if (result == DialogResult.No) { return; } 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.AnularPagoComision(CodComision); string Descripcion = "ANULACIÓN 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, Importe, 0, 0, 0, 0, Fecha, Descripcion); MessageBox.Show("Datos grabados Correctamente", Clases.cMensaje.Mensaje()); btnGrabar.Enabled = false; btnAnular.Enabled = false; }
private void btnGuardar_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (txtEfectivo.Text == "") { MessageBox.Show("Ingresar efectivo para continuar", Clases.cMensaje.Mensaje()); return; } if (txtFecha.Text == "") { MessageBox.Show("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); string Descripcion = txtDescripcion.Text; Double Importe = fun.ToDouble(txtEfectivo.Text); // Clases.cFunciones fun = new Clases.cFunciones(); if (cmbTipo.SelectedIndex == 1) { Importe = (-1) * Importe; } Clases.cMovimiento mov = new Clases.cMovimiento(); mov.RegistrarMovimientoDescripcion(0, Principal.CodUsuarioLogueado, Importe, 0, 0, 0, 0, Fecha, Descripcion); MessageBox.Show("Datos grabados correctamente", Clases.cMensaje.Mensaje()); txtEfectivo.Text = ""; txtDescripcion.Text = ""; }
private void btnGrabar_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (txtNombre.Text == "") { MessageBox.Show("Debe ingresar un nombre para continuar", Clases.cMensaje.Mensaje()); return; } if (txtTelefono.Text == "") { MessageBox.Show("Debe ingresar un teléfono para continuar", Clases.cMensaje.Mensaje()); return; } if (txtImporte.Text == "") { MessageBox.Show("Debe ingresar un Importe para continuar", Clases.cMensaje.Mensaje()); return; } if (fun.ValidarFecha(txtFecha.Text) == false) { MessageBox.Show("Debe ingresar una fecha válida para continuar", Clases.cMensaje.Mensaje()); return; } if (fun.ValidarFecha(txtFechaVencimiento.Text) == false) { MessageBox.Show("Debe ingresar una fecha de vencimiento válidad para continuar", Clases.cMensaje.Mensaje()); return; } if (txtPorcentaje.Text == "") { MessageBox.Show("Debe ingresar un Porcentaje para continuar", Clases.cMensaje.Mensaje()); return; } // Clases.cFunciones fun = new Clases.cFunciones(); string Nombre = txtNombre.Text; string Telefono = txtTelefono.Text; string Dirección = txtDireccion.Text; DateTime Fecha = Convert.ToDateTime(txtFecha.Text); double Importe = fun.ToDouble(txtImporte.Text); double PorcentajeInteres = Convert.ToDouble(txtPorcentaje.Text); DateTime FechaVencimiento = Convert.ToDateTime(txtFechaVencimiento.Text); double ImporteaPagar = fun.ToDouble(txtMontoApagar.Text); Clases.cPrestamo prestamo = new Clases.cPrestamo(); prestamo.InsertarPrestamo(Nombre, Telefono, Dirección, Fecha, Importe, PorcentajeInteres, FechaVencimiento, ImporteaPagar); Int32 CodPrestamo = prestamo.GetMaxPrestamo(); string Descripcion = "INGRESO PRESTAMO " + txtNombre.Text.ToUpper(); string DescripcionDetalle = "INGRESO PRESTAMO " + Importe.ToString().Replace(",", "."); Clases.cDetallePrestamo detalle = new Clases.cDetallePrestamo(); detalle.InsertarDetallePrestamo(CodPrestamo, Importe, DescripcionDetalle, Fecha); Clases.cMovimiento mov = new Clases.cMovimiento(); mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, Importe, 0, 0, 0, 0, Fecha, Descripcion); MessageBox.Show("Datos grabados correctamente", Clases.cMensaje.Mensaje()); txtNombre.Text = ""; txtDireccion.Text = ""; txtTelefono.Text = ""; txtMontoApagar.Text = ""; txtImporte.Text = ""; txtFecha.Text = ""; txtFechaVencimiento.Text = ""; txtPorcentaje.Text = ""; }
private void btnGrabar_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (Grilla.Rows.Count < 2) { MessageBox.Show("Debe ingresar un registro para continuar", Clases.cMensaje.Mensaje()); return; } if (Grilla.CurrentRow == null) { MessageBox.Show("Debe ingresar un registro 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; } Int32 CodCobranza = Convert.ToInt32(Grilla.CurrentRow.Cells[0].Value.ToString()); //Double Importe = fun.ToDouble(Grilla.CurrentRow.Cells[2].Value.ToString()); double Tope = fun.ToDouble(txtTope.Text); double Importe = fun.ToDouble(txtImporte.Text); double Saldo = fun.ToDouble(txtSaldo.Text); Double Punitorio = 0; if (txtPunitorio.Text != "") { Punitorio = fun.ToDouble(txtPunitorio.Text); } if (Importe > Tope) { MessageBox.Show("El importe ingresado supera el monto total", Clases.cMensaje.Mensaje()); return; } Saldo = Tope - Importe; string Descripcion = "REGISTRO DE COBRANZA PATENTE " + txtPatente.Text; Int32 CodVenta = Convert.ToInt32(Grilla.CurrentRow.Cells[1].Value.ToString()); DateTime Fecha = Convert.ToDateTime(txtFecha.Text); Clases.cCobranza cobranza = new Clases.cCobranza(); cobranza.RegistrarCobranza(CodCobranza, txtFecha.Text, Importe, Saldo); Clases.cMovimiento mov = new Clases.cMovimiento(); Clases.cPunitorioCobranza objPunitorio = new Clases.cPunitorioCobranza(); //Importe = Importe + Punitorio; mov.RegistrarMovimientoDescripcion(CodVenta, Principal.CodUsuarioLogueado, Importe, ((-1) * Importe), 0, 0, 0, Fecha, Descripcion); Clases.cSaldoCobranza saldoCob = new Clases.cSaldoCobranza(); saldoCob.InsertarSaldoCob(CodCobranza, Fecha, Importe); if (Punitorio > 0) { 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()); CargarGrilla(); }