-- mejora alta cuentas

This commit is contained in:
2022-08-25 19:24:11 -07:00
parent e5ec7e0ce5
commit 9328dab743

View File

@@ -1559,11 +1559,13 @@ Partial Class General_SaldosIniciales
For Each Row As DataRow In dt.Rows For Each Row As DataRow In dt.Rows
NombreCuenta = Row("NombreCuenta").ToString Dim Cuenta As String = Row("Cuenta").ToString.Trim
CuentaPadre = Row("CuentaPadre").ToString If Cuenta <> "" Then
Dim Cuenta As String = Row("Cuenta").ToString NombreCuenta = Row("NombreCuenta").ToString.Trim
Dim TipoCuenta As String = Row("TipoCuenta").ToString CuentaPadre = Row("CuentaPadre").ToString.Trim
Dim AgrupadorSAT As String = Row("AgrupadorSAT").ToString
Dim TipoCuenta As String = Row("TipoCuenta").ToString.Trim
Dim AgrupadorSAT As String = Row("AgrupadorSAT").ToString.Trim
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) Dim CveAgrupadorSAT As Integer = If(AgrupadorSAT = "0", -1, AgrupadoresSAT.FiltroPrimeroValor("CveAgrupadorSAT", String.Format("CodigoNombre LIKE '%{0}%'", AgrupadorSAT)).ToEntero)
@@ -1591,6 +1593,8 @@ Partial Class General_SaldosIniciales
ContadorError = ContadorError + 1 ContadorError = ContadorError + 1
Exit For Exit For
End If End If
End If
Next Next
Else Else
Alert("No se tienen asociados Agrupadores para esta empresa") Alert("No se tienen asociados Agrupadores para esta empresa")
@@ -1598,12 +1602,12 @@ Partial Class General_SaldosIniciales
End If End If
If Not TieneError Then If Not TieneError Then
ObjConta.Commit() ObjConta.Commit()
Alert($"Se agregaron {ContadorUpdate} Cuentas Correctamente y se omitieron: {ContadorError} cuentas.")
Else Else
Alert($"No pudimos agregar la cuenta en ContaSIG: {NombreCuenta} - Cuenta Padre: {CuentaPadre}", TipoMensaje.MsgError) Alert($"No pudimos agregar la cuenta en ContaSIG: {NombreCuenta} - Cuenta Padre: {CuentaPadre}", TipoMensaje.MsgError)
ObjConta.RollBack() ObjConta.RollBack()
End If End If
Alert($"Se agregaron {ContadorUpdate} Cuentas Correctamente y se omitieron: {ContadorError} cuentas.")
Catch ex As Exception Catch ex As Exception
ObjConta.RollBack() ObjConta.RollBack()