-- cambios en contabilidad

This commit is contained in:
rrene
2020-10-10 17:50:41 -07:00
parent cc27df9490
commit c92fb2fdd7
3 changed files with 208 additions and 203 deletions

View File

@@ -2183,13 +2183,14 @@ Public Class ClsCompras
#Region " ESTATUS ALMACEN " #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 Dim Retorno As Boolean = False
DataAdapter("PA_Comp_ComprasEstatusAlmacenUpdate") DataAdapter("PA_Comp_ComprasEstatusAlmacenUpdate")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra .Add("@CveCompra", SqlDbType.Int).Value = CveCompra
.Add("@Estatus", SqlDbType.Int).Value = ValorEstatus .Add("@Estatus", SqlDbType.Int).Value = ValorEstatus
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With End With
Try Try
@@ -2201,13 +2202,14 @@ Public Class ClsCompras
Return Retorno Return Retorno
End Function 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 Dim Retorno As Boolean = False
DataAdapter("PA_Comp_ComprasDetalleEstatusAlmacenUpdate") DataAdapter("PA_Comp_ComprasDetalleEstatusAlmacenUpdate")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveCompraDetalle", SqlDbType.Int).Value = CveCompraDetalle .Add("@CveCompraDetalle", SqlDbType.Int).Value = CveCompraDetalle
.Add("@Estatus", SqlDbType.Int).Value = ValorEstatus .Add("@Estatus", SqlDbType.Int).Value = ValorEstatus
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With End With
Try Try

View File

@@ -153,22 +153,22 @@ Public Class ClsContabilidad
Public Function CuentasContablesSigGet(cveEmpresa As Int32) As Boolean 'Public Function CuentasContablesSigGet(cveEmpresa As Int32) As Boolean
Dim retorno As Boolean = False ' Dim retorno As Boolean = False
DataAdapter("PA_Conta_CuentasContablesSigGet", CommandType.StoredProcedure) ' DataAdapter("PA_Conta_CuentasContablesSigGet", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters ' With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa ' .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa
End With ' End With
Try ' Try
SqlAdapter.Fill(Data) ' SqlAdapter.Fill(Data)
retorno = True ' retorno = True
Catch ex1 As SqlException ' Catch ex1 As SqlException
OnError("Ocurrió un error al obtener las Cuentas Contables", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) ' OnError("Ocurrió un error al obtener las Cuentas Contables", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
Catch ex As Exception ' Catch ex As Exception
OnError("Ocurrió un error al obtener las Cuentas Contables", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) ' OnError("Ocurrió un error al obtener las Cuentas Contables", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try ' End Try
Return retorno ' Return retorno
End Function 'End Function
#Region " C O N T A B I L I D A D - P R E P O L I Z A" #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 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 = "", 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 Optional ObjConta As ClsContPAQi = Nothing, Optional pIDPoliza As Integer = -1) As Boolean
Dim StrLog As New StringBuilder
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
StrLog.AppendFormat("CvePrep:{0} - Inicio", CvePrePoliza)
If Empresa.TipoContabilizacion = 1 Then ' contabilidad en SIG If Empresa.TipoContabilizacion = 1 Then ' contabilidad en SIG
@@ -1396,6 +1397,8 @@ Public Class ClsContabilidad
If Not ContaCompartida Then ObjConta.Dispose() If Not ContaCompartida Then ObjConta.Dispose()
End If End If
StrLog.AppendFormat(" - Fin")
StrLog.ToString.GuardaLogAD("LogContabilidazacion")
Return Retorno Return Retorno
End Function End Function
@@ -4645,25 +4648,25 @@ Public Class ClsContabilidad
Return Retorno Return Retorno
End Function End Function
Public Function GetSaldoCuenta(IdCuenta As Integer, TipoMovto As Integer, Ejercicio As Integer) As Boolean 'Public Function GetSaldoCuenta(IdCuenta As Integer, TipoMovto As Integer, Ejercicio As Integer) As Boolean
Dim Retorno As Boolean ' Dim Retorno As Boolean
If TipoMovto = 0 Then ' 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) ' 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 ' 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) ' 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 ' End If
Try ' Try
SqlAdapter.Fill(Data) ' SqlAdapter.Fill(Data)
'Retorno = Math.Round(SqlCommand.ExecuteScalar.ToString.ToDouble, 2) ' 'Retorno = Math.Round(SqlCommand.ExecuteScalar.ToString.ToDouble, 2)
Retorno = True ' Retorno = True
Catch ex As Exception ' Catch ex As Exception
Me.OnError("Ocurrió un error al obtener eL saldo de la cuenta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) ' Me.OnError("Ocurrió un error al obtener eL saldo de la cuenta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try ' End Try
Return Retorno ' Return Retorno
End Function '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 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 Dim Retorno As Boolean = False
DataAdapter("PA_PresupuestosEgresosSaldosRep") DataAdapter("PA_PresupuestosEgresosSaldosRep")
@@ -4742,138 +4745,138 @@ Public Class ClsContabilidad
Return Retorno Return Retorno
End Function End Function
Public Function Conta_ContabilizaPrePoliza(CvePrepoliza As Integer, Ejercicio As Integer) As Boolean 'Public Function Conta_ContabilizaPrePoliza(CvePrepoliza As Integer, Ejercicio As Integer) As Boolean
Dim Retorno = False ' Dim Retorno = False
DataAdapter("PA_Conta_ContabilizaPrepolizas") ' DataAdapter("PA_Conta_ContabilizaPrepolizas")
With SqlAdapter.SelectCommand.Parameters ' With SqlAdapter.SelectCommand.Parameters
.Add("@CvePrepoliza", SqlDbType.Int).Value = CvePrepoliza ' .Add("@CvePrepoliza", SqlDbType.Int).Value = CvePrepoliza
.Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio ' .Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio
.Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output ' .Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output
End With ' End With
Try ' Try
SqlAdapter.Fill(Data) ' SqlAdapter.Fill(Data)
If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero = 0 Then ' If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero = 0 Then
Retorno = True ' Retorno = True
Else ' Else
Retorno = False ' Retorno = False
End If ' End If
Catch ex As Exception ' Catch ex As Exception
Me.OnError("Ocurrió un error al contabilizar la prepoliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) ' Me.OnError("Ocurrió un error al contabilizar la prepoliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try ' End Try
Return Retorno ' Return Retorno
End Function 'End Function
Public Function Conta_CompactaPrePoliza(CvePrepoliza As Integer) As Boolean 'Public Function Conta_CompactaPrePoliza(CvePrepoliza As Integer) As Boolean
Dim Retorno = False ' Dim Retorno = False
DataAdapter("PA_Comp_CompactaPrepoliza") ' DataAdapter("PA_Comp_CompactaPrepoliza")
With SqlAdapter.SelectCommand.Parameters ' With SqlAdapter.SelectCommand.Parameters
.Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrepoliza ' .Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrepoliza
.Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output ' .Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output
End With ' End With
Try ' Try
SqlAdapter.Fill(Data) ' SqlAdapter.Fill(Data)
If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero = 0 Then ' If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero = 0 Then
Retorno = True ' Retorno = True
Else ' Else
Retorno = False ' Retorno = False
End If ' End If
Catch ex As Exception ' Catch ex As Exception
Me.OnError("Ocurrió un error al contabilizar la prepoliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) ' Me.OnError("Ocurrió un error al contabilizar la prepoliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try ' End Try
Return Retorno ' Return Retorno
End Function 'End Function
Public Function Conta_GeneraPptarias(CveCompra As Integer) As Boolean 'Public Function Conta_GeneraPptarias(CveCompra As Integer) As Boolean
Dim Retorno = False ' Dim Retorno = False
DataAdapter("PA_Conta_GeneraPptarias") ' DataAdapter("PA_Conta_GeneraPptarias")
With SqlAdapter.SelectCommand.Parameters ' With SqlAdapter.SelectCommand.Parameters
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra ' .Add("@CveCompra", SqlDbType.Int).Value = CveCompra
.Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output ' .Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output
End With ' End With
Try ' Try
SqlAdapter.Fill(Data) ' SqlAdapter.Fill(Data)
If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero = 0 Then ' If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero = 0 Then
Retorno = True ' Retorno = True
Else ' Else
Retorno = False ' Retorno = False
End If ' End If
Catch ex As Exception ' Catch ex As Exception
Me.OnError("Ocurrió un error al Generar las Cuentas Presupuestarias", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) ' Me.OnError("Ocurrió un error al Generar las Cuentas Presupuestarias", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try ' End Try
Return Retorno ' Return Retorno
End Function '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 '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 ' Dim Retorno As Integer = 0
DataAdapter("PA_Add_Conta_Polizas") ' DataAdapter("PA_Add_Conta_Polizas")
With SqlAdapter.SelectCommand.Parameters ' With SqlAdapter.SelectCommand.Parameters
.Add("@Folio", SqlDbType.Int).Value = Folio ' .Add("@Folio", SqlDbType.Int).Value = Folio
' .Add("@CveTipoPoliza", SqlDbType.Int).Value = CveTipoPoliza ' ' .Add("@CveTipoPoliza", SqlDbType.Int).Value = CveTipoPoliza
.Add("@Ejercicio", SqlDbType.Int).Value = CveEjercicio ' .Add("@Ejercicio", SqlDbType.Int).Value = CveEjercicio
.Add("@Concepto", SqlDbType.VarChar).Value = Concepto ' .Add("@Concepto", SqlDbType.VarChar).Value = Concepto
.Add("@FechaPoliza", SqlDbType.DateTime).Value = FechaPoliza ' .Add("@FechaPoliza", SqlDbType.DateTime).Value = FechaPoliza
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario ' .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CvePoliza", SqlDbType.Int).Direction = ParameterDirection.Output ' .Add("@CvePoliza", SqlDbType.Int).Direction = ParameterDirection.Output
End With ' End With
Try ' Try
SqlAdapter.Fill(Data) ' SqlAdapter.Fill(Data)
Retorno = SqlAdapter.SelectCommand.Parameters("@CvePoliza").Value.ToString.ToEntero ' Retorno = SqlAdapter.SelectCommand.Parameters("@CvePoliza").Value.ToString.ToEntero
Catch ex As Exception ' Catch ex As Exception
OnError("Ocurrió un error al agregar la poliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) ' OnError("Ocurrió un error al agregar la poliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try ' End Try
Return Retorno ' Return Retorno
End Function 'End Function
Public Function AddConta_PolizaDetalle(CvePoliza As Integer, CveCuenta As Integer, TipoMovto As Boolean, Importe As Double, Referencia As String, '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 ' Concepto As String, FechaMovto As Date, CveUsuario As Integer, Optional ImporteMonedaExtranjera As Double = 0) As Boolean
Dim Retorno As Boolean = False ' Dim Retorno As Boolean = False
If CvePoliza <= 0 Or CveCuenta <= 0 Then ' If CvePoliza <= 0 Or CveCuenta <= 0 Then
Return False ' Return False
End If ' End If
DataAdapter("PA_Add_Conta_PolizasDetalles") ' DataAdapter("PA_Add_Conta_PolizasDetalles")
'DataAdapter("PA_Conta_PolizasDetalleAdd") ' 'DataAdapter("PA_Conta_PolizasDetalleAdd")
With SqlAdapter.SelectCommand.Parameters ' With SqlAdapter.SelectCommand.Parameters
.Add("@CvePoliza", SqlDbType.Int).Value = CvePoliza ' .Add("@CvePoliza", SqlDbType.Int).Value = CvePoliza
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta ' .Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
.Add("@TipoMovto", SqlDbType.Int).Value = TipoMovto ' .Add("@TipoMovto", SqlDbType.Int).Value = TipoMovto
.Add("@Total", SqlDbType.Money).Value = Math.Round(Importe, 2) ' .Add("@Total", SqlDbType.Money).Value = Math.Round(Importe, 2)
.Add("@ImporteME", SqlDbType.Money).Value = ImporteMonedaExtranjera ' .Add("@ImporteME", SqlDbType.Money).Value = ImporteMonedaExtranjera
.Add("@Referencia", SqlDbType.VarChar).Value = Referencia ' .Add("@Referencia", SqlDbType.VarChar).Value = Referencia
.Add("@Concepto", SqlDbType.VarChar).Value = Concepto ' .Add("@Concepto", SqlDbType.VarChar).Value = Concepto
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario ' .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output ' .Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output
End With ' End With
Try ' Try
SqlAdapter.Fill(Data) ' SqlAdapter.Fill(Data)
If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero <> 0 Then ' If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero <> 0 Then
Retorno = False ' Retorno = False
Else ' Else
Retorno = True ' Retorno = True
End If ' End If
Catch ex As Exception ' Catch ex As Exception
OnError("Ocurrió un error al agregar el movimiento en la póliza.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) ' OnError("Ocurrió un error al agregar el movimiento en la póliza.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try ' End Try
Return Retorno ' Return Retorno
End Function 'End Function
Public Function GetSaldoCuentaAC(TipoMovto As Integer, CveCuentaAprobado As Integer, CveCuentaDevengado As Integer, Ejercicio As Integer) As Decimal Public Function GetSaldoCuentaAC(TipoMovto As Integer, CveCuentaAprobado As Integer, CveCuentaDevengado As Integer, Ejercicio As Integer) As Decimal
Dim Retorno As Decimal Dim Retorno As Decimal
DataAdapter("PA_Conta_CalculaSaldo") DataAdapter("PA_Conta_CalculaSaldo")
@@ -4895,51 +4898,51 @@ Public Class ClsContabilidad
Return Retorno Return Retorno
End Function End Function
Public Function GetSegmentosNegocio(Id As Integer, Codigo As String) As Boolean 'Public Function GetSegmentosNegocio(Id As Integer, Codigo As String) As Boolean
Dim Retorno As Boolean = False ' Dim Retorno As Boolean = False
Dim StrSQl = New StringBuilder ' Dim StrSQl = New StringBuilder
StrSQl.Clear() ' StrSQl.Clear()
StrSQl.Append(" SELECT Id, RTRIM (LTRIM (Codigo)) AS Codigo, Nombre, '' AS CveProyecto, '' AS CveSubProyecto ") ' StrSQl.Append(" SELECT Id, RTRIM (LTRIM (Codigo)) AS Codigo, Nombre, '' AS CveProyecto, '' AS CveSubProyecto ")
StrSQl.Append(" FROM SegmentosNegocio ") ' StrSQl.Append(" FROM SegmentosNegocio ")
StrSQl.Append(" WHERE (@Id = -1 OR Id = @Id) ") ' StrSQl.Append(" WHERE (@Id = -1 OR Id = @Id) ")
StrSQl.Append(" AND (@Codigo = '-1' OR Codigo = @Codigo) ") ' StrSQl.Append(" AND (@Codigo = '-1' OR Codigo = @Codigo) ")
DataAdapter(StrSQl.ToString, CommandType.Text) ' DataAdapter(StrSQl.ToString, CommandType.Text)
SqlAdapter.SelectCommand.Parameters.Add("@Id", SqlDbType.Int).Value = Id ' SqlAdapter.SelectCommand.Parameters.Add("@Id", SqlDbType.Int).Value = Id
SqlAdapter.SelectCommand.Parameters.Add("@Codigo", SqlDbType.VarChar).Value = Codigo ' SqlAdapter.SelectCommand.Parameters.Add("@Codigo", SqlDbType.VarChar).Value = Codigo
Try ' Try
SqlAdapter.Fill(Data) ' SqlAdapter.Fill(Data)
Retorno = True ' Retorno = True
Catch ex As Exception ' Catch ex As Exception
OnError("Ocurrió un error al consultar los Segmentos de Negocio.", ex) ' OnError("Ocurrió un error al consultar los Segmentos de Negocio.", ex)
End Try ' End Try
Return Retorno ' Return Retorno
End Function 'End Function
Public Function GetSubProyectos(CveEmpresa As Integer) As Boolean 'Public Function GetSubProyectos(CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False ' Dim Retorno As Boolean = False
Dim StrSQl = New StringBuilder ' Dim StrSQl = New StringBuilder
DataAdapter("PA_Comp_Compras_Pptarias") ' DataAdapter("PA_Comp_Compras_Pptarias")
With SqlAdapter.SelectCommand.Parameters ' With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With ' End With
SqlAdapter.Fill(Data) ' SqlAdapter.Fill(Data)
Retorno = True ' Retorno = True
Try ' Try
SqlAdapter.Fill(Data) ' SqlAdapter.Fill(Data)
Retorno = True ' Retorno = True
Catch ex As Exception ' Catch ex As Exception
OnError("Ocurrió un error al consultar los Segmentos de Negocio.", ex) ' OnError("Ocurrió un error al consultar los Segmentos de Negocio.", ex)
End Try ' End Try
Return Retorno ' Return Retorno
End Function 'End Function
Public Function GetNumeroPoliza(CveTipoPoliza As Integer, Tipo As String, Fecha As DateTime, CveEmpresa As Integer) As Boolean Public Function GetNumeroPoliza(CveTipoPoliza As Integer, Tipo As String, Fecha As DateTime, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
@@ -4962,29 +4965,29 @@ Public Class ClsContabilidad
Return Retorno Return Retorno
End Function 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 ' With SqlAdapter.SelectCommand.Parameters
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra ' .Add("@CveCompra", SqlDbType.Int).Value = CveCompra
.Add("@Importe", SqlDbType.Decimal).Value = Importe ' .Add("@Importe", SqlDbType.Decimal).Value = Importe
.Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable ' .Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable
End With ' End With
Try ' Try
SqlAdapter.Fill(Data) ' SqlAdapter.Fill(Data)
Retorno = True ' Retorno = True
Catch ex1 As SqlException ' Catch ex1 As SqlException
OnError("Ocurrió un error al obtener las Plantillas", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) ' OnError("Ocurrió un error al obtener las Plantillas", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
Catch ex As Exception ' Catch ex As Exception
OnError("Ocurrió un error al obtener las Plantillas", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) ' OnError("Ocurrió un error al obtener las Plantillas", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try ' End Try
Return Retorno ' Return Retorno
End Function 'End Function
#End Region #End Region
#Region "FIS IMPUESTOS" #Region "FIS IMPUESTOS"
@@ -5878,7 +5881,7 @@ Public Class ClsContabilidad
End Function End Function
Public Function GetPrePolizasImpresion(CveEmpresa As Integer, FechaI As String, FechaF As String, Optional CveTipoPoliza As Integer = -1, Optional FolioI As Integer = -1, 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 Optional CveCuenta As Integer = -1, Optional CvePlantillaPoliza As Integer = -1, Optional CveProveedor As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
@@ -5892,7 +5895,7 @@ Public Class ClsContabilidad
.Add("@FolioI", SqlDbType.Int).Value = FolioI .Add("@FolioI", SqlDbType.Int).Value = FolioI
.Add("@FolioF", SqlDbType.Int).Value = FolioF .Add("@FolioF", SqlDbType.Int).Value = FolioF
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .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("@CveCuenta", SqlDbType.Int).Value = CveCuenta
.Add("@CvePlantillaPoliza", SqlDbType.Int).Value = CvePlantillaPoliza .Add("@CvePlantillaPoliza", SqlDbType.Int).Value = CvePlantillaPoliza
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor

View File

@@ -4631,7 +4631,7 @@ Namespace Modelos
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"}) Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {CveAlmacenDevolucion}").ToEntero 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 IdCtaContable As Integer = 0
Dim CveCuenta As Integer = 0 Dim CveCuenta As Integer = 0
If tmpCostos.Rows.Count > 0 Then If tmpCostos.Rows.Count > 0 Then
@@ -4668,7 +4668,7 @@ Namespace Modelos
cont += 1 cont += 1
Next 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 ErrorCancelar = True
End If End If