- comisiones sms

This commit is contained in:
2024-05-31 06:05:55 -07:00
parent b842bf042a
commit b143495301
3 changed files with 82 additions and 37 deletions

View File

@@ -6899,7 +6899,7 @@ Public Class ClsVentas
End Function 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 Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ComisionesMedicasRepGet") DataAdapter("PA_Vta_ComisionesMedicasRepGet")
@@ -6914,7 +6914,8 @@ Public Class ClsVentas
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveTipoVenta", SqlDbType.Int).Value = CveTipoVenta .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 End With
@@ -6934,7 +6935,7 @@ Public Class ClsVentas
#Region "VENTAS MEDICAS COMISIONES ESPECIALES" #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 Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ComisionesMedicasEspecialesGet") DataAdapter("PA_Vta_ComisionesMedicasEspecialesGet")

View File

@@ -67,7 +67,6 @@
</div> </div>
<div class="col-md-1 truncate"> <div class="col-md-1 truncate">
Fecha Fin: Fecha Fin:
</div> </div>
<div class="col-md-1" style="min-width: 115px"> <div class="col-md-1" style="min-width: 115px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;"> <div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
@@ -84,6 +83,45 @@
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
<div class="col-md-1 truncate">
Fecha I. Pago:
</div>
<div class="col-md-1" style="min-width: 115px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<asp:TextBox Width="80px" ID="TxtFechaIPago" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioIPago" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TxtFechaIPago" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaIPago" PopupButtonID="ImgCalendarioIPago" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaIPago" runat="server" ControlToValidate="TxtFechaIPago" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaIPago" runat="server" ControlToValidate="TxtFechaIPago" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaIPago" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaIPago" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-1 truncate">
Fecha F. Pago:
</div>
<div class="col-md-1" style="min-width: 115px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<asp:TextBox Width="80px" ID="TxtFechaFPago" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioFPago" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="TxtFechaFPago" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender2" TargetControlID="TxtFechaFPago" PopupButtonID="ImgCalendarioFPago" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaFPago" runat="server" ControlToValidate="TxtFechaFPago" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaFPago" runat="server" ControlToValidate="TxtFechaFPago" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaFPago" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaFPago" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="portlet-body" style="display: none">
<div class="row">
<label class="col-md-1 ">Médico:</label> <label class="col-md-1 ">Médico:</label>
<div class="col-md-1"> <div class="col-md-1">
<asp:DropDownList ID="DdlMedico" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Medico" DataValueField="CveMedico" Width="100%"> <asp:DropDownList ID="DdlMedico" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Medico" DataValueField="CveMedico" Width="100%">
@@ -101,15 +139,6 @@
<asp:DropDownList ID="DdlUsuarioAtendio" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="CveUsuario" Width="100%"> <asp:DropDownList ID="DdlUsuarioAtendio" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="CveUsuario" Width="100%">
</asp:DropDownList> </asp:DropDownList>
</div> </div>
</div>
</div>
</div>
<div class="portlet-body" style="display: none">
<div class="row">
</div> </div>
</div> </div>
</div> </div>
@@ -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"> EmptyDataText="No se encontraron Medicos Registrados" ToolTip="Listado de Medicos" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
<Columns> <Columns>
<asp:BoundField HeaderText="Folio" DataField="SerieFolio" ItemStyle-HorizontalAlign="Left" /> <asp:HyperLinkField HeaderText="Folio" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataNavigateUrlFields="CveVenta" DatatextField="SerieFolio" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Nombre Hospital" DataField="Hospital" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Nombre Hospital" DataField="Hospital" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Especialidad" DataField="Especialidad" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Especialidad" DataField="Especialidad" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Médico" DataField="Medico" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Médico" DataField="Medico" ItemStyle-HorizontalAlign="Left" />
@@ -138,14 +167,15 @@
<asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="P Unitario" DataField="PU" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="P Unitario" DataField="PU" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Venta Total" DataField="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Venta Total" DataField="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Vendedor" DataField="Vendedor" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Vendedor" DataField="Vendedor" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="$ Vendedor" DataField="ComisionVendedor" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="$ Vendedor" DataField="ComisionVendedor" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Técnico" DataField="Nombre" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Técnico" DataField="Nombre" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="$ Técnico" DataField="ComisionTecnico" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="$ Técnico" DataField="ComisionTecnico" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="$ Gerente" DataField="ComisionGerente" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" Visible="false" />
<asp:BoundField HeaderText="$ E. Médica" DataField="ComisionMedico" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="$ E. Médica" DataField="ComisionMedico" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Fecha Pago" DataField="FechaPago" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:dd/MM/yyyy}" ControlStyle-Width="100px" /> <asp:BoundField HeaderText="Fecha Pago" DataField="FechaPago" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:dd/MM/yyyy}" ControlStyle-Width="100px" />

View File

@@ -2,10 +2,7 @@
Option Strict On Option Strict On
Imports System.Data Imports System.Data
Imports System.Data.Entity
Imports Extensiones Imports Extensiones
Imports Microsoft.EntityFrameworkCore
Partial Class Ventas_RepComisionesSMS Partial Class Ventas_RepComisionesSMS
Inherits ClsPaginas Inherits ClsPaginas
@@ -62,10 +59,12 @@ Partial Class Ventas_RepComisionesSMS
Public Sub CargaDatos() Public Sub CargaDatos()
LnkExportar.Visible = False 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 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 GvDatos.DataSource = ObjVentas.DtResultados
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
@@ -76,9 +75,10 @@ Partial Class Ventas_RepComisionesSMS
End If End If
ObjVentas.Dispose() ObjVentas.Dispose()
GvDatos.DataBind() GvDatos.DataBind()
If UsuarioActual.CveVendedor = 0 Then GvDatos.Columns(15).Visible = True 'columna de comisiones de gerente
UpDatos.Update() UpDatos.Update()
End Sub End Sub
@@ -270,7 +270,7 @@ Partial Class Ventas_RepComisionesSMS
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
GvComisionesEspeciales.DataSource = Nothing GvComisionesEspeciales.DataSource = Nothing
If ObjVentas.GetComisionesMedicasEsPeciales(-1, -1, UsuarioActual.CveEmpresa) Then If ObjVentas.GetComisionesMedicasEspeciales(-1, -1, UsuarioActual.CveEmpresa) Then
GvComisionesEspeciales.DataSource = ObjVentas.DtResultados GvComisionesEspeciales.DataSource = ObjVentas.DtResultados
End If End If
ObjVentas.Dispose() ObjVentas.Dispose()
@@ -345,7 +345,12 @@ Partial Class Ventas_RepComisionesSMS
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
If ObjVentas.AddComisionesMedicasEspeciales(DdlModalMedico.SelectedValue.ToEntero, DdlModalPS.SelectedValue.ToEntero, DdlModalTipoComision.SelectedValue.ToEntero, Comision, UsuarioActual.CveUsuario) Then 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 Else
errorProceso = True errorProceso = True
End If End If
@@ -354,7 +359,16 @@ Partial Class Ventas_RepComisionesSMS
If Not errorProceso Then If Not errorProceso Then
CargaComisionesEspeciales() 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 If
End Sub End Sub