se obtiene el CveAgrupadorSat

This commit is contained in:
Antonio Gonzalez
2019-12-20 13:16:34 -07:00
parent 6562acea5a
commit 989b3720c8

View File

@@ -1797,6 +1797,14 @@ Partial Class General_SaldosIniciales
Dim NombreCuenta As String = "" Dim NombreCuenta As String = ""
Dim CuentaPadre As String = "" Dim CuentaPadre As String = ""
Dim AgrupadoresSAT As DataTable = New DataTable
If ObjConta.GetAgrupadoresSAT(UsuarioActual.CveEmpresa) Then
AgrupadoresSAT = ObjConta.DtResultados
End If
If AgrupadoresSAT.Rows.Count > 0 Then
For Each Row As DataRow In dt.Rows For Each Row As DataRow In dt.Rows
NombreCuenta = Row("NombreCuenta").ToString NombreCuenta = Row("NombreCuenta").ToString
CuentaPadre = Row("CuentaPadre").ToString CuentaPadre = Row("CuentaPadre").ToString
@@ -1804,6 +1812,7 @@ Partial Class General_SaldosIniciales
Dim TipoCuenta As String = Row("TipoCuenta").ToString Dim TipoCuenta As String = Row("TipoCuenta").ToString
Dim AgrupadorSAT As String = Row("AgrupadorSAT").ToString Dim AgrupadorSAT As String = Row("AgrupadorSAT").ToString
Dim CveCuentaPadre As Integer = -1 Dim CveCuentaPadre As Integer = -1
Dim CveAgrupadorSAT As Integer = If(AgrupadorSAT = "0", -1, AgrupadoresSAT.FiltroPrimeroValor("CveAgrupadorSAT", String.Format("CodigoNombre LIKE '%{0}%'", AgrupadorSAT)).ToEntero)
If Not CuentaPadre = "" Then If Not CuentaPadre = "" Then
If ObjConta.GetCuentas(-1, CuentaPadre.Replace("-", ""), -1, UsuarioActual.CveEmpresa) Then If ObjConta.GetCuentas(-1, CuentaPadre.Replace("-", ""), -1, UsuarioActual.CveEmpresa) Then
@@ -1821,7 +1830,7 @@ Partial Class General_SaldosIniciales
CveCuentaPadre = -2 CveCuentaPadre = -2
End If End If
Dim IdNew = ObjConta.AddCuenta(CveCuentaPadre, Cuenta.Replace("-", ""), NombreCuenta, TipoCuenta, 1, 1, CveEmpresaParam:=UsuarioActual.CveEmpresa) Dim IdNew = ObjConta.AddCuenta(CveCuentaPadre, Cuenta.Replace("-", ""), NombreCuenta, TipoCuenta, 1, 1, CveEmpresaParam:=UsuarioActual.CveEmpresa, CveAgrupadorSAT:=CveAgrupadorSAT)
If IdNew > 0 Then If IdNew > 0 Then
ContadorUpdate = ContadorUpdate + 1 ContadorUpdate = ContadorUpdate + 1
Else Else
@@ -1830,7 +1839,10 @@ Partial Class General_SaldosIniciales
Exit For Exit For
End If End If
Next Next
Else
Alert("No se tienen asociados Agrupadores para esta empresa")
TieneError = True
End If
If Not TieneError Then If Not TieneError Then
ObjConta.Commit() ObjConta.Commit()
Else Else