tipocontabilidad 2
This commit is contained in:
@@ -315,7 +315,7 @@ Partial Class Contabilidad2_CatCuentas
|
|||||||
|
|
||||||
Dim codigo As String = DtDatos.FiltroPrimeroValor("Codigo", $"CveCuenta={IDSelected}")
|
Dim codigo As String = DtDatos.FiltroPrimeroValor("Codigo", $"CveCuenta={IDSelected}")
|
||||||
|
|
||||||
If UsuarioActual.Empresa.TipoContabilidad <> 1 Then
|
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
|
||||||
|
|
||||||
Using ObjConta2 As New ClsContPAQi(UsuarioActual.Empresa)
|
Using ObjConta2 As New ClsContPAQi(UsuarioActual.Empresa)
|
||||||
|
|
||||||
@@ -371,7 +371,7 @@ Partial Class Contabilidad2_CatCuentas
|
|||||||
|
|
||||||
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
|
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
|
||||||
Dim ObjConta As New ClsContabilidad
|
Dim ObjConta As New ClsContabilidad
|
||||||
Dim ObjConta2 As New ClsContPAQi(UsuarioActual.Empresa)
|
Dim ObjConta2 As ClsContPAQi
|
||||||
|
|
||||||
Dim CuentaEfectivo As Integer = 0
|
Dim CuentaEfectivo As Integer = 0
|
||||||
Dim Afectable As Integer = 1 'If(DcuentaMayor.SelectedValue <> 2, 0, 1) ' cuando sea tipo 2, va a ser afectable
|
Dim Afectable As Integer = 1 'If(DcuentaMayor.SelectedValue <> 2, 0, 1) ' cuando sea tipo 2, va a ser afectable
|
||||||
@@ -388,41 +388,45 @@ Partial Class Contabilidad2_CatCuentas
|
|||||||
If idnew > 0 Then
|
If idnew > 0 Then
|
||||||
|
|
||||||
Dim codigoPadre As String = DtDatos.FiltroPrimeroValor("Codigo", $"CveCuenta={IDSelected}") 'Tsubcuenta.Text
|
Dim codigoPadre As String = DtDatos.FiltroPrimeroValor("Codigo", $"CveCuenta={IDSelected}") 'Tsubcuenta.Text
|
||||||
If ObjConta2.GetCuentas(-1, "-1", -1) Then
|
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
|
||||||
Dim IdPadre As Integer = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"Codigo='{codigoPadre}'").ToEntero
|
ObjConta2 = New ClsContPAQi(UsuarioActual.Empresa)
|
||||||
Dim IdAgrupador As Integer
|
|
||||||
|
|
||||||
If ObjConta2.GetAgrupadoresSAT() Then
|
If ObjConta2.GetCuentas(-1, "-1", -1) Then
|
||||||
IdAgrupador = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"CodigoNombre='{DdlAgrupadorSAT.SelectedItem.Text}'").ToEntero
|
Dim IdPadre As Integer = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"Codigo='{codigoPadre}'").ToEntero
|
||||||
End If
|
Dim IdAgrupador As Integer
|
||||||
|
|
||||||
If IdPadre > 0 Then
|
If ObjConta2.GetAgrupadoresSAT() Then
|
||||||
Dim idnew2 As Integer = ObjConta2.AddCuenta(TxtCuenta.Text.Replace("-", ""), Tnombre.Text, DTcuenta.SelectedValue.ToString, DcuentaMayor.SelectedValue.ToString.ToEntero, CuentaEfectivo, DdlMoneda.SelectedValue.ToEntero, TxtDigAgrup.Text.ToEntero, TxtNomIngles.Text.Trim, Afectable, IdPadre, IdAgrupador)
|
IdAgrupador = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"CodigoNombre='{DdlAgrupadorSAT.SelectedItem.Text}'").ToEntero
|
||||||
|
|
||||||
If idnew2 > 0 Then
|
|
||||||
If ObjConta.UpdateCuentaCompaq(idnew, idnew2, UsuarioActual.CveEmpresa) Then
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If IdPadre > 0 Then
|
||||||
|
Dim idnew2 As Integer = ObjConta2.AddCuenta(TxtCuenta.Text.Replace("-", ""), Tnombre.Text, DTcuenta.SelectedValue.ToString, DcuentaMayor.SelectedValue.ToString.ToEntero, CuentaEfectivo, DdlMoneda.SelectedValue.ToEntero, TxtDigAgrup.Text.ToEntero, TxtNomIngles.Text.Trim, Afectable, IdPadre, IdAgrupador)
|
||||||
|
|
||||||
|
If idnew2 > 0 Then
|
||||||
|
If ObjConta.UpdateCuentaCompaq(idnew, idnew2, UsuarioActual.CveEmpresa) Then
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim dr As DataRow = DtDatos.NewRow
|
Dim dr As DataRow = DtDatos.NewRow
|
||||||
dr("CveCuenta") = idnew
|
dr("CveCuenta") = idnew
|
||||||
dr("CuentaFormato") = TxtCuenta.Text
|
dr("CuentaFormato") = TxtCuenta.Text
|
||||||
'dr("CuentaFormato") = Tcuenta.Text
|
'dr("CuentaFormato") = Tcuenta.Text
|
||||||
dr("Nombre") = Tnombre.Text
|
dr("Nombre") = Tnombre.Text
|
||||||
dr("CtaCodigo") = String.Format("{0} - {1}", TxtCuenta.Text, Tnombre.Text)
|
dr("CtaCodigo") = String.Format("{0} - {1}", TxtCuenta.Text, Tnombre.Text)
|
||||||
'dr("CtaCodigo") = String.Format("{0} - {1}", Tcuenta.Text, Tnombre.Text)
|
'dr("CtaCodigo") = String.Format("{0} - {1}", Tcuenta.Text, Tnombre.Text)
|
||||||
dr("Tipo") = DTcuenta.SelectedValue.ToString
|
dr("Tipo") = DTcuenta.SelectedValue.ToString
|
||||||
dr("CtaMayor") = DcuentaMayor.SelectedValue.ToString
|
dr("CtaMayor") = DcuentaMayor.SelectedValue.ToString
|
||||||
dr("CvePadre") = IDSelected
|
dr("CvePadre") = IDSelected
|
||||||
dr("Codigo") = Tnombre.Text
|
dr("Codigo") = Tnombre.Text
|
||||||
dr("CveMoneda") = DdlMoneda.SelectedValue.ToEntero
|
dr("CveMoneda") = DdlMoneda.SelectedValue.ToEntero
|
||||||
dr("DigAgrup") = TxtDigAgrup.Text.Trim.ToEntero
|
dr("DigAgrup") = TxtDigAgrup.Text.Trim.ToEntero
|
||||||
dr("NomIdioma") = TxtNomIngles.Text.Trim
|
dr("NomIdioma") = TxtNomIngles.Text.Trim
|
||||||
DtDatos.Rows.Add(dr)
|
DtDatos.Rows.Add(dr)
|
||||||
ArbolCuentas.DataSource = DtDatos
|
ArbolCuentas.DataSource = DtDatos
|
||||||
'.Attributes.Add("data-hijos","0");
|
'.Attributes.Add("data-hijos","0");
|
||||||
Dim item As ADServerControl.DragableItem = DirectCast(ArbolCuentas.FindControl(String.Format("{0}", IDSelected)), ADServerControl.DragableItem)
|
Dim item As ADServerControl.DragableItem = DirectCast(ArbolCuentas.FindControl(String.Format("{0}", IDSelected)), ADServerControl.DragableItem)
|
||||||
item.Attributes.Item("data-hijos") = item.Attributes.Item("data-hijos").ToEntero + 1
|
item.Attributes.Item("data-hijos") = item.Attributes.Item("data-hijos").ToEntero + 1
|
||||||
@@ -444,7 +448,7 @@ Partial Class Contabilidad2_CatCuentas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
ObjConta.Dispose()
|
ObjConta.Dispose()
|
||||||
ObjConta2.Dispose()
|
If ObjConta2 IsNot Nothing Then ObjConta2.Dispose()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub LimpiarCampos()
|
Private Sub LimpiarCampos()
|
||||||
TxtCuenta.Text = ""
|
TxtCuenta.Text = ""
|
||||||
|
|||||||
Reference in New Issue
Block a user