diff --git a/App_Code/ClsMovimientos.vb b/App_Code/ClsMovimientos.vb
index 8d328c4bb..eb4b801f9 100644
--- a/App_Code/ClsMovimientos.vb
+++ b/App_Code/ClsMovimientos.vb
@@ -7,41 +7,41 @@ Imports System.Data.SqlClient
Imports Extensiones
Public Class ClsMovimientos
- Implements IDisposable
-
+ Implements IDisposable
+
#Region "Campos"
-
- 'SQL
+
+ 'SQL
Private SqlConexion As SqlConnection
Private SqlAdapter As SqlDataAdapter
Private SqlTransacc As SqlTransaction
Private SqlCommand As SqlCommand
- Private Data As DataTable
+ Private Data As DataTable
Private DS As DataSet
'Atributos de la clase
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
'REGISTRAR CONEXIONES ABIERTAS
- Private CveConexion As Integer = 0
-
+ Private CveConexion As Integer = 0
+
#End Region
-
+
#Region "Propiedades"
Public ReadOnly Property DtResultados() As DataTable
Get
DtResultados = Data
End Get
- End Property
-
- Public ReadOnly Property DSResultados() As DataSet
- Get
- DSResultados = DS
- End Get
End Property
- Public Property AlertaMensaje As New StringBuilder
+ Public ReadOnly Property DSResultados() As DataSet
+ Get
+ DSResultados = DS
+ End Get
+ End Property
+
+ Public Property AlertaMensaje As New StringBuilder
#End Region
-
+
Sub New()
SqlConexion = New SqlConnection
SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString
@@ -62,9 +62,9 @@ Public Class ClsMovimientos
End With
If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
Data = New DataTable
- End Sub
+ End Sub
#Region "Conexiones"
-
+
Private Sub ConexionAdd()
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try
@@ -97,9 +97,9 @@ Public Class ClsMovimientos
CveConexion = 0
End If
- End Sub
+ End Sub
#End Region
-
+
Public Sub IniciaTransacSQL()
SqlTransacc = SqlConexion.BeginTransaction()
End Sub
@@ -110,27 +110,27 @@ Public Class ClsMovimientos
Public Sub Commit()
SqlTransacc.Commit()
- End Sub
-
+ End Sub
+
#Region "CxC"
- 'Public Function GetCxCCliente(CveCliente As Integer) As Boolean
- ' Dim Retorno As Boolean = False
- ' 'Data = New DataTable
- ' 'SqlAdapter = New SqlDataAdapter("PA_ClienteCxC", SqlConexion)
- ' 'SqlAdapter.SelectCommand.CommandType = CommandType.StoredProcedure
- ' DataAdapter("PA_ClienteCxC")
- ' SqlAdapter.SelectCommand.Parameters.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
-
- ' Try
- ' SqlAdapter.Fill(Data)
- ' Retorno = True
- ' Catch ex As SqlException
- ' OnError("Ocurrió un error al consultar las CxC del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- ' End Try
-
- ' Return Retorno
- 'End Function
-
+ 'Public Function GetCxCCliente(CveCliente As Integer) As Boolean
+ ' Dim Retorno As Boolean = False
+ ' 'Data = New DataTable
+ ' 'SqlAdapter = New SqlDataAdapter("PA_ClienteCxC", SqlConexion)
+ ' 'SqlAdapter.SelectCommand.CommandType = CommandType.StoredProcedure
+ ' DataAdapter("PA_ClienteCxC")
+ ' SqlAdapter.SelectCommand.Parameters.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+
+ ' Try
+ ' SqlAdapter.Fill(Data)
+ ' Retorno = True
+ ' Catch ex As SqlException
+ ' OnError("Ocurrió un error al consultar las CxC del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ ' End Try
+
+ ' Return Retorno
+ 'End Function
+
Public Function GetCxCClienteDetalle(CveCliente As Integer, FechaI As String, FechaF As String, CveMoneda As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, CveClienteSucursal As Integer, Optional TipoDocto As String = "-1", Optional FechaCorte As Date = MaxFecha, Optional CveIESustitucion As Integer = -1, Optional FechaVencimientoI As Date = MinFecha, Optional FechaVencimientoF As Date = MaxFecha) As Boolean
Dim Retorno As Boolean = False
@@ -176,7 +176,7 @@ Public Class ClsMovimientos
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@TipoAgrupador", SqlDbType.Int).Value = TipoAgrupador
.Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta
- .Add("@Cuenta", SqlDbType.NVarChar).Value = Cuenta
+ .Add("@Cuenta", SqlDbType.NVarChar).Value = Cuenta
.Add("@EstatusFactura", SqlDbType.Int).Value = EstatusFactura
End With
@@ -248,7 +248,8 @@ Public Class ClsMovimientos
Gpo As Integer, CveResponsable As Integer,
TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional TipoDocto As String = "-1",
Optional FechaVI As String = "-1", Optional FechaVF As String = "-1", Optional FechaCorte As Date = Nothing, Optional EstatusCliente As Integer = -1, Optional CveUsuarioConsulta As Integer = -1,
- Optional CveCobranzaEstatus As Integer = -1, Optional CveClienteClasificacion As Integer = -1, Optional TipoCliente As Integer = -1, Optional AplicaAnticiposPagados As Integer = 1, Optional CveMoneda As Integer = -1) As Boolean
+ Optional CveCobranzaEstatus As Integer = -1, Optional CveClienteClasificacion As Integer = -1, Optional TipoCliente As Integer = -1, Optional AplicaAnticiposPagados As Integer = 1, Optional CveMoneda As Integer = -1,
+ Optional TieneLineaAdicional As Integer = -1) As Boolean
Dim Retorno As Boolean = False
'Data = New DataTable
@@ -280,9 +281,10 @@ Public Class ClsMovimientos
.Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta
.Add("@CveCobranzaEstatus", SqlDbType.Int).Value = CveCobranzaEstatus
.Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion
- .Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente
- .Add("@AplicaAnticiposPagados", SqlDbType.Int).Value = AplicaAnticiposPagados
+ .Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente
+ .Add("@AplicaAnticiposPagados", SqlDbType.Int).Value = AplicaAnticiposPagados
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
+ .Add("@TieneLineaAdicional", SqlDbType.Int).Value = TieneLineaAdicional
End With
Try
@@ -333,7 +335,7 @@ Public Class ClsMovimientos
CveResponsable As Integer, TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional TipoDocto As String = "-1",
Optional FechaVI As String = "-1", Optional FechaVF As String = "1", Optional FechaCorte As Date = Nothing, Optional CveUsuarioConsulta As Integer = -1,
Optional CveCobranzaEstatus As Integer = -1, Optional CveClienteClasificacion As Integer = -1, Optional LimiteCredito As Decimal = -1,
- Optional TipoCliente As Integer = -1, Optional CveMoneda As Integer = -1, Optional EstatusCliente As Integer = -1, Optional AplicaAnticiposPagados As Integer = 1) As Boolean
+ Optional TipoCliente As Integer = -1, Optional CveMoneda As Integer = -1, Optional EstatusCliente As Integer = -1, Optional AplicaAnticiposPagados As Integer = 1, Optional TieneLineaAdicional As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DS = New DataSet
@@ -374,8 +376,9 @@ Public Class ClsMovimientos
.Add("@LimiteCredito", SqlDbType.Float).Value = LimiteCredito
.Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
- .Add("@EstatusCliente", SqlDbType.Int).Value = EstatusCliente
+ .Add("@EstatusCliente", SqlDbType.Int).Value = EstatusCliente
.Add("@AplicaAnticiposPagados", SqlDbType.Int).Value = AplicaAnticiposPagados
+ .Add("@TieneLineaAdicional", SqlDbType.Int).Value = TieneLineaAdicional
End With
Try
@@ -386,8 +389,8 @@ Public Class ClsMovimientos
End Try
Return Retorno
- End Function
-
+ End Function
+
Public Function AddNotificacionEdoCuentaCliente(CveCliente As Integer, Fecha As DateTime) As Boolean
Dim Retorno As Boolean = False
@@ -406,14 +409,14 @@ Public Class ClsMovimientos
End Try
Return Retorno
- End Function
-
+ End Function
+
Public Function GetNotificacionEdoCuentaCliente(CveEmpresa As Integer, CveCliente As Integer, Fecha As DateTime) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Sis_NotificacionesEdoCuentaClienteGet")
- With SqlAdapter.SelectCommand.Parameters
+ With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@Fecha", SqlDbType.DateTime).Value = Fecha
@@ -427,8 +430,8 @@ Public Class ClsMovimientos
End Try
Return Retorno
- End Function
-
+ End Function
+
Public Function UpdateNotificacionEdoCuentaCliente(CveNotificacionBitacora As Integer, Notifico As Boolean) As Boolean
Dim Retorno As Boolean = False
@@ -484,11 +487,11 @@ Public Class ClsMovimientos
OnError("Ocurrió un error al descargar los segmentos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-
-
+ End Function
+
+
#End Region
-
+
#Region "Anticipos de Clientes"
Public Function GetAnticiposCliente(CveCliente As Integer, Optional SelectTop As Integer = -1, Optional CveMoneda As Integer = 1) As Boolean
Dim Retorno As Boolean = False
@@ -526,7 +529,7 @@ Public Class ClsMovimientos
End Try
Return Retorno
- End Function
+ End Function
Public Function GetRemisionesNCCliente(CveCliente As Integer, MostarDetalle As Boolean, Optional CveMoneda As Integer = -1, Optional CveClienteSucursal As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ClienteRemisionesNC")
@@ -566,12 +569,12 @@ Public Class ClsMovimientos
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
+
#Region "CxP"
-
+
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,
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,
@@ -733,7 +736,7 @@ Public Class ClsMovimientos
Public Function GetCxPPeriodo(CveProveedor As Integer, CveSubProyecto As Integer, CveClasificacion As Integer, CveUsuarioResponsable As Integer,
CveUsuarioRegistro As Integer, CveEstatus As Integer, CveEmpresa As Integer, Gpo As Integer, CveSucursal As Integer,
- TipoCambio As Integer, TCEspecifico As Double, FechaCorte As Date, CveUsuarioConsulta As Integer, CveTipoProveedor As Integer,
+ TipoCambio As Integer, TCEspecifico As Double, FechaCorte As Date, CveUsuarioConsulta As Integer, CveTipoProveedor As Integer,
Optional TipoDocto As String = "-1", Optional CveMoneda As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Comp_RepCxPPeriodo")
@@ -751,7 +754,7 @@ Public Class ClsMovimientos
.Add("@FechaCorte", SqlDbType.Date).Value = FechaCorte
.Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta
.Add("@CveTipoProveedor", SqlDbType.Int).Value = CveTipoProveedor
- .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
+ .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
End With
Try
@@ -1325,7 +1328,7 @@ Public Class ClsMovimientos
.Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta
.Add("@CveTipoProveedor", SqlDbType.Int).Value = CveTipoProveedor
.Add("@Comprobaciones", SqlDbType.Int).Value = Comprobaciones
- .Add("@AplicaNC", SqlDbType.Int).Value = AplicaNC
+ .Add("@AplicaNC", SqlDbType.Int).Value = AplicaNC
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
End With
@@ -1457,9 +1460,9 @@ Public Class ClsMovimientos
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#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
Dim Retorno As Boolean = False
@@ -1484,30 +1487,30 @@ Public Class ClsMovimientos
End Try
Return Retorno
- End Function
-
- 'Public Function GetAnticiposClienteAuxiliar(CveCliente As Integer, CveVenta As Integer) As Boolean
- ' Dim Retorno As Boolean = False
- ' 'Data = New DataTable
- ' 'SqlAdapter = New SqlDataAdapter("PA_ClienteAnticiposAuxiliar", SqlConexion)
- ' 'SqlAdapter.SelectCommand.CommandType = CommandType.StoredProcedure
- ' DataAdapter("PA_ClienteAnticiposAuxiliar")
- ' With SqlAdapter.SelectCommand.Parameters
- ' .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
- ' .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
- ' End With
- ' Try
- ' SqlAdapter.Fill(Data)
- ' Retorno = True
- ' Catch ex As SqlException
- ' OnError("Ocurrió un error al consultar el Auxiliar Contable de Anticipos del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- ' End Try
-
- ' Return Retorno
- 'End Function
-
+ End Function
+
+ 'Public Function GetAnticiposClienteAuxiliar(CveCliente As Integer, CveVenta As Integer) As Boolean
+ ' Dim Retorno As Boolean = False
+ ' 'Data = New DataTable
+ ' 'SqlAdapter = New SqlDataAdapter("PA_ClienteAnticiposAuxiliar", SqlConexion)
+ ' 'SqlAdapter.SelectCommand.CommandType = CommandType.StoredProcedure
+ ' DataAdapter("PA_ClienteAnticiposAuxiliar")
+ ' With SqlAdapter.SelectCommand.Parameters
+ ' .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ ' .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
+ ' End With
+ ' Try
+ ' SqlAdapter.Fill(Data)
+ ' Retorno = True
+ ' Catch ex As SqlException
+ ' OnError("Ocurrió un error al consultar el Auxiliar Contable de Anticipos del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ ' End Try
+
+ ' Return Retorno
+ 'End Function
+
#End Region
-
+
#Region "REP RECUPERACION"
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,
@@ -1541,13 +1544,13 @@ Public Class ClsMovimientos
.Add("@TipoCambio", SqlDbType.Int).Value = TipoCambio
.Add("@TCEspecifico", SqlDbType.Float).Value = TCEspecifico
.Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion
- .Add("@EsDistribuidor", SqlDbType.Int).Value = EsDistribuidor
- .Add("@CveCondicionesPago", SqlDbType.Int).Value = CveCondicionesPago
- .Add("@CveTipoTransaccion", SqlDbType.Int).Value = CveTipoTransaccion
-
+ .Add("@EsDistribuidor", SqlDbType.Int).Value = EsDistribuidor
+ .Add("@CveCondicionesPago", SqlDbType.Int).Value = CveCondicionesPago
+ .Add("@CveTipoTransaccion", SqlDbType.Int).Value = CveTipoTransaccion
+
.Add("@FechaAplicadoI", SqlDbType.Date).Value = FechaAplicadoI.ToShortDateString
- .Add("@FechaAplicadoF", SqlDbType.Date).Value = FechaAplicadoF.ToShortDateString
-
+ .Add("@FechaAplicadoF", SqlDbType.Date).Value = FechaAplicadoF.ToShortDateString
+
.Add("@FechaRegistroIEI", SqlDbType.Date).Value = FechaRegistroIEI.ToShortDateString
.Add("@FechaRegistroIEF", SqlDbType.Date).Value = FechaRegistroIEF.ToShortDateString
End With
@@ -1604,7 +1607,7 @@ Public Class ClsMovimientos
Optional TipoCambio As Integer = -1, Optional TCEspecifico As Double = 0,
Optional CveMoneda As Integer = -1, Optional CveClienteClasificacion As Integer = -1, Optional Tipo As Integer = -1,
Optional EsDistribuidor As Integer = -1, Optional FechaAplicadoI As Date = Nothing, Optional FechaAplicadoF As Date = Nothing,
- Optional FechaRegistroIEI As Date = MinFecha, Optional FechaRegistroIEF As Date = MaxFecha,
+ Optional FechaRegistroIEI As Date = MinFecha, Optional FechaRegistroIEF As Date = MaxFecha,
Optional CveCondicionesPago As Integer = -1, Optional CveTipoTransaccion As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -1634,12 +1637,12 @@ Public Class ClsMovimientos
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
.Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion
.Add("@Tipo", SqlDbType.Int).Value = Tipo
- .Add("@EsDistribuidor", SqlDbType.Int).Value = EsDistribuidor
- .Add("@CveCondicionesPago", SqlDbType.Int).Value = CveCondicionesPago
- .Add("@CveTipoTransaccion", SqlDbType.Int).Value = CveTipoTransaccion
-
+ .Add("@EsDistribuidor", SqlDbType.Int).Value = EsDistribuidor
+ .Add("@CveCondicionesPago", SqlDbType.Int).Value = CveCondicionesPago
+ .Add("@CveTipoTransaccion", SqlDbType.Int).Value = CveTipoTransaccion
+
.Add("@FechaAplicadoI", SqlDbType.Date).Value = FechaAplicadoI.ToShortDateString
- .Add("@FechaAplicadoF", SqlDbType.Date).Value = FechaAplicadoF.ToShortDateString
+ .Add("@FechaAplicadoF", SqlDbType.Date).Value = FechaAplicadoF.ToShortDateString
.Add("@FechaRegistroIEI", SqlDbType.Date).Value = FechaRegistroIEI.ToShortDateString
.Add("@FechaRegistroIEF", SqlDbType.Date).Value = FechaRegistroIEF.ToShortDateString
@@ -1653,9 +1656,9 @@ Public Class ClsMovimientos
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "REP COBRADO"
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,
@@ -1725,11 +1728,11 @@ Public Class ClsMovimientos
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "EDITAR FECHA DE MOVIMIENTO"
-
+
Public Function UpdateMovimientoFecha(Fecha As DateTime, CveMovimiento As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Mov_MovimientoFechaUpdate")
@@ -1744,12 +1747,12 @@ Public Class ClsMovimientos
OnError("Ocurrió un error al actualizar la fecha del movimiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#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,
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
@@ -1823,23 +1826,23 @@ Public Class ClsMovimientos
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
+
#Region "IDisposable Support"
-
-
- ' IDisposable
+
+
+ ' IDisposable
Protected Overridable Sub Dispose(disposing As Boolean)
If Not Me.disposedValue Then
- If disposing Then
- ' TODO: dispose managed state (managed objects).
- If Not Data Is Nothing Then Data.Dispose() : Data = Nothing
- If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing
- If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing
- If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing
- If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close()
+ If disposing Then
+ ' TODO: dispose managed state (managed objects).
+ If Not Data Is Nothing Then Data.Dispose() : Data = Nothing
+ If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing
+ If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing
+ If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing
+ If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close()
If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing
End If
@@ -1863,9 +1866,9 @@ Public Class ClsMovimientos
ConexionClose()
Dispose(True)
GC.SuppressFinalize(Me)
- End Sub
+ End Sub
#End Region
-
+
Public Function GetPersonalCajaChica(CveEmpresa As Integer, CveCompra As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_PersonalCajaChica")
diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index e5ad7c6c9..6af729f4c 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -400,7 +400,7 @@ Public Class ClsVentas
Optional CveTipoAmortizacionAnticipo As Integer = -1, Optional CveVentaRelacion As Integer = -1, Optional ImporteRelacion As Decimal = -1, Optional CveEmpresaCRM As Integer = -1, Optional EsInterno As Integer = -1, Optional CveAcercamientoCRM As Integer = -1,
Optional DiasCredito As Integer = 0, Optional EsDiasCreditoFijo As Boolean = False, Optional AnticipoEspecial As Boolean = False, Optional Kilometraje As Double = 0, Optional EsAmortizacion As Boolean = False, Optional CveTipoRetencion As Integer = 0,
Optional CorreoNotificacion As String = "", Optional FormaPaqueteria As Integer = 1, Optional FacturarSucursal As Boolean = False, Optional VentaDesglosaIEPS As Boolean = False, Optional ServicioDomicilio As Boolean = False, Optional RFCReceptor As String = "", Optional Adjunto As String = "-1",
- Optional DevolucionImportePagado As Decimal = 0, Optional EsGarantia As Boolean = False) As Boolean
+ Optional DevolucionImportePagado As Decimal = 0, Optional EsGarantia As Boolean = False, Optional CveLineaAdicional As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_VentasAdd")
@@ -499,7 +499,7 @@ Public Class ClsVentas
.Add("@DevolucionImportePagado", SqlDbType.Money).Value = DevolucionImportePagado
.Add("@EsGarantia", SqlDbType.Bit).Value = EsGarantia
-
+ .Add("@CveLineaAdicional", SqlDbType.Int).Value = CveLineaAdicional
.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
End With
'SqlTypes.SqlDateTime.Null
@@ -5603,6 +5603,50 @@ Public Class ClsVentas
End Function
+ Public Function GetLineasAdicionalesSaldo(CveLineaAdicional As Integer, CveCliente As Integer, CveProveedor As Integer, CveMoneda As Integer, CveEmpresa As Integer, Optional ConSaldo As Integer = -1) As Boolean
+
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_LineasAdicionalesSaldoGet")
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveLineaAdicional", SqlDbType.Int).Value = CveLineaAdicional
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
+ .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@ConSaldo", SqlDbType.Int).Value = ConSaldo
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error obtener las lineas de adicionales.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+ Return Retorno
+
+
+ End Function
+
+ Public Function UpdateVentaLineaAdicional(CveLineaAdicional As Integer, CveVenta As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_LineasAdicionalesVentaUpdate")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveLineaAdicional", SqlDbType.Int).Value = CveLineaAdicional
+ .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error actualizar la linea adicional.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+
+ End Function
+
Public Function AddLineasAdicionales(LineaAdicional As String, CveCliente As Integer, CveProveedor As Integer, TipoLinea As Integer, Importe As Decimal,
CveMoneda As Integer, FechaVencimiento As Date, CveUsuario As Integer, CveClasificacionPS As Integer, CveEstatus As Integer) As Boolean
diff --git a/Contabilidad2/RepAnexoCatalogoAnual.aspx b/Contabilidad2/RepAnexoCatalogoAnual.aspx
index 8789e9f31..fc12ba75c 100644
--- a/Contabilidad2/RepAnexoCatalogoAnual.aspx
+++ b/Contabilidad2/RepAnexoCatalogoAnual.aspx
@@ -56,16 +56,16 @@
Ejercicio Inicio:
-
+
Ejercicio Fin:
-
+
-
+
@@ -83,7 +83,7 @@
SubProyecto:
-
+
Divisor:
@@ -93,6 +93,18 @@
+
Cuenta:
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Contabilidad2/RepAnexoCatalogoAnual.aspx.vb b/Contabilidad2/RepAnexoCatalogoAnual.aspx.vb
index ef64e84a7..f88da1720 100644
--- a/Contabilidad2/RepAnexoCatalogoAnual.aspx.vb
+++ b/Contabilidad2/RepAnexoCatalogoAnual.aspx.vb
@@ -137,9 +137,12 @@ Partial Class Contabilidad2_RepAnexoCatalogoAnual
DdlSubProyecto.SelectedValueExist(SubProyectoParametro.ToString)
DdlDivisor.SelectedValueExist(DivisorParametro.ToString)
- DdlPeriodo.SelectedValueExist(Periodo)
-
- CargaDatos()
+ DdlPeriodo.SelectedValueExist(Periodo)
+
+ If CveCuenta > 0 Then
+ DdlCuentas.SelectedValueExist(CveCuenta)
+ CargaDatos()
+ End If
End If
End Sub
@@ -158,9 +161,21 @@ Partial Class Contabilidad2_RepAnexoCatalogoAnual
Else
DdlEjercicio.DataSource = Nothing
DdlEjercicio2.DataSource = Nothing
+ End If
+
+ Dim strGlobal As String = ""
+
+ If Conta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then
+ Dim dr As DataRow = Conta.DtResultados.FiltroPrimero("Codigo IN ('_GLOBAL')")
+ If dr IsNot Nothing Then strGlobal = dr.Item(0).ToString
+ DdlCuentas.DataSource = Conta.DtResultados
End If
+
+
Conta.Dispose()
+ DdlCuentas.DataBind()
+
DdlEjercicio.DataBind()
DdlEjercicio2.DataBind()
@@ -181,8 +196,8 @@ Partial Class Contabilidad2_RepAnexoCatalogoAnual
Private Sub CargaDatos()
- If CveCuenta <= -1 Then
- Alert("No hay una cuenta expecificada.", TipoMensaje.MsgAdvertencia)
+ If Not DdlCuentas.SelectedValue.ToEntero > 0 Then
+ Alert("Debe de seleccionar una cuenta.")
Exit Sub
End If
diff --git a/Contabilidad2/RepAnexoCatalogoCC.aspx b/Contabilidad2/RepAnexoCatalogoCC.aspx
index 0a34338fd..fce33e0af 100644
--- a/Contabilidad2/RepAnexoCatalogoCC.aspx
+++ b/Contabilidad2/RepAnexoCatalogoCC.aspx
@@ -88,6 +88,20 @@
+
+
Cuenta:
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Contabilidad2/RepAnexoCatalogoCC.aspx.vb b/Contabilidad2/RepAnexoCatalogoCC.aspx.vb
index 55871e9f4..50a086700 100644
--- a/Contabilidad2/RepAnexoCatalogoCC.aspx.vb
+++ b/Contabilidad2/RepAnexoCatalogoCC.aspx.vb
@@ -106,10 +106,16 @@ Partial Class Contabilidad2_RepAnexoCatalogoCC
DdlEjercicio.SelectedValueExist(EjercicioParametro.ToString)
DdlSubProyecto.SelectedValueExist(SubProyectoParametro.ToString)
DdlDivisor.SelectedValueExist(DivisorParametro.ToString)
- DdlPeriodo.SelectedValueExist(Periodo)
-
- CargaDatos()
-
+ DdlPeriodo.SelectedValueExist(Periodo)
+
+
+ If CveCuenta > 0 Then
+ DdlCuentas.SelectedValueExist(CveCuenta)
+ CargaDatos()
+ End If
+
+
+
End If
End Sub
@@ -125,18 +131,38 @@ Partial Class Contabilidad2_RepAnexoCatalogoCC
DdlEjercicio.DataSource = Conta.DtResultados
Else
DdlEjercicio.DataSource = Nothing
+ End If
+
+ Dim strGlobal As String = ""
+
+ If Conta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then
+ Dim dr As DataRow = Conta.DtResultados.FiltroPrimero("Codigo IN ('_GLOBAL')")
+ If dr IsNot Nothing Then strGlobal = dr.Item(0).ToString
+ DdlCuentas.DataSource = Conta.DtResultados
End If
+
+
Conta.Dispose()
DdlEjercicio.DataBind()
- DdlEjercicio.SelectedValueExist(Now.Year.ToString)
-
- 'DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa)
- 'DdlSubProyecto.DataBind()
- 'DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
- 'DdlSubProyecto.SelectedValue = "-1"
-
+ DdlEjercicio.SelectedValueExist(Now.Year.ToString)
+
+ DdlCuentas.DataBind()
+
+ 'DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa)
+ 'DdlSubProyecto.DataBind()
+ 'DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
+ 'DdlSubProyecto.SelectedValue = "-1"
+
+
+
+
+
End Sub
+
+
+
+
#End Region
@@ -147,6 +173,12 @@ Partial Class Contabilidad2_RepAnexoCatalogoCC
Private Sub CargaDatos()
+
+ If Not DdlCuentas.SelectedValue.ToEntero > 0 Then
+ Alert("Debe de seleccionar una cuenta.")
+ Exit Sub
+ End If
+
DTHeaders = New DataTable
DTDatos = New DataTable
Dim Conta As New ClsContabilidad
diff --git a/Contabilidad2/RepAnexoCatalogoMensual.aspx b/Contabilidad2/RepAnexoCatalogoMensual.aspx
index dd41e2feb..b83546560 100644
--- a/Contabilidad2/RepAnexoCatalogoMensual.aspx
+++ b/Contabilidad2/RepAnexoCatalogoMensual.aspx
@@ -56,16 +56,17 @@
+
Ejercicio:
-
+
-
+
-
+
@@ -83,7 +84,7 @@
SubProyecto:
-
+
Divisor:
@@ -102,6 +103,20 @@
+
Cuenta:
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Contabilidad2/RepAnexoCatalogoMensual.aspx.vb b/Contabilidad2/RepAnexoCatalogoMensual.aspx.vb
index ed9732f15..ab5fb1a91 100644
--- a/Contabilidad2/RepAnexoCatalogoMensual.aspx.vb
+++ b/Contabilidad2/RepAnexoCatalogoMensual.aspx.vb
@@ -70,11 +70,16 @@ Partial Class Contabilidad2_RepAnexoCatalogoMensual
DdlSubProyecto.SelectedValueExist(SubProyectoParametro.ToString)
DdlDivisor.SelectedValueExist(DivisorParametro.ToString)
DdlPeriodo.SelectedValueExist(Periodo)
- DdlTri.SelectedValueExist(TRCU)
-
-
- CargaDatos()
-
+ DdlTri.SelectedValueExist(TRCU)
+
+ If CveCuenta > 0 Then
+ DdlCuentas.SelectedValueExist(CveCuenta)
+ CargaDatos()
+ End If
+
+
+
+
End If
End Sub
@@ -85,14 +90,28 @@ Partial Class Contabilidad2_RepAnexoCatalogoMensual
End Sub
Private Sub CargaCombos()
+
+
Dim Conta As New ClsContabilidad
If Conta.GetEjercicios(UsuarioActual.CveEmpresa) Then
DdlEjercicio.DataSource = Conta.DtResultados
Else
DdlEjercicio.DataSource = Nothing
+ End If
+
+ Dim strGlobal As String = ""
+
+ If Conta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then
+ Dim dr As DataRow = Conta.DtResultados.FiltroPrimero("Codigo IN ('_GLOBAL')")
+ If dr IsNot Nothing Then strGlobal = dr.Item(0).ToString
+ DdlCuentas.DataSource = Conta.DtResultados
End If
+
+
Conta.Dispose()
+ DdlCuentas.DataBind()
+
DdlEjercicio.DataBind()
DdlEjercicio.SelectedValueExist(Now.Year.ToString)
@@ -101,18 +120,27 @@ Partial Class Contabilidad2_RepAnexoCatalogoMensual
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
DdlSubProyecto.SelectedValue = "-1"
- End Sub
+
+
+ End Sub
#End Region
-
-
+
+
#Region " CARGA DATOS "
Protected Sub BtnCargaAsignados_Click(sender As Object, e As EventArgs) Handles BtnCargaAsignados.Click
CargaDatos()
End Sub
- Private Sub CargaDatos()
+ Private Sub CargaDatos()
+
+
+ If Not DdlCuentas.SelectedValue.ToEntero > 0 Then
+ Alert("Debe de seleccionar una cuenta.")
+ Exit Sub
+ End If
+
Dim Conta As New ClsContabilidad
- If Conta.GetAnexoCatalogoMensual(CveCuenta, DdlEjercicio.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlDivisor.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlPeriodo.SelectedValue.ToEntero) Then
+ If Conta.GetAnexoCatalogoMensual(DdlCuentas.SelectedValue.ToEntero, DdlEjercicio.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlDivisor.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlPeriodo.SelectedValue.ToEntero) Then
GvMensual2.DataSource = Conta.DtResultados
Else
GvMensual2.DataSource = Nothing
diff --git a/Contabilidad2/RepEstadoResultadosHorizontal.aspx b/Contabilidad2/RepEstadoResultadosHorizontal.aspx
index b30462cd0..76e29e41b 100644
--- a/Contabilidad2/RepEstadoResultadosHorizontal.aspx
+++ b/Contabilidad2/RepEstadoResultadosHorizontal.aspx
@@ -66,21 +66,21 @@