-- ajustes para cmbiar la cuenta contable el tipoconta=1

This commit is contained in:
2023-07-07 09:49:07 -07:00
parent 0bb02a27ae
commit 67c63da7ea
3 changed files with 115 additions and 34 deletions

View File

@@ -932,8 +932,8 @@ Partial Class AF_AF
TxtCodigo.Text = ObjActivoFijo.Codigo
TxtValorCompra.Text = ObjActivoFijo.ValorCompra.ToString.FormatoNumero
TxtFechaCompra.Text = ObjActivoFijo.FechaCompra.ToShortDateString
TxtValorCompraMN.Text = ObjActivoFijo.ValorCompraMN.ToString.FormatoNumero
If ObjActivoFijo.ValorCompra <> ObjActivoFijo.ValorCompraMN Then DivValorCompraMN.visible = True
TxtFechaBaja.Text = If(ObjActivoFijo.FechaBaja = New Date(1900, 1, 1), "", ObjActivoFijo.FechaBaja.ToString("dd/MM/yyyy"))
@@ -3152,13 +3152,15 @@ Partial Class AF_AF
Private Sub CargaCuentasConceptos()
Dim ObjConta As New ClsContabilidad
If ObjConta.GetCuentasConceptos(10, UsuarioActual.CveEmpresa, CveAF:=CveActivoFijo) Then
BtnVincularCuenta.Visible = ObjConta.DtResultados.Rows.Count = 0
GvCta.DataSource = ObjConta.DtResultados
divCuentas.Visible = True
End If
ObjConta.Dispose()
GvCta.DataBind()
End Sub
End Sub
Private Sub ActivarRegistroCuentaAF()
If DdlCtaContable.SelectedValue.ToEntero <= 0 And UsuarioActual.Empresa.Funcionalidad(221).ToEntero > 0 Then
BtnCtaContable.Visible = True
@@ -4878,15 +4880,10 @@ Partial Class AF_AF
DT_PlgaEfermedad.AcceptChanges()
End If
ErrorProceso = False
End If
If Not ErrorProceso Then
RegistraScript("$('#DVModalPlagaEnfermedad').modal('hide');")
Alert("Plaga Enfermedad guardada Correctamente.")
@@ -4895,9 +4892,51 @@ Partial Class AF_AF
End Sub
Private Sub BtnVincularCuenta_Click(sender As Object, e As EventArgs) Handles BtnVincularCuenta.Click
RegistraScript("$('#ModalContaCuenta').modal('show');")
DdlContaCuenta.DataSource = GlobalDTContaCuentasContables(UsuarioActual.CveEmpresa, Afectable:=1)
DdlContaCuenta.DataBind()
End Sub
#End Region
Protected Sub BtnCuentaAsociar_Click(sender As Object, e As EventArgs)
Dim ObjConta As New ClsContabilidad
ObjConta.IniciaTransacSQL()
Dim ErrorString As String = ""
If HdnCveCuentaAsignacion.Value.ToEntero <= 0 Then
If Not ObjConta.AddCuentasAsignaciones(49, UsuarioActual.CveEmpresa, DdlContaCuenta.SelectedValue.ToEntero, CveActivoFijo:=CveActivoFijo) Then
ErrorString = "Error al agregar"
End If
ElseIf HdnCveCuentaAsignacion.Value.ToEntero > 0 Then
If Not ObjConta.UpdateCuentasAsignaciones(HdnCveCuentaAsignacion.Value.ToEntero, 49, DdlContaCuenta.SelectedValue.ToEntero, CveActivoFijo:=CveActivoFijo) Then
ErrorString = "Error al actualizar"
End If
End If
If ErrorString.Length > 0 Then
ObjConta.RollBack()
Alert(ErrorString)
Else
ObjConta.Commit()
CargaCuentasConceptos()
UPG.Update()
RegistraScript("$('#ModalContaCuenta').modal('hide');")
Alert("Agregado correctamente")
End If
ObjConta.Dispose()
End Sub
Protected Sub ActualizaContaCuenta(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim CveConceptoContable As Integer = GvRow.DataKey("CveConceptoContable").ToString.ToEntero
HdnCveCuentaAsignacion.Value = GvRow.DataKey("CveCuentaAsignacion").ToString
DdlContaCuenta.DataSource = GlobalDTContaCuentasContables(UsuarioActual.CveEmpresa, Afectable:=1)
DdlContaCuenta.DataBind()
DdlContaCuenta.SelectedValue = GvRow.DataKey("CveCuenta").ToString
RegistraScript("$('#ModalContaCuenta').modal('show');")
End Sub
End Class