diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb
index 1852ebb92..232f88953 100644
--- a/App_Code/ClsInventarios.vb
+++ b/App_Code/ClsInventarios.vb
@@ -5734,10 +5734,29 @@ Public Class ClsInventarios
#End Region
+ Public Function GetExistencias119(CvePS As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, CveUsuarioConsulta As Integer, Compuesto As String) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Inv_Existencias119Get")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta
+ .Add("@Compuesto", SqlDbType.VarChar).Value = Compuesto
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+ Me.OnError("Ocurrió un error al obtener las existencias.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener las existencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
-
+ Return Retorno
+ End Function
Public Function GetExistenciasMedRin(CvePS As Integer, CveEmpresa As Integer, CveRinTamaño As Integer, CveMedida As Integer) As Boolean
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/Bancos/IE.aspx b/Bancos/IE.aspx
index f3f596eb5..14f91a793 100644
--- a/Bancos/IE.aspx
+++ b/Bancos/IE.aspx
@@ -1255,7 +1255,7 @@
Movimiento:
-
+ Seleccione uno
@@ -1266,7 +1266,7 @@
Cuenta Devolución:
-
+ -
@@ -1319,7 +1319,7 @@
-
+<%--
@@ -1362,7 +1362,7 @@
-
+
--%>
diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb
index 24f10ebf4..7c11763f9 100644
--- a/Bancos/IE.aspx.vb
+++ b/Bancos/IE.aspx.vb
@@ -655,7 +655,7 @@ Partial Class Bancos_IE
CvePrePoliza = -1
CveSolicitudViatico = -1
ComplementoSerieFolio = ""
- TxtFechaDevuelto.Text = Now.ToShortDateString
+ 'TxtFechaDevuelto.Text = Now.ToShortDateString
TxtFechaCancelacion.Text = Now.ToShortDateString
CveCompraDeCDin = -1
'If UsuarioActual.CveEmpresa.Contiene(66) Then trNotificar.Visible = True
@@ -4564,20 +4564,16 @@ Partial Class Bancos_IE
Msg.Append("El movimiento bancario quedó cancelado exitosamente.")
End If
-
If IdPolizaNueva > 0 Then Msg.AppendFormat("
Ver Póliza de cancelación", IdPolizaNueva)
Alert(Msg.ToString, TipoMensaje.MsgInformacion, "document.location.href=""/Bancos/RepIE.aspx""")
Else
-
If ObjAC IsNot Nothing Then ObjAC.RollBack()
Banc.RollBack()
Alert("El movimiento bancario no se pudo cancelar. Por favor vuelva a intentar.", TipoMensaje.MsgError)
GuardaLog(MensajeError + " | CANCELAR IE")
End If
-
-
Else
If ObjAC IsNot Nothing Then ObjAC.RollBack()
Banc.RollBack()
@@ -4593,125 +4589,125 @@ Partial Class Bancos_IE
ObjConta.Dispose()
End Sub
- Protected Sub BtnDevueltoIE_Click(sender As Object, e As EventArgs)
- RegistraScript("$('#DivChqDevueltoIE').modal('hide');")
+ 'Protected Sub BtnDevueltoIE_Click(sender As Object, e As EventArgs)
+ ' RegistraScript("$('#DivChqDevueltoIE').modal('hide');")
- ChequeDevuelto()
+ ' ChequeDevuelto()
- End Sub
+ 'End Sub
- Private Sub ChequeDevuelto()
- If Not IsDate(TxtFechaDevuelto.Text.ToDate) Then
- Alert("El campo fecha cancelación es incorrecto. Por favor verifique y vuelva a intentar")
- Exit Sub
- End If
+ 'Private Sub ChequeDevuelto()
+ ' If Not IsDate(TxtFechaDevuelto.Text.ToDate) Then
+ ' Alert("El campo fecha cancelación es incorrecto. Por favor verifique y vuelva a intentar")
+ ' Exit Sub
+ ' End If
- If ChkConciliado.Checked Then
- Alert("El documento seleccionado no se puede eliminar porque se encuentra conciliado.", TipoMensaje.MsgError)
- Exit Sub
- End If
+ ' If ChkConciliado.Checked Then
+ ' Alert("El documento seleccionado no se puede eliminar porque se encuentra conciliado.", TipoMensaje.MsgError)
+ ' Exit Sub
+ ' End If
- Dim Banc As New ClsBancos
- Banc.IniciaTransacSQL()
- Dim ObjConta As New ClsContabilidad(Banc.IniciaTransacSQL)
+ ' Dim Banc As New ClsBancos
+ ' Banc.IniciaTransacSQL()
+ ' Dim ObjConta As New ClsContabilidad(Banc.IniciaTransacSQL)
- Dim ObjAC As ClsContPAQi = Nothing
- If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") Then
- ObjAC = New ClsContPAQi(UsuarioActual.Empresa)
- ObjAC.IniciaTransacSQL()
- End If
+ ' Dim ObjAC As ClsContPAQi = Nothing
+ ' If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") Then
+ ' ObjAC = New ClsContPAQi(UsuarioActual.Empresa)
+ ' ObjAC.IniciaTransacSQL()
+ ' End If
- Dim ErrorCancelar = False
- Dim IdPolizaNueva = -1
- Dim FolioPolizaNueva = -1
+ ' Dim ErrorCancelar = False
+ ' Dim IdPolizaNueva = -1
+ ' Dim FolioPolizaNueva = -1
- If (IDPoliza > 0 AndAlso (UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1")) Then
+ ' If (IDPoliza > 0 AndAlso (UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1")) Then
- If ObjAC Is Nothing Then
- ErrorCancelar = True
- End If
+ ' If ObjAC Is Nothing Then
+ ' ErrorCancelar = True
+ ' End If
- If Not ErrorCancelar Then
- Dim dt As DataTable
- If ObjAC.GetPoliza(IDPoliza, -1, -1, -1, -1) AndAlso ObjAC.DtResultados.Rows.Count > 0 Then
- dt = ObjAC.DtResultados
+ ' If Not ErrorCancelar Then
+ ' Dim dt As DataTable
+ ' If ObjAC.GetPoliza(IDPoliza, -1, -1, -1, -1) AndAlso ObjAC.DtResultados.Rows.Count > 0 Then
+ ' dt = ObjAC.DtResultados
- ' MES ANTERIOR, MOVIMIENTOS CONTRARIOS (NEGATIVOS)
+ ' ' MES ANTERIOR, MOVIMIENTOS CONTRARIOS (NEGATIVOS)
- IdPolizaNueva = ObjAC.AddPoliza(1, String.Format("Cheque Devuelto: {0}", dt.Rows(0)("Concepto").ToString), 0, 0, UsuarioActual.CveUsuario, TxtFechaDevuelto.Text.ToDate)
+ ' IdPolizaNueva = ObjAC.AddPoliza(1, String.Format("Cheque Devuelto: {0}", dt.Rows(0)("Concepto").ToString), 0, 0, UsuarioActual.CveUsuario, TxtFechaDevuelto.Text.ToDate)
- If IdPolizaNueva > 0 Then
- FolioPolizaNueva = ObjAC.Folio
+ ' If IdPolizaNueva > 0 Then
+ ' FolioPolizaNueva = ObjAC.Folio
- 'CREA POLIZA NEGATIVA
- For Each dr As DataRow In dt.Rows
- If Not ObjAC.AddMovimiento(IdPolizaNueva, dr("IdCuenta").ToString.ToEntero, dr("TipoMovto").ToString = "True", dr("Importe").ToString.ToDecimal * -1, dr("Referencia").ToString, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), dr("IdSegNeg").ToString.ToEntero, TxtFechaDevuelto.Text.ToDate, "") Then
- ErrorCancelar = True : Exit For
- End If
- Next
+ ' 'CREA POLIZA NEGATIVA
+ ' For Each dr As DataRow In dt.Rows
+ ' If Not ObjAC.AddMovimiento(IdPolizaNueva, dr("IdCuenta").ToString.ToEntero, dr("TipoMovto").ToString = "True", dr("Importe").ToString.ToDecimal * -1, dr("Referencia").ToString, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), dr("IdSegNeg").ToString.ToEntero, TxtFechaDevuelto.Text.ToDate, "") Then
+ ' ErrorCancelar = True : Exit For
+ ' End If
+ ' Next
- 'AJUSTA POLIZA
- If Not ErrorCancelar Then
- If Not ObjAC.AjustaPoliza(IdPolizaNueva) Then
- ErrorCancelar = True
- End If
- End If
+ ' 'AJUSTA POLIZA
+ ' If Not ErrorCancelar Then
+ ' If Not ObjAC.AjustaPoliza(IdPolizaNueva) Then
+ ' ErrorCancelar = True
+ ' End If
+ ' End If
- 'genera nuevo IE contrario
- If Not ErrorCancelar Then
- If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDevuelto.Text.ToDate, 2, 16) <= 0 Then
- ErrorCancelar = True
- End If
- End If
+ ' 'genera nuevo IE contrario
+ ' If Not ErrorCancelar Then
+ ' If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDevuelto.Text.ToDate, 2, 16) <= 0 Then
+ ' ErrorCancelar = True
+ ' End If
+ ' End If
- Else
- ErrorCancelar = True
- End If
+ ' Else
+ ' ErrorCancelar = True
+ ' End If
- End If
- End If
+ ' End If
+ ' End If
- Else
+ ' Else
- 'siempre se hace una cancelación
- If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDevuelto.Text.ToDate, 2, 16) <= 0 Then
- ErrorCancelar = True
- End If
+ ' 'siempre se hace una cancelación
+ ' If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDevuelto.Text.ToDate, 2, 16) <= 0 Then
+ ' ErrorCancelar = True
+ ' End If
- If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
- If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
+ ' If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
+ ' If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
- IDPoliza = ObjConta.ContaIdPoliza
- Else
- ErrorCancelar = True
- Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
- End If
- End If
+ ' IDPoliza = ObjConta.ContaIdPoliza
+ ' Else
+ ' ErrorCancelar = True
+ ' Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
+ ' End If
+ ' End If
- End If
+ ' End If
- If Not ErrorCancelar Then
- If ObjAC IsNot Nothing Then ObjAC.Commit()
- Banc.Commit()
- Dim Msg As New StringBuilder
- Msg.Append("El movimiento bancario quedó devuelto exitosamente.")
+ ' If Not ErrorCancelar Then
+ ' If ObjAC IsNot Nothing Then ObjAC.Commit()
+ ' Banc.Commit()
+ ' Dim Msg As New StringBuilder
+ ' Msg.Append("El movimiento bancario quedó devuelto exitosamente.")
- If IdPolizaNueva > 0 Then Msg.AppendFormat("
Ver Póliza de cancelación", IdPolizaNueva)
- Alert(Msg.ToString, TipoMensaje.MsgInformacion, "document.location.href=""/Bancos/RepIE.aspx""")
- Else
- If ObjAC IsNot Nothing Then ObjAC.RollBack()
- Banc.RollBack()
- Alert("El movimiento bancario no se pudo registrar. Por favor vuelva a intentar.", TipoMensaje.MsgError)
- End If
+ ' If IdPolizaNueva > 0 Then Msg.AppendFormat("
Ver Póliza de cancelación", IdPolizaNueva)
+ ' Alert(Msg.ToString, TipoMensaje.MsgInformacion, "document.location.href=""/Bancos/RepIE.aspx""")
+ ' Else
+ ' If ObjAC IsNot Nothing Then ObjAC.RollBack()
+ ' Banc.RollBack()
+ ' Alert("El movimiento bancario no se pudo registrar. Por favor vuelva a intentar.", TipoMensaje.MsgError)
+ ' End If
- If ObjAC IsNot Nothing Then ObjAC.Dispose()
- Banc.Dispose()
+ ' If ObjAC IsNot Nothing Then ObjAC.Dispose()
+ ' Banc.Dispose()
- End Sub
+ 'End Sub
Protected Sub LnkEliminar_Click(sender As Object, e As EventArgs) Handles LnkEliminar.Click
If CveIECancelado > 0 Then
@@ -5999,7 +5995,13 @@ Partial Class Bancos_IE
Alert("El documento seleccionado no se puede eliminar porque se encuentra conciliado.", TipoMensaje.MsgError)
Exit Sub
End If
- RegistraScript("ShowDivDevueltoIE();")
+ ChkGeneraCancelacion.Checked = True
+ ChkGeneraCancelacion.Visible = False
+ ActivaDevolucion()
+ DdlTipoTransaccionCancelacion.SelectedValue = "16"
+ DdlTipoTransaccionCancelacion.Enabled = False
+ BtnCancelarIE.Text = "Devuelto"
+ RegistraScript("ShowDivCancelarIE();")
End Sub
Protected Sub LnkCancelar_Click(sender As Object, e As EventArgs)
@@ -6712,6 +6714,11 @@ Partial Class Bancos_IE
Protected Sub ChkGeneraCancelacion_CheckedChanged(sender As Object, e As EventArgs)
+ ActivaDevolucion()
+
+ End Sub
+
+ Private Sub ActivaDevolucion()
Dim dttemp As DataTable
Dim TipoMovto As String
dttemp = GlobalDTTipoTransacciones.FiltraParametros($"CveTipoTransaccion ={DdlTipoTransaccion.SelectedValue}")
@@ -6743,7 +6750,6 @@ Partial Class Bancos_IE
End If
UpEliminarCotizacion.Update()
-
End Sub
Private Sub RVTxtFechaDocumento_Init(sender As Object, e As EventArgs) Handles RVTxtFechaDocumento.Init
RVTxtFechaDocumento.MaximumValue = DateTime.Now.ToShortDateString
diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx
index c358525f0..960072f71 100644
--- a/Compras/Compras.aspx
+++ b/Compras/Compras.aspx
@@ -4102,7 +4102,7 @@
-
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index e47d14efd..8a8e6a275 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -8669,10 +8669,7 @@ Partial Class Compras_Compras
' If Not RegenerarPrePoliza(ObjContabilidad, ObjContaAC, 6, False, MultiplicadorNC) Then
' Retorno = False
' End If
- 'End If
-
-
-
+ 'End If
If Not TmpDT.Columns.Contains("DesvicularAF") Then
TmpDT.Columns.Add("DesvicularAF", GetType(Boolean))
@@ -8686,9 +8683,6 @@ Partial Class Compras_Compras
End If
Next
-
-
-
'If UsuarioActual.Empresa.Funcionalidad(207) = "1" Then
If Not ActualizarPrePoliza(ObjContabilidad, ObjCompra) Then
Retorno = False
@@ -8767,31 +8761,6 @@ Partial Class Compras_Compras
Dim CuentaMatrizAlmacen As Integer
Dim ContadorInventario As Integer = GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked)
- 'COMENTADO 15/3/2016
- 'cuando hay algo que ingresar a inventarios
- 'Dim x As Integer = 0
- 'For Each Dr As DataRow In TmpDT.Rows
- ' If GvInv.Rows.Count > 0 Then
- ' If GvInv.Rows(x).FCCheckBox("cbInv").Checked Then
- ' Dr("CveAlmacen") = GvInv.Rows(x).FCDropDownList("ddlEAlmacen").SelectedValue.ToEntero
- ' Else 'limpio el valor para que no truene en linq mas abajo
- ' Dr("CveAlmacen") = 0
- ' End If
- ' x = x + 1
- ' Else
- ' Exit For
- ' End If
- 'Next
-
- ''previamente si hay un ingreso a inventarios
- 'Dim CtaAlmacen As Integer
- 'If ContadorInventario > 0 Then
- ' Dim drr As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveAlmacen = {0}", TmpDT.Rows(0)("CveAlmacen").ToString))
- ' If drr IsNot Nothing Then
- ' CtaAlmacen = drr("IdCtaContable").ToString.ToEntero
- ' End If
- 'End If
-
Dim CtaAlmacen As Integer
If ContadorInventario > 0 Then
Dim drr As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveAlmacen = {0}", GvInv.HeaderRow.FCDropDownList("ddlAlmacen").SelectedValue.ToString.ToEntero))
@@ -8882,24 +8851,10 @@ Partial Class Compras_Compras
tImporte = gvr.FCLiteral("LtlTotal").Text.ToDouble
ttIVA = Math.Round(tImporte * tTotalIVA / tTotalGral, 2)
- ' tDiferenciaIVA -= tIVA
- ' 'identifico si es el ultimo registro, para ver si es necesario un ajuste
- ' If ipresup = GvPS.Rows.Count Then
- ' If Math.Round(TotalDetalle - tTotalGral, 2) <= 0.01 AndAlso tDiferenciaIVA > 0 Then
- ' tIVA += tDiferenciaIVA
- ' End If
- ' End If
' ' 'le sumo el iva al concepto
tImporte += ttIVA
-
- 'PU = tImporte / gvr.DataKey("Cantidad").ToDouble
- 'If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, gvr.DataKey("Cantidad").ToDouble, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1) Then
- ' ErrorAC = True
- ' Exit For
- 'End If
End If
-
Next
CuentaMatrizAlmacen = CtaAlmacen
@@ -9308,15 +9263,7 @@ Partial Class Compras_Compras
Dim Referencia As String = $"{TxtSerie.Text}-{TxtFolio.Text}" ' concatenation interpolation
Select Case ConceptoContable
- 'Case 5
- ' IdCtaContable = 1244
- ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importeMovimiento, Referencia, 5, Referencia, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=DdlProveedor.SelectedValue.ToEntero, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TxtTotal.Text.ToDecimal, ImporteME:=If(tipoCambioActual = 1, 0, TxtTotal.Text.ToDecimal)) Then
- ' ErrorPrepoliza = True
- ' End If
- ' IdCtaContable = 1243
- ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importeMovimiento, Referencia, 205, Referencia, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=DdlProveedor.SelectedValue.ToEntero, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TxtTotal.Text.ToDecimal, ImporteME:=If(tipoCambioActual = 1, 0, TxtTotal.Text.ToDecimal)) Then
- ' ErrorPrepoliza = True
- ' End If
+
Case 6
Dim CveProveedorConcepto As Integer = 0, CveIE As Integer = 0, CveCreditoDetalle As Integer = 0
Dim ConceptoPersonal As String = "", Concepto As String = ""
@@ -9383,13 +9330,6 @@ Partial Class Compras_Compras
DT = TmpDT.FiltraParametros("ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) > 0", "", {"CveAlmacen"})
'RECORREMOS PARA DETECTAR LA MODALIDAD DEL ALMACEN, EN CASO DE SER SOLO EXISTENCIA LIMPIAMOS CVEALMACEN
- 'For Each Dr As DataRow In DT.Rows
- ' If DtAlmacenes.FiltroPrimeroValor("Modalidad", $"CveAlmacen = {Dr("CveAlmacen").ToString.ToEntero}").ToString = "Solo Existencia" Then
- ' Dr("CveAlmacen") = 0
- ' End If
- ' Dr.AcceptChanges()
- 'Next
-
DT.AcceptChanges()
DT = DT.FiltraParametros("ISNULL(CveAlmacen,0) > 0")
If (DT.Rows.Count > 0) AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
@@ -9462,8 +9402,6 @@ Partial Class Compras_Compras
End If
End If
End If
-
-
'GASTO
DT = TmpDT.Copy
'RECORREMOS PARA DETECTAR LA MODALIDAD DEL ALMACEN, EN CASO DE SER SOLO EXISTENCIA LIMPIAMOS CVEALMACEN
@@ -9520,7 +9458,6 @@ Partial Class Compras_Compras
ErrorPrepoliza = True
End If
End If
-
Next
End If
@@ -9529,7 +9466,6 @@ Partial Class Compras_Compras
IdCtaContable = 0
End Select
-
Next
End If
diff --git a/CxC/RepCxC.aspx b/CxC/RepCxC.aspx
index 3e639b089..bfe73aab6 100644
--- a/CxC/RepCxC.aspx
+++ b/CxC/RepCxC.aspx
@@ -351,6 +351,18 @@
diff --git a/CxC/RepCxCDetalle.aspx.vb b/CxC/RepCxCDetalle.aspx.vb
index 3e189178f..cd9c0c6ac 100644
--- a/CxC/RepCxCDetalle.aspx.vb
+++ b/CxC/RepCxCDetalle.aspx.vb
@@ -424,7 +424,9 @@ Partial Class RepCxCDetalle
DdlClientesWS.Attributes.Add("style", "!important width: 100%;")
End If
- If UsuarioActual.CveEmpresa.Contiene(72, 80, 146, 119) Then ChkAnticipos.Visible = True
+ If UsuarioActual.CveEmpresa.Contiene(72, 80, 146, 119) Then ChkAnticipos.Visible = True
+
+ DdlTieneLineaAdicional.SelectedValueExist(If(Request("TieneLineaAdicional") IsNot Nothing, Request("TieneLineaAdicional").ToString, "-1").ToString)
End Sub
Private Function CargaDatos() As DataSet
@@ -455,7 +457,7 @@ Partial Class RepCxCDetalle
RblTipoCambio.SelectedValue.ToEntero, TCEspecifico, If(DdlTipoDocto.GetSelectedValuesM = "", "-1", DdlTipoDocto.GetSelectedValuesM), FechaVI, FechaVF,
FechaCorte:=txtCorteA.Text.ToDate, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveCobranzaEstatus:=DdlCobranzaEstatusFiltro.SelectedValue.ToEntero,
CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, LimiteCredito:=LimiteCredito, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero,
- CveMoneda:=CveMoneda, EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticiposPagados:=If(ChkAnticipos.Checked, 1, 0)) Then
+ CveMoneda:=CveMoneda, EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticiposPagados:=If(ChkAnticipos.Checked, 1, 0), TieneLineaAdicional:=DdlTieneLineaAdicional.SelectedValue.ToEntero()) Then
GvDatos.DataSource = ObjMovtos.DSResultados.Tables(0)
diff --git a/Inventarios/PopUpExistenciasAlmacen.aspx b/Inventarios/PopUpExistenciasAlmacen.aspx
index 89158f963..c4ddc02d5 100644
--- a/Inventarios/PopUpExistenciasAlmacen.aspx
+++ b/Inventarios/PopUpExistenciasAlmacen.aspx
@@ -91,6 +91,13 @@
+
+
Compuesto:
+
+
+
+
+
@@ -130,11 +137,12 @@
-
+
-
+
-
+
+
<%-- --%>
diff --git a/Inventarios/PopUpExistenciasAlmacen.aspx.vb b/Inventarios/PopUpExistenciasAlmacen.aspx.vb
index 963025db1..2393e712e 100644
--- a/Inventarios/PopUpExistenciasAlmacen.aspx.vb
+++ b/Inventarios/PopUpExistenciasAlmacen.aspx.vb
@@ -73,6 +73,9 @@ Partial Class Inventarios_Default
DivEquivalentes.Visible = True
DivPS.Visible = False
End If
+ If UsuarioActual.CveEmpresa = 119 AndAlso UsuarioActual.CveUsuario.Contiene(1703, 100) Then
+ TrCompuesto.Visible = True
+ End If
Dim Txt As String = IfNull(Request("Txt"), "").ToString
If Txt <> "" Then LblTitulo.Text = String.Format("Búsqueda de {0}", Txt)
@@ -91,6 +94,8 @@ Partial Class Inventarios_Default
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
CargarDatosMedRin()
CargaEquivalencia()
+ ElseIf UsuarioActual.CveEmpresa = 119 AndAlso UsuarioActual.CveUsuario.Contiene(1703, 100) Then
+ CargaDatosCompuesto()
Else
CargaDatos(DDlPS.SelectedValue.ToEntero, 1)
End If
@@ -107,53 +112,7 @@ Partial Class Inventarios_Default
If ObjInventarios.GetExistenciasProducto(CvePS, -1, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"),
ExcluyeApartados:=-1, ExcluyeAdelantado:=1, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero,
ExcluyeTransitorios:=1, RestringirAlmacenes:=RestringirAlmacenes, TopSelect:=100) Then
- Dim dr As Data.DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
-
- If dr IsNot Nothing Then
- LtPs.Text = $"Producto: {dr("PSCodigo").ToString}"
- Dim CvePrecioLista As Integer = -1
- If Not UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'sino manneja precios de lista
- CvePrecioLista = -2
- End If
-
- Dim ObjVta As New ClsVentas
- Dim objPS As New ClsProductosServicios
- If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then
- If ObjVta.DtResultados.Rows.Count > 0 Then
- If CvePrecioLista = -1 Then CvePrecioLista = ObjVta.DtResultados.Rows(0)("CvePrecioLista").ToString.ToEntero
- If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioLista, -1, DDlPS.SelectedValue.ToEntero) Then
- If objPS.DtResultados.Rows.Count > 0 Then
- LtPrecioPS.Text = $"Precio de venta: $: {objPS.DtResultados.Rows(0)("PrecioLista").ToString.FormatoNumero} {dr("Abreviatura").ToString}"
- End If
- End If
- End If
- End If
- ObjVta.Dispose()
- objPS.Dispose()
- If UsuarioActual.CveEmpresa = 119 Then
- If CBool(dr("AplicaIEPS")) Then
- LtlIEPS.Visible = True
- LtlIEPSPorcentaje.Visible = True
- LtlIEPSPorcentaje.Text = $"% {(dr("IEPSPorcentaje").ToString.ToDouble * 100).FormatoNumero}"
- Else
- LtlIEPS.Visible = False
- LtlIEPSPorcentaje.Visible = False
- End If
- If dr("IVA").ToString = "-1" OrElse dr("IVA").ToString.ToDecimal > 0 Then
- LtlIVA.Visible = True
- LtlIVAPorcentaje.Visible = True
- LtlIVAPorcentaje.Text = $"Si"
- Else
- LtlIVA.Visible = False
- LtlIVAPorcentaje.Visible = False
- End If
- End If
- End If
-
- If UsuarioActual.TienePermisoPagina(624) Then
- HlPendiente.Visible = True
- HlPendiente.NavigateUrl = String.Format("/Inventarios/RepVentasXSurtir.aspx?CvePS={0}", CvePS)
- End If
+ CargaPS(CvePS)
If ObjInventarios.DtResultados.Rows.Count > 0 Then
GV.DataSource = ObjInventarios.DtResultados
@@ -167,14 +126,66 @@ Partial Class Inventarios_Default
ObjInventarios.Dispose()
GV.DataBind()
-
-
UPDatos.Update()
- TblBusqueda.Visible = True
+
Else
Alert("Seleccione un producto", TipoMensaje.MsgAdvertencia)
End If
End Sub
+
+ Private Sub CargaPS(CvePS As Integer)
+ If CvePS <= 0 Then Exit Sub
+
+ Dim dr As Data.DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
+
+ If dr IsNot Nothing Then
+ TblBusqueda.Visible = True
+ LtPs.Text = $"Producto: {dr("PSCodigo").ToString}"
+ Dim CvePrecioLista As Integer = -1
+ If Not UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'sino manneja precios de lista
+ CvePrecioLista = -2
+ End If
+
+ Dim ObjVta As New ClsVentas
+ Dim objPS As New ClsProductosServicios
+ If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then
+ If ObjVta.DtResultados.Rows.Count > 0 Then
+ If CvePrecioLista = -1 Then CvePrecioLista = ObjVta.DtResultados.Rows(0)("CvePrecioLista").ToString.ToEntero
+ If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioLista, -1, DDlPS.SelectedValue.ToEntero) Then
+ If objPS.DtResultados.Rows.Count > 0 Then
+ LtPrecioPS.Text = $"Precio de venta: $: {objPS.DtResultados.Rows(0)("PrecioLista").ToString.FormatoNumero} {dr("Abreviatura").ToString}"
+ End If
+ End If
+ End If
+ End If
+ ObjVta.Dispose()
+ objPS.Dispose()
+ If UsuarioActual.CveEmpresa = 119 Then
+ If CBool(dr("AplicaIEPS")) Then
+ LtlIEPS.Visible = True
+ LtlIEPSPorcentaje.Visible = True
+ LtlIEPSPorcentaje.Text = $"% {(dr("IEPSPorcentaje").ToString.ToDouble * 100).FormatoNumero}"
+ Else
+ LtlIEPS.Visible = False
+ LtlIEPSPorcentaje.Visible = False
+ End If
+ If dr("IVA").ToString = "-1" OrElse dr("IVA").ToString.ToDecimal > 0 Then
+ LtlIVA.Visible = True
+ LtlIVAPorcentaje.Visible = True
+ LtlIVAPorcentaje.Text = $"Si"
+ Else
+ LtlIVA.Visible = False
+ LtlIVAPorcentaje.Visible = False
+ End If
+ End If
+
+ If UsuarioActual.TienePermisoPagina(624) Then
+ HlPendiente.Visible = True
+ HlPendiente.NavigateUrl = String.Format("/Inventarios/RepVentasXSurtir.aspx?CvePS={0}", CvePS)
+ End If
+
+ End If
+ End Sub
Private Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CveAlmacen") = "" Then
@@ -199,7 +210,22 @@ Partial Class Inventarios_Default
End If
End Sub
+ Private Sub CargaDatosCompuesto()
+ Dim Compuesto As String = TxtCompuesto.Text.Trim
+ If Compuesto = "" Then Compuesto = "-1"
+ Dim ObjInventarios As New ClsInventarios
+ If ObjInventarios.GetExistencias119(DDlPS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveUsuario, Compuesto) Then
+ GV.DataSource = ObjInventarios.DtResultados
+ TblBusqueda.Visible = False
+ CargaPS(DDlPS.SelectedValue.ToEntero)
+ GV.Columns(6).Visible = True
+ End If
+ ObjInventarios.Dispose()
+ GV.DataBind()
+ UPDatos.Update()
+ DivMedRin.Visible = True
+ End Sub
#Region " BUSCA | CODIGO - SERIE "
Protected Sub BtnCodigoPS_Click(sender As Object, e As EventArgs)
diff --git a/Inventarios/RepProductosPorCaducar.aspx b/Inventarios/RepProductosPorCaducar.aspx
index 451465fb4..d069541b3 100644
--- a/Inventarios/RepProductosPorCaducar.aspx
+++ b/Inventarios/RepProductosPorCaducar.aspx
@@ -104,10 +104,13 @@
Elaboración
-
+
+
+
+
-
+
@@ -117,10 +120,10 @@
-
+
-
+
diff --git a/Inventarios/RepProductosPorCaducar.aspx.cs b/Inventarios/RepProductosPorCaducar.aspx.cs
index 3fbb2a6d8..8a1519fdd 100644
--- a/Inventarios/RepProductosPorCaducar.aspx.cs
+++ b/Inventarios/RepProductosPorCaducar.aspx.cs
@@ -42,14 +42,18 @@ public partial class Inventarios_RepProductosPorCaducar : ClsPaginas
string Cves_Alamcenes = ddlAlmacen.GetSelectedValuesM();
DateTime FI = ModExtensiones.MinFecha;
- if (TxtFechaInicio.Text != "") FI = TxtFechaInicio.Text.ToDate();
-
+ DateTime FF = ModExtensiones.MaxFecha;
+ if (!ChkFechasTodas.Checked)
+ {
+ if (TxtFechaInicio.Text != "") FI = TxtFechaInicio.Text.ToDate();
+ if (TxtFechaFin.Text != "") FF = TxtFechaFin.Text.ToDate();
+ }
int CvePS = -1;
if (DdlPS.SelectedValue.ToEntero() > 0) CvePS = DdlPS.SelectedValue.ToEntero();
// aqui siempre se visualiza la caducidad, sin importar la condición, porque siempre se valida la caducidad
ClsInventarios ObjInventarios = new ClsInventarios();
- if (ObjInventarios.GetProductosCaducidad(DdlProveedor.SelectedValue.ToEntero(), FI, TxtFechaFin.Text.ToDate(), DdlSucursal.SelectedValue.ToEntero(),
+ if (ObjInventarios.GetProductosCaducidad(DdlProveedor.SelectedValue.ToEntero(), FI, FF, DdlSucursal.SelectedValue.ToEntero(),
DdlClasificacion.SelectedValue.ToEntero(), CvePS, Cves_Alamcenes, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Opcion: DdlOpcion.SelectedValue.ToEntero(),
CveCompuesto: DdlCompuesto.SelectedValue.ToEntero() ))
{
@@ -107,36 +111,20 @@ public partial class Inventarios_RepProductosPorCaducar : ClsPaginas
private void CargarSucursales()
{
- //ClsSubProyectos ObjSubProyectos = new ClsSubProyectos();
- //if (ObjSubProyectos.GetSubProyectos(UsuarioActual.CveEmpresa))
- //{
- // DdlSucursal.DataSource = ObjSubProyectos.DtResultados;
- //}
- //ObjSubProyectos.Dispose();
+
DdlSucursal.DataSource = get_GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1);
DdlSucursal.DataBind();
- DdlSucursal.Items.Insert(0, new ListItem("Todas", "-1"));
-
-
-
+ DdlSucursal.Items.Insert(0, new ListItem("Todas", "-1"));
}
private void CargarClasificaciones()
{
- //ClsClasificaciones ObjClasificacion = new ClsClasificaciones();
- //if (ObjClasificacion.GetClasificaciones(UsuarioActual.CveEmpresa))
- //{
- // DdlClasificacion.DataSource = ObjClasificacion.DtResultados;
- //}
- //ObjClasificacion.Dispose();
+
DdlClasificacion.DataSource = get_GlobalDTClasificaciones(UsuarioActual.CveEmpresa);
DdlClasificacion.DataBind();
DdlClasificacion.Items.Insert(0, new ListItem("Todas", "-1"));
}
-
-
-
-
+
private void CargaAlamacenes(int CveSubProyectoFiltro = -1)
{
@@ -156,9 +144,7 @@ public partial class Inventarios_RepProductosPorCaducar : ClsPaginas
UPFiltros.Update();
}
-
-
-
+
protected void BtnConsultar_Click(object sender, EventArgs e)
{
@@ -210,10 +196,7 @@ public partial class Inventarios_RepProductosPorCaducar : ClsPaginas
ImprimirPDF("Empresas/Grales/Formatos/RepProductosCaducidad.rdlc", DTDatos, @params, "Reporte de Productos por Caducar", formato);
}
-
-
-
-
+
protected void DdlSucursal_SelectedIndexChanged(object sender, EventArgs e)
{
CargaAlamacenes(DdlSucursal.SelectedValue.ToEntero());
@@ -239,5 +222,16 @@ public partial class Inventarios_RepProductosPorCaducar : ClsPaginas
CargarDatos();//Si no se recarga no se muestran los valores dela la columna de tiempo caducindad laprimera vez que pasa de oculta a mostrarse
UpDatos.Update();
}
-
+
+ protected void ChkFechasTodas_CheckedChanged(object sender, EventArgs e)
+ {
+ if (ChkFechasTodas.Checked)
+ {
+ divF1.Visible = false; divF2.Visible = false; divF3.Visible = false; divF4.Visible = false;
+ }
+ else
+ {
+ divF1.Visible = true; divF2.Visible = true; divF3.Visible = true; divF4.Visible = true;
+ }
+ }
}
\ No newline at end of file
diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb
index 0506df4ff..a23bcf161 100644
--- a/Inventarios/TraspasoAlmacen.aspx.vb
+++ b/Inventarios/TraspasoAlmacen.aspx.vb
@@ -956,7 +956,7 @@ Partial Class Inventarios_TraspasoAlmacen
' si la existencia es negativa y tiene serie ó lote, quiere decir que la consulta es específica, y si hay pendientes por surtir. puede generar negativos
' para asegurarnos que lo pendiente por surtir se pueda surtir con otras series, consultamos de nuevo, pero a nivel producto, para checar existencia
- If ExistenciaSinPendiente > 0 AndAlso Existencia < 0 AndAlso PendienteporSurtir > 0 Then
+ If ExistenciaSinPendiente > 0 AndAlso Existencia <= 0 AndAlso PendienteporSurtir > 0 Then
If ObjInventario.GetExistenciasProducto(gvr.DataKey("CvePS").ToEntero, gvr.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd 23:59")) Then
'si hay existencia en almacen costeado, lo tengo que sacar
Existencia = ObjInventario.DtResultados.FiltroPrimeroValor("ExistenciaFinal", String.Format("CveAlmacen = {0}", DdlAlmacenOrigen.SelectedValue)).ToDecimal
diff --git a/Ventas/CatPS.aspx.vb b/Ventas/CatPS.aspx.vb
index 7a1992cb7..1663db614 100644
--- a/Ventas/CatPS.aspx.vb
+++ b/Ventas/CatPS.aspx.vb
@@ -39,12 +39,14 @@ Partial Class CatPS
TxtCodigoBarras.Focus()
End If
- 'CargaDatos()
-
If UsuarioActual.TienePermisoProceso(122) Then
LBAgregarPS.Visible = False
End If
+ If UsuarioActual.CveEmpresa = 119 Then
+ DdlEstado.SelectedValue = "-1"
+ End If
+
End If
End Sub
diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx
index 1ee46d247..c70a0433f 100644
--- a/Ventas/Clientes.aspx
+++ b/Ventas/Clientes.aspx
@@ -2104,6 +2104,7 @@
+
@@ -7059,9 +7060,9 @@
$("#C_Tab_TabContratos_tab").click(function () { CargaContratos(); });
}
- var isAsyncPostback = Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();
- if (isAsyncPostback) {
- tb_init('a.thickbox');
+ var isAsyncPostback = Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();
+ if (isAsyncPostback) {
+ tb_init('a.thickbox');
}
}
diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx
index 36662c5fb..180aa01e7 100644
--- a/Ventas/Ventas.aspx
+++ b/Ventas/Ventas.aspx
@@ -3443,6 +3443,17 @@
+
+
Linea Adicional:
+
+
+
+
+
+
+
+
+
Forma de entrega:
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index b828d9285..e2375e4b3 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -2231,6 +2231,32 @@ Partial Class Ventas
ViewState("ClienteRegimenFiscal") = value
End Set
End Property
+ Private Property CveLineaAdicionalVenta As Integer
+ Get
+ Return IfNull(ViewState("CveLineaAdicionalVenta"), "-1", ViewState("CveLineaAdicionalVenta")).ToString().ToEntero()
+ End Get
+ Set(value As Integer)
+ ViewState("CveLineaAdicionalVenta") = value
+ End Set
+ End Property
+
+ Private Property SaldoLineaAdicional As Decimal
+ Get
+ Return (IfNull(ViewState("ImporteLineaAdicional"), "0", ViewState("ImporteLineaAdicional"))).ToString().ToDecimal()
+ End Get
+ Set(value As Decimal)
+ ViewState("ImporteLineaAdicional") = value
+ End Set
+ End Property
+
+ Private Property CveClasificacionLineaAdicional As Integer
+ Get
+ Return IfNull(ViewState("CveClasificacionLineaAdicional"), "-1", ViewState("CveClasificacionLineaAdicional")).ToString().ToEntero()
+ End Get
+ Set(value As Integer)
+ ViewState("CveClasificacionLineaAdicional") = value
+ End Set
+ End Property
#End Region
@@ -4583,6 +4609,11 @@ Partial Class Ventas
ViewState("CveSubProyectoVenta") = DbRowVenta("CveSubProyecto").ToString().ToEntero()
Me.CveEstatusFacturaPadre = DbRowVenta("CveEstatusFacturaPadre").ToString().ToEntero()
+
+ If UsuarioActual.Empresa.Funcionalidad(705) = "1" Then
+ Me.CveLineaAdicionalVenta = DbRowVenta("CveLineaAdicional").ToString().ToEntero()
+ End If
+
'CargaEncabezado
If Not (CveRemision > 0 Or CveCotizacion > 0) Then
DdlTipoComprobante.SelectedValue = DbRowVenta("TipoDocto").ToString()
@@ -5637,6 +5668,10 @@ Partial Class Ventas
End If
End If
+ If UsuarioActual.Empresa.Funcionalidad(705) = "1" AndAlso Me.CveLineaAdicionalVenta > 0 Then
+ CalculaLineasAdicionales()
+ End If
+
UpPS.Update()
UpContado.Update()
UpEstatus.Update()
@@ -6645,6 +6680,16 @@ Partial Class Ventas
End If
BloqueaCondiconesPago()
DeshabilitarAplicarNotaDeCredito(LblRFC.Text)
+
+ 'If UsuarioActual.Empresa.Funcionalidad(705) = "1" Then
+ ' Using ObjVentas As New ClsVentas
+ ' If ObjVentas.GetLineasAdicionales(-1, CveCliente, -1, -1, DdlMoneda.SelectedValue.ToEntero(), MinFecha, MaxFecha, 0, UsuarioActual.CveEmpresa) Then
+ ' If ObjVentas.DtResultados.Rows.Count > 0 Then
+ ' TrLineaAdicional.Visible = True
+ ' End If
+ ' End If
+ ' End Using
+ 'End If
End Sub
Private Sub CargaRelacionadasPendientes()
@@ -8727,9 +8772,10 @@ Partial Class Ventas
End If
End If
+ 'SI TIENE LINEA ADICIONAL NO VERIFICAR LIMITE DE CREDITO
'SI NO TIENE AUTORIZACION VERIFICAR LIMITE DE CREDITO Y CANDADOS DE VENTA
'No exceder el limite de credito, Si no tiene contrato limita el credito, si tiene no hace nada. Si no tiene remisiones tampoco hace nada.
- If Me.CveAutorizacion <= 0 AndAlso (Not CveContrato > 0 Or CveContratoTipo.Contiene(28)) AndAlso (Not NuevaFactura = 1) AndAlso RBLPago.SelectedValue = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") AndAlso RemisionesLista.Count <= 0 AndAlso TxtTotal.Text.ToDecimal > 0 AndAlso Not CvePedidoA > 0 Then
+ If DdlLineaAdicional.SelectedValue.ToEntero() <= 0 AndAlso Me.CveAutorizacion <= 0 AndAlso (Not CveContrato > 0 Or CveContratoTipo.Contiene(28)) AndAlso (Not NuevaFactura = 1) AndAlso RBLPago.SelectedValue = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") AndAlso RemisionesLista.Count <= 0 AndAlso TxtTotal.Text.ToDecimal > 0 AndAlso Not CvePedidoA > 0 Then
'If UsuarioActual.Empresa.Funcionalidad(518) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(185) Then
If Not UsuarioActual.Empresa.Funcionalidad(702) = "1" Then
@@ -8782,6 +8828,30 @@ Partial Class Ventas
'End If
End If
+ 'VALIDAR LINEAS ADICIONALES
+ If UsuarioActual.Empresa.Funcionalidad(705) = "1" AndAlso DdlLineaAdicional.SelectedValue.ToEntero() > 0 Then
+ 'VERIFICA QUE LA CLASIFICACION DE LOS PRODUCTOS DEBE SER LA MISMA DE LA LINEA ADICIONAL
+ If TmpDT IsNot Nothing AndAlso Me.CveClasificacionLineaAdicional > 0 Then
+ For Each Row As DataRow In TmpDT.FiltraParametros("", DistinctColumns:={"CveClasificacion", "Clasificacion"}).Rows
+ If Me.CveClasificacionLineaAdicional <> Row("CveClasificacion").ToString().ToEntero() Then
+ Alert($"La clasificación '{Row("Clasificacion")}' no pertenece a la linea adicional.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+ Next
+ End If
+
+ If Me.SaldoLineaAdicional <= 0 Then
+ Alert("El saldo de la linea adicional debe ser mayor a cero", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ 'VERIFICA QUE EL SALDO DISPONIBLE SEA MENOR AL IMPORTE
+ If Me.SaldoLineaAdicional <= TxtTotal.Text.ToDecimal() Then
+ Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+ End If
+
'VALIDA PRECIO AL AGREGAR A ALMACEN
If Not UsuarioActual.TienePermisoProceso(169) Then
@@ -12559,7 +12629,8 @@ Partial Class Ventas
CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, CveAcercamientoCRM:=CveAcercamientoCRM,
DiasCredito:=factura.DiasCredito, EsDiasCreditoFijo:=factura.EsDiasCreditoFijo, AnticipoEspecial:=If(TrAntEspecial.Visible, ChkAntEspecial.Checked, False),
Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=factura.CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text,
- FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, FacturarSucursal:=factura.FacturarSucursal, VentaDesglosaIEPS:=factura.VentaDesglosaIEPS, RFCReceptor:=RFCReceptor, Adjunto:=Adjunto, DevolucionImportePagado:=factura.DevolucionImportePagado, EsGarantia:=factura.EsGarantia, ServicioDomicilio:=TrServicioDomicilio.Visible) Then
+ FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, FacturarSucursal:=factura.FacturarSucursal, VentaDesglosaIEPS:=factura.VentaDesglosaIEPS, RFCReceptor:=RFCReceptor, Adjunto:=Adjunto, DevolucionImportePagado:=factura.DevolucionImportePagado, EsGarantia:=factura.EsGarantia, ServicioDomicilio:=TrServicioDomicilio.Visible,
+ CveLineaAdicional:=DdlLineaAdicional.SelectedValue.ToEntero()) Then
ErrorList.Add("Ocurrió un error al Generar la Venta. Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Else
If factura.TipoDocto.Contiene("Dev", "Egs") OrElse DtVentasNC IsNot Nothing OrElse CveEstatusRefacturacion > 0 OrElse CveAnticipoPadre > 0 Then
@@ -17963,6 +18034,8 @@ Partial Class Ventas
ListaDescuentos.Add(ObjDescuento)
End If
+ CalculaLineasAdicionales()
+
CalculaTotalesVenta()
LimpiaAgregar()
@@ -17979,6 +18052,43 @@ Partial Class Ventas
End Sub
+ Private Sub CalculaLineasAdicionales()
+ If DdlTipoComprobante.SelectedValue = "Ing" AndAlso UsuarioActual.Empresa.Funcionalidad(705) = "1" Then
+ DdlLineaAdicional.DataSource = Nothing
+
+ Using ObjVentas As New ClsVentas
+ If CveVenta > 0 Then
+ If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, DdlMoneda.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, ConSaldo:=-1) Then
+ If ObjVentas.DtResultados.Rows.Count > 0 Then
+ TrLineaAdicional.Visible = True
+ DdlLineaAdicional.DataSource = ObjVentas.DtResultados.FiltraParametros($"Saldo > 0 OR CveLineaAdicional = {Me.CveLineaAdicionalVenta}")
+ End If
+ End If
+ Else
+ If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, DdlMoneda.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, ConSaldo:=1) Then
+ If ObjVentas.DtResultados.Rows.Count > 0 Then
+ TrLineaAdicional.Visible = True
+ DdlLineaAdicional.DataSource = ObjVentas.DtResultados
+ End If
+ End If
+ End If
+ End Using
+
+ DdlLineaAdicional.DataBind()
+ DdlLineaAdicional.Items.Insert(0, New ListItem("Seleccione", "-1"))
+
+ If Me.CveLineaAdicionalVenta > 0 Then
+ DdlLineaAdicional.SelectedValueExist(CveLineaAdicionalVenta.ToString())
+ DdlLineaAdicional_SelectedIndexChanged(DdlLineaAdicional, EventArgs.Empty)
+ DdlLineaAdicional.Enabled = False
+ LnkUpdateLineaAdicional.Visible = True
+ End If
+
+ End If
+
+ UPCondicionesPago.Update()
+ End Sub
+
Private Sub AgregarPSPYME()
If Modalidad = "A" Then
@@ -18277,8 +18387,12 @@ Partial Class Ventas
End If
LblRetIVA.Text = (ClienteRetIVA * 100).FormatoNumero
- TrRetIVA.Style.Add("display", "")
- DdlTipoRetencion.Visible = True
+ If LblRetIVA.Text.ToDecimal() > 0 Then
+ TrRetIVA.Style.Add("display", "")
+ DdlTipoRetencion.Visible = True
+ Else
+ TrRetIVA.Style.Add("display", "none")
+ End If
Row("IVA") = Row("PorcentajeIVA")
@@ -33288,13 +33402,15 @@ Partial Class Ventas
TxtPedidoContrato.Enabled = True
TxtObsAlmacen.Enabled = True
RblPaqueteria.Enabled = True
-
+ DdlLineaAdicional.Enabled = True
+ LnkUpdateLineaAdicional.Visible = True
'Acciones
BtnEditar.Text = "Guardar"
UpParametros.Update()
UPObservaciones.Update()
UpFacturar.Update()
+ UPCondicionesPago.Update()
End Sub
Private Sub GuardarValoresEditados()
@@ -35153,5 +35269,57 @@ Partial Class Ventas
End Sub
+ Protected Sub DdlLineaAdicional_SelectedIndexChanged(sender As Object, e As EventArgs)
+ If DdlLineaAdicional.SelectedValue.ToEntero() > 0 Then
+ RBLPago.SelectedValue = "1"
+ RBLPago.Enabled = False
+
+ Using ObjVentas As New ClsVentas
+ If ObjVentas.GetLineasAdicionalesSaldo(DdlLineaAdicional.SelectedValue.ToEntero(), CveCliente, -1, DdlMoneda.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa) Then
+ If ObjVentas.DtResultados.Rows.Count > 0 Then
+ TxtFechaPago.Text = ObjVentas.DtResultados.Rows(0)("FechaVencimiento").ToString().ToDateTime().ToString("dd/MM/yyyy")
+ Me.SaldoLineaAdicional = ObjVentas.DtResultados.Rows(0)("Saldo").ToString().ToDecimal()
+ Me.CveClasificacionLineaAdicional = ObjVentas.DtResultados.Rows(0)("CveClasificacionPS").ToString().ToEntero()
+ End If
+ End If
+ End Using
+ Else
+ Me.SaldoLineaAdicional = 0
+ Me.CveClasificacionLineaAdicional = 0
+ End If
+
+ UPCondicionesPago.Update()
+ End Sub
+ Protected Sub LnkUpdateLineaAdicional_Click(sender As Object, e As EventArgs)
+ 'VALIDAR LINEAS ADICIONALES
+ If UsuarioActual.Empresa.Funcionalidad(705) = "1" AndAlso DdlLineaAdicional.SelectedValue.ToEntero() > 0 Then
+ 'VERIFICA QUE LA CLASIFICACION DE LOS PRODUCTOS DEBE SER LA MISMA DE LA LINEA ADICIONAL
+ If TmpDT IsNot Nothing AndAlso Me.CveClasificacionLineaAdicional > 0 Then
+ For Each Row As DataRow In TmpDT.FiltraParametros("", DistinctColumns:={"CveClasificacion", "Clasificacion"}).Rows
+ If Me.CveClasificacionLineaAdicional <> Row("CveClasificacion").ToString().ToEntero() Then
+ Alert($"La clasificación '{Row("Clasificacion")}' no pertenece a la linea adicional.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+ Next
+ End If
+
+ If Me.SaldoLineaAdicional <= 0 Then
+ Alert("El saldo de la linea adicional debe ser mayor a cero", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ 'VERIFICA QUE EL SALDO DISPONIBLE SEA MENOR AL IMPORTE
+ If Me.SaldoLineaAdicional <= TxtTotal.Text.ToDecimal() Then
+ Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+ End If
+
+ Using ObjVentas As New ClsVentas
+ If ObjVentas.UpdateVentaLineaAdicional(DdlLineaAdicional.SelectedValue.ToEntero(), Me.CveVenta, UsuarioActual.CveEmpresa) Then
+ Alert("Se actualizo la linea adicional de crédito de la venta")
+ End If
+ End Using
+ End Sub
End Class