diff --git a/App_Code/ClsAcumuladores.vb b/App_Code/ClsAcumuladores.vb
index 85b31fb86..0ad493781 100644
--- a/App_Code/ClsAcumuladores.vb
+++ b/App_Code/ClsAcumuladores.vb
@@ -7,10 +7,10 @@ Imports Extensiones
Public Class ClsAcumuladores
- Implements IDisposable
-
+ Implements IDisposable
+
#Region "Campos"
- 'SQL
+ 'SQL
Private SqlConexion As SqlConnection
Private SqlAdapter As SqlDataAdapter
Private SqlTransacc As SqlTransaction
@@ -51,7 +51,7 @@ Public Class ClsAcumuladores
If TransaccionCompartida Is Nothing Then
SqlConexion = New SqlConnection
- SqlConexion.ConnectionString = CadenaConexion() ' ConfigurationManager.ConnectionStrings("Conexion").ConnectionString
+ SqlConexion.ConnectionString = CadenaConexion() ' ConfigurationManager.ConnectionStrings("Conexion").ConnectionString
SqlAdapter = New SqlDataAdapter("", SqlConexion)
Try
@@ -68,9 +68,9 @@ Public Class ClsAcumuladores
SqlAdapter = New SqlDataAdapter("", SqlConexion)
ConexionAdd()
- End Sub
+ End Sub
#Region "Conexiones"
-
+
Private Sub ConexionAdd()
If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try
@@ -103,18 +103,18 @@ Public Class ClsAcumuladores
CveConexion = 0
End If
- End Sub
+ End Sub
#End Region
Public ReadOnly Property DtResultados() As DataTable
Get
DtResultados = Data
End Get
- End Property
-
+ End Property
+
#End Region
-
+
#Region " TAMAÑOS "
-
+
Public Function TamañoGet(CveTamaño As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
'Data = New DataTable
@@ -245,38 +245,38 @@ Public Class ClsAcumuladores
End Try
Return Retorno
- End Function
-
- Public Function EntradasUsadosGet(CveEmpresa As Integer, CveAlmacen As Integer, FechaInicial As Date, FechaFinal As Date) As Boolean
- Dim retorno As Boolean = False
-
- SqlDataAdapter("PA_Acum_EntradasUsadosResumenRep")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
- .Add("@FechaInicial", SqlDbType.Date).Value = FechaInicial
- .Add("@FechaFinal", SqlDbType.Date).Value = FechaFinal
- End With
-
- Try
- SqlAdapter.Fill(Data)
- retorno = True
- Catch ex As Exception
-
- OnError("Ocurrió un error al traerse el reporte de usados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
-
- End Try
-
- Return retorno
-
- End Function
-
-
+ End Function
+
+ Public Function EntradasUsadosGet(CveEmpresa As Integer, CveAlmacen As Integer, FechaInicial As Date, FechaFinal As Date) As Boolean
+ Dim retorno As Boolean = False
+
+ SqlDataAdapter("PA_Acum_EntradasUsadosResumenRep")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
+ .Add("@FechaInicial", SqlDbType.Date).Value = FechaInicial
+ .Add("@FechaFinal", SqlDbType.Date).Value = FechaFinal
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ retorno = True
+ Catch ex As Exception
+
+ OnError("Ocurrió un error al traerse el reporte de usados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+
+ End Try
+
+ Return retorno
+
+ End Function
+
+
#End Region
-
+
#Region " TIPOS DEFECTO "
-
+
Public Function TiposDefectoGet(CveTipoDefecto As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
'Data = New DataTable
@@ -375,12 +375,12 @@ Public Class ClsAcumuladores
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
+
#Region " TIPOS USO "
-
+
Public Function TiposUsoGet(CveTipoUso As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
'Data = New DataTable
@@ -479,12 +479,12 @@ Public Class ClsAcumuladores
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
+
#Region " FOLIOS GARANTÍA "
-
+
Public Function FoliosGarantiaGet(CveFolioGarantia As Integer, CveEmpresa As Integer, Optional Estatus As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional TipoFolio As String = "-1", Optional Area As Integer = 1) As Boolean
Dim Retorno As Boolean = False
'Data = New DataTable
@@ -492,11 +492,11 @@ Public Class ClsAcumuladores
SqlDataAdapter("PA_Acum_FoliosGarantiaGet")
With SqlAdapter.SelectCommand.Parameters
- .Add("@CveFolioGarantia", SqlDbType.Int).Value = CveFolioGarantia
+ .Add("@CveFolioGarantia", SqlDbType.Int).Value = CveFolioGarantia
.Add("@Estatus", SqlDbType.Int).Value = Estatus
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
- .Add("@tipoFolio", SqlDbType.VarChar).Value = TipoFolio
+ .Add("@tipoFolio", SqlDbType.VarChar).Value = TipoFolio
.Add("@Area", SqlDbType.Int).Value = Area
End With
@@ -526,7 +526,7 @@ Public Class ClsAcumuladores
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@TipoFolio", SqlDbType.VarChar).Value = TipoFolio
- .Add("@Limite", SqlDbType.Int).Value = Limite
+ .Add("@Limite", SqlDbType.Int).Value = Limite
.Add("@Area", SqlDbType.Int).Value = Area
End With
@@ -594,27 +594,27 @@ Public Class ClsAcumuladores
End Try
Return Retorno
- End Function
-
- Public Function GetNuevoConsecutivoFolio(CveFolioGarantia As Integer) As Boolean
- Dim Retorno As Boolean = False
- SqlDataAdapter(String.Format("SELECT MAX(dbo.FNC_Numero(Consecutivo)) AS NuevoConsecutivo FROM Acum_GarantiasDetalle d WHERE d.CveFolioGarantia = {0}", CveFolioGarantia), CommandType.Text)
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError(String.Format("Ocurrió un error al consultar un nuevo consecutivo para el folio {0}", CveFolioGarantia), ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
+ End Function
+
+ Public Function GetNuevoConsecutivoFolio(CveFolioGarantia As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ SqlDataAdapter(String.Format("SELECT MAX(dbo.FNC_Numero(Consecutivo)) AS NuevoConsecutivo FROM Acum_GarantiasDetalle d WHERE d.CveFolioGarantia = {0}", CveFolioGarantia), CommandType.Text)
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError(String.Format("Ocurrió un error al consultar un nuevo consecutivo para el folio {0}", CveFolioGarantia), ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
Return Retorno
- End Function
-
-
+ End Function
+
+
#End Region
-
+
#Region " GARANTÍAS MESES "
-
+
Public Function GarantiasMesesGet(CveGarantiaMes As Integer, CveEmpresa As Integer, Optional CveMarca As Integer = -1, Optional CveTipoUso As Integer = -1, Optional Mes As Integer = -1) As Boolean
Dim Retorno As Boolean = False
'Data = New DataTable
@@ -720,12 +720,12 @@ Public Class ClsAcumuladores
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
+
#Region "GARANTIAS DETALLES"
-
+
Public Function AddGarantiasDetalle(CveVentaDetalle As Integer, CvePS As Integer, CveFolioGarantia As Integer, CveTipoUso As Integer,
CodigoEnsamble As String, CodigoLinea As String, CodigoInspeccion As String,
CveTipoDefecto As Integer, CodigoTD As String, TipoComprobante As Integer, Comprobante As String, Importe As Double,
@@ -741,18 +741,18 @@ Public Class ClsAcumuladores
.Add("@CodigoEnsamble", SqlDbType.VarChar).Value = CodigoEnsamble
.Add("@CodigoLinea", SqlDbType.VarChar).Value = CodigoLinea
.Add("@CodigoInspeccion", SqlDbType.VarChar).Value = CodigoInspeccion
- .Add("@CveTipoDefecto", SqlDbType.Int).Value = CveTipoDefecto
- .Add("@CodigoTD", SqlDbType.VarChar).Value = CodigoTD
+ .Add("@CveTipoDefecto", SqlDbType.Int).Value = CveTipoDefecto
+ .Add("@CodigoTD", SqlDbType.VarChar).Value = CodigoTD
.Add("@TipoComprobante", SqlDbType.TinyInt).Value = TipoComprobante
.Add("@Comprobante", SqlDbType.VarChar).Value = Comprobante
.Add("@Importe", SqlDbType.Float).Value = Importe
- .Add("@Consecutivo", SqlDbType.VarChar).Value = Consecutivo
- .Add("@FechaAjuste", SqlDbType.DateTime).Value = FechaAjuste
+ .Add("@Consecutivo", SqlDbType.VarChar).Value = Consecutivo
+ .Add("@FechaAjuste", SqlDbType.DateTime).Value = FechaAjuste
.Add("@PorcentajeAjuste", SqlDbType.Float).Value = PorcentajeAjuste
- .Add("@CveBCIAjuste", SqlDbType.Int).Value = CveBCIAjuste
- .Add("@Etiqueta", SqlDbType.VarChar).Value = Etiqueta
- .Add("@CveClienteDistribuidor", SqlDbType.Int).Value = CveClienteDistribuidor
- .Add("@CveModeloAuto", SqlDbType.Int).Value = CveModeloAuto
+ .Add("@CveBCIAjuste", SqlDbType.Int).Value = CveBCIAjuste
+ .Add("@Etiqueta", SqlDbType.VarChar).Value = Etiqueta
+ .Add("@CveClienteDistribuidor", SqlDbType.Int).Value = CveClienteDistribuidor
+ .Add("@CveModeloAuto", SqlDbType.Int).Value = CveModeloAuto
.Add("@Año", SqlDbType.VarChar).Value = Año
End With
Try
@@ -762,9 +762,9 @@ Public Class ClsAcumuladores
OnError("Ocurrió un al agregar la garantia detalle. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-
-
+ End Function
+
+
Public Function GetGarantiasDetalle(CveVenta As Integer) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_Acum_GarantiasDetalleGet")
@@ -778,7 +778,7 @@ Public Class ClsAcumuladores
OnError("Ocurrió un al obtener la garantía detalle. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
+ End Function
Public Function GetGarantiasPolizaVirtual(CveVenta As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_Acum_GarantiasPolizaVirtualGet")
@@ -793,8 +793,8 @@ Public Class ClsAcumuladores
OnError("Ocurrió un al obtener la información de poliza virtual.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-
+ End Function
+
Public Function UpdateGarantiasDetallePoliza(CveVenta As Integer, FolioPolizaVirtual As String) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_Acum_GarantiasDetallePolizaUpdate")
@@ -809,8 +809,8 @@ Public Class ClsAcumuladores
OnError("Ocurrió un error a actualizar folio de garantia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-
+ End Function
+
Public Function EliminarGarantiasDetalle(CveVenta As Integer) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_Acum_GarantiasDetallePolizaRemove")
@@ -824,13 +824,13 @@ Public Class ClsAcumuladores
OnError("Ocurrió un error a eliminar de garantia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-
-
-
+ End Function
+
+
+
#End Region
-
-#Region "P O L I Z A - V I R T U A L"
+
+#Region "P O L I Z A - V I R T U A L"
Public Function AddPolizaVirtual(CveVenta As Integer, CveVentaDetalle As Integer, CvePS As Integer, Cantidad As Decimal, PU As Decimal, Descuento As Decimal, Total As Decimal,
TipoServicio As Integer, TipoPoliza As Integer, CveModeloAuto As Integer, AnioVehiculo As Integer, TieneUsado As Boolean, FechaUsado As DateTime,
CvePSUsado As Integer, CveBCIUsado As Integer, CveMarcaUsado As Integer) As Boolean
@@ -841,16 +841,16 @@ Public Class ClsAcumuladores
.Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVentaDetalle
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@Cantidad", SqlDbType.Float).Value = Cantidad
- .Add("@PU", SqlDbType.Money).Value = PU
- .Add("@Descuento", SqlDbType.Money).Value = Descuento
+ .Add("@PU", SqlDbType.Money).Value = PU
+ .Add("@Descuento", SqlDbType.Money).Value = Descuento
.Add("@Total", SqlDbType.Money).Value = Total
- .Add("@TipoServicio", SqlDbType.Int).Value = TipoServicio
- .Add("@TipoPoliza", SqlDbType.Int).Value = TipoPoliza
+ .Add("@TipoServicio", SqlDbType.Int).Value = TipoServicio
+ .Add("@TipoPoliza", SqlDbType.Int).Value = TipoPoliza
.Add("@CveModeloAuto", SqlDbType.Int).Value = CveModeloAuto
.Add("@AnioVehiculo", SqlDbType.Int).Value = AnioVehiculo
.Add("@TieneUsado", SqlDbType.Bit).Value = TieneUsado
.Add("@FechaUsado", SqlDbType.DateTime).Value = FechaUsado
- .Add("@CvePSUsado", SqlDbType.Int).Value = CvePSUsado
+ .Add("@CvePSUsado", SqlDbType.Int).Value = CvePSUsado
.Add("@CveBCIUsado", SqlDbType.Int).Value = CveBCIUsado
.Add("@CveMarcaUsado", SqlDbType.Int).Value = CveMarcaUsado
End With
@@ -861,7 +861,7 @@ Public Class ClsAcumuladores
OnError("Ocurrió un al agregar la poliza virtual. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
+ End Function
Public Function GetPolizasVirtuales(CveVenta As Integer) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_Vta_PolizaVirtualGet")
@@ -875,14 +875,14 @@ Public Class ClsAcumuladores
OnError("Ocurrió un al obtener la poliza virtual. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-
+ End Function
+
Public Function UpdatePolizaVirtual(CvePolizaVirtual As Integer, CveMarca As Integer, FechaUsado As DateTime) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_Vta_PolizaVirtualUpdate")
With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePolizaVirtual", SqlDbType.Int).Value = CvePolizaVirtual
- .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
+ .Add("@CvePolizaVirtual", SqlDbType.Int).Value = CvePolizaVirtual
+ .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
.Add("@FechaUsado", SqlDbType.DateTime).Value = FechaUsado
End With
Try
@@ -892,15 +892,15 @@ Public Class ClsAcumuladores
OnError("Ocurrió un al actualizar el envio de la poliza virtual. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
+ End Function
Public Function UpdateEnvioPolizaVirtual(CvePolizaVirtual As Integer, Envio As Boolean, FechaEnvio As DateTime, CodigoUnico As String, RespuestaEnvio As String) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_Vta_PolizaVirtualEnvioUpdate")
With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePolizaVirtual", SqlDbType.Int).Value = CvePolizaVirtual
- .Add("@Envio", SqlDbType.TinyInt).Value = Envio
- .Add("@FechaEnvio", SqlDbType.DateTime).Value = FechaEnvio
- .Add("@CodigoUnico", SqlDbType.VarChar).Value = CodigoUnico
+ .Add("@CvePolizaVirtual", SqlDbType.Int).Value = CvePolizaVirtual
+ .Add("@Envio", SqlDbType.TinyInt).Value = Envio
+ .Add("@FechaEnvio", SqlDbType.DateTime).Value = FechaEnvio
+ .Add("@CodigoUnico", SqlDbType.VarChar).Value = CodigoUnico
.Add("@RespuestaEnvio", SqlDbType.VarChar).Value = RespuestaEnvio
End With
Try
@@ -910,8 +910,8 @@ Public Class ClsAcumuladores
OnError("Ocurrió un al actualizar el envio de la poliza virtual. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-
+ End Function
+
Public Function EliminarPolizaVirtual(CveVenta As Integer) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_Vta_PolizaVirtualRemove")
@@ -925,11 +925,12 @@ Public Class ClsAcumuladores
OnError("Ocurrió un al eliminar poliza virtual. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-#End Region
-
+ End Function
+#End Region
+
Public Function DistribuidorMovtosAdd(CveCliente As Integer, Cantidad As Decimal, CveTamaño As Integer, CveConcepto As Integer, CveVenta As Integer, CveUsuario As Integer,
- CveEmpresa As Integer, ImporteCompras As Decimal, Observaciones As String, FechaIng As DateTime, Optional CveMovimiento As Integer = -1) As Boolean
+ CveEmpresa As Integer, ImporteCompras As Decimal, Observaciones As String, FechaIng As DateTime, Optional CveMovimiento As Integer = -1,
+ Optional CveVentaBonificacion As Integer = -1, Optional FacturadoBonificacion As Boolean = False) As Boolean
Dim Retorno As Boolean = False
'Data = New DataTable
@@ -947,6 +948,8 @@ Public Class ClsAcumuladores
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento
.Add("@FechaIng", SqlDbType.DateTime).Value = FechaIng
+ .Add("@CveVentaBonificacion", SqlDbType.Int).Value = CveVentaBonificacion
+ .Add("@FacturadoBonificacion", SqlDbType.Bit).Value = FacturadoBonificacion
End With
Try
@@ -983,8 +986,8 @@ Public Class ClsAcumuladores
End Try
Return Retorno
- End Function
-
+ End Function
+
Public Function GetMovimientosDistribuidorResumen(CveCliente As Integer, CveEmpresa As Integer, Optional FechaI As Date = MinFecha, Optional FechaF As Date = MaxFecha) As Boolean
Dim Retorno As Boolean = False
'Data = New DataTable
@@ -1076,8 +1079,8 @@ Public Class ClsAcumuladores
OnError("Ocurrió un error al consultar el reporte de usados. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-
+ End Function
+
Public Function EntradasUsadosClientesRep(CveAlmacen As Integer, FechaI As Date, FechaF As Date, CveUsuario As Integer, CveEmpresa As Integer, Optional CveCliente As Integer = -1) As Boolean
Dim Retorno As Boolean = False
'Data = New DataTable
@@ -1085,10 +1088,10 @@ Public Class ClsAcumuladores
SqlDataAdapter("PA_Acum_EntradasUsadosClientesGet")
With SqlAdapter.SelectCommand.Parameters
- .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
+ .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
.Add("@FechaInicio", SqlDbType.Date).Value = FechaI
- .Add("@FechaFin", SqlDbType.Date).Value = FechaF
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@FechaFin", SqlDbType.Date).Value = FechaF
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
@@ -1104,8 +1107,8 @@ Public Class ClsAcumuladores
End Try
Return Retorno
- End Function
-
+ End Function
+
Public Function EntradasUsadosClientesDetalleRep(EsDistribuidor As Boolean, CveCliente As Integer, CvePS As Integer, FechaInicio As Date, FechaFin As Date, CveAlmacen As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
'Data = New DataTable
@@ -1116,10 +1119,10 @@ Public Class ClsAcumuladores
.Add("@EsDistribuidor", SqlDbType.Bit).Value = If(EsDistribuidor, 1, 0)
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
+ .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
- .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
@@ -1133,25 +1136,25 @@ Public Class ClsAcumuladores
End Try
Return Retorno
- End Function
-
-
- Public Function GetRepIndicadorDiario(FechaInicio As Date, FechaFin As Date, CveSubProyecto As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
-
- Dim Retorno As Boolean = False
-
+ End Function
+
+
+ Public Function GetRepIndicadorDiario(FechaInicio As Date, FechaFin As Date, CveSubProyecto As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
SqlDataAdapter("PA_Acum_RepIndicadorDiarioGet")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
- .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
- .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
+ .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
- Try
-
+ Try
+
SqlAdapter.Fill(Data)
Retorno = True
@@ -1162,25 +1165,25 @@ Public Class ClsAcumuladores
End Try
Return Retorno
- End Function
-
- Public Function GetRepIndicadorDiarioDetalle(FechaInicio As Date, FechaFin As Date, Opcion As Integer, CveSubProyecto As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
-
- Dim Retorno As Boolean = False
-
+ End Function
+
+ Public Function GetRepIndicadorDiarioDetalle(FechaInicio As Date, FechaFin As Date, Opcion As Integer, CveSubProyecto As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
SqlDataAdapter("PA_Acum_RepIndicadorDiarioDetalleGet")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
- .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
- .Add("@Opcion", SqlDbType.Int).Value = Opcion
- .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
+ .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
+ .Add("@Opcion", SqlDbType.Int).Value = Opcion
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
- Try
-
+ Try
+
SqlAdapter.Fill(Data)
Retorno = True
@@ -1191,22 +1194,22 @@ Public Class ClsAcumuladores
End Try
Return Retorno
- End Function
-
- Public Function GetUsadosClasificacionVentas(CveCliente As Integer, CvePS As Integer, FechaInicio As String, FechaFin As String) As Boolean
-
- Dim Retorno As Boolean = False
-
- SqlDataAdapter("PA_Acum_UsadosClasificacionVentas")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
- .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
+ End Function
+
+ Public Function GetUsadosClasificacionVentas(CveCliente As Integer, CvePS As Integer, FechaInicio As String, FechaFin As String) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ SqlDataAdapter("PA_Acum_UsadosClasificacionVentas")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
+ .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
End With
- Try
+ Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As SqlException
@@ -1214,15 +1217,15 @@ Public Class ClsAcumuladores
End Try
Return Retorno
- End Function
-
+ End Function
+
Public Function GetFoliosGarantiasDetalle(CveFolioGarantia As Integer, Optional CveGarantiaDetalle As Integer = -1, Optional CveEstatusConsecutivo As Integer = -1, Optional Consec As Integer = -1) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_Acum_GarantiasDetalleFolioGet")
With SqlAdapter.SelectCommand.Parameters
- .Add("@CveFolioGarantia", SqlDbType.Int).Value = CveFolioGarantia
+ .Add("@CveFolioGarantia", SqlDbType.Int).Value = CveFolioGarantia
.Add("@CveGarantiaDetalle", SqlDbType.Int).Value = CveGarantiaDetalle
.Add("@CveEstatusConsecutivo", SqlDbType.Int).Value = CveEstatusConsecutivo
.Add("@Consec", SqlDbType.Int).Value = Consec
@@ -1236,8 +1239,8 @@ Public Class ClsAcumuladores
End Try
Return Retorno
- End Function
-
+ End Function
+
Public Function UpdateGarantiaCancelacion(CveVenta As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -1255,17 +1258,17 @@ Public Class ClsAcumuladores
End Try
Return Retorno
- End Function
-
-
+ End Function
+
+
Public Function GetSabanaVenta(Fecha As Date, CveOpcion As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_Acum_SabanaVentaGet")
- With SqlAdapter.SelectCommand.Parameters
+ With SqlAdapter.SelectCommand.Parameters
.Add("@Fecha", SqlDbType.Date).Value = Fecha
- .Add("@Opcion", SqlDbType.Int).Value = CveOpcion
+ .Add("@Opcion", SqlDbType.Int).Value = CveOpcion
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
@@ -1278,19 +1281,19 @@ Public Class ClsAcumuladores
End Try
Return Retorno
- End Function
-
-
+ End Function
+
+
Public Function GetPolizaVirtualRep(FechaInicio As Date, FechaFin As Date, Opcion As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_Vta_PolizaVirtualRepGet")
- With SqlAdapter.SelectCommand.Parameters
+ With SqlAdapter.SelectCommand.Parameters
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
- .Add("@Opcion", SqlDbType.Int).Value = Opcion
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@Opcion", SqlDbType.Int).Value = Opcion
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
@@ -1304,20 +1307,20 @@ Public Class ClsAcumuladores
End Try
Return Retorno
- End Function
-
-
+ End Function
+
+
#Region " IDisposable Support "
- ' IDisposable
+ ' IDisposable
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
If Not disposedValue Then
- If disposing Then
-
- If Not Data Is Nothing Then Data.Dispose() : Data = Nothing
- If Not DSet Is Nothing Then DSet.Dispose() : DSet = Nothing
- If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing
- If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing
- If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close()
+ If disposing Then
+
+ If Not Data Is Nothing Then Data.Dispose() : Data = Nothing
+ If Not DSet Is Nothing Then DSet.Dispose() : DSet = Nothing
+ If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = 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
@@ -1334,7 +1337,7 @@ Public Class ClsAcumuladores
ConexionClose()
Dispose(True)
GC.SuppressFinalize(Me)
- End Sub
+ End Sub
#End Region
-
+
End Class
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index f5b77c5c0..f6d9bb605 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -4324,6 +4324,7 @@ Public Class ClsPaginas
PaginaDict.Add("/OC/OCPendientes.aspx".ToUpper(), -1)
PaginaDict.Add("/Sistemas/Registro.aspx".ToUpper(), -1)
PaginaDict.Add("/Sistemas/WizardRegistro.aspx".ToUpper(), -1)
+ PaginaDict.Add("/Sistemas/ListadoReportes.aspx".ToUpper(), 702)
PaginaDict.Add("/Ventas/VentasRene.aspx".ToUpper(), -1)
PaginaDict.Add("/Contratos/Contrato2.aspx".ToUpper(), -1)
PaginaDict.Add("/Flotillas/CatMantenimientos.aspx".ToUpper(), -1)
@@ -6962,7 +6963,8 @@ Public Class ClsPaginas
' GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
' End Try
'End Sub
- Public Function PdfFactura(ByRef Vta As Modelos.Factura, Optional AplicaPagare As String = "0", Optional Guardar As Boolean = True, Optional SubReportData As Modelos.MSubReportData = Nothing) As Byte()
+
+ Public Function PdfFactura(ByRef Vta As Modelos.Factura, Optional AplicaPagare As String = "0", Optional Guardar As Boolean = True, Optional SubReportData As Modelos.MSubReportData = Nothing, Optional UsarStimulsoft As Boolean = False) As Byte()
Dim retorno As Byte() = Nothing
' Dim ObjVentas As New ClsVentas
@@ -7789,46 +7791,52 @@ Public Class ClsPaginas
Next
End If
- Dim Archivo As New System.IO.FileInfo(RutaFormato)
- If Archivo.Exists Then
- 'If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
- ' RutaFormato = RutaFormato.Replace(".rdlc", ".mrt")
- ' retorno = StreamBytesStimulsoft("Facturas", RutaFormato, lrds, params, NombreArchivo:=NombreArchivo, Formato:="PDF")
- 'Else
- ' retorno = StreamPDF(RutaFormato, lrds, params, NombreArchivo, "PDF", MR:=Nothing)
- 'End If
- retorno = StreamPDF(RutaFormato, lrds, params, NombreArchivo, "PDF", MR:=Nothing, SubReportData:=SubReportData)
+ If Not UsarStimulsoft Then
+ Dim Archivo As New System.IO.FileInfo(RutaFormato)
+ If Archivo.Exists Then
+ 'If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
+ ' RutaFormato = RutaFormato.Replace(".rdlc", ".mrt")
+ ' retorno = StreamBytesStimulsoft("Facturas", RutaFormato, lrds, params, NombreArchivo:=NombreArchivo, Formato:="PDF")
+ 'Else
+ ' retorno = StreamPDF(RutaFormato, lrds, params, NombreArchivo, "PDF", MR:=Nothing)
+ 'End If
+ retorno = StreamPDF(RutaFormato, lrds, params, NombreArchivo, "PDF", MR:=Nothing, SubReportData:=SubReportData)
- Dim ArchivoPDF As New System.IO.FileInfo(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio))
- If Guardar Then
- If Not ArchivoPDF.Exists Then
- Try
- DirectoryExistsCreate(String.Format("{0}PDF", UsuarioActual.Empresa.Ruta))
- DirectoryExistsCreate(String.Format("{0}PDF\{1}", UsuarioActual.Empresa.Ruta, Vta.TipoDocto))
- File.WriteAllBytes(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio), retorno)
- Catch ex As Exception
- Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
- End Try
- Else
- Try
- ArchivoPDF.Delete()
- File.WriteAllBytes(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio), retorno)
- Catch ex As Exception
- Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
- End Try
+ Dim ArchivoPDF As New System.IO.FileInfo(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio))
+ If Guardar Then
+ If Not ArchivoPDF.Exists Then
+ Try
+ DirectoryExistsCreate(String.Format("{0}PDF", UsuarioActual.Empresa.Ruta))
+ DirectoryExistsCreate(String.Format("{0}PDF\{1}", UsuarioActual.Empresa.Ruta, Vta.TipoDocto))
+ File.WriteAllBytes(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio), retorno)
+ Catch ex As Exception
+ Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
+ End Try
+ Else
+ Try
+ ArchivoPDF.Delete()
+ File.WriteAllBytes(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio), retorno)
+ Catch ex As Exception
+ Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
+ End Try
+ End If
End If
+ Else
+ params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
+ params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC))
+ 'If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
+ ' RutaFormato = RutaFormato.Replace(".rdlc", ".mrt")
+ ' retorno = StreamBytesStimulsoft("Facturas", RutaFormatoDefault, lrds, params, NombreArchivo:=NombreArchivo, Formato:="PDF")
+ 'Else
+ ' retorno = StreamPDF(RutaFormatoDefault, lrds, params, NombreArchivo, "PDF", MR:=Nothing)
+ 'End If
+ retorno = StreamPDF(RutaFormatoDefault, lrds, params, NombreArchivo, "PDF", MR:=Nothing, SubReportData:=SubReportData)
End If
Else
- params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
- params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC))
- 'If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
- ' RutaFormato = RutaFormato.Replace(".rdlc", ".mrt")
- ' retorno = StreamBytesStimulsoft("Facturas", RutaFormatoDefault, lrds, params, NombreArchivo:=NombreArchivo, Formato:="PDF")
- 'Else
- ' retorno = StreamPDF(RutaFormatoDefault, lrds, params, NombreArchivo, "PDF", MR:=Nothing)
- 'End If
- retorno = StreamPDF(RutaFormatoDefault, lrds, params, NombreArchivo, "PDF", MR:=Nothing, SubReportData:=SubReportData)
+ RutaFormato = RutaFormato.Replace(".rdlc", ".mrt")
+ retorno = StreamBytesStimulsoft("Facturas", RutaFormato, lrds, params, NombreArchivo:=NombreArchivo, Formato:="PDF")
End If
+
Catch ex As Exception
GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
End Try
@@ -7864,9 +7872,12 @@ Public Class ClsPaginas
If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then
RutaReporte = String.Format("{0}{1}", bdir, RutaReporte)
End If
-
+ Dim urlHost As String = "http://localhost:2202/"
+ If EsProduccion Then
+ urlHost = "http://sig.adssistemas.mx:6599/"
+ End If
'SITIO DE PRUEBA EN IIS
- Dim Url = New Uri(String.Format("{0}{1}", "http://localhost:2202/", Opcion))
+ Dim Url = New Uri(String.Format("{0}{1}", urlHost, Opcion))
Try
Dim dataSourceArray As New JArray()
@@ -7883,6 +7894,7 @@ Public Class ClsPaginas
Dim payload As New JObject(
New JProperty("formato", Formato),
New JProperty("ruta", RutaReporte),
+ New JProperty("UsarFormatoCompilado", false),
New JProperty("parametros", paramsArray),
New JProperty("dataSource", dataSourceArray)
)
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index c6b3e3147..c557b907e 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -379,7 +379,7 @@ Namespace Modelos
End If
Timbre = New CFDITimbre
End Sub
- Public Sub New(UsuarioActual As Usuario, CveVenta As Integer, CveEmpresa As Integer, Optional DirectorioServidor As String = "", Optional EsCancelacion As Boolean = False, Optional CargaDTDetalle As Boolean = True, Optional CargaDatosCliente As Boolean = True, Optional CargaDatosRelacionados As Boolean = True)
+ Public Sub New(UsuarioActual As Usuario, CveVenta As Integer, CveEmpresa As Integer, Optional DirectorioServidor As String = "", Optional EsCancelacion As Boolean = False, Optional CargaDTDetalle As Boolean = True, Optional CargaDatosCliente As Boolean = True, Optional CargaDatosRelacionados As Boolean = True, Optional VerificaAlmacen As Boolean = True)
Me.UsuarioActual = UsuarioActual
Me.CveVenta = CveVenta
Me.CveEmpresa = CveEmpresa
@@ -391,7 +391,7 @@ Namespace Modelos
IniciaValores()
Dim ObjVentas As New ClsVentas()
- If ObjVentas.GetVenta(CveVenta, CveEmpresa) Then
+ If ObjVentas.GetVenta(CveVenta, CveEmpresa, VerificaAlmacen:=VerificaAlmacen) Then
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
setValues(ObjVentas.DtResultados.Rows(0))
@@ -2101,21 +2101,34 @@ Namespace Modelos
Case "Egs"
CveConcepto = 6
End Select
+ 'SI ES FACTURA,NC,DEV O ES RNC DE CARGO, CANCELAR MOVIMIENTOS
+ If factura.TipoDocto.Contiene("Ing", "Dev", "Egs") OrElse factura.TipoDocto.Contiene("RNC") AndAlso factura.Num1 = 1 Then
+ If ObjAcum.DistribuidorMovtosGet(factura.CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=factura.CveVenta, CveConcepto:=CveConcepto) Then
+ Dim DtMovimientos As DataTable = ObjAcum.DtResultados.FiltraParametros("Cantidad > 0")
+ If DtMovimientos IsNot Nothing AndAlso DtMovimientos.Rows.Count > 0 Then
+ For Each RowSalida As DataRow In DtMovimientos.Rows
+ Dim Cantidad As Decimal = RowSalida("Cantidad").ToString().ToDecimal() * -1
- If ObjAcum.DistribuidorMovtosGet(factura.CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=factura.CveVenta, CveConcepto:=CveConcepto) Then
- Dim DtMovimientos As DataTable = ObjAcum.DtResultados.FiltraParametros("Cantidad > 0")
- If DtMovimientos IsNot Nothing AndAlso DtMovimientos.Rows.Count > 0 Then
- For Each RowSalida As DataRow In DtMovimientos.Rows
- Dim Cantidad As Decimal = RowSalida("Cantidad").ToString().ToDecimal() * -1
+ Dim FacturadoBonificacion = False
+ Dim CveVentaBonificacion As Integer = -1
- If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Cantidad, RowSalida("CveTamaño").ToString.ToEntero, CveConcepto, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "", factura.Fecha) Then
- Retorno = False
- Exit For
- End If
- Next
- DtMovimientos.Dispose()
+ If factura.TipoDocto = "RNC" Then
+ CveVentaBonificacion = RowSalida("CveVentaBonificacion").ToString().ToEntero()
+ FacturadoBonificacion = CBool(RowSalida("FacturadoBonificacion").ToString())
+ End If
+
+ If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Cantidad, RowSalida("CveTamaño").ToString.ToEntero, CveConcepto, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "", factura.Fecha, CveVentaBonificacion:=CveVentaBonificacion, FacturadoBonificacion:=FacturadoBonificacion) Then
+ Retorno = False
+ Exit For
+ End If
+ Next
+ DtMovimientos.Dispose()
+ End If
End If
+ Else
+
End If
+
Return Retorno
End Function
@@ -2217,7 +2230,7 @@ Namespace Modelos
End Function
- Private Function CancelarInventarioUsado(factura As Modelos.Factura, CveAlmacenUsado As Integer, CveMovimientoEntrada As Integer, ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad) As Integer
+ Private Function CancelarInventarioUsado(factura As Modelos.Factura, CveAlmacenUsado As Integer, CveMovimientoEntrada As Integer, ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad, Optional GenerarPrePoliza As Boolean = True) As Integer
Dim CveMovimiento As Integer = -1
Try
Dim CveConceptoSalidaUsado As Integer = 45
@@ -2240,7 +2253,7 @@ Namespace Modelos
End If
Next
- If CveMovimiento > 0 Then
+ If GenerarPrePoliza AndAlso CveMovimiento > 0 Then
Dim Concepto As String = "Cancelación Usado" & factura.SerieFolio
Dim CvePrePoliza = ObjConta.AddPrePolizas("Mod/CancSalUsados", 74, DtMovimientosEntrada.SUMD("Total"), DtMovimientosEntrada.SUMD("Total"), 1, tFecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero
@@ -2498,7 +2511,7 @@ Namespace Modelos
Dim TipoMovto68 = TipoMovimiento
'SI ES CANCELACION DEBE GENERAR EL MOVIMIENTO DE SALIDA DE USADOS
If ValorMultiplicador = -1 Then
- CveMovimientoReferencia = CancelarInventarioUsado(ObjFactura, CveAlmacen, CveMovimiento, ObjInventario, ObjConta)
+ CveMovimientoReferencia = CancelarInventarioUsado(ObjFactura, CveAlmacen, CveMovimiento, ObjInventario, ObjConta, GenerarPrePoliza:=False)
Else
CveMovimientoReferencia = CveMovimiento
End If
@@ -5675,6 +5688,11 @@ Namespace Modelos
If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
DtMovRemision = ObjInventario.DtResultados.FiltraParametros("CveTipoAlmacen = 10")
CveAlmacenGeneral = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 1").ToString().ToEntero()
+ 'SI ES SERVICIO A DOMICILIO DEBE REGRESAR A ESTE TIPO DE ALMACEN
+ If Me.ServicioDomicilio Then
+ CveAlmacenGeneral = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 29").ToString().ToEntero()
+ End If
+
CveAlmacenExA = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 10").ToString().ToEntero()
CveMovimientoUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveMovimiento", "CvePS IS NULL AND CveConcepto = 42").ToEntero()
diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb
index 536ae9bc7..9dfcbe489 100644
--- a/Compras/PopUpVerFactura.aspx.vb
+++ b/Compras/PopUpVerFactura.aspx.vb
@@ -1082,7 +1082,9 @@ Partial Class PopUpVerFactura
Dim AplicaPagare As String = If(UrlParametros("PAG") IsNot Nothing AndAlso UrlParametros("PAG").ToString <> "", UrlParametros("PAG").ToString, "0")
Dim Guardar As Boolean = UrlParametros("GUARDAR") IsNot Nothing AndAlso UrlParametros("GUARDAR").ToString() = "1"
Dim RegenerarPDF As Boolean = UrlParametros("REGENERAR") IsNot Nothing AndAlso UrlParametros("REGENERAR").ToString() = "1"
- imprimirFacturaVenta(UrlParametros("CVEVENTA").ToString.ToEntero, AplicaPagare, GuardarPDF:=Guardar, RegenerarPDF:=RegenerarPDF)
+ Dim STIMULSOFT As Boolean = UrlParametros("STIMULSOFT") IsNot Nothing AndAlso UrlParametros("STIMULSOFT").ToString() = "1"
+
+ imprimirFacturaVenta(UrlParametros("CVEVENTA").ToString.ToEntero, AplicaPagare, GuardarPDF:=Guardar, RegenerarPDF:=RegenerarPDF, UsarStimulsoft:=STIMULSOFT)
End If
End If
@@ -2697,7 +2699,7 @@ Partial Class PopUpVerFactura
Archivo = Nothing
End If
End Sub
- Public Sub imprimirFacturaVenta(CveVenta As Integer, AplicaPagare As String, Optional GuardarPDF As Boolean = False, Optional RegenerarPDF As Boolean = False)
+ Public Sub imprimirFacturaVenta(CveVenta As Integer, AplicaPagare As String, Optional GuardarPDF As Boolean = False, Optional RegenerarPDF As Boolean = False, Optional UsarStimulsoft As Boolean = False)
Dim ObjVentas As New ClsVentas
Dim Vta As Modelos.Factura = Nothing
@@ -2726,7 +2728,7 @@ Partial Class PopUpVerFactura
Dim Archivo As New System.IO.FileInfo(PathArchivo)
'SI EL ARCHIVO NO EXISTE O SE VA REGENERA EL PDF, SE DEBEN LLENAR LOS DATOS
- If Not Archivo.Exists OrElse RegenerarPDF Then
+ If Not Archivo.Exists OrElse RegenerarPDF OrElse UsarStimulsoft Then
Vta.MonedaAbreviatura = dtVentas(0)("Abreviatura").ToString
'se rellena la sucursal
'Vta.Subproyecto = ObjVentas.DtResultados.Rows(0).DataRowToObject(Of Modelos.SucursalModel)
@@ -3031,7 +3033,7 @@ Partial Class PopUpVerFactura
Dim CveTimbreCartaPorteVenta As Integer = -1
Dim CartaPorte As Modelos.MSubReportData = Nothing
'SI EL ARCHIVO NO EXISTE O SE VA REGENERA EL PDF, SE DEBEN LLENAR LOS DATOS
- If Not Archivo.Exists OrElse RegenerarPDF Then
+ If Not Archivo.Exists OrElse RegenerarPDF OrElse UsarStimulsoft Then
If UsuarioActual.CveEmpresa = 13 AndAlso Vta.TipoDocto = "Ing" Then
Using ObjGral As New ClsGenerales
If ObjGral.GetGralTimbre(-1, "Ing", MinFecha, MaxFecha, 0, UsuarioActual.CveEmpresa, -1, CveVenta:=CveVenta) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
@@ -3049,37 +3051,42 @@ Partial Class PopUpVerFactura
End If
End If
- If Archivo.Exists Then
- If RegenerarPDF Then
- Archivo.Delete()
+ If UsarStimulsoft Then
+ ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=True, SubReportData:=CartaPorte, UsarStimulsoft:=UsarStimulsoft), Vta.SerieFolio, "PDF")
+ Else
+ If Archivo.Exists Then
+ If RegenerarPDF Then
+ Archivo.Delete()
+ If UsuarioActual.Empresa.CvePlataforma = 2 Then
+ GeneraPDFVtaPyMe(Vta, "PDF")
+ Else
+ ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=True, SubReportData:=CartaPorte), Vta.SerieFolio, "PDF")
+ Vta = Nothing
+ End If
+ Else
+ HttpContext.Current.Response.Clear()
+ HttpContext.Current.Response.ClearContent()
+ HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = ".txt", "text/plain", "application/pdf")
+ HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" & Archivo.Name)
+ HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
+ HttpContext.Current.Response.TransmitFile(PathArchivo)
+ 'HttpContext.Current.Response.Flush()
+ HttpContext.Current.Response.End()
+ Archivo = Nothing
+ End If
+ Else
+
+ '04/05/2018 - Se agrega seccion pruebas para generar factura venta .mrt para PyME
If UsuarioActual.Empresa.CvePlataforma = 2 Then
GeneraPDFVtaPyMe(Vta, "PDF")
Else
- ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=True, SubReportData:=CartaPorte), Vta.SerieFolio, "PDF")
+ ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=Guardar, SubReportData:=CartaPorte), Vta.SerieFolio, "PDF")
Vta = Nothing
End If
- Else
- HttpContext.Current.Response.Clear()
- HttpContext.Current.Response.ClearContent()
- HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = ".txt", "text/plain", "application/pdf")
- HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" & Archivo.Name)
- HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
- HttpContext.Current.Response.TransmitFile(PathArchivo)
- 'HttpContext.Current.Response.Flush()
- HttpContext.Current.Response.End()
- Archivo = Nothing
- End If
- Else
-
- '04/05/2018 - Se agrega seccion pruebas para generar factura venta .mrt para PyME
- If UsuarioActual.Empresa.CvePlataforma = 2 Then
- GeneraPDFVtaPyMe(Vta, "PDF")
- Else
- ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=Guardar, SubReportData:=CartaPorte), Vta.SerieFolio, "PDF")
- Vta = Nothing
End If
End If
+
End If
End Sub
diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb
index 807fcfcd0..3385a7bfa 100644
--- a/Inventarios/RecepcionUsados.aspx.vb
+++ b/Inventarios/RecepcionUsados.aspx.vb
@@ -2278,7 +2278,7 @@ Partial Class Inventarios_RecepcionUsados
Me.ObjFactura = Nothing
End If
- Me.ObjFactura = New Modelos.Factura(UsuarioActual, CveRemisionRecibida, UsuarioActual.CveEmpresa, DirectorioServidor:=ModExtensiones.DirectorioBaseEmpresas, CargaDatosCliente:=False, CargaDatosRelacionados:=False)
+ Me.ObjFactura = New Modelos.Factura(UsuarioActual, CveRemisionRecibida, UsuarioActual.CveEmpresa, DirectorioServidor:=ModExtensiones.DirectorioBaseEmpresas, CargaDatosCliente:=False, CargaDatosRelacionados:=False, VerificaAlmacen:=False)
If Me.ObjFactura IsNot Nothing Then
diff --git a/Sistemas/ListadoReportes.aspx b/Sistemas/ListadoReportes.aspx
new file mode 100644
index 000000000..04c7bdaa4
--- /dev/null
+++ b/Sistemas/ListadoReportes.aspx
@@ -0,0 +1,81 @@
+<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="ListadoReportes.aspx.cs" Inherits="Sistemas_ListadoReportes" %>
+
+