|
|
|
|
@@ -19,13 +19,13 @@ Public Class ClsCompras
|
|
|
|
|
Private StrSQL As StringBuilder
|
|
|
|
|
|
|
|
|
|
'Atributos de la clase
|
|
|
|
|
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
|
|
|
|
|
'REGISTRAR CONEXIONES ABIERTAS
|
|
|
|
|
Private CveConexion As Integer = 0
|
|
|
|
|
Private EsTransaccionCompartida As Boolean = False
|
|
|
|
|
|
|
|
|
|
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
|
|
|
|
|
'REGISTRAR CONEXIONES ABIERTAS
|
|
|
|
|
Private CveConexion As Integer = 0
|
|
|
|
|
Private EsTransaccionCompartida As Boolean = False
|
|
|
|
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Region "Propiedades"
|
|
|
|
|
Public ReadOnly Property DtResultados() As DataTable
|
|
|
|
|
Get
|
|
|
|
|
@@ -60,12 +60,12 @@ Public Class ClsCompras
|
|
|
|
|
SqlConexion.Open()
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex)
|
|
|
|
|
End Try
|
|
|
|
|
End Try
|
|
|
|
|
Else
|
|
|
|
|
SqlConexion = TransaccionCompartida.Connection
|
|
|
|
|
SqlTransacc = TransaccionCompartida
|
|
|
|
|
SqlTransacc = TransaccionCompartida
|
|
|
|
|
EsTransaccionCompartida = True
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
SqlAdapter = New SqlDataAdapter("", SqlConexion)
|
|
|
|
|
ConexionAdd()
|
|
|
|
|
@@ -80,18 +80,18 @@ Public Class ClsCompras
|
|
|
|
|
End With
|
|
|
|
|
Data = New DataTable
|
|
|
|
|
If SqlTransacc IsNot Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
#Region "Conexiones"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Private Sub ConexionAdd()
|
|
|
|
|
If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
|
|
|
|
|
Try
|
|
|
|
|
DataAdapter("PA_Sis_RegistrarConexion")
|
|
|
|
|
With SqlAdapter.SelectCommand.Parameters
|
|
|
|
|
.Add("@Clase", SqlDbType.VarChar).Value = Me.GetType().Name
|
|
|
|
|
.Add("@Modulo", SqlDbType.VarChar).Value = String.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString, HttpContext.Current.Request.QueryString.ToString)
|
|
|
|
|
.Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output
|
|
|
|
|
Try
|
|
|
|
|
DataAdapter("PA_Sis_RegistrarConexion")
|
|
|
|
|
With SqlAdapter.SelectCommand.Parameters
|
|
|
|
|
.Add("@Clase", SqlDbType.VarChar).Value = Me.GetType().Name
|
|
|
|
|
.Add("@Modulo", SqlDbType.VarChar).Value = String.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString, HttpContext.Current.Request.QueryString.ToString)
|
|
|
|
|
.Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output
|
|
|
|
|
End With
|
|
|
|
|
SqlAdapter.Fill(Data)
|
|
|
|
|
CveConexion = SqlAdapter.SelectCommand.Parameters("@IDConexion").Value.ToString.ToEntero
|
|
|
|
|
@@ -116,9 +116,9 @@ Public Class ClsCompras
|
|
|
|
|
CveConexion = 0
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
End Sub
|
|
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Public Function GetCompras(CveCompra As Integer, Serie As String, Folio As String, CveProveedor As Integer, IdPoliza As Integer, CveEmpresa As Integer, Optional ProveedorRFC As String = "-1") As Boolean
|
|
|
|
|
Dim Retorno As Boolean = False
|
|
|
|
|
DataAdapter("PA_Comp_ComprasGet")
|
|
|
|
|
@@ -143,7 +143,7 @@ Public Class ClsCompras
|
|
|
|
|
|
|
|
|
|
Return Retorno
|
|
|
|
|
End Function
|
|
|
|
|
Public Function GetCompras(CveEmpresa As Integer, TipoDocto As String, Folio As String, FolioFiscal As String, Codigo As String, Proveedor As String, FechaI As String,
|
|
|
|
|
Public Function GetCompras(CveEmpresa As Integer, TipoDocto As String, Folio As String, FolioFiscal As String, Codigo As String, Proveedor As String, FechaI As String,
|
|
|
|
|
FechaF As String, Descripcion As String, Observaciones As String, Optional CveProveedor As Integer = -1, Optional TopSelect As Integer = 10000) As Boolean
|
|
|
|
|
Dim Retorno As Boolean = False
|
|
|
|
|
DataAdapter("PA_Comp_ComprasGetBuscar")
|
|
|
|
|
@@ -199,8 +199,8 @@ Public Class ClsCompras
|
|
|
|
|
|
|
|
|
|
Dim Retorno As Boolean = False
|
|
|
|
|
|
|
|
|
|
DataAdapter("PA_Comp_CompraAdd")
|
|
|
|
|
|
|
|
|
|
DataAdapter("PA_Comp_CompraAdd")
|
|
|
|
|
|
|
|
|
|
With SqlAdapter.SelectCommand.Parameters
|
|
|
|
|
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
|
|
|
|
|
.Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion
|
|
|
|
|
@@ -588,10 +588,10 @@ Public Class ClsCompras
|
|
|
|
|
End If
|
|
|
|
|
Catch ex As SqlException
|
|
|
|
|
If ex.Message.Contains("FK_Inv_MovimientosDetalle_Inv_MovimientosDetalleEntrada") Then
|
|
|
|
|
Alert(String.Format("No se puede eliminar la compra, porque tiene movimientos de salida de Almacen relacionados."), TipoMensaje.MsgAdvertencia)
|
|
|
|
|
|
|
|
|
|
ElseIf ex.Message.Contains("50015") Then
|
|
|
|
|
Alert("No se puede eliminar na compra debido a que el perido esta cerrado.", TipoMensaje.MsgAdvertencia)
|
|
|
|
|
Alert(String.Format("No se puede eliminar la compra, porque tiene movimientos de salida de Almacen relacionados."), TipoMensaje.MsgAdvertencia)
|
|
|
|
|
|
|
|
|
|
ElseIf ex.Message.Contains("50015") Then
|
|
|
|
|
Alert("No se puede eliminar na compra debido a que el perido esta cerrado.", TipoMensaje.MsgAdvertencia)
|
|
|
|
|
Else
|
|
|
|
|
Me.OnError("Ocurrió un error al eliminar la Compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
|
|
|
|
End If
|
|
|
|
|
@@ -1765,11 +1765,11 @@ Public Class ClsCompras
|
|
|
|
|
SqlAdapter.Fill(Data)
|
|
|
|
|
OnError = True
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
If ex.Message.Contains("Desbordamiento de SqlDateTime. Debe estar entre 1/1/1753 12:00:00 AM y 12/31/9999 11:59:59 PM.") Then
|
|
|
|
|
Alert("Fechas fuera de rango, debe estar entre 1/1/1753 12:00:00 AM y 12/31/9999 11:59:59 PM", TipoMensaje.MsgAdvertencia)
|
|
|
|
|
Else
|
|
|
|
|
If ex.Message.Contains("Desbordamiento de SqlDateTime. Debe estar entre 1/1/1753 12:00:00 AM y 12/31/9999 11:59:59 PM.") Then
|
|
|
|
|
Alert("Fechas fuera de rango, debe estar entre 1/1/1753 12:00:00 AM y 12/31/9999 11:59:59 PM", TipoMensaje.MsgAdvertencia)
|
|
|
|
|
Else
|
|
|
|
|
Me.OnError("Ocurrió un error al obtener la bitácora.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
End Try
|
|
|
|
|
|
|
|
|
|
Return OnError
|
|
|
|
|
@@ -2218,10 +2218,10 @@ Public Class ClsCompras
|
|
|
|
|
End Try
|
|
|
|
|
|
|
|
|
|
Return Retorno
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Region " DEVOLUCIONES COMPRAS - IPP FEBRERO 2018 "
|
|
|
|
|
Public Function ComprasDetalleDevolucionesAdd(CveCompraDetalle As Integer, CveCompraNC As Integer, Cantidad As Double, CveEmpresa As Integer) As Boolean
|
|
|
|
|
Dim Retorno As Boolean = False
|
|
|
|
|
@@ -2242,11 +2242,11 @@ Public Class ClsCompras
|
|
|
|
|
End Try
|
|
|
|
|
|
|
|
|
|
Return Retorno
|
|
|
|
|
End Function
|
|
|
|
|
End Function
|
|
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Region "TIPOS DE GASTOS"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Public Function GetTipoGasto(CveTipoGasto As Integer, CveEmpresa As Integer) As Boolean
|
|
|
|
|
Dim Retorno As Boolean = False
|
|
|
|
|
DataAdapter("PA_Comp_TiposGastosGet")
|
|
|
|
|
@@ -2264,17 +2264,17 @@ Public Class ClsCompras
|
|
|
|
|
End Try
|
|
|
|
|
|
|
|
|
|
Return Retorno
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
Public Function AddTipoGasto(TipoGasto As String, Estatus As Boolean, FechaIng As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
|
|
|
|
Dim Retorno As Boolean = False
|
|
|
|
|
DataAdapter("PA_Comp_TiposGastosAdd")
|
|
|
|
|
|
|
|
|
|
With SqlAdapter.SelectCommand.Parameters
|
|
|
|
|
.Add("@TipoGasto", SqlDbType.NVarChar).Value = TipoGasto
|
|
|
|
|
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
|
|
|
|
|
.Add("@FechaIng", SqlDbType.DateTime).Value = FechaIng
|
|
|
|
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
|
|
|
|
.Add("@TipoGasto", SqlDbType.NVarChar).Value = TipoGasto
|
|
|
|
|
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
|
|
|
|
|
.Add("@FechaIng", SqlDbType.DateTime).Value = FechaIng
|
|
|
|
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
|
|
|
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
|
|
|
|
End With
|
|
|
|
|
|
|
|
|
|
@@ -2286,17 +2286,17 @@ Public Class ClsCompras
|
|
|
|
|
End Try
|
|
|
|
|
|
|
|
|
|
Return Retorno
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
Public Function UpdateTipoGasto(CveTipoGasto As Integer, TipoGasto As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
|
|
|
|
Dim Retorno As Boolean = False
|
|
|
|
|
DataAdapter("PA_Comp_TiposGastosUpdate")
|
|
|
|
|
|
|
|
|
|
With SqlAdapter.SelectCommand.Parameters
|
|
|
|
|
.Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto
|
|
|
|
|
.Add("@TipoGasto", SqlDbType.NVarChar).Value = TipoGasto
|
|
|
|
|
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
|
|
|
|
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
|
|
|
|
.Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto
|
|
|
|
|
.Add("@TipoGasto", SqlDbType.NVarChar).Value = TipoGasto
|
|
|
|
|
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
|
|
|
|
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
|
|
|
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
|
|
|
|
End With
|
|
|
|
|
|
|
|
|
|
@@ -2308,8 +2308,8 @@ Public Class ClsCompras
|
|
|
|
|
End Try
|
|
|
|
|
|
|
|
|
|
Return Retorno
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
Public Function RemoveTipoGasto(CveTipoGasto As Integer) As Boolean
|
|
|
|
|
Dim Retorno As Boolean = False
|
|
|
|
|
DataAdapter("PA_Comp_TiposGastosRemove")
|
|
|
|
|
@@ -2326,51 +2326,51 @@ Public Class ClsCompras
|
|
|
|
|
End Try
|
|
|
|
|
|
|
|
|
|
Return Retorno
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Region "VINCULAR PAGO"
|
|
|
|
|
'Public Function GetVincularPago(CveProveedor As Integer, CveCompra As Integer, Tipo As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Optional CveTipoProveedor As Integer = -1) As Boolean
|
|
|
|
|
' Dim Retorno As Boolean = False
|
|
|
|
|
' DataAdapter("PA_Comp_VincularPagoGet")
|
|
|
|
|
' With SqlAdapter.SelectCommand.Parameters
|
|
|
|
|
' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
|
|
|
|
|
' .Add("@CveCompra", SqlDbType.Int).Value = CveCompra
|
|
|
|
|
' .Add("@Tipo", SqlDbType.Int).Value = Tipo
|
|
|
|
|
' .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
|
|
|
|
|
' .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
|
|
|
|
|
' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
|
|
|
|
' .Add("@CveTipoProveedor", SqlDbType.Int).Value = CveTipoProveedor
|
|
|
|
|
' End With
|
|
|
|
|
' Try
|
|
|
|
|
' SqlAdapter.Fill(Data)
|
|
|
|
|
' Retorno = True
|
|
|
|
|
' Catch ex As Exception
|
|
|
|
|
' OnError("Ocurrió un error al obtener los pagos a vincular.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
|
|
|
|
' End Try
|
|
|
|
|
' Return Retorno
|
|
|
|
|
'End Function
|
|
|
|
|
|
|
|
|
|
'Public Function GetVincularPago(CveProveedor As Integer, Monto As Decimal, XMLPagos As String, CveEmpresa As Integer) As Boolean
|
|
|
|
|
' Dim Retorno As Boolean = False
|
|
|
|
|
' DataAdapter("PA_Comp_VincularComplementoPagoGet")
|
|
|
|
|
' With SqlAdapter.SelectCommand.Parameters
|
|
|
|
|
' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
|
|
|
|
|
' .Add("@Monto", SqlDbType.Float).Value = Monto
|
|
|
|
|
' .Add("@XMLPagos", SqlDbType.Xml).Value = XMLPagos
|
|
|
|
|
' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
|
|
|
|
' End With
|
|
|
|
|
' Try
|
|
|
|
|
' SqlAdapter.Fill(Data)
|
|
|
|
|
' Retorno = True
|
|
|
|
|
' Catch ex As Exception
|
|
|
|
|
' OnError("Ocurrió un error al obtener la vinculación de complemento de pago.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
|
|
|
|
' End Try
|
|
|
|
|
' Return Retorno
|
|
|
|
|
'End Function
|
|
|
|
|
|
|
|
|
|
'Public Function GetVincularPago(CveProveedor As Integer, CveCompra As Integer, Tipo As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Optional CveTipoProveedor As Integer = -1) As Boolean
|
|
|
|
|
' Dim Retorno As Boolean = False
|
|
|
|
|
' DataAdapter("PA_Comp_VincularPagoGet")
|
|
|
|
|
' With SqlAdapter.SelectCommand.Parameters
|
|
|
|
|
' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
|
|
|
|
|
' .Add("@CveCompra", SqlDbType.Int).Value = CveCompra
|
|
|
|
|
' .Add("@Tipo", SqlDbType.Int).Value = Tipo
|
|
|
|
|
' .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
|
|
|
|
|
' .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
|
|
|
|
|
' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
|
|
|
|
' .Add("@CveTipoProveedor", SqlDbType.Int).Value = CveTipoProveedor
|
|
|
|
|
' End With
|
|
|
|
|
' Try
|
|
|
|
|
' SqlAdapter.Fill(Data)
|
|
|
|
|
' Retorno = True
|
|
|
|
|
' Catch ex As Exception
|
|
|
|
|
' OnError("Ocurrió un error al obtener los pagos a vincular.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
|
|
|
|
' End Try
|
|
|
|
|
' Return Retorno
|
|
|
|
|
'End Function
|
|
|
|
|
|
|
|
|
|
'Public Function GetVincularPago(CveProveedor As Integer, Monto As Decimal, XMLPagos As String, CveEmpresa As Integer) As Boolean
|
|
|
|
|
' Dim Retorno As Boolean = False
|
|
|
|
|
' DataAdapter("PA_Comp_VincularComplementoPagoGet")
|
|
|
|
|
' With SqlAdapter.SelectCommand.Parameters
|
|
|
|
|
' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
|
|
|
|
|
' .Add("@Monto", SqlDbType.Float).Value = Monto
|
|
|
|
|
' .Add("@XMLPagos", SqlDbType.Xml).Value = XMLPagos
|
|
|
|
|
' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
|
|
|
|
' End With
|
|
|
|
|
' Try
|
|
|
|
|
' SqlAdapter.Fill(Data)
|
|
|
|
|
' Retorno = True
|
|
|
|
|
' Catch ex As Exception
|
|
|
|
|
' OnError("Ocurrió un error al obtener la vinculación de complemento de pago.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
|
|
|
|
' End Try
|
|
|
|
|
' Return Retorno
|
|
|
|
|
'End Function
|
|
|
|
|
|
|
|
|
|
Public Function AddComplementoPago(CveIE As Integer, CveCompra As Integer, Importe As Decimal, CvePrePolizaDetalle As Integer, CveFactura As Integer) As Integer
|
|
|
|
|
Dim Retorno As Integer = 0
|
|
|
|
|
DataAdapter("PA_Comp_ComplementoPagoAdd")
|
|
|
|
|
@@ -3003,8 +3003,8 @@ Public Class ClsCompras
|
|
|
|
|
OnError("Ocurrió un error al obtener el reporte de anticipos - nc - exc detalle .", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
|
|
|
|
End Try
|
|
|
|
|
Return Retorno
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
#End Region
|
|
|
|
|
Public Function GetCxPProgramado(CveCompra As Integer, CveEmpresa As Integer) As Boolean
|
|
|
|
|
Dim Retorno As Boolean = False
|
|
|
|
|
@@ -3020,8 +3020,8 @@ Public Class ClsCompras
|
|
|
|
|
OnError("Ocurrió un error al obtener la información de la compra programada.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
|
|
|
|
End Try
|
|
|
|
|
Return Retorno
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
Public Function GetCancelarNC(CveCompra As Integer, CveEmpresa As Integer) As Boolean
|
|
|
|
|
Dim Retorno As Boolean = False
|
|
|
|
|
DataAdapter("PA_Conta_CancelarNCGet")
|
|
|
|
|
@@ -3036,79 +3036,79 @@ Public Class ClsCompras
|
|
|
|
|
OnError("Ocurrió un error al obtener los datos para cancelar la nc.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
|
|
|
|
End Try
|
|
|
|
|
Return Retorno
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
Public Function UpdateFechaVencimientoCompra(CveCompra As Integer, FechaVencimiento As Date, CveEmpresa As Integer) As Boolean
|
|
|
|
|
Dim Retorno As Boolean = False
|
|
|
|
|
DataAdapter("PA_Comp_ComprasFechaVencimientoUpdate")
|
|
|
|
|
With SqlAdapter.SelectCommand.Parameters
|
|
|
|
|
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
|
|
|
|
|
.Add("@FechaVencimiento", SqlDbType.Date).Value = FechaVencimiento
|
|
|
|
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
|
|
|
|
End With
|
|
|
|
|
Try
|
|
|
|
|
SqlAdapter.Fill(Data)
|
|
|
|
|
Retorno = True
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
OnError("Ocurrió un error al actualizar la fecha de vencimiento de la compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
|
|
|
|
End Try
|
|
|
|
|
Return Retorno
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
Public Function GetRepEvaluacionesProveedores(CveEmpresa As Integer, CveProveedor As Integer, FechaI As Date, FechaF As Date, Evaluado As Integer) As Boolean
|
|
|
|
|
Dim Retorno As Boolean = False
|
|
|
|
|
DataAdapter("PA_Comp_RepEvaluacionesProveedoresGet")
|
|
|
|
|
With SqlAdapter.SelectCommand.Parameters
|
|
|
|
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
|
|
|
|
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
|
|
|
|
|
.Add("@FechaI", SqlDbType.DateTime).Value = FechaI
|
|
|
|
|
.Add("@FechaF", SqlDbType.DateTime).Value = FechaF
|
|
|
|
|
.Add("@Evaluado", SqlDbType.Int).Value = Evaluado
|
|
|
|
|
End With
|
|
|
|
|
Try
|
|
|
|
|
SqlAdapter.Fill(Data)
|
|
|
|
|
Retorno = True
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
OnError("Ocurrió un error al querer obtener el reporte de evaluaciones de proveedores.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
|
|
|
|
End Try
|
|
|
|
|
Return Retorno
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
Public Function GetFletesCompras(CveFlete As Integer, CveEmpresa As Integer) As Boolean
|
|
|
|
|
Dim Retorno As Boolean = False
|
|
|
|
|
DataAdapter("PA_Comp_FletesComprasGet")
|
|
|
|
|
With SqlAdapter.SelectCommand.Parameters
|
|
|
|
|
.Add("@CveFlete", SqlDbType.Int).Value = CveFlete
|
|
|
|
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
|
|
|
|
End With
|
|
|
|
|
Try
|
|
|
|
|
SqlAdapter.Fill(Data)
|
|
|
|
|
Retorno = True
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
OnError("Ocurrió un error al querer obtener las compras relacionadas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
|
|
|
|
End Try
|
|
|
|
|
Return Retorno
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
Public Function AddFletesCompras(CveFlete As Integer, Optional CveCompra As Integer = -1, Optional CveOC As Integer = -1) As Boolean
|
|
|
|
|
Dim Retorno As Boolean = False
|
|
|
|
|
DataAdapter("PA_Comp_FletesComprasAdd")
|
|
|
|
|
With SqlAdapter.SelectCommand.Parameters
|
|
|
|
|
.Add("@CveFlete", SqlDbType.Int).Value = CveFlete
|
|
|
|
|
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
|
|
|
|
|
.Add("@CveOC", SqlDbType.Int).Value = CveOC
|
|
|
|
|
End With
|
|
|
|
|
Try
|
|
|
|
|
SqlAdapter.Fill(Data)
|
|
|
|
|
Retorno = True
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
OnError("Ocurrió un error al querer agregar las compras relacionadas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
|
|
|
|
End Try
|
|
|
|
|
Return Retorno
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
Public Function UpdateFechaVencimientoCompra(CveCompra As Integer, FechaVencimiento As Date, CveEmpresa As Integer) As Boolean
|
|
|
|
|
Dim Retorno As Boolean = False
|
|
|
|
|
DataAdapter("PA_Comp_ComprasFechaVencimientoUpdate")
|
|
|
|
|
With SqlAdapter.SelectCommand.Parameters
|
|
|
|
|
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
|
|
|
|
|
.Add("@FechaVencimiento", SqlDbType.Date).Value = FechaVencimiento
|
|
|
|
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
|
|
|
|
End With
|
|
|
|
|
Try
|
|
|
|
|
SqlAdapter.Fill(Data)
|
|
|
|
|
Retorno = True
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
OnError("Ocurrió un error al actualizar la fecha de vencimiento de la compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
|
|
|
|
End Try
|
|
|
|
|
Return Retorno
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
Public Function GetRepEvaluacionesProveedores(CveEmpresa As Integer, CveProveedor As Integer, FechaI As Date, FechaF As Date, Evaluado As Integer) As Boolean
|
|
|
|
|
Dim Retorno As Boolean = False
|
|
|
|
|
DataAdapter("PA_Comp_RepEvaluacionesProveedoresGet")
|
|
|
|
|
With SqlAdapter.SelectCommand.Parameters
|
|
|
|
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
|
|
|
|
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
|
|
|
|
|
.Add("@FechaI", SqlDbType.DateTime).Value = FechaI
|
|
|
|
|
.Add("@FechaF", SqlDbType.DateTime).Value = FechaF
|
|
|
|
|
.Add("@Evaluado", SqlDbType.Int).Value = Evaluado
|
|
|
|
|
End With
|
|
|
|
|
Try
|
|
|
|
|
SqlAdapter.Fill(Data)
|
|
|
|
|
Retorno = True
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
OnError("Ocurrió un error al querer obtener el reporte de evaluaciones de proveedores.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
|
|
|
|
End Try
|
|
|
|
|
Return Retorno
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
Public Function GetFletesCompras(CveFlete As Integer, CveEmpresa As Integer) As Boolean
|
|
|
|
|
Dim Retorno As Boolean = False
|
|
|
|
|
DataAdapter("PA_Comp_FletesComprasGet")
|
|
|
|
|
With SqlAdapter.SelectCommand.Parameters
|
|
|
|
|
.Add("@CveFlete", SqlDbType.Int).Value = CveFlete
|
|
|
|
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
|
|
|
|
End With
|
|
|
|
|
Try
|
|
|
|
|
SqlAdapter.Fill(Data)
|
|
|
|
|
Retorno = True
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
OnError("Ocurrió un error al querer obtener las compras relacionadas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
|
|
|
|
End Try
|
|
|
|
|
Return Retorno
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
Public Function AddFletesCompras(CveFlete As Integer, Optional CveCompra As Integer = -1, Optional CveOC As Integer = -1) As Boolean
|
|
|
|
|
Dim Retorno As Boolean = False
|
|
|
|
|
DataAdapter("PA_Comp_FletesComprasAdd")
|
|
|
|
|
With SqlAdapter.SelectCommand.Parameters
|
|
|
|
|
.Add("@CveFlete", SqlDbType.Int).Value = CveFlete
|
|
|
|
|
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
|
|
|
|
|
.Add("@CveOC", SqlDbType.Int).Value = CveOC
|
|
|
|
|
End With
|
|
|
|
|
Try
|
|
|
|
|
SqlAdapter.Fill(Data)
|
|
|
|
|
Retorno = True
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
OnError("Ocurrió un error al querer agregar las compras relacionadas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
|
|
|
|
End Try
|
|
|
|
|
Return Retorno
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
#Region "REPORTE PUE SIN PAGO"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Public Function GetPUESinPago(FI As DateTime, FF As DateTime, CveProveedor As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, Optional CveUsuario As Integer = -1) As Boolean
|
|
|
|
|
Dim retorno As Boolean = False
|
|
|
|
|
DataAdapter("PA_Comp_PUESinPagoGet", CommandType.StoredProcedure)
|
|
|
|
|
@@ -3127,10 +3127,10 @@ Public Class ClsCompras
|
|
|
|
|
OnError("Ocurrió un error al obtener las compras con método de pago PUE.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
|
|
|
|
End Try
|
|
|
|
|
Return retorno
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
#End Region
|
|
|
|
|
#Region "Reporte de REQ-OC-Compra-Inv"
|
|
|
|
|
#Region "Reporte de REQ-OC-Compra-Inv"
|
|
|
|
|
Public Function GetRepReqOCCompraInv(FI As Date, FF As Date, CveProveedor As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean
|
|
|
|
|
Dim Retorno As Boolean = False
|
|
|
|
|
DataAdapter("PA_Comp_ReqOCCompraInvGet")
|
|
|
|
|
@@ -3151,9 +3151,9 @@ Public Class ClsCompras
|
|
|
|
|
End Try
|
|
|
|
|
|
|
|
|
|
Return Retorno
|
|
|
|
|
End Function
|
|
|
|
|
#End Region
|
|
|
|
|
#Region "Reporte de Precios de Compras"
|
|
|
|
|
End Function
|
|
|
|
|
#End Region
|
|
|
|
|
#Region "Reporte de Precios de Compras"
|
|
|
|
|
Public Function GetRepComprasPrecios(CveProveedor As Integer, CveEmpresa As Integer) As Boolean
|
|
|
|
|
Dim Retorno As Boolean = False
|
|
|
|
|
DataAdapter("PA_Comp_ComprasPreciosGet")
|
|
|
|
|
@@ -3170,8 +3170,8 @@ Public Class ClsCompras
|
|
|
|
|
OnError("Ocurrió un error al obtener el reporte de Precios de Compras.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
|
|
|
|
End Try
|
|
|
|
|
Return Retorno
|
|
|
|
|
End Function
|
|
|
|
|
#End Region
|
|
|
|
|
End Function
|
|
|
|
|
#End Region
|
|
|
|
|
End Class
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|