-- autoasignación de af
This commit is contained in:
@@ -374,8 +374,7 @@ Partial Class AF_AF
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
|
||||
InicializaValores()
|
||||
|
||||
InicializaValores()
|
||||
|
||||
CargaCombos()
|
||||
|
||||
@@ -407,6 +406,7 @@ Partial Class AF_AF
|
||||
|
||||
BtnEliminar.Visible = False
|
||||
CargaAFPadres()
|
||||
CargaCuentasContables()
|
||||
|
||||
End If
|
||||
|
||||
@@ -2498,6 +2498,11 @@ Partial Class AF_AF
|
||||
FechaBaja:=FechaBaja, Lat:=TxtLatitud.Text, Longi:=TxtLongitud.Text, AgroCuenta:=TxtAgroCuenta.Text) > 0 Then
|
||||
ViewState("CveActivoFijo") = ObjAF.CveActivoFijo
|
||||
GlobalDTActivoFijos(UsuarioActual.CveEmpresa) = Nothing
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
|
||||
If Not ObjContabilidad.AddCuentasAsignaciones(49, UsuarioActual.CveEmpresa, CveCuenta:=DdlCtaContable.SelectedValue.ToEntero, CveActivoFijo:=ObjAF.CveActivoFijo) Then
|
||||
ErrorGuardar = True
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
ErrorGuardar = True
|
||||
End If
|
||||
@@ -3111,25 +3116,36 @@ Partial Class AF_AF
|
||||
|
||||
Private Sub CargaCuentasContables()
|
||||
trCuentaContable.Visible = True
|
||||
Dim DtCuentas As New DataTable
|
||||
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
|
||||
Dim Conta As New ClsContabilidad
|
||||
If Conta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then
|
||||
DtCuentas = Conta.DtResultados
|
||||
End If
|
||||
Conta.Dispose()
|
||||
DdlCtaContable.DataValueField = "CveCuenta"
|
||||
Else
|
||||
Dim Conta As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
|
||||
Dim CuentaPadre = UsuarioActual.Empresa.Funcionalidad(221).ToEntero
|
||||
|
||||
If Conta.GetCuentasRecursiva(CuentaPadre, 1) Then
|
||||
DtCuentas = Conta.DtResultados
|
||||
Else
|
||||
DtCuentas = Nothing
|
||||
Alert("Ocurrió un error al obtener las Cuentas Contables.", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
Conta.Dispose()
|
||||
|
||||
DdlCtaContableDepreciacion.DataSource = DtCuentas
|
||||
DdlCtaContableDepreciacion.DataBind()
|
||||
End If
|
||||
|
||||
Dim Conta As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
Dim DtCuentas As New DataTable
|
||||
Dim CuentaPadre = UsuarioActual.Empresa.Funcionalidad(221).ToEntero
|
||||
|
||||
If Conta.GetCuentasRecursiva(CuentaPadre, 1) Then
|
||||
DtCuentas = Conta.DtResultados
|
||||
Else
|
||||
DtCuentas = Nothing
|
||||
Alert("Ocurrió un error al obtener las Cuentas Contables.", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
Conta.Dispose()
|
||||
|
||||
DdlCtaContable.DataSource = DtCuentas
|
||||
DdlCtaContable.DataBind()
|
||||
|
||||
DdlCtaContableDepreciacion.DataSource = DtCuentas
|
||||
DdlCtaContableDepreciacion.DataBind()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user