- comisiones sms
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -66,8 +66,7 @@
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
Fecha Fin:
|
||||
|
||||
Fecha Fin:
|
||||
</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;">
|
||||
@@ -84,32 +83,62 @@
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 ">Médico:</label>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 ">Vendedor:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlVendedor" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 ">Técnico:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlUsuarioAtendio" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="CveUsuario" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</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>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 ">Vendedor:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlVendedor" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 ">Técnico:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlUsuarioAtendio" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="CveUsuario" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</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">
|
||||
<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="Especialidad" DataField="Especialidad" 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="Código" DataField="Codigo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" />
|
||||
<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="Cantidad" DataField="Cantidad" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="P Unitario" DataField="PU" 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="ComisionVendedor" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
|
||||
<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="$ 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="Fecha Pago" DataField="FechaPago" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:dd/MM/yyyy}" ControlStyle-Width="100px" />
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user