diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index 6255262da..a90f706f1 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -6899,7 +6899,7 @@ Public Class ClsVentas
End Function
- Public Function GetComisionesMedicasRep(FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CveSubProyecto As Integer, CveProcedimiento As Integer, CveMedico As Integer, CveVendedor As Integer, CveUsuario As Integer, CveTipoVenta As Integer, Opcion As Integer) As Boolean
+ Public Function GetComisionesMedicasRep(FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CveSubProyecto As Integer, CveProcedimiento As Integer, CveMedico As Integer, CveVendedor As Integer, CveUsuario As Integer, CveTipoVenta As Integer, FechaInicioPago As Date, FechaFinPago As Date) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ComisionesMedicasRepGet")
@@ -6914,7 +6914,8 @@ Public Class ClsVentas
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveTipoVenta", SqlDbType.Int).Value = CveTipoVenta
- .Add("@Opcion", SqlDbType.Int).Value = Opcion
+ .Add("@FechaInicioPago", SqlDbType.Date).Value = FechaInicioPago
+ .Add("@FechaFinPago", SqlDbType.Date).Value = FechaFinPago
End With
@@ -6934,7 +6935,7 @@ Public Class ClsVentas
#Region "VENTAS MEDICAS COMISIONES ESPECIALES"
- Public Function GetComisionesMedicasEsPeciales(CveMedico As Integer, CvePS As Integer, CveEmpresa As Integer) As Boolean
+ Public Function GetComisionesMedicasEspeciales(CveMedico As Integer, CvePS As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ComisionesMedicasEspecialesGet")
diff --git a/Ventas/RepComisionesSMS.aspx b/Ventas/RepComisionesSMS.aspx
index 172a5b8ed..9fce7ed34 100644
--- a/Ventas/RepComisionesSMS.aspx
+++ b/Ventas/RepComisionesSMS.aspx
@@ -66,8 +66,7 @@
- Fecha Fin:
-
+ Fecha Fin:
@@ -84,32 +83,62 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ Fecha I. Pago:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Fecha F. Pago:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -130,7 +159,7 @@
EmptyDataText="No se encontraron Medicos Registrados" ToolTip="Listado de Medicos" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
-
+
@@ -138,14 +167,15 @@
-
-
+
+
+
diff --git a/Ventas/RepComisionesSMS.aspx.vb b/Ventas/RepComisionesSMS.aspx.vb
index 5ec007988..226514bc9 100644
--- a/Ventas/RepComisionesSMS.aspx.vb
+++ b/Ventas/RepComisionesSMS.aspx.vb
@@ -2,10 +2,7 @@
Option Strict On
Imports System.Data
-Imports System.Data.Entity
Imports Extensiones
-Imports Microsoft.EntityFrameworkCore
-
Partial Class Ventas_RepComisionesSMS
Inherits ClsPaginas
@@ -62,10 +59,12 @@ Partial Class Ventas_RepComisionesSMS
Public Sub CargaDatos()
LnkExportar.Visible = False
+ Dim FechaIPago As Date = If(TxtFechaIPago.Text.ToDate < MinFecha, MinFecha, TxtFechaIPago.Text.ToDate)
+ Dim FechaFPago As Date = If(TxtFechaFPago.Text.ToDate < MinFecha, MaxFecha, TxtFechaFPago.Text.ToDate)
Dim ObjVentas As New ClsVentas
- If ObjVentas.GetComisionesMedicasRep(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, -1, -1, DdlMedico.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuarioAtendio.SelectedValue.ToEntero, -1, 1) Then
+ If ObjVentas.GetComisionesMedicasRep(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, -1, -1, DdlMedico.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuarioAtendio.SelectedValue.ToEntero, -1, FechaIPago, FechaFPago) Then
GvDatos.DataSource = ObjVentas.DtResultados
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
@@ -76,9 +75,10 @@ Partial Class Ventas_RepComisionesSMS
End If
ObjVentas.Dispose()
-
GvDatos.DataBind()
+ If UsuarioActual.CveVendedor = 0 Then GvDatos.Columns(15).Visible = True 'columna de comisiones de gerente
+
UpDatos.Update()
End Sub
@@ -270,7 +270,7 @@ Partial Class Ventas_RepComisionesSMS
Dim ObjVentas As New ClsVentas
GvComisionesEspeciales.DataSource = Nothing
- If ObjVentas.GetComisionesMedicasEsPeciales(-1, -1, UsuarioActual.CveEmpresa) Then
+ If ObjVentas.GetComisionesMedicasEspeciales(-1, -1, UsuarioActual.CveEmpresa) Then
GvComisionesEspeciales.DataSource = ObjVentas.DtResultados
End If
ObjVentas.Dispose()
@@ -345,7 +345,12 @@ Partial Class Ventas_RepComisionesSMS
Dim ObjVentas As New ClsVentas
If ObjVentas.AddComisionesMedicasEspeciales(DdlModalMedico.SelectedValue.ToEntero, DdlModalPS.SelectedValue.ToEntero, DdlModalTipoComision.SelectedValue.ToEntero, Comision, UsuarioActual.CveUsuario) Then
- Alert("Comisión agregada correctamente")
+ Alert("Comisión agregada correctamente", TipoMensaje.ToastInformacion)
+ DdlModalPS.SelectedValue = "-1"
+ DdlModalPS.SelectedValue = ""
+ DdlModalPS.SelectedText = ""
+ TxtModalComision.Text = ""
+ DdlModalPS.Focus()
Else
errorProceso = True
End If
@@ -354,7 +359,16 @@ Partial Class Ventas_RepComisionesSMS
If Not errorProceso Then
CargaComisionesEspeciales()
- ReiniciaModalComisionesEspeciales()
+ 'ReiniciaModalComisionesEspeciales()
+ End If
+
+ End Sub
+
+ Private Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
+ If e.Row.RowType = DataControlRowType.DataRow Then
+ If e.Row.DBCampo("SerieFolio") = "" Then
+ e.Row.CssClass = "SubTotales"
+ End If
End If
End Sub