diff --git a/AF/AF.aspx.vb b/AF/AF.aspx.vb
index 690738748..2dcae1e8e 100644
--- a/AF/AF.aspx.vb
+++ b/AF/AF.aspx.vb
@@ -2135,12 +2135,12 @@ Partial Class AF_AF
'PREPOLIZA DE IMPORTACION DESDE ALMACEN
If AFInvCvePS > 0 AndAlso AFInvCveAlmacen > 0 Then
Dim IDCtaContableInv = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen={AFInvCveAlmacen}").ToEntero
- Dim CveCuentaInv = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen={AFInvCveAlmacen}").ToEntero
+ 'Dim CveCuentaInv = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen={AFInvCveAlmacen}").ToEntero
If Not ErrorGuardar Then
Dim CvePrePoliza As Integer = ObjContabilidad.AddPrePolizas("AF/ImportadoInv", 4, TxtValorCompra.Text.ToDouble, TxtValorCompra.Text.ToDouble, 1, Now, $"AF importado de Almacén {TxtCodigo.Text.Trim}", UsuarioActual.CveUsuario, CveEmpresaActual)
If ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, False, TxtValorCompra.Text.ToDecimal, $"{TxtCodigo.Text.Trim} - {TxtDescripcion.Text.Trim}", 49, $"{TxtCodigo.Text.Trim} - {TxtDescripcion.Text.Trim}", Now, DdlCtaContable.SelectedValue.Trim.ToEntero, -1, CveActivoFijo:=CveActivoFijo, ImporteMX:=TxtValorCompra.Text.ToDecimal, CveCuenta:=If(UsuarioActual.Empresa.UsaContabilidad AndAlso UsuarioActual.Empresa.UsaContabilidadSIG, ObtenerCuentaDobleConta(DdlCtaContable.SelectedValue.Trim.ToEntero, UsuarioActual.CveEmpresa), -1)) Then
If Not ErrorGuardar Then
- If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, True, TxtValorCompra.Text.ToDecimal, TxtCodigo.Text.Trim, 68, TxtCodigo.Text.Trim, Now, IDCtaContableInv, -1, CveMovimientoAlmacen:=CveMovimientoSalidaInv, ImporteMX:=TxtValorCompra.Text.ToDecimal, CveCuenta:=CveCuentaInv) Then
+ If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, True, TxtValorCompra.Text.ToDecimal, TxtCodigo.Text.Trim, 68, TxtCodigo.Text.Trim, Now, IDCtaContableInv, -1, CveMovimientoAlmacen:=CveMovimientoSalidaInv, ImporteMX:=TxtValorCompra.Text.ToDecimal) Then
ErrorGuardar = True
End If
End If
diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb
index 41a2511cb..eacb04c20 100644
--- a/App_Code/ClsBancos.vb
+++ b/App_Code/ClsBancos.vb
@@ -417,8 +417,8 @@ Public Class ClsBancos
Me.FFinal = Data.Rows(0)("FFinal").ToString.ToEntero
Me.IdCtaContable = Data.Rows(0)("IdCtaContable").ToString.ToEntero
Me.IdCtaContableComplementaria = Data.Rows(0)("IdCtaContableComplementaria").ToString.ToEntero
- Me.CveCuentaConta = Data.Rows(0)("IdCtaContableSIG").ToString.ToEntero
- Me.CveCuentaContaComplementaria = Data.Rows(0)("IdCtaContableComplementariaSIG").ToString.ToEntero
+ Me.CveCuentaConta = Data.Rows(0)("CveCuentaContable").ToString.ToEntero
+ Me.CveCuentaContaComplementaria = Data.Rows(0)("CveCuentaComplementaria").ToString.ToEntero
Me.FormatoCheque = Data.Rows(0)("FormatoCheque").ToString
Me.Estatus = Data.Rows(0)("Estatus").ToString
Me.Fecha = Data.Rows(0)("Fecha").ToString.ToDate
diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb
index cd1106378..bf0da4b34 100644
--- a/App_Code/ClsCompras.vb
+++ b/App_Code/ClsCompras.vb
@@ -2183,13 +2183,14 @@ Public Class ClsCompras
#Region " ESTATUS ALMACEN "
- Public Function UpdateEstatusAlmacen(CveCompra As Integer, ValorEstatus As Integer) As Boolean
+ Public Function UpdateEstatusAlmacen(CveCompra As Integer, ValorEstatus As Integer, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Comp_ComprasEstatusAlmacenUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
.Add("@Estatus", SqlDbType.Int).Value = ValorEstatus
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With
Try
@@ -2201,13 +2202,14 @@ Public Class ClsCompras
Return Retorno
End Function
- Public Function UpdateEstatusAlmacenDetalle(CveCompraDetalle As Integer, ValorEstatus As Integer) As Boolean
+ Public Function UpdateEstatusAlmacenDetalle(CveCompraDetalle As Integer, ValorEstatus As Integer, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Comp_ComprasDetalleEstatusAlmacenUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCompraDetalle", SqlDbType.Int).Value = CveCompraDetalle
.Add("@Estatus", SqlDbType.Int).Value = ValorEstatus
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With
Try
@@ -2445,6 +2447,30 @@ Public Class ClsCompras
Return Retorno
End Function
+ Public Function GetComprasPagosConciliados(CveCompra As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Comp_ComprasPagosConciliadosGet")
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveCompra", SqlDbType.Int).Value = CveCompra
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener los de pagos de compra", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+
+ End Function
+
+
+
+
Public Function RemoveComplementoPagoDesVincular(CveFactura As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Comp_CompraComplementoDesVincular")
diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb
index 4085f9b24..a3e36c05a 100644
--- a/App_Code/ClsContabilidad.vb
+++ b/App_Code/ClsContabilidad.vb
@@ -62,7 +62,7 @@ Public Class ClsContabilidad
Public Property CveEmpresa As Integer
Public Property CveTipoPlantillaPoliza As Integer
- Public Property ContaIdPoliza As Integer
+ Public Property ContaIdPoliza As Integer = 0
Public Property ContaFolio As Integer
Public Property ValorPolizaDescuadre As Integer
@@ -153,22 +153,22 @@ Public Class ClsContabilidad
- Public Function CuentasContablesSigGet(cveEmpresa As Int32) As Boolean
- Dim retorno As Boolean = False
- DataAdapter("PA_Conta_CuentasContablesSigGet", CommandType.StoredProcedure)
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa
- End With
- Try
- SqlAdapter.Fill(Data)
- retorno = True
- Catch ex1 As SqlException
- OnError("Ocurrió un error al obtener las Cuentas Contables", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- Catch ex As Exception
- OnError("Ocurrió un error al obtener las Cuentas Contables", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
- Return retorno
- End Function
+ 'Public Function CuentasContablesSigGet(cveEmpresa As Int32) As Boolean
+ ' Dim retorno As Boolean = False
+ ' DataAdapter("PA_Conta_CuentasContablesSigGet", CommandType.StoredProcedure)
+ ' With SqlAdapter.SelectCommand.Parameters
+ ' .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa
+ ' End With
+ ' Try
+ ' SqlAdapter.Fill(Data)
+ ' retorno = True
+ ' Catch ex1 As SqlException
+ ' OnError("Ocurrió un error al obtener las Cuentas Contables", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ ' Catch ex As Exception
+ ' OnError("Ocurrió un error al obtener las Cuentas Contables", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ ' End Try
+ ' Return retorno
+ 'End Function
#Region " C O N T A B I L I D A D - P R E P O L I Z A"
Public Function ObtenerTipoPoliza(Valor1 As String, Valor2 As String, CveEmpresa As Integer) As Integer
@@ -1118,8 +1118,9 @@ Public Class ClsContabilidad
Public Function ContabilizarPrePoliza(CvePrePoliza As Integer, CveUsuario As Integer, Empresa As Empresa, Optional Fecha As Date = MinFecha, Optional Concepto As String = "",
Optional ObjConta As ClsContPAQi = Nothing, Optional pIDPoliza As Integer = -1) As Boolean
-
+ Dim StrLog As New StringBuilder
Dim Retorno As Boolean = False
+ StrLog.AppendFormat("CvePrep:{0} - Inicio", CvePrePoliza)
If Empresa.TipoContabilizacion = 1 Then ' contabilidad en SIG
@@ -1396,6 +1397,8 @@ Public Class ClsContabilidad
If Not ContaCompartida Then ObjConta.Dispose()
End If
+ StrLog.AppendFormat(" - Fin")
+ StrLog.ToString.GuardaLogAD("LogContabilidazacion")
Return Retorno
End Function
@@ -4645,25 +4648,25 @@ Public Class ClsContabilidad
Return Retorno
End Function
- Public Function GetSaldoCuenta(IdCuenta As Integer, TipoMovto As Integer, Ejercicio As Integer) As Boolean
- Dim Retorno As Boolean
+ 'Public Function GetSaldoCuenta(IdCuenta As Integer, TipoMovto As Integer, Ejercicio As Integer) As Boolean
+ ' Dim Retorno As Boolean
- If TipoMovto = 0 Then
- DataAdapter(String.Format("SELECT SUM(CASE WHEN TipoMovto = 1 THEN -1 ELSE 1 END * Importe) AS Saldo from Conta_PolizasDetalle CD inner join Conta_Polizas CP on CP.CvePoliza=CD.CvePoliza and year(CP.Fecha)={1} WHERE CveCuenta = {0}", IdCuenta, Ejercicio), CommandType.Text)
- Else
- DataAdapter(String.Format("SELECT SUM(CASE WHEN TipoMovto = 0 THEN -1 ELSE 1 END * Importe) AS Saldo from Conta_PolizasDetalle CD inner join Conta_Polizas CP on CP.CvePoliza=CD.CvePoliza and year(CP.Fecha)={1} WHERE CveCuenta = {0} ", IdCuenta, Ejercicio), CommandType.Text)
- End If
+ ' If TipoMovto = 0 Then
+ ' DataAdapter(String.Format("SELECT SUM(CASE WHEN TipoMovto = 1 THEN -1 ELSE 1 END * Importe) AS Saldo from Conta_PolizasDetalle CD inner join Conta_Polizas CP on CP.CvePoliza=CD.CvePoliza and year(CP.Fecha)={1} WHERE CveCuenta = {0}", IdCuenta, Ejercicio), CommandType.Text)
+ ' Else
+ ' DataAdapter(String.Format("SELECT SUM(CASE WHEN TipoMovto = 0 THEN -1 ELSE 1 END * Importe) AS Saldo from Conta_PolizasDetalle CD inner join Conta_Polizas CP on CP.CvePoliza=CD.CvePoliza and year(CP.Fecha)={1} WHERE CveCuenta = {0} ", IdCuenta, Ejercicio), CommandType.Text)
+ ' End If
- Try
- SqlAdapter.Fill(Data)
- 'Retorno = Math.Round(SqlCommand.ExecuteScalar.ToString.ToDouble, 2)
- Retorno = True
- Catch ex As Exception
- Me.OnError("Ocurrió un error al obtener eL saldo de la cuenta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
+ ' Try
+ ' SqlAdapter.Fill(Data)
+ ' 'Retorno = Math.Round(SqlCommand.ExecuteScalar.ToString.ToDouble, 2)
+ ' Retorno = True
+ ' Catch ex As Exception
+ ' Me.OnError("Ocurrió un error al obtener eL saldo de la cuenta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ ' End Try
- Return Retorno
- End Function
+ ' Return Retorno
+ 'End Function
Public Function GetRepPresupuestosEgresosSaldos(Ejercicio As Integer, Fecha As Date, Capitulo As String, CveClasificacion As Integer, CveFuenteFinanciamiento As Integer, CveProgramaOperativo As Integer, CveUnidadAdministrativa As Integer, CveTipoGasto As Integer, Gpo As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_PresupuestosEgresosSaldosRep")
@@ -4742,138 +4745,138 @@ Public Class ClsContabilidad
Return Retorno
End Function
- Public Function Conta_ContabilizaPrePoliza(CvePrepoliza As Integer, Ejercicio As Integer) As Boolean
- Dim Retorno = False
+ 'Public Function Conta_ContabilizaPrePoliza(CvePrepoliza As Integer, Ejercicio As Integer) As Boolean
+ ' Dim Retorno = False
- DataAdapter("PA_Conta_ContabilizaPrepolizas")
+ ' DataAdapter("PA_Conta_ContabilizaPrepolizas")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePrepoliza", SqlDbType.Int).Value = CvePrepoliza
- .Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio
- .Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output
- End With
+ ' With SqlAdapter.SelectCommand.Parameters
+ ' .Add("@CvePrepoliza", SqlDbType.Int).Value = CvePrepoliza
+ ' .Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio
+ ' .Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output
+ ' End With
- Try
- SqlAdapter.Fill(Data)
- If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero = 0 Then
- Retorno = True
- Else
- Retorno = False
- End If
- Catch ex As Exception
- Me.OnError("Ocurrió un error al contabilizar la prepoliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
+ ' Try
+ ' SqlAdapter.Fill(Data)
+ ' If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero = 0 Then
+ ' Retorno = True
+ ' Else
+ ' Retorno = False
+ ' End If
+ ' Catch ex As Exception
+ ' Me.OnError("Ocurrió un error al contabilizar la prepoliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ ' End Try
- Return Retorno
- End Function
- Public Function Conta_CompactaPrePoliza(CvePrepoliza As Integer) As Boolean
- Dim Retorno = False
+ ' Return Retorno
+ 'End Function
+ 'Public Function Conta_CompactaPrePoliza(CvePrepoliza As Integer) As Boolean
+ ' Dim Retorno = False
- DataAdapter("PA_Comp_CompactaPrepoliza")
+ ' DataAdapter("PA_Comp_CompactaPrepoliza")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrepoliza
- .Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output
- End With
+ ' With SqlAdapter.SelectCommand.Parameters
+ ' .Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrepoliza
+ ' .Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output
+ ' End With
- Try
- SqlAdapter.Fill(Data)
- If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero = 0 Then
- Retorno = True
- Else
- Retorno = False
- End If
- Catch ex As Exception
- Me.OnError("Ocurrió un error al contabilizar la prepoliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
+ ' Try
+ ' SqlAdapter.Fill(Data)
+ ' If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero = 0 Then
+ ' Retorno = True
+ ' Else
+ ' Retorno = False
+ ' End If
+ ' Catch ex As Exception
+ ' Me.OnError("Ocurrió un error al contabilizar la prepoliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ ' End Try
- Return Retorno
- End Function
- Public Function Conta_GeneraPptarias(CveCompra As Integer) As Boolean
- Dim Retorno = False
+ ' Return Retorno
+ 'End Function
+ 'Public Function Conta_GeneraPptarias(CveCompra As Integer) As Boolean
+ ' Dim Retorno = False
- DataAdapter("PA_Conta_GeneraPptarias")
+ ' DataAdapter("PA_Conta_GeneraPptarias")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveCompra", SqlDbType.Int).Value = CveCompra
- .Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output
- End With
+ ' With SqlAdapter.SelectCommand.Parameters
+ ' .Add("@CveCompra", SqlDbType.Int).Value = CveCompra
+ ' .Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output
+ ' End With
- Try
- SqlAdapter.Fill(Data)
- If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero = 0 Then
- Retorno = True
- Else
- Retorno = False
- End If
- Catch ex As Exception
- Me.OnError("Ocurrió un error al Generar las Cuentas Presupuestarias", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
+ ' Try
+ ' SqlAdapter.Fill(Data)
+ ' If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero = 0 Then
+ ' Retorno = True
+ ' Else
+ ' Retorno = False
+ ' End If
+ ' Catch ex As Exception
+ ' Me.OnError("Ocurrió un error al Generar las Cuentas Presupuestarias", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ ' End Try
- Return Retorno
- End Function
+ ' Return Retorno
+ 'End Function
- Public Function AddConta_Poliza(CveTipoPoliza As Integer, CveEjercicio As Integer, Folio As Integer, FechaPoliza As Date, Concepto As String, CveUsuario As Integer, CveEmpresa As Integer) As Integer
- Dim Retorno As Integer = 0
+ 'Public Function AddConta_Poliza(CveTipoPoliza As Integer, CveEjercicio As Integer, Folio As Integer, FechaPoliza As Date, Concepto As String, CveUsuario As Integer, CveEmpresa As Integer) As Integer
+ ' Dim Retorno As Integer = 0
- DataAdapter("PA_Add_Conta_Polizas")
+ ' DataAdapter("PA_Add_Conta_Polizas")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@Folio", SqlDbType.Int).Value = Folio
- ' .Add("@CveTipoPoliza", SqlDbType.Int).Value = CveTipoPoliza
- .Add("@Ejercicio", SqlDbType.Int).Value = CveEjercicio
- .Add("@Concepto", SqlDbType.VarChar).Value = Concepto
- .Add("@FechaPoliza", SqlDbType.DateTime).Value = FechaPoliza
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@CvePoliza", SqlDbType.Int).Direction = ParameterDirection.Output
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = SqlAdapter.SelectCommand.Parameters("@CvePoliza").Value.ToString.ToEntero
- Catch ex As Exception
- OnError("Ocurrió un error al agregar la poliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
+ ' With SqlAdapter.SelectCommand.Parameters
+ ' .Add("@Folio", SqlDbType.Int).Value = Folio
+ ' ' .Add("@CveTipoPoliza", SqlDbType.Int).Value = CveTipoPoliza
+ ' .Add("@Ejercicio", SqlDbType.Int).Value = CveEjercicio
+ ' .Add("@Concepto", SqlDbType.VarChar).Value = Concepto
+ ' .Add("@FechaPoliza", SqlDbType.DateTime).Value = FechaPoliza
+ ' .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ ' .Add("@CvePoliza", SqlDbType.Int).Direction = ParameterDirection.Output
+ ' End With
+ ' Try
+ ' SqlAdapter.Fill(Data)
+ ' Retorno = SqlAdapter.SelectCommand.Parameters("@CvePoliza").Value.ToString.ToEntero
+ ' Catch ex As Exception
+ ' OnError("Ocurrió un error al agregar la poliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ ' End Try
- Return Retorno
- End Function
- Public Function AddConta_PolizaDetalle(CvePoliza As Integer, CveCuenta As Integer, TipoMovto As Boolean, Importe As Double, Referencia As String,
- Concepto As String, FechaMovto As Date, CveUsuario As Integer, Optional ImporteMonedaExtranjera As Double = 0) As Boolean
- Dim Retorno As Boolean = False
+ ' Return Retorno
+ 'End Function
+ 'Public Function AddConta_PolizaDetalle(CvePoliza As Integer, CveCuenta As Integer, TipoMovto As Boolean, Importe As Double, Referencia As String,
+ ' Concepto As String, FechaMovto As Date, CveUsuario As Integer, Optional ImporteMonedaExtranjera As Double = 0) As Boolean
+ ' Dim Retorno As Boolean = False
- If CvePoliza <= 0 Or CveCuenta <= 0 Then
- Return False
- End If
+ ' If CvePoliza <= 0 Or CveCuenta <= 0 Then
+ ' Return False
+ ' End If
- DataAdapter("PA_Add_Conta_PolizasDetalles")
- 'DataAdapter("PA_Conta_PolizasDetalleAdd")
+ ' DataAdapter("PA_Add_Conta_PolizasDetalles")
+ ' 'DataAdapter("PA_Conta_PolizasDetalleAdd")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePoliza", SqlDbType.Int).Value = CvePoliza
- .Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
- .Add("@TipoMovto", SqlDbType.Int).Value = TipoMovto
- .Add("@Total", SqlDbType.Money).Value = Math.Round(Importe, 2)
- .Add("@ImporteME", SqlDbType.Money).Value = ImporteMonedaExtranjera
- .Add("@Referencia", SqlDbType.VarChar).Value = Referencia
- .Add("@Concepto", SqlDbType.VarChar).Value = Concepto
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output
- End With
+ ' With SqlAdapter.SelectCommand.Parameters
+ ' .Add("@CvePoliza", SqlDbType.Int).Value = CvePoliza
+ ' .Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
+ ' .Add("@TipoMovto", SqlDbType.Int).Value = TipoMovto
+ ' .Add("@Total", SqlDbType.Money).Value = Math.Round(Importe, 2)
+ ' .Add("@ImporteME", SqlDbType.Money).Value = ImporteMonedaExtranjera
+ ' .Add("@Referencia", SqlDbType.VarChar).Value = Referencia
+ ' .Add("@Concepto", SqlDbType.VarChar).Value = Concepto
+ ' .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ ' .Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output
+ ' End With
- Try
- SqlAdapter.Fill(Data)
- If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero <> 0 Then
- Retorno = False
- Else
- Retorno = True
- End If
- Catch ex As Exception
- OnError("Ocurrió un error al agregar el movimiento en la póliza.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
+ ' Try
+ ' SqlAdapter.Fill(Data)
+ ' If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero <> 0 Then
+ ' Retorno = False
+ ' Else
+ ' Retorno = True
+ ' End If
+ ' Catch ex As Exception
+ ' OnError("Ocurrió un error al agregar el movimiento en la póliza.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ ' End Try
- Return Retorno
- End Function
+ ' Return Retorno
+ 'End Function
Public Function GetSaldoCuentaAC(TipoMovto As Integer, CveCuentaAprobado As Integer, CveCuentaDevengado As Integer, Ejercicio As Integer) As Decimal
Dim Retorno As Decimal
DataAdapter("PA_Conta_CalculaSaldo")
@@ -4895,51 +4898,51 @@ Public Class ClsContabilidad
Return Retorno
End Function
- Public Function GetSegmentosNegocio(Id As Integer, Codigo As String) As Boolean
- Dim Retorno As Boolean = False
- Dim StrSQl = New StringBuilder
+ 'Public Function GetSegmentosNegocio(Id As Integer, Codigo As String) As Boolean
+ ' Dim Retorno As Boolean = False
+ ' Dim StrSQl = New StringBuilder
- StrSQl.Clear()
- StrSQl.Append(" SELECT Id, RTRIM (LTRIM (Codigo)) AS Codigo, Nombre, '' AS CveProyecto, '' AS CveSubProyecto ")
- StrSQl.Append(" FROM SegmentosNegocio ")
- StrSQl.Append(" WHERE (@Id = -1 OR Id = @Id) ")
- StrSQl.Append(" AND (@Codigo = '-1' OR Codigo = @Codigo) ")
+ ' StrSQl.Clear()
+ ' StrSQl.Append(" SELECT Id, RTRIM (LTRIM (Codigo)) AS Codigo, Nombre, '' AS CveProyecto, '' AS CveSubProyecto ")
+ ' StrSQl.Append(" FROM SegmentosNegocio ")
+ ' StrSQl.Append(" WHERE (@Id = -1 OR Id = @Id) ")
+ ' StrSQl.Append(" AND (@Codigo = '-1' OR Codigo = @Codigo) ")
- DataAdapter(StrSQl.ToString, CommandType.Text)
- SqlAdapter.SelectCommand.Parameters.Add("@Id", SqlDbType.Int).Value = Id
- SqlAdapter.SelectCommand.Parameters.Add("@Codigo", SqlDbType.VarChar).Value = Codigo
+ ' DataAdapter(StrSQl.ToString, CommandType.Text)
+ ' SqlAdapter.SelectCommand.Parameters.Add("@Id", SqlDbType.Int).Value = Id
+ ' SqlAdapter.SelectCommand.Parameters.Add("@Codigo", SqlDbType.VarChar).Value = Codigo
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al consultar los Segmentos de Negocio.", ex)
- End Try
+ ' Try
+ ' SqlAdapter.Fill(Data)
+ ' Retorno = True
+ ' Catch ex As Exception
+ ' OnError("Ocurrió un error al consultar los Segmentos de Negocio.", ex)
+ ' End Try
- Return Retorno
- End Function
+ ' Return Retorno
+ 'End Function
- Public Function GetSubProyectos(CveEmpresa As Integer) As Boolean
- Dim Retorno As Boolean = False
- Dim StrSQl = New StringBuilder
+ 'Public Function GetSubProyectos(CveEmpresa As Integer) As Boolean
+ ' Dim Retorno As Boolean = False
+ ' Dim StrSQl = New StringBuilder
- DataAdapter("PA_Comp_Compras_Pptarias")
+ ' DataAdapter("PA_Comp_Compras_Pptarias")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- End With
+ ' With SqlAdapter.SelectCommand.Parameters
+ ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ ' End With
- SqlAdapter.Fill(Data)
- Retorno = True
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al consultar los Segmentos de Negocio.", ex)
- End Try
+ ' SqlAdapter.Fill(Data)
+ ' Retorno = True
+ ' Try
+ ' SqlAdapter.Fill(Data)
+ ' Retorno = True
+ ' Catch ex As Exception
+ ' OnError("Ocurrió un error al consultar los Segmentos de Negocio.", ex)
+ ' End Try
- Return Retorno
- End Function
+ ' Return Retorno
+ 'End Function
Public Function GetNumeroPoliza(CveTipoPoliza As Integer, Tipo As String, Fecha As DateTime, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -4962,29 +4965,29 @@ Public Class ClsContabilidad
Return Retorno
End Function
- Public Function Compras_Pptarias(CveCompra As Integer, Importe As Decimal, CveConceptoContable As Integer) As Boolean
+ 'Public Function Compras_Pptarias(CveCompra As Integer, Importe As Decimal, CveConceptoContable As Integer) As Boolean
- Dim Retorno As Boolean = False
+ ' Dim Retorno As Boolean = False
- DataAdapter("PA_Comp_Compras_Pptarias")
+ ' DataAdapter("PA_Comp_Compras_Pptarias")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveCompra", SqlDbType.Int).Value = CveCompra
- .Add("@Importe", SqlDbType.Decimal).Value = Importe
- .Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable
- End With
+ ' With SqlAdapter.SelectCommand.Parameters
+ ' .Add("@CveCompra", SqlDbType.Int).Value = CveCompra
+ ' .Add("@Importe", SqlDbType.Decimal).Value = Importe
+ ' .Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable
+ ' End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex1 As SqlException
- OnError("Ocurrió un error al obtener las Plantillas", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- Catch ex As Exception
- OnError("Ocurrió un error al obtener las Plantillas", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
+ ' Try
+ ' SqlAdapter.Fill(Data)
+ ' Retorno = True
+ ' Catch ex1 As SqlException
+ ' OnError("Ocurrió un error al obtener las Plantillas", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ ' Catch ex As Exception
+ ' OnError("Ocurrió un error al obtener las Plantillas", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ ' End Try
- Return Retorno
- End Function
+ ' Return Retorno
+ 'End Function
#End Region
#Region "FIS IMPUESTOS"
@@ -5878,7 +5881,7 @@ Public Class ClsContabilidad
End Function
Public Function GetPrePolizasImpresion(CveEmpresa As Integer, FechaI As String, FechaF As String, Optional CveTipoPoliza As Integer = -1, Optional FolioI As Integer = -1,
- Optional FolioF As Integer = -1, Optional CveUsuario As Integer = -1, Optional IdSegNegocio As Integer = -1,
+ Optional FolioF As Integer = -1, Optional CveUsuario As Integer = -1, Optional CveSubProyecto As Integer = -1,
Optional CveCuenta As Integer = -1, Optional CvePlantillaPoliza As Integer = -1, Optional CveProveedor As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -5892,7 +5895,7 @@ Public Class ClsContabilidad
.Add("@FolioI", SqlDbType.Int).Value = FolioI
.Add("@FolioF", SqlDbType.Int).Value = FolioF
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@IdSegNegocio", SqlDbType.Int).Value = IdSegNegocio
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
.Add("@CvePlantillaPoliza", SqlDbType.Int).Value = CvePlantillaPoliza
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 8cef487fc..a3d763c62 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -4386,6 +4386,9 @@ Public Class ClsPaginas
PaginaDict.Add("/Finanzas/RazonesFinancierasCuentas.aspx".ToUpper(), -1)
PaginaDict.Add("/Finanzas/RepRotacionCartera.aspx".ToUpper(), 649)
PaginaDict.Add("/Finanzas/RepRotacionCarteraDetalle.aspx".ToUpper(), 649)
+
+
+ PaginaDict.Add("/Finanzas/RepBalanceGeneralHorizontal2.aspx".ToUpper(), -1)
#End Region
#Region "Flotillas"
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index 6df233d4e..deb17d739 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -4631,7 +4631,7 @@ Namespace Modelos
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {CveAlmacenDevolucion}").ToEntero
- Dim CveCuentaAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {CveAlmacenDevolucion}").ToEntero
+ 'Dim CveCuentaAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {CveAlmacenDevolucion}").ToEntero
Dim IdCtaContable As Integer = 0
Dim CveCuenta As Integer = 0
If tmpCostos.Rows.Count > 0 Then
@@ -4668,7 +4668,7 @@ Namespace Modelos
cont += 1
Next
- If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, True, -1 * TotalCosto, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimientoDevolucion, CveSubProyecto:=ObjFactura.CveSubProyecto, ImporteMX:=-1 * TotalCosto, CveCuenta:=CveCuentaAlmacen) Then
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, True, -1 * TotalCosto, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimientoDevolucion, CveSubProyecto:=ObjFactura.CveSubProyecto, ImporteMX:=-1 * TotalCosto) Then
ErrorCancelar = True
End If
diff --git a/Bancos/CuentasBancariasDetalle.aspx.vb b/Bancos/CuentasBancariasDetalle.aspx.vb
index 2b4c1f02f..656a2aa10 100644
--- a/Bancos/CuentasBancariasDetalle.aspx.vb
+++ b/Bancos/CuentasBancariasDetalle.aspx.vb
@@ -41,9 +41,8 @@ Partial Class Bancos_CuentasBancariasDetalle
ViewState("CveCuenta") = Request("CveCuenta")
- If UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC Then
- trCuentaContable.Visible = True
- trCuentaContableComplementaria.Visible = True
+ If UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC Then
+
CargaCuentasContables()
End If
@@ -60,9 +59,8 @@ Partial Class Bancos_CuentasBancariasDetalle
ViewState("CveCuenta") = -1
BtnEliminar.Visible = False
CreaDTUsuarios()
- If UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC Then
- trCuentaContable.Visible = True
- trCuentaContableComplementaria.Visible = True
+ If UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC Then
+
CargaCuentasContables()
End If
'LbAgregarSucursal.Enabled = False
@@ -98,37 +96,69 @@ Partial Class Bancos_CuentasBancariasDetalle
DdlMoneda.DataSource = GlobalDTMonedas
DdlMoneda.DataBind()
End Sub
- Private Sub CargaCuentasContables()
- Dim IdPadre As Integer
- Dim Conta As New ClsContPAQi(UsuarioActual.Empresa)
-
- If DdlTipoCuenta.SelectedValue.ToEntero = 1 Then 'Caja Chica
- IdPadre = UsuarioActual.Empresa.Funcionalidad(218).ToEntero
- Else
- Dim tesstr = UsuarioActual.Empresa.Funcionalidad(209)
- IdPadre = UsuarioActual.Empresa.Funcionalidad(209).ToEntero
- End If
-
- If IdPadre = 0 Then IdPadre = -1
+ Private Sub CargaCuentasContables()
Dim dt As DataTable = Nothing
- If Conta.GetCuentasRecursiva(IdPadre, 1) Then
- dt = Conta.DtResultados
- End If
- Conta.Dispose()
- DDlCuentaContable.DataSource = dt
- DDlCuentaContable.DataBind()
- DDlCuentaContable.Items.Insert(0, New ListItem("-", "-1"))
- DdlCuentaContableComplementaria.DataSource = dt
- DdlCuentaContableComplementaria.DataBind()
- DdlCuentaContableComplementaria.Items.Insert(0, New ListItem("-", "-1"))
- If dt IsNot Nothing Then dt.Dispose()
- End Sub
+ If UsuarioActual.Empresa.TipoContabilizacion = 1 Then
+ Using ObjContabilidad As New ClsContabilidad
+ 'UsuarioActual.Empresa.Funcionalidad(208).ToEntero
+ If ObjContabilidad.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then
+ DDlCuentaContable.DataSource = ObjContabilidad.DtResultados
+ DDlCuentaContable.DataBind()
+ DDlCuentaContable.Items.Insert(0, New ListItem("Selecione", "-1"))
+ DDlCuentaContable.DataTextField = "Cuenta"
+ DDlCuentaContable.DataValueField = "CveCuenta"
+ End If
+ End Using
+
+ DDlCuentaContable.DataSource = dt
+ DDlCuentaContable.DataBind()
+ DDlCuentaContable.Items.Insert(0, New ListItem("-", "-1"))
+ DdlCuentaContableComplementaria.DataSource = dt
+ DdlCuentaContableComplementaria.DataBind()
+ DdlCuentaContableComplementaria.Items.Insert(0, New ListItem("-", "-1"))
+ If dt IsNot Nothing Then dt.Dispose()
+ trCuentaContable.Visible = True
+ trCuentaContableComplementaria.Visible = True
+
+ Else
+ If UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC Then
+ Dim IdPadre As Integer
+ Dim Conta As New ClsContPAQi(UsuarioActual.Empresa)
+
+ If DdlTipoCuenta.SelectedValue.ToEntero = 1 Then 'Caja Chica
+ IdPadre = UsuarioActual.Empresa.Funcionalidad(218).ToEntero
+ Else
+ Dim tesstr = UsuarioActual.Empresa.Funcionalidad(209)
+ IdPadre = UsuarioActual.Empresa.Funcionalidad(209).ToEntero
+ End If
+
+ If IdPadre = 0 Then IdPadre = -1
+
+ If Conta.GetCuentasRecursiva(IdPadre, 1) Then
+ dt = Conta.DtResultados
+ End If
+
+ Conta.Dispose()
+ DDlCuentaContable.DataSource = dt
+ DDlCuentaContable.DataBind()
+ DDlCuentaContable.Items.Insert(0, New ListItem("-", "-1"))
+ DdlCuentaContableComplementaria.DataSource = dt
+ DdlCuentaContableComplementaria.DataBind()
+ DdlCuentaContableComplementaria.Items.Insert(0, New ListItem("-", "-1"))
+ If dt IsNot Nothing Then dt.Dispose()
+ trCuentaContable.Visible = True
+ trCuentaContableComplementaria.Visible = True
+ End If
+ End If
+
+
+ End Sub
#End Region
-
+
#End Region
-
-
+
+
#Region " CARGA DATOS "
Private Sub CargaDatos()
Dim ObjCuentasBancariasDetalle As New ClsBancos()
@@ -164,8 +194,14 @@ Partial Class Bancos_CuentasBancariasDetalle
DdlTipoCuenta.SelectedValue = ObjCuentasBancariasDetalle.CveTipoCuenta.ToString
DdlTipoCuenta_SelectedIndexChanged(DdlTipoCuenta, EventArgs.Empty)
- DDlCuentaContable.SelectedValueExist(ObjCuentasBancariasDetalle.IdCtaContable.ToString)
- DdlCuentaContableComplementaria.SelectedValueExist(ObjCuentasBancariasDetalle.IdCtaContableComplementaria.ToString)
+ If UsuarioActual.Empresa.TipoContabilizacion = 1 Then
+ DDlCuentaContable.SelectedValueExist(ObjCuentasBancariasDetalle.CveCuentaConta.ToString)
+ DdlCuentaContableComplementaria.SelectedValueExist(ObjCuentasBancariasDetalle.CveCuentaContaComplementaria.ToString)
+ Else
+ DDlCuentaContable.SelectedValueExist(ObjCuentasBancariasDetalle.IdCtaContable.ToString)
+ DdlCuentaContableComplementaria.SelectedValueExist(ObjCuentasBancariasDetalle.IdCtaContableComplementaria.ToString)
+ End If
+
Else
Alert("El Banco Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
BtnGuardar.Enabled = False
diff --git a/Bancos/FluctuacionCambiaria.aspx b/Bancos/FluctuacionCambiaria.aspx
index 56c76c41c..93673c3d1 100644
--- a/Bancos/FluctuacionCambiaria.aspx
+++ b/Bancos/FluctuacionCambiaria.aspx
@@ -333,7 +333,7 @@