diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index b4dd3f16b..23f442f65 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -3505,7 +3505,7 @@ Public Class ClsVentas
'''
'''
'''
- Public Function GetVta_ReporteCortesDetalle(CveCorte As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, Opcion As Integer, Optional ConsultaIVA As Boolean = False) As Boolean
+ Public Function GetVta_ReporteCortesDetalle(CveCorte As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, Opcion As Integer, Optional ConsultaIVA As Boolean = False, Optional FechaConsulta As Date = ModExtensiones.MaxFecha) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ReporteCortesDetalleGet")
@@ -3516,6 +3516,7 @@ Public Class ClsVentas
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Opcion", SqlDbType.Int).Value = Opcion
.Add("@ConsultaIVA", SqlDbType.Bit).Value = ConsultaIVA
+ .Add("@FechaConsulta", SqlDbType.Date).Value = FechaConsulta
End With
Try
diff --git a/Bancos/RepCortes.aspx.vb b/Bancos/RepCortes.aspx.vb
index 67ddada77..0f791b9dc 100644
--- a/Bancos/RepCortes.aspx.vb
+++ b/Bancos/RepCortes.aspx.vb
@@ -106,7 +106,7 @@ Partial Class Bancos_RepCortes
#Region "G V - D A T O S "
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
- If e.Row.DBCampo("CveCorte").ToString = "" Then
+ If e.Row.DBCampo("FechaInicial").ToString = "" Then
e.Row.CssClass = "SubTotales2"
If DtCortes IsNot Nothing Then
e.Row.FCLiteral("LtlImporteInicial").Text = DtCortes.SUMD("ImporteInicial").FormatoNumero(2)
@@ -189,10 +189,12 @@ Partial Class Bancos_RepCortes
Protected Sub LbDescripcion_Click(sender As Object, e As EventArgs)
Dim btn As LinkButton = DirectCast(sender, LinkButton)
Dim gvr As GridViewRow = DirectCast(btn.NamingContainer, GridViewRow)
- CveCorte = gvr.DataKey("CveCorte").ToString.ToEntero
- Dim Finalizado As Integer = gvr.DataKey("Finalizado").ToString.ToEntero
- Fecha = gvr.DataKey("FechaInicial").ToString
- Nombre = gvr.DataKey("Nombre").ToString
+
+ CveCorte = gvr.DataKey("CveCorte").ToEntero()
+
+ Dim Finalizado As Integer = gvr.DataKey("Finalizado").ToEntero()
+ Fecha = gvr.DataKey("FechaInicial")
+ Nombre = gvr.DataKey("Nombre")
'If ObjPuntoVenta.GetCortesDetalleVentas(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 2) Then
' DtCortesVentas = ObjPuntoVenta.DtResultados.Copy()
@@ -212,9 +214,17 @@ Partial Class Bancos_RepCortes
' GvPorIVA.DataSource = ObjVentas.DtResultados
' End If
'End If
+ Dim FechaConsulta = ModExtensiones.MaxFecha
+
+ Dim ConsultaPorSucursal As Boolean = UsuarioActual.Empresa.Funcionalidad(382) = "1"
+
+ If ConsultaPorSucursal Then
+ CveCorte = -1
+ FechaConsulta = gvr.DataKey("FechaInicial").ToDate()
+ End If
Dim ObjVentas As New ClsVentas
- If ObjVentas.GetVta_ReporteCortesDetalle(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Opcion:=2, ConsultaIVA:=UsuarioActual.CveEmpresa.Contiene(190, 192)) Then
+ If ObjVentas.GetVta_ReporteCortesDetalle(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Opcion:=2, ConsultaIVA:=UsuarioActual.CveEmpresa.Contiene(190, 192), FechaConsulta:=FechaConsulta) Then
Dim DsDatos = ObjVentas.DataSetResultados.Copy()
If DsDatos IsNot Nothing Then
'DESGLOSE
@@ -242,11 +252,12 @@ Partial Class Bancos_RepCortes
End If
End If
- If ObjVentas.GetVta_MovimientosCajasReporte(CveCorte, -1) Then
- GvIngresosRetiros.DataSource = ObjVentas.DtResultados.Copy()
+ If CveCorte > 0 Then
+ If ObjVentas.GetVta_MovimientosCajasReporte(CveCorte, -1) Then
+ GvIngresosRetiros.DataSource = ObjVentas.DtResultados.Copy()
+ End If
End If
-
If Not UsuarioActual.CveEmpresa.Contiene(140, 141) AndAlso ObjVentas.GetCortesDetalleDepositosCaja(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
GvDep.DataSource = ObjVentas.DtResultados
If ObjVentas.DtResultados.Rows.Count > 0 Then
diff --git a/Ventas/Promociones.aspx.vb b/Ventas/Promociones.aspx.vb
index e622f196e..6aea352cf 100644
--- a/Ventas/Promociones.aspx.vb
+++ b/Ventas/Promociones.aspx.vb
@@ -128,7 +128,11 @@ Partial Class Ventas_Promociones
'CLASIFICACIONES
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion")
DdlClasificacion.DataBind()
- DdlClasificacion.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
+ DdlClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
+ Else
+ DdlClasificacion.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ End If
'CARGA PS
DdlPS.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
@@ -373,9 +377,11 @@ Partial Class Ventas_Promociones
Protected Sub BtnAgregar_Click(sender As Object, e As EventArgs)
- If DdlClasificacion.SelectedValue.ToEntero <= 0 Then
- Alert("Debe seleccionar una clasificacion", TipoMensaje.MsgAdvertencia)
- Exit Sub
+ If UsuarioActual.Empresa.Funcionalidad(382) <> "1" Then
+ If DdlClasificacion.SelectedValue.ToEntero <= 0 Then
+ Alert("Debe seleccionar una clasificacion", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
End If
If TxtCantMinima.Text.ToEntero <= 0 Then
@@ -397,8 +403,13 @@ Partial Class Ventas_Promociones
Dr("CveClasificacion") = DdlClasificacion.SelectedValue
Dr("Clasificacion") = DdlClasificacion.SelectedItem.Text
Else
- Dr("CveClasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimeroValor("CveClasificacion")
- Dr("Clasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimeroValor("Clasificacion")
+ If DdlPS.SelectedValue.ToEntero > 0 Then
+ Dr("CveClasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimeroValor("CveClasificacion")
+ Dr("Clasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimeroValor("Clasificacion")
+ Else
+ Dr("CveClasificacion") = -1
+ Dr("Clasificacion") = "Todas"
+ End If
End If
Dr("CvePS") = If(DdlPS.SelectedValue = "", "-1", DdlPS.SelectedValue)
@@ -481,7 +492,7 @@ Partial Class Ventas_Promociones
RegistraScript("$('#DivAgregar').modal('show')")
CveConsecutivo = e.CommandArgument.ToString.ToEntero
DdlRin.SelectedValueExist(Gvr.DataKey("CveRinTamaño"))
- DdlClasificacion.SelectedValue = Gvr.DataKey("CveClasificacion")
+ DdlClasificacion.SelectedValueExist(Gvr.DataKey("CveClasificacion"))
ChangeDdlProducto()
If UsuarioActual.Empresa.Funcionalidad(105) = "" Then
DdlPS.SelectedValue = Gvr.DataKey("CvePS")
diff --git a/Ventas/RepCancelacionesPorRespuesta.aspx.cs b/Ventas/RepCancelacionesPorRespuesta.aspx.cs
index 80134a3fd..fc89d05b1 100644
--- a/Ventas/RepCancelacionesPorRespuesta.aspx.cs
+++ b/Ventas/RepCancelacionesPorRespuesta.aspx.cs
@@ -576,7 +576,11 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
{
AplicaCancelacionConPagos = true;
}
- retorno = factura.EjecutarCancelacionPendiente(CveEstatus, CancelacionFecha, CancelacionAcuse,AplicaCancelacionConPagos: AplicaCancelacionConPagos);
+ if (UsuarioActual.TienePermisoProceso(269) && UsuarioActual.Empresa.Funcionalidad(109) == "1" && factura.TipoDocto == "Ing" && factura.SaldoAlmacen != 0)
+ {
+ factura.RealizarDevolucionAlmacen = true;
+ }
+ retorno = factura.EjecutarCancelacionPendiente(CveEstatus, CancelacionFecha, CancelacionAcuse, AplicaCancelacionConPagos: AplicaCancelacionConPagos);
}
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 5d9ca90cd..e4df44d3f 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -5079,7 +5079,7 @@ Partial Class Ventas
If DbRowVenta("Fecha").ToString.ToDate.ToShortDateString.ToDate < Now.ToShortDateString.ToDate Then
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Egs", "Ant") AndAlso UsuarioActual.TienePermisoProceso(159) Then
LkRefacturacion.Visible = True
- LbCancelarDocumento.Visible = False
+ LbCancelarDocumento.Visible = UsuarioActual.TienePermisoProceso(378)
Else
LbCancelarDocumento.Visible = UsuarioActual.TienePermisoProceso(378)
End If
@@ -19042,7 +19042,11 @@ Partial Class Ventas
If dr Is Nothing Then
'verifica marca, si tiene asignada la promocion
- dr = DtPromociones.FiltroPrimero(String.Format("CvePS IS NULL AND CveClasificacion = {0} AND (CveMarca = {1} OR CveMarca IS NULL) AND (CveSubProyecto = {2} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {3} OR CveRinTamaño IS NULL) AND ((TipoPromocion <> 3 AND (CantidadMinima <= {4} OR CantidadMinima IS NULL)) OR (TipoPromocion = 3 AND CantidadMinima <= {4} )) ", CveClasifPS, CveMarcaPS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS, Cantidad), Orderby:="CantidadMinima desc")
+ If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
+ dr = DtPromociones.FiltroPrimero(String.Format("CvePS IS NULL AND (CveClasificacion = {0} OR CveClasificacion IS NULL) AND (CveMarca = {1} OR CveMarca IS NULL) AND (CveSubProyecto = {2} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {3} OR CveRinTamaño IS NULL) AND ((TipoPromocion <> 3 AND (CantidadMinima <= {4} OR CantidadMinima IS NULL)) OR (TipoPromocion = 3 AND CantidadMinima <= {4} )) ", CveClasifPS, CveMarcaPS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS, Cantidad), Orderby:="CantidadMinima desc")
+ Else
+ dr = DtPromociones.FiltroPrimero(String.Format("CvePS IS NULL AND CveClasificacion = {0} AND (CveMarca = {1} OR CveMarca IS NULL) AND (CveSubProyecto = {2} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {3} OR CveRinTamaño IS NULL) AND ((TipoPromocion <> 3 AND (CantidadMinima <= {4} OR CantidadMinima IS NULL)) OR (TipoPromocion = 3 AND CantidadMinima <= {4} )) ", CveClasifPS, CveMarcaPS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS, Cantidad), Orderby:="CantidadMinima desc")
+ End If
End If
End If