diff --git a/Contabilidad/RegPrePoliza.aspx.vb b/Contabilidad/RegPrePoliza.aspx.vb index dc90976f5..16798628d 100644 --- a/Contabilidad/RegPrePoliza.aspx.vb +++ b/Contabilidad/RegPrePoliza.aspx.vb @@ -2185,6 +2185,8 @@ Partial Class ContabilidadC_RegPrePoliza Dim YaExiste As Boolean = False Dim CveConceptoContable As Integer = Row("CveConceptoContable").ToString.ToEntero Dim IdCtaContable As Integer = Row("IdCtaContable").ToString.ToEntero + 'sino viene el cveconcepto, busca por le nombre del concepto + If CveConceptoContable = 0 Then CveConceptoContable = GlobalDTContaConceptosContables(-1).FiltroPrimeroValor("CveConceptoContable", String.Format("ConceptoContable = '{0}'", Row("ConceptoContable"))).ToEntero If ObjConta.GetCuentas(-1, Cuenta.Replace("-", ""), 1, UsuarioActual.CveEmpresa) Then If ObjConta.DtResultados.Rows.Count > 0 Then diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 5a4b20361..2c82e48bf 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -1944,19 +1944,29 @@ Partial Class ContabilidadC_RegPrePolizaS Dim Importe As Decimal = If(Row("Cargo").ToString.ToDecimal <> 0, Row("Cargo").ToString.ToDecimal, Row("Abono").ToString.ToDecimal) Dim Concepto As String = Row("Concepto").ToString Dim Referencia As String = Row("Referencia").ToString - Dim IdCuenta As Integer = -1 + Dim CveCuenta As Integer = -1 Dim CveSubProyecto As Integer = Row("CveSubProyecto").ToString.ToEntero Dim TipoMovto As Boolean = If(Row("Cargo").ToString.ToDecimal <> 0, False, True) Dim YaExiste As Boolean = False Dim CveConceptoContable As Integer = Row("CveConceptoContable").ToString.ToEntero Dim IdCtaContable As Integer = Row("IdCtaContable").ToString.ToEntero + Dim CveClasificacion As Integer = -1 + 'sino viene el cveconcepto, busca por le nombre del concepto + If CveConceptoContable = 0 Then CveConceptoContable = GlobalDTContaConceptosContables(-1).FiltroPrimeroValor("CveConceptoContable", String.Format("ConceptoContable = '{0}'", Row("ConceptoAdministrativo"))).ToEntero + + If CveConceptoContable = 69 Then + CveClasificacion = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", "").ToEntero + End If + + If CveSubProyecto = 0 Then CveSubProyecto = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", String.Format("SubProyecto = '{0}'", Row("SubProyecto"))).ToEntero + If Importe <> 0 Then If ObjConta.GetCuentas(-1, Cuenta.Replace("-", ""), 1, UsuarioActual.CveEmpresa) Then If ObjConta.DtResultados.Rows.Count > 0 Then - IdCuenta = ObjConta.DtResultados().FiltroPrimeroValor("CveCuenta").ToEntero + CveCuenta = ObjConta.DtResultados().FiltroPrimeroValor("CveCuenta").ToEntero 'TipoCuenta = ObjConta.DtResultados().FiltroPrimeroValor("Tipo") Else Reporte.AppendLine($"{Cuenta} - {NombreCuenta} - {Importe}
") @@ -1970,13 +1980,13 @@ Partial Class ContabilidadC_RegPrePolizaS If YaExiste = False Then - If IdCuenta > 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, "", CveConceptoContable, Concepto, Now.ToDate, IdCtaContable, -1, ImporteMX:=Importe, CveSubProyecto:=CveSubProyecto, CveCuenta:=IdCuenta) Then + If CveCuenta > 0 Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, "", CveConceptoContable, Concepto, Now.ToDate, IdCtaContable, -1, ImporteMX:=Importe, CveSubProyecto:=CveSubProyecto, CveClasificacion:=CveClasificacion, CveCuenta:=CveCuenta) Then TieneError = True Exit For End If Else - IdCuenta = -2 + CveCuenta = -2 End If End If