-- docuemntos por pagar
This commit is contained in:
@@ -2,16 +2,17 @@
|
|||||||
Option Explicit On
|
Option Explicit On
|
||||||
Option Strict On
|
Option Strict On
|
||||||
|
|
||||||
|
Imports System
|
||||||
Imports System.Data
|
Imports System.Data
|
||||||
Imports System.Data.SqlClient
|
Imports System.Data.SqlClient
|
||||||
Imports Extensiones
|
Imports Extensiones
|
||||||
|
|
||||||
Public Class ClsMovimientos
|
Public Class ClsMovimientos
|
||||||
Implements IDisposable
|
Implements IDisposable
|
||||||
|
|
||||||
#Region "Campos"
|
#Region "Campos"
|
||||||
|
|
||||||
'SQL
|
'SQL
|
||||||
Private SqlConexion As SqlConnection
|
Private SqlConexion As SqlConnection
|
||||||
Private SqlAdapter As SqlDataAdapter
|
Private SqlAdapter As SqlDataAdapter
|
||||||
Private SqlTransacc As SqlTransaction
|
Private SqlTransacc As SqlTransaction
|
||||||
@@ -20,12 +21,12 @@ Public Class ClsMovimientos
|
|||||||
Private DS As DataSet
|
Private DS As DataSet
|
||||||
|
|
||||||
'Atributos de la clase
|
'Atributos de la clase
|
||||||
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
|
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
|
||||||
'REGISTRAR CONEXIONES ABIERTAS
|
'REGISTRAR CONEXIONES ABIERTAS
|
||||||
Private CveConexion As Integer = 0
|
Private CveConexion As Integer = 0
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "Propiedades"
|
#Region "Propiedades"
|
||||||
Public ReadOnly Property DtResultados() As DataTable
|
Public ReadOnly Property DtResultados() As DataTable
|
||||||
Get
|
Get
|
||||||
@@ -36,12 +37,13 @@ Public Class ClsMovimientos
|
|||||||
Public ReadOnly Property DSResultados() As DataSet
|
Public ReadOnly Property DSResultados() As DataSet
|
||||||
Get
|
Get
|
||||||
DSResultados = DS
|
DSResultados = DS
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public Property AlertaMensaje As New StringBuilder
|
Public Property AlertaMensaje As New StringBuilder
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Sub New()
|
Sub New()
|
||||||
SqlConexion = New SqlConnection
|
SqlConexion = New SqlConnection
|
||||||
SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString
|
SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString
|
||||||
@@ -62,9 +64,10 @@ Public Class ClsMovimientos
|
|||||||
End With
|
End With
|
||||||
If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
|
If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
|
||||||
Data = New DataTable
|
Data = New DataTable
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#Region "Conexiones"
|
#Region "Conexiones"
|
||||||
|
|
||||||
Private Sub ConexionAdd()
|
Private Sub ConexionAdd()
|
||||||
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
|
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
|
||||||
Try
|
Try
|
||||||
@@ -97,9 +100,9 @@ Public Class ClsMovimientos
|
|||||||
CveConexion = 0
|
CveConexion = 0
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Public Sub IniciaTransacSQL()
|
Public Sub IniciaTransacSQL()
|
||||||
SqlTransacc = SqlConexion.BeginTransaction()
|
SqlTransacc = SqlConexion.BeginTransaction()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -485,13 +488,13 @@ Public Class ClsMovimientos
|
|||||||
Retorno = True
|
Retorno = True
|
||||||
Catch ex As SqlException
|
Catch ex As SqlException
|
||||||
OnError("Ocurrió un error al descargar los segmentos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
OnError("Ocurrió un error al descargar los segmentos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
End Try
|
End Try
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "Anticipos de Clientes"
|
#Region "Anticipos de Clientes"
|
||||||
Public Function GetAnticiposCliente(CveCliente As Integer, Optional SelectTop As Integer = -1, Optional CveMoneda As Integer = 1) As Boolean
|
Public Function GetAnticiposCliente(CveCliente As Integer, Optional SelectTop As Integer = -1, Optional CveMoneda As Integer = 1) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
@@ -569,12 +572,14 @@ Public Class ClsMovimientos
|
|||||||
End Try
|
End Try
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "CxP"
|
#Region "CxP"
|
||||||
|
|
||||||
Public Function GetCxPEmpresa(CveProveedor As Integer, FechaVencimientoInicio As String, FechaVencimientoFin As String, CveSubProyecto As Integer, DiasVencidos As Integer, CveUsuarioRegistro As Integer,
|
Public Function GetCxPEmpresa(CveProveedor As Integer, FechaVencimientoInicio As String, FechaVencimientoFin As String, CveSubProyecto As Integer, DiasVencidos As Integer, CveUsuarioRegistro As Integer,
|
||||||
CveUsuarioProgramo As Integer, CveUsuarioResponsable As Integer, CveClasificacion As Integer, CveMoneda As Integer, CveTipoPagoProgramo As Integer, CveEstatusFactura As Integer,
|
CveUsuarioProgramo As Integer, CveUsuarioResponsable As Integer, CveClasificacion As Integer, CveMoneda As Integer, CveTipoPagoProgramo As Integer, CveEstatusFactura As Integer,
|
||||||
CveAplicaNC As Integer, CveEmpresa As Integer, Optional FechaVI As String = "-1", Optional FechaVF As String = "-1", Optional CodigoProgramacion As String = "-1", Optional CveTipoProveedor As Integer = 0,
|
CveAplicaNC As Integer, CveEmpresa As Integer, Optional FechaVI As String = "-1", Optional FechaVF As String = "-1", Optional CodigoProgramacion As String = "-1", Optional CveTipoProveedor As Integer = 0,
|
||||||
@@ -1201,6 +1206,29 @@ Public Class ClsMovimientos
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Public Function GetDocumentosxPagarDetalle(CveCliente As Integer, CveMoneda As Integer, Opcion As Integer, CveEmpresa As Integer) As Boolean
|
||||||
|
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
DataAdapter("PA_Banc_DocumentosxPagarSaldosDetalle")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||||
|
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
|
||||||
|
.Add("@Opcion", SqlDbType.Int).Value = Opcion
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al obtener el Reporte de documentos por pagar.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
Public Function GetCajaChicaDetalle(CveCajaChica As Integer, CveEmpresa As Integer) As Boolean
|
Public Function GetCajaChicaDetalle(CveCajaChica As Integer, CveEmpresa As Integer) As Boolean
|
||||||
|
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
@@ -1462,9 +1490,9 @@ Public Class ClsMovimientos
|
|||||||
End Try
|
End Try
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "Anticipos de Proveedores"
|
#Region "Anticipos de Proveedores"
|
||||||
Public Function GetAnticiposProveedor(CveProveedor As Integer, CveProveedorSucursal As Integer, Optional CveMoneda As Integer = -1, Optional SelectTop As Integer = -1, Optional FechaI As String = "-1", Optional FechaF As String = "-1", Optional TipoDocto As String = "-1") As Boolean
|
Public Function GetAnticiposProveedor(CveProveedor As Integer, CveProveedorSucursal As Integer, Optional CveMoneda As Integer = -1, Optional SelectTop As Integer = -1, Optional FechaI As String = "-1", Optional FechaF As String = "-1", Optional TipoDocto As String = "-1") As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
@@ -1486,33 +1514,32 @@ Public Class ClsMovimientos
|
|||||||
Retorno = True
|
Retorno = True
|
||||||
Catch ex As SqlException
|
Catch ex As SqlException
|
||||||
OnError("Ocurrió un error al consultar los Anticipos del proveedor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
OnError("Ocurrió un error al consultar los Anticipos del proveedor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
End Try
|
End Try
|
||||||
|
Return Retorno
|
||||||
Return Retorno
|
End Function
|
||||||
End Function
|
|
||||||
|
|
||||||
'Public Function GetAnticiposClienteAuxiliar(CveCliente As Integer, CveVenta As Integer) As Boolean
|
'Public Function GetAnticiposClienteAuxiliar(CveCliente As Integer, CveVenta As Integer) As Boolean
|
||||||
' Dim Retorno As Boolean = False
|
' Dim Retorno As Boolean = False
|
||||||
' 'Data = New DataTable
|
' 'Data = New DataTable
|
||||||
' 'SqlAdapter = New SqlDataAdapter("PA_ClienteAnticiposAuxiliar", SqlConexion)
|
' 'SqlAdapter = New SqlDataAdapter("PA_ClienteAnticiposAuxiliar", SqlConexion)
|
||||||
' 'SqlAdapter.SelectCommand.CommandType = CommandType.StoredProcedure
|
' 'SqlAdapter.SelectCommand.CommandType = CommandType.StoredProcedure
|
||||||
' DataAdapter("PA_ClienteAnticiposAuxiliar")
|
' DataAdapter("PA_ClienteAnticiposAuxiliar")
|
||||||
' With SqlAdapter.SelectCommand.Parameters
|
' With SqlAdapter.SelectCommand.Parameters
|
||||||
' .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
' .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||||
' .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
' .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||||
' End With
|
' End With
|
||||||
' Try
|
' Try
|
||||||
' SqlAdapter.Fill(Data)
|
' SqlAdapter.Fill(Data)
|
||||||
' Retorno = True
|
' Retorno = True
|
||||||
' Catch ex As SqlException
|
' Catch ex As SqlException
|
||||||
' OnError("Ocurrió un error al consultar el Auxiliar Contable de Anticipos del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
' OnError("Ocurrió un error al consultar el Auxiliar Contable de Anticipos del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
' End Try
|
' End Try
|
||||||
|
|
||||||
' Return Retorno
|
' Return Retorno
|
||||||
'End Function
|
'End Function
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "REP RECUPERACION"
|
#Region "REP RECUPERACION"
|
||||||
Public Function GetRepRecuperacion(FechaI As Date, FechaF As Date, CveCliente As Integer, CveSubProyecto As Integer,
|
Public Function GetRepRecuperacion(FechaI As Date, FechaF As Date, CveCliente As Integer, CveSubProyecto As Integer,
|
||||||
CveVendedor As Integer, CveUsuario As Integer, CveEstatus As Integer, IVA As String,
|
CveVendedor As Integer, CveUsuario As Integer, CveEstatus As Integer, IVA As String,
|
||||||
@@ -1658,9 +1685,9 @@ Public Class ClsMovimientos
|
|||||||
End Try
|
End Try
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "REP COBRADO"
|
#Region "REP COBRADO"
|
||||||
Public Function GetRepCobrado(FechaI As Date, FechaF As Date, CveProveedor As Integer, CveSubProyecto As Integer,
|
Public Function GetRepCobrado(FechaI As Date, FechaF As Date, CveProveedor As Integer, CveSubProyecto As Integer,
|
||||||
CveUsuario As Integer, IVA As String, CveEmpresa As Integer, Gpo As Integer, CveResponsable As Integer,
|
CveUsuario As Integer, IVA As String, CveEmpresa As Integer, Gpo As Integer, CveResponsable As Integer,
|
||||||
@@ -1730,11 +1757,13 @@ Public Class ClsMovimientos
|
|||||||
End Try
|
End Try
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "EDITAR FECHA DE MOVIMIENTO"
|
#Region "EDITAR FECHA DE MOVIMIENTO"
|
||||||
|
|
||||||
Public Function UpdateMovimientoFecha(Fecha As DateTime, CveMovimiento As Integer) As Boolean
|
Public Function UpdateMovimientoFecha(Fecha As DateTime, CveMovimiento As Integer) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Mov_MovimientoFechaUpdate")
|
DataAdapter("PA_Mov_MovimientoFechaUpdate")
|
||||||
@@ -1749,12 +1778,16 @@ Public Class ClsMovimientos
|
|||||||
OnError("Ocurrió un error al actualizar la fecha del movimiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
OnError("Ocurrió un error al actualizar la fecha del movimiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
End Try
|
End Try
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "Registros Contables"
|
#Region "Registros Contables"
|
||||||
|
|
||||||
|
|
||||||
Public Function AddMovimiento(CveConcepto As Integer, Tipo As String, Referencia1 As String, Referencia2 As String, CveMoneda As Integer, Cargo As Double, Abono As Double,
|
Public Function AddMovimiento(CveConcepto As Integer, Tipo As String, Referencia1 As String, Referencia2 As String, CveMoneda As Integer, Cargo As Double, Abono As Double,
|
||||||
Fecha As Date, FechaVencimiento As Date, Folio As String, IdCtaContable As Integer, CveUsuario As Integer, CveEmprea As Integer) As Boolean
|
Fecha As Date, FechaVencimiento As Date, Folio As String, IdCtaContable As Integer, CveUsuario As Integer, CveEmprea As Integer) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
@@ -1828,14 +1861,14 @@ Public Class ClsMovimientos
|
|||||||
End Try
|
End Try
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "IDisposable Support"
|
#Region "IDisposable Support"
|
||||||
|
|
||||||
|
|
||||||
' IDisposable
|
' IDisposable
|
||||||
Protected Overridable Sub Dispose(disposing As Boolean)
|
Protected Overridable Sub Dispose(disposing As Boolean)
|
||||||
If Not Me.disposedValue Then
|
If Not Me.disposedValue Then
|
||||||
If disposing Then
|
If disposing Then
|
||||||
@@ -1868,9 +1901,10 @@ Public Class ClsMovimientos
|
|||||||
ConexionClose()
|
ConexionClose()
|
||||||
Dispose(True)
|
Dispose(True)
|
||||||
GC.SuppressFinalize(Me)
|
GC.SuppressFinalize(Me)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Public Function GetPersonalCajaChica(CveEmpresa As Integer, CveCompra As Integer) As Boolean
|
Public Function GetPersonalCajaChica(CveEmpresa As Integer, CveCompra As Integer) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_PersonalCajaChica")
|
DataAdapter("PA_PersonalCajaChica")
|
||||||
|
|||||||
Reference in New Issue
Block a user