From cffab0e70c746ff0703c35015265bc84be4a3932 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 27 Oct 2021 16:16:33 -0700 Subject: [PATCH] mejoras en fecha --- General/SaldosIniciales.aspx.vb | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index 80285172c..bff609215 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -1697,7 +1697,7 @@ Partial Class General_SaldosIniciales Dim SubProTemp As DataTable = GlobalDTSubProyectos(-1, -1, CveEmpresa:=UsuarioActual.CveEmpresa) CvePrePoliza = ObjConta.AddPrePolizas("SI", 1, 0, 0, 1, TxtFecha.Text.ToDate, "Saldos Iniciales", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - For Each Row As DataRow In dt.Rows + For Each Row As DataRow In dt.FiltraParametros("Cuenta <> '' ").Rows NombreCuenta = Row("NombreCuenta").ToString Cuenta = Row("Cuenta").ToString @@ -1709,11 +1709,8 @@ Partial Class General_SaldosIniciales Dim YaExiste As Boolean = False Dim DataTemp As DataTable - Dim SubP As String = Row("SubProyecto").ToString - If SubP <> "" Then - DataTemp = SubProTemp.FiltraParametros(String.Format("SubProyecto = '{0}'", SubP)) - CveSubProyecto = DataTemp.FiltroPrimeroValor("CveSubProyecto", "").ToEntero - End If + + Cuenta = Cuenta.Replace(" ", "") If ObjConta.GetCuentas(-1, Cuenta.Replace("-", "").Trim, 1, UsuarioActual.CveEmpresa) Then If ObjConta.DtResultados.Rows.Count > 0 Then @@ -1729,6 +1726,17 @@ Partial Class General_SaldosIniciales Exit For End If + Dim SubP As String = Row("SubProyecto").ToString + If SubP <> "" OrElse SubP <> "-" Then + DataTemp = SubProTemp.FiltraParametros(String.Format("SubProyecto = '{0}'", SubP)) + CveSubProyecto = DataTemp.FiltroPrimeroValor("CveSubProyecto", "").ToEntero + If CveSubProyecto <= 0 Then + Reporte.AppendLine($"'{SubP}' - no se encontrĂ³ en los subproyectos
") + TieneError = True + Exit For + End If + End If + 'If TipoCuenta.Contiene("A", "C", "E") Then ' CargoAbono = False @@ -1738,6 +1746,8 @@ Partial Class General_SaldosIniciales If IdCuenta > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, "", 95, Concepto, Now.ToDate, -1, -1, ImporteMX:=Importe, CveSubProyecto:=CveSubProyecto, CveCuenta:=IdCuenta) Then TieneError = True + Reporte.Append(NombreCuenta) + NombreCuenta.GuardaLog Exit For End If Else