-- 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
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
If Not IsPostBack Then
|
If Not IsPostBack Then
|
||||||
|
|
||||||
InicializaValores()
|
InicializaValores()
|
||||||
|
|
||||||
|
|
||||||
CargaCombos()
|
CargaCombos()
|
||||||
|
|
||||||
@@ -407,6 +406,7 @@ Partial Class AF_AF
|
|||||||
|
|
||||||
BtnEliminar.Visible = False
|
BtnEliminar.Visible = False
|
||||||
CargaAFPadres()
|
CargaAFPadres()
|
||||||
|
CargaCuentasContables()
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -2498,6 +2498,11 @@ Partial Class AF_AF
|
|||||||
FechaBaja:=FechaBaja, Lat:=TxtLatitud.Text, Longi:=TxtLongitud.Text, AgroCuenta:=TxtAgroCuenta.Text) > 0 Then
|
FechaBaja:=FechaBaja, Lat:=TxtLatitud.Text, Longi:=TxtLongitud.Text, AgroCuenta:=TxtAgroCuenta.Text) > 0 Then
|
||||||
ViewState("CveActivoFijo") = ObjAF.CveActivoFijo
|
ViewState("CveActivoFijo") = ObjAF.CveActivoFijo
|
||||||
GlobalDTActivoFijos(UsuarioActual.CveEmpresa) = Nothing
|
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
|
Else
|
||||||
ErrorGuardar = True
|
ErrorGuardar = True
|
||||||
End If
|
End If
|
||||||
@@ -3111,25 +3116,36 @@ Partial Class AF_AF
|
|||||||
|
|
||||||
Private Sub CargaCuentasContables()
|
Private Sub CargaCuentasContables()
|
||||||
trCuentaContable.Visible = True
|
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.DataSource = DtCuentas
|
||||||
DdlCtaContable.DataBind()
|
DdlCtaContable.DataBind()
|
||||||
|
|
||||||
DdlCtaContableDepreciacion.DataSource = DtCuentas
|
|
||||||
DdlCtaContableDepreciacion.DataBind()
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user