This commit is contained in:
2023-12-09 09:09:45 -07:00
15 changed files with 1181 additions and 180 deletions

View File

@@ -493,6 +493,37 @@ Public Class ClsOS
Return Retorno
End Function
Public Function GetRepOrdenesServicioMedicasRep(FechaI As Date, FechaF As Date, CveCliente As Integer, CveVendedor As Integer, CveEstatusOrdenServicio As Integer, CveUsuarioAtendio As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OS_OrdenesServiciosMedicasRepGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@FechaI", SqlDbType.Date).Value = FechaI
.Add("@FechaF", SqlDbType.Date).Value = FechaF
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@CveEstatusOrdenServicio", SqlDbType.Int).Value = CveEstatusOrdenServicio
.Add("@CveUsuarioAtendio", SqlDbType.Int).Value = CveUsuarioAtendio 'Este es el técnico
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener el Reporte de Ordenes de Servicio Medicas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetOrdenesServicios(CveOS As Integer, CveCliente As Integer, Folio As Integer, CveUsuarioRecibio As Integer, CveEstatusOrdenServicio As Integer,
CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional TopSelect As Integer = 10000, Optional CveOSDetalle As Integer = -1) As Boolean
Dim Retorno As Boolean = False

View File

@@ -9053,6 +9053,7 @@ Public Class ClsPaginas
PaginaDict.Add("/OS/PopUpMateriales.aspx".ToUpper(), 135)
PaginaDict.Add("/OS/Asignaciones.aspx".ToUpper(), 125)
PaginaDict.Add("/OS/RepServicioDomicilio.aspx".ToUpper(), 1330)
PaginaDict.Add("/OS/RepOSMedicas.aspx".ToUpper(), 1345)
#End Region
#Region "OC"
PaginaDict.Add("/OC/OC.aspx".ToUpper(), 155)
@@ -9373,7 +9374,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Ventas/CatMedicos.aspx".ToUpper(), 1343)
PaginaDict.Add("/Ventas/CatProcedimientos.aspx".ToUpper(), 1344)
PaginaDict.Add("/Ventas/CatProcedimientoDetalle.aspx".ToUpper(), 1344)
PaginaDict.Add("/Ventas/VentasMedicas.aspx".ToUpper(), 1345)

View File

@@ -1811,6 +1811,30 @@ Public Class ClsProductosServicios
Return Retorno
End Function
Public Function GetPSMultiplesPreciosLista(CveEmpresa As Integer, Optional ListasPrecios As String = "-1", Optional CveClasificacion As Integer = -1, Optional CvePS As Integer = -1,
Optional CveProveedor As Integer = -1, Optional Estado As Integer = -1, Optional Marcas As String = "-1", Optional CveModelo As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_PSPrecioListaMultipleGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@ListasPrecios", SqlDbType.VarChar).Value = ListasPrecios
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@Estado", SqlDbType.Int).Value = Estado
.Add("@Marcas", SqlDbType.VarChar).Value = Marcas
.Add("@CveModelo", SqlDbType.Int).Value = CveModelo
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los precios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function UpdatePSPreciosLista(Importe As Decimal, CvePrecioLista As Integer, Porcentaje As Decimal, CvePS As Integer, CveUsuario As Integer, Fecha As DateTime, Fijo As Boolean, Optional PrecioMinimo As Decimal = Nothing) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_PSPrecioListaAdd")

View File

@@ -5998,7 +5998,7 @@ Public Class ClsVentas
Public Function AddMedico(Medico As String, CedulaProfesional As String, FechaNacimiento As Date, Notas As String, DiasAtencion As String, Horario As String, Lugar As String, Estatus As Boolean, CveUsuario As Integer,
CveEmpresa As Integer, Telefono As String, Mail As String, Especialidad As String) As Boolean
CveEmpresa As Integer, Telefono As String, Mail As String, Especialidad As String, Celular As String, Consultorio As String) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_MedicosAdd")
@@ -6017,6 +6017,8 @@ Public Class ClsVentas
.Add("@Telefono", SqlDbType.VarChar).Value = Telefono
.Add("@Mail", SqlDbType.VarChar).Value = Mail
.Add("@Especialidad", SqlDbType.VarChar).Value = Especialidad
.Add("@Celular", SqlDbType.VarChar).Value = Celular
.Add("@Consultorio", SqlDbType.VarChar).Value = Consultorio
End With
@@ -6031,7 +6033,7 @@ Public Class ClsVentas
End Function
Public Function UpdateMedico(CveMedico As Integer, Medico As String, CedulaProfesional As String, FechaNacimiento As Date, Notas As String, DiasAtencion As String, Horario As String, Lugar As String, Estatus As Boolean, CveUsuario As Integer,
CveEmpresa As Integer, Telefono As String, Mail As String, Especialidad As String) As Boolean
CveEmpresa As Integer, Telefono As String, Mail As String, Especialidad As String, Celular As String, Consultorio As String) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_MedicosUpdate")
@@ -6050,6 +6052,9 @@ Public Class ClsVentas
.Add("@Telefono", SqlDbType.VarChar).Value = Telefono
.Add("@Mail", SqlDbType.VarChar).Value = Mail
.Add("@Especialidad", SqlDbType.VarChar).Value = Especialidad
.Add("@Celular", SqlDbType.VarChar).Value = Celular
.Add("@Consultorio", SqlDbType.VarChar).Value = Consultorio
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -66,7 +66,7 @@
<tr runat="server" id="DivListasPrecios" visible="false">
<td class="text-right">Lista de precio: </td>
<td>
<asp:DropDownList runat="server" ID="DdlPrecioLista" CssClass="form-control input-sm select2me" Width="150px" DataTextField="PrecioLista" DataValueField="CvePrecioLista"></asp:DropDownList>
<asp:DropDownList runat="server" ID="DdlPrecioLista" CssClass="form-control input-sm select2me" Width="150px" DataTextField="PrecioLista" DataValueField="CvePrecioLista" AutoPostBack="true" OnSelectedIndexChanged="DdlPrecioLista_SelectedIndexChanged"></asp:DropDownList>
</td>
<td></td>
</tr>
@@ -113,26 +113,22 @@
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="TblBusqueda" style="width: 100%" runat="server" border="0" visible="false">
<div class="row">
<div class="row" style="max-width: 780px;">
<div class="col-md-6">
<asp:Literal ID="LtPs" Text="" runat="server" />&nbsp&nbsp&nbsp&nbsp
<asp:Literal ID="LtPrecioPS" Text="" runat="server" Visible="false" />
&nbsp&nbsp&nbsp&nbsp
<asp:Literal ID="LtlIEPS" Text="IEPS:" runat="server" Visible="false" />
&nbsp&nbsp
<asp:Literal ID="LtlIEPSPorcentaje" Text="" runat="server" Visible="false" />
&nbsp&nbsp&nbsp&nbsp
<asp:Literal ID="LtlIVA" Text="IVA:" runat="server" Visible="false" />
&nbsp
<asp:Literal ID="LtlIVAPorcentaje" Text="" runat="server" Visible="false" />
<asp:Literal ID="LtPs" Text="" runat="server">&nbsp&nbsp</asp:Literal>
<asp:Literal ID="LtlIEPS" Text="IEPS:" runat="server" Visible="false">&nbsp&nbsp</asp:Literal>
<asp:Literal ID="LtlIEPSPorcentaje" Text="" runat="server" Visible="false">&nbsp&nbsp</asp:Literal>
<asp:Literal ID="LtlIVA" Text="IVA:" runat="server" Visible="false">&nbsp&nbsp</asp:Literal>
<asp:Literal ID="LtlIVAPorcentaje" Text="" runat="server" Visible="false">&nbsp&nbsp</asp:Literal>
</div>
<div class="col-md-3" style="text-align: right;">
<asp:Literal ID="LtPrecioPS" Text="" runat="server" Visible="false" />
<br />
<asp:HyperLink ID="HlPendiente" Style="color: #337ab7;" Visible="false" runat="server" Text="Ventas Pendiente por Surtir" Target="_blank"></asp:HyperLink>
</div>
</div>
@@ -150,7 +146,7 @@
</Columns>
</asp:GridView>
</div>
<div id="DivMedRin" style="overflow-y: auto; width: 765px; height: 325px;" runat="server" visible="False">
<div id="DivMedRin" style="overflow-y: auto; width: 765px; height: 325px;" runat="server" visible="false" >
<asp:GridView ID="GvMedRin" Width="100%" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" CssClass="table table-striped table-hover" GridLines="None">
<Columns>
<asp:BoundField DataField="Almacen" HeaderText="Almacén" />

View File

@@ -46,12 +46,6 @@ Partial Class Inventarios_Default
DivSucursal.Visible = True
End If
If UsuarioActual.CveEmpresa.Contiene(119) Then
LtPrecioPS.Visible = True
DivSucursal.Visible = True
End If
If UsuarioActual.CveEmpresa.Contiene(186) Then
LtPrecioPS.Visible = True
DivListasPrecios.Visible = True
@@ -303,16 +297,16 @@ Partial Class Inventarios_Default
Dim ObjInventarios As New ClsInventarios
If ObjInventarios.GetExistenciasMedRin(DDlPS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlRin.SelectedValue.ToEntero, DdlMedidas.SelectedValue.ToEntero) Then
GvMedRin.DataSource = ObjInventarios.DtResultados
GvMedRin.DataSource = ObjInventarios.DtResultados.Copy()
If ObjInventarios.DtResultados.Rows.Count > 0 Then
TblBusqueda.Visible = True
GvMedRin.Columns(5).Visible = ObjInventarios.DtResultados.MAX("CantidadMinimaPromo") <> ""
End If
End If
ObjInventarios.Dispose()
GvMedRin.DataBind()
UPDatos.Update()
DivMedRin.Visible = True
GvMedRin.DataBind()
UPDatos.Update()
End Sub
Private Sub CargaEquivalencia()
@@ -353,6 +347,28 @@ Partial Class Inventarios_Default
UpModalBuscarPorSerie.Update()
End Sub
End Sub
Protected Sub DdlPrecioLista_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim dr As Data.DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DDlPS.SelectedValue.ToEntero).FiltroPrimero("")
If dr IsNot Nothing Then
Dim ObjVta As New ClsVentas
Dim objPS As New ClsProductosServicios
If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then
If ObjVta.DtResultados.Rows.Count > 0 Then
If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, DdlPrecioLista.SelectedValue.ToEntero(), -1, DDlPS.SelectedValue.ToEntero) Then
If objPS.DtResultados.Rows.Count > 0 Then
LtPrecioPS.Text = $"Precio de venta: <b>$: {objPS.DtResultados.Rows(0)("PrecioLista").ToString.FormatoNumero} {dr("Abreviatura").ToString}</b>"
End If
End If
End If
End If
ObjVta.Dispose()
objPS.Dispose()
End If
UPDatos.Update()
End Sub
End Class

245
OS/RepOSMedicas.aspx Normal file
View File

@@ -0,0 +1,245 @@
<%@ Page Title="Reporte de Ordenes de Servicio Medicas" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepOSMedicas.aspx.vb" Inherits="OS_RepOSMedicas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
<style>
.btnopaco {
background-color: rgba(0,0,0,0.2);
color: #FFF;
}
.btnopaco:hover {
background-color: rgba(0,0,0,0.4);
color: #FFF;
font-weight: bold;
}
.select2 .select2-selection__rendered {
line-height: 1;
color: #111;
}
.select2 .select2-selection--multiple {
box-sizing: border-box;
cursor: pointer;
display: block;
min-height: 20px;
user-select: none;
-webkit-user-select: none;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
margin-top: 10px;
}
.select2-selection__rendered {
margin-top: 0px;
height: 25px;
}
.select2-selection {
margin-top: 0px;
height: 31px;
}
.select2-container--default.select2-container--focus .select2-selection--multiple {
border: none;
outline: 0;
}
#chartdiv {
width: 100%;
height: 500px;
}
</style>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<%-- <asp:UpdatePanel ID="UpAcciones" runat="server" >
<ContentTemplate>
</ContentTemplate>
<Triggers>
</Triggers>
</asp:UpdatePanel>--%>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Reporte de Ordenes de Servicio Medicas
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpAcciones">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkExportar" runat="server" Visible="false"><i class="fa fa-file-excel-o"></i> Excel</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkExportar" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row" style="height: 32px;">
<div class="col-md-1 truncate">
Fecha Inicio:
</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="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" 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="cvFechaI" runat="server" ControlToValidate="txtFechaI" 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="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-1 truncate">
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;">
<asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" 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="cvFechaF" runat="server" ControlToValidate="txtFechaF" 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="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">Cliente:</label>
<div class="col-md-2">
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"></ADS:Dropdownlost>
</div>
<label class="col-md-1 truncate">Vendedor:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlVendedor" data-text="Todos" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass=" input-sm select2me " Style="width: 100%;" runat="server"></asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="portlet-body" style="display: none">
<div class="row">
<label class="col-md-1 ">Estatus:</label>
<div class="col-md-1" >
<asp:DropDownList ID="DdlEstatusOS" runat="server" AppendDataBoundItems="true" Width="110px"
DataTextField="EstatusOrdenServicio" DataValueField="CveEstatusOrdenServicio" Class="input-sm select2me">
</asp:DropDownList>
</div>
<label class="col-md-1 ">Técnico:</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlTecnico" ClientIDMode="Static" CssClass="form-control input-sm select2me" runat="server" DataTextField="Nombre" DataValueField="CveUsuario" Width="110px" ></asp:DropDownList>
</div>
<asp:Label ID="LblProyecto" runat="server" class="col-md-1 truncate">Proyecto:</asp:Label>
<div runat="server" id="DivProyecto" class="col-md-2">
<asp:DropDownList ID="DdlProyecto" runat="server" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="Proyecto" DataValueField="CveProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me"></asp:DropDownList>
</div>
<asp:Label ID="LblSubProyecto" runat="server" class="col-md-1 truncate">SubProyecto:</asp:Label>
<div runat="server" id="DivSubProyecto" class="col-md-2">
<asp:DropDownList ID="DdlSubProyecto" data-text="Todos" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass=" input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:DropDownList>
</div>
</div>
<div class="row">
</div>
<div class="row">
</div>
<div class="row">
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" Width="99%" EmptyDataText="No se encontraron ordenes de servicio con los filtros especificados"
ToolTip="Listado de ordenes de servicio" CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" Style="text-align: center;" GridLines="None">
<Columns>
<%-- CveOS,FechaCita,Folio,Nombre,Medico,Procedimiento,Vendedor,RequiereOS,RequiereOSStr,CveUsuarioAtendio,Usuario,CveEstatusOrdenServicio,EstatusOrdenServicio,EstatusRepartidor,FolioPedido--%>
<%--0--%>
<asp:HyperLinkField HeaderText="Folio" DataNavigateUrlFields="CveOS" DataNavigateUrlFormatString="/OS/OrdenesServicios.aspx?CveOS={0}" DataTextField="Folio" Target="_blank" />
<%--<asp:BoundField HeaderText="Folio" DataField="Folio" ItemStyle-HorizontalAlign="Left" />--%>
<%--1--%>
<asp:BoundField HeaderText="FechaCita" DataField="FechaCita" ItemStyle-HorizontalAlign="Left" />
<%--2--%>
<asp:BoundField HeaderText="Cliente" DataField="Nombre" ItemStyle-HorizontalAlign="Left" />
<%--3--%>
<asp:BoundField HeaderText="Medico" DataField="Medico" ItemStyle-HorizontalAlign="Left" />
<%--4--%>
<asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" ItemStyle-HorizontalAlign="Left" />
<%--5--%>
<asp:BoundField HeaderText="Vendedor" DataField="Vendedor" ItemStyle-HorizontalAlign="Left" />
<%--6--%>
<asp:BoundField HeaderText="Estatus" DataField="EstatusOrdenServicio" ItemStyle-HorizontalAlign="Left" />
<%--7--%>
<asp:BoundField HeaderText="Ténico" DataField="Usuario" ItemStyle-HorizontalAlign="Left" />
</Columns>
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

182
OS/RepOSMedicas.aspx.vb Normal file
View File

@@ -0,0 +1,182 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Web.Compilation
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Imports System.Xml.Serialization
Imports System.IO
Imports System.Xml
Partial Class OS_RepOSMedicas
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario.Contiene(77, 21) Then Response.Redirect("/Inicio.aspx")
CargaCombos()
End If
End Sub
#Region " CARGA COMBOS "
Private Sub CargaCombos()
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto)
'CargaEstatus
DdlEstatusOS.DataSource = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa)
DdlEstatusOS.DataBind()
DdlEstatusOS.Items.Insert(0, New ListItem("Todos", "-1"))
Dim DTTecnicos = New DataTable
Dim ObjUsuarios As New ClsSisUsuarios
If ObjUsuarios.GetPermisosPorUsuarioProcesos(-1, -1, -1, -1, 351, UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) Then
If UsuarioActual.CveRol = 1 Then
DTTecnicos = ObjUsuarios.DtResultados.FiltraParametros(" CveProcesoUsuarioAcceso > 0")
Else
DTTecnicos = ObjUsuarios.DtResultados.FiltraParametros(" CveProcesoUsuarioAcceso > 0 and CveUsuario <> 100")
End If
End If
ObjUsuarios.Dispose()
DdlTecnico.DataSource = DTTecnicos 'GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True'")
DdlTecnico.DataBind()
DdlTecnico.Items.Insert(0, New ListItem("Todos", "-1"))
DdlTecnico.Items.Insert(1, New ListItem("Sin Asignar", "-2"))
'CargaClientes
Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
If EsWS Then
DdlClientes.setEsWebService(True)
Else
DdlClientes.setEsWebService(False)
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
DdlClientes.DataBind()
DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End If
'Vendedor
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltraParametros("VendedorTipo in (1,4)") 'vendedores y vendedores de piso
DdlVendedor.DataBind()
DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1"))
DdlVendedor.Items.Insert(1, New ListItem("Sin Vendedor", "-2"))
If UsuarioActual.CveVendedor > 0 Then
DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor)
DdlVendedor.Enabled = False
End If
txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString
txtFechaF.Text = NowADS().ToShortDateString
End Sub
#End Region
#Region " CARGA DATOS "
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
CargaDatos()
End Sub
Private Sub CargaDatos()
Dim ObjOS As New ClsOS
Dim FechaI As Date = If(txtFechaI.Text.Trim = "", MinFecha, txtFechaI.Text.ToDate)
Dim FechaF As Date = If(txtFechaF.Text.Trim = "", MaxFecha, txtFechaF.Text.ToDate)
Dim Cvecliente As Integer = If(DdlClientes.SelectedValue.ToEntero > 0, DdlClientes.SelectedValue.ToEntero, -1)
If ObjOS.GetRepOrdenesServicioMedicasRep(FechaI, FechaF, Cvecliente, DdlVendedor.SelectedValue.ToEntero, DdlEstatusOS.SelectedValue.ToEntero, DdlTecnico.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = ObjOS.DtResultados
Else
GvDatos.DataSource = Nothing
End If
ObjOS.Dispose()
GvDatos.DataBind()
LnkExportar.Visible = If(GvDatos.Rows.Count > 0, True, False)
UpAcciones.Update()
UPDatos.Update()
End Sub
#End Region
Private Sub CargaClientes()
DdlClientes.ddl.Items.Clear()
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) '.FiltraParametros($"CveClienteClasificacion = {DdlClienteClasificacion.SelectedValue.ToEntero} OR {DdlClienteClasificacion.SelectedValue.ToEntero} = -1")
DdlClientes.DataBind()
DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged
CargarSubProyecto(DdlSubProyecto, DdlProyecto.SelectedValue)
End Sub
#Region " GV DATOS - ROW DATABOUND "
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
End If
End Sub
#End Region
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
Dim SubProyecto As String = ""
If DdlSubProyecto.SelectedValue.ToEntero > 0 Then
SubProyecto = DdlSubProyecto.SelectedItem.Text
End If
Dim SbFiltros As New StringBuilder()
SbFiltros.AppendFormat($"Fecha Inicio: {txtFechaI.Text} Fecha Fin: {txtFechaF.Text}|")
SbFiltros.AppendFormat("SubProyecto: {0}|", SubProyecto)
GvDatos.ExportToExcelGembox("OrdenesServicio", UsuarioActual, "Ordenes de Servicio Medicas", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
End Sub
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
End Sub
End Class

View File

@@ -21,11 +21,11 @@
</li>
<li>
<asp:UpdatePanel ID="UpExportarExcel" runat="server">
<ContentTemplate>
<asp:LinkButton ID="LnkExportarExcel" Text="<i class='fa fa-file-excel-o'></i> ExportarExcel" runat="server" OnClick="LnkExportarExcel_Click"></asp:LinkButton>
</ContentTemplate>
<ContentTemplate>
<asp:LinkButton ID="LnkExportarExcel" Text="<i class='fa fa-file-excel-o'></i> ExportarExcel" runat="server" OnClick="LnkExportarExcel_Click"></asp:LinkButton>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkExportarExcel"/>
<asp:PostBackTrigger ControlID="LnkExportarExcel" />
</Triggers>
</asp:UpdatePanel>
</li>
@@ -42,46 +42,57 @@
</div>
<div class="titlefiltros caption ">
<div class="row v-center">
<label class="col-md-1 v-center truncate">Precio de Lista:</label>
<div class="col-md-1 v-center">
<asp:DropDownList ID="DdlPrecioLista" runat="server" AppendDataBoundItems="true" Width="100%" CssClass="select2me" DataValueField="CvePrecioLista" DataTextField="PrecioLista"></asp:DropDownList>
<label class="col-md-1 v-center truncate" runat="server" id="LblModalidad" visible="false" style="width: 80px;">Modalidad:</label>
<div class="col-md-2 v-center" runat="server" id="DivModalidad" visible="false">
<asp:DropDownList ID="DdlModalidad" runat="server" AppendDataBoundItems="true" Width="100%" CssClass="select2me" AutoPostBack="true" OnSelectedIndexChanged="DdlModalidad_SelectedIndexChanged">
<asp:ListItem Selected="True" Value="1" Text="Por lista de precio"></asp:ListItem>
<asp:ListItem Value="2" Text="Multiples listas de precio"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 v-center truncate" style="width: 80px;">PS:</label>
<div class="col-md-2 v-center">
<ADS:Dropdownlost ID="DDlPs" AutoPostBack="false" runat="server" DataTextField="PSCodigo" DataValueField="CvePS" CssClassDdl="select2me" CssStyle="width:250px;"></ADS:Dropdownlost>
</div>
<label class="col-md-1 v-center truncate">Clasificación:</label>
<div class="col-md-1 v-center">
<div class="col-md-2 v-center">
<asp:DropDownList ID="DDlClasificacion" runat="server" Width="100%" CssClass="select2me" OnSelectedIndexChanged="DDlClasificacion_SelectedIndexChanged" AutoPostBack="True" DataValueField="CveClasificacion" DataTextField="Clasificacion"></asp:DropDownList>
</div>
<label class="col-md-1 v-center truncate">PS:</label>
<div class="col-md-2 v-center">
<ADS:Dropdownlost ID="DDlPs" AutoPostBack="false" runat="server" DataTextField="PSCodigo" DataValueField="CvePS" CssClassDdl="select2me" CssStyle="width:200px;"></ADS:Dropdownlost>
<label class="col-md-1 v-center truncate">Precio de Lista:</label>
<div class="col-md-2 v-center" id="DivPrecioLista" runat="server">
<asp:DropDownList ID="DdlPrecioLista" runat="server" AppendDataBoundItems="true" Width="220px" CssClass="select2me" DataValueField="CvePrecioLista" DataTextField="PrecioLista"></asp:DropDownList>
</div>
<label id="LblMarca" runat="server" visible="false" class="col-md-1 v-center truncate">Marca:</label>
<div class="col-md-9">
<asp:ListBox ID="DdlMarca" visible="false" runat="server" DataTextField="Marca" DataValueField="CveMarca" data-text="Todos" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 50%; height: 50px !important;">
</asp:ListBox>
<div class="col-md-2 v-center" id="DivMultiplePrecioLista" runat="server" visible="false">
<asp:ListBox ID="DdlMultiplePrecioLista" runat="server" DataTextField="PrecioLista" DataValueField="CvePrecioLista" data-text="Todos" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width:200px; height: 50px !important;"></asp:ListBox>
</div>
</div>
</div>
</div>
<div class="portlet-body" >
<div class="portlet-body">
<br />
<div class="row v-center">
<label class="col-md-1 v-center" id="LblProveedorCompra" runat="server" visible="false">Proveedor:</label>
<div class="col-md-1 v-center" id="DivProveedorCompra" runat="server" visible="false">
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlProveedor" Width="100%" data-metodo="getproveedores" runat="server" DataTextField="RazonSocial" DataValueField="CveProveedor" CssStyle="width: 100%;"></ADS:Dropdownlost>
</div>
<label class="col-md-1 v-center truncate">Estado:</label>
<div class="col-md-1 v-center">
<label class="col-md-1 v-center truncate" style="width: 80px;">Estado:</label>
<div class="col-md-2 v-center">
<asp:DropDownList ID="DdlEstado" runat="server" Width="100%" CssClass="select2me">
<asp:ListItem Value="-1">Todos</asp:ListItem>
<asp:ListItem Value="1" Selected="True">Activos</asp:ListItem>
<asp:ListItem Value="0">Incativos</asp:ListItem>
</asp:DropDownList>
</div>
<label id="LblMarca" runat="server" visible="false" class="col-md-1 v-center truncate" style="width: 80px;">Marca:</label>
<div class="col-md-2 v-center" id="DivMarca" runat="server" visible="false">
<asp:ListBox ID="DdlMarca" runat="server" DataTextField="Marca" DataValueField="CveMarca" data-text="Todos" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width:250px; height: 50px !important;"></asp:ListBox>
</div>
<label id="lblModelo" runat="server" class="col-md-1 v-center truncate" visible="false">Modelo:</label>
<div class="col-md-1 v-center">
<asp:DropDownList ID="DdlModelo" Visible="false" runat="server" Width="100%" CssClass="select2me" DataTextField="Modelo" DataValueField="CveModelo">
<div class="col-md-2 v-center" id="DivModelo" runat="server" visible="false">
<asp:DropDownList ID="DdlModelo" runat="server" Width="100%" CssClass="select2me" DataTextField="Modelo" DataValueField="CveModelo">
</asp:DropDownList>
</div>
<label class="col-md-1 v-center" id="LblProveedorCompra" runat="server" visible="false">Proveedor:</label>
<div class="col-md-2 v-center" id="DivProveedorCompra" runat="server" visible="false">
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlProveedor" Width="100%" data-metodo="getproveedores" runat="server" DataTextField="RazonSocial" DataValueField="CveProveedor" CssStyle="width: 100%;"></ADS:Dropdownlost>
</div>
</div>
</div>
</div>
@@ -89,7 +100,7 @@
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" UpdateMode="conditional" ID="UPPrecioLista">
<ContentTemplate>
<div class="row">
<div class="row" id="DivActualizarPrecio" runat="server">
<div class="col-md-6">
<div class="portlet light smmallpadding traspasorow bordered xspadding">
<div class="portlet-title">
@@ -164,7 +175,7 @@
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBuscar','{0}')", GVPrecios.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GVPrecios" runat="server" GridLines="None" DataKeyNames="CvePS, CvePrecioLista,PrecioLista,PS,Codigo,Codigo2,Porcentaje,CodigoPS"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" AutoGenerateColumns="False" data-sort="true" EmptyDataText="No se encontraron registros" >
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" AutoGenerateColumns="False" data-sort="true" EmptyDataText="No se encontraron registros">
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="5%">
<ItemTemplate>
@@ -173,7 +184,7 @@
</asp:TemplateField>
<asp:BoundField DataField="Codigo" ItemStyle-Width="5%" HeaderText="Código" />
<asp:BoundField DataField="Codigo2" ItemStyle-Width="5%" HeaderText="Código CPK" Visible="false" />
<asp:BoundField DataField="PS" HeaderText="Producto/Servicio" />
<asp:BoundField DataField="PS" HeaderText="Producto/Servicio" />
<asp:BoundField DataField="Clasificacion" ItemStyle-Width="15%" HeaderText="Clasificación" />
<asp:BoundField DataField="PrecioLista" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="Importe" DataFormatString="$ {0:N2}" ItemStyle-HorizontalAlign="right" />
<asp:TemplateField HeaderText="">
@@ -192,13 +203,13 @@
<asp:TemplateField HeaderText="">
<ItemTemplate>
<asp:TextBox ID="TxtPrecioMinimo" runat="server" Text='<%# Eval("PrecioMinimo", "{0:0.######}")%>' CssClass="CssCamviaPrecio" MaxLength="39" Width="60px" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
<%-- <ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtPrecioMinimo" FilterType="Numbers,Custom" ValidChars="." />
<%-- <ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtPrecioMinimo" FilterType="Numbers,Custom" ValidChars="." />
<asp:RegularExpressionValidator ID="REVTxtPrecioMinimo" runat="server" ControlToValidate="TxtPrecioMinimo" Display="None" EnableClientScript="True" ErrorMessage="El campo <b>''PrecioLista''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." ValidationGroup="GrpGuardar" ValidationExpression="^[0-9]{1,15}(?:\.[0-9]{1,4})?$" />
<ajax:ValidatorCalloutExtender ID="VCTxtPrecioMinimo" runat="server" HighlightCssClass="vco" TargetControlID="REVTxtPrecioMinimo" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="UnidadMedida" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="U.M." />
<asp:BoundField DataField="UnidadMedida" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="U.M." />
<asp:BoundField DataField="Moneda" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="Moneda" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="CostoPromedio" NullDisplayText="-" ItemStyle-Width="5%" DataFormatString="{0:N2}" Visible="false" HeaderText="C. Promedio" ItemStyle-HorizontalAlign="right" />
<asp:BoundField DataField="VentaMinima" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="E. Mínimo" ItemStyle-HorizontalAlign="right" />
@@ -216,6 +227,155 @@
</asp:GridView>
</div>
<div id="dvMultiple" runat="server" visible="false">
<div class="row">
<div class="col-md-3">
<asp:LinkButton ID="LnkGuardarMultiple" runat="server" AlternateText="Actualizar" CausesValidation="True" CssClass="btn btn-primary" Text="Actualizar Seleccionadas" OnClick="LnkGuardarMultiple_Click" />
<%--<button onclick="convertirTabla(); return false;"> test</button>--%>
</div>
<div class="col-md-6">
</div>
<div class="col-md-3">
<div align="right">
<input type="text" id="TxtBuscarM" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBuscarM','{0}')", GvMultiple.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBuscarM','{0}')", GvMultiple.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
<br />
<asp:GridView ID="GvMultiple" runat="server" GridLines="None" ClientIDMode="Static" AutoGenerateColumns="false"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" EmptyDataText="No se encontraron registros"
OnRowCreated="GvMultiple_RowCreated" OnRowDataBound="GvMultiple_RowDataBound">
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="5%">
<ItemTemplate>
<asp:CheckBox runat="server" ID="chkPS" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="CodigoPS" HeaderText="Producto/Servicio" />
<asp:TemplateField Visible="false">
<HeaderTemplate>
<asp:Label ID="LtlLista_1" runat="server"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TxtPrecio_1" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>
<asp:Label ID="LtlLista_2" runat="server"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TxtPrecio_2" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>
<asp:Label ID="LtlLista_3" runat="server"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TxtPrecio_3" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>
<asp:Label ID="LtlLista_4" runat="server"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TxtPrecio_4" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>
<asp:Label ID="LtlLista_5" runat="server"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TxtPrecio_5" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>
<asp:Label ID="LtlLista_6" runat="server"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TxtPrecio_6" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>
<asp:Label ID="LtlLista_7" runat="server"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TxtPrecio_7" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>
<asp:Label ID="LtlLista_8" runat="server"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TxtPrecio_8" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>
<asp:Label ID="LtlLista_9" runat="server"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TxtPrecio_9" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>
<asp:Label ID="LtlLista_10" runat="server"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TxtPrecio_10" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>
<asp:Label ID="LtlLista_11" runat="server"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TxtPrecio_11" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>
<asp:Label ID="LtlLista_12" runat="server"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TxtPrecio_12" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>
<asp:Label ID="LtlLista_13" runat="server"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TxtPrecio_13" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>
<asp:Label ID="LtlLista_14" runat="server"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TxtPrecio_14" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>
<asp:Label ID="LtlLista_15" runat="server"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TxtPrecio_15" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div id="ModalActualizaPrecios" class="modal ADS fade" role="dialog">
@@ -255,7 +415,7 @@
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="chkSucursal" runat="server" Checked="false" CssClass="CsMCheckGvSucursal" />
<asp:HiddenField ID="hdnEnBD" runat="server" Value='<%# If (IsDBNull(Eval("CvePS")),0,1) %>' />
<asp:HiddenField ID="hdnEnBD" runat="server" Value='<%# If(IsDBNull(Eval("CvePS")), 0, 1) %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sucursal" ItemStyle-Width="30%">
@@ -366,18 +526,43 @@
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script>
function convertirTabla() {
let json = tableToJson($('#GvMultiple').get(0));
}
function tableToJson(table) {
var data = [];
// first row needs to be headers
var headers = [];
for (var i = 0; i < table.rows[0].cells.length; i++) {
if (table.rows[0].cells[i].innerHTML != "") {
headers[i] = table.rows[0].cells[i].innerText.toLowerCase().replace(/ /gi, '');
}
}
// go through cells
for (var i = 1; i < table.rows.length; i++) {
var tableRow = table.rows[i];
var rowData = {};
for (var j = 1; j < tableRow.cells.length; j++) {
rowData[headers[j]] = tableRow.cells[j].innerText;
}
data.push(rowData);
}
return data;
}
function onlyNumberKey(evt) {
// Only ASCII character in that range allowed
var ASCIICode = (evt.which) ? evt.which : evt.keyCode
if (ASCIICode > 31 && (ASCIICode < 48 || ASCIICode > 57))
{
if (ASCIICode > 31 && (ASCIICode < 48 || ASCIICode > 57)) {
if (ASCIICode == 46) {
return true
return true
} else {
return false;
}
}
}
return true;
}

View File

@@ -8,7 +8,16 @@ Imports Extensiones
Imports GemBox.Spreadsheet
Partial Class Ventas_ActualizarPrecios
Inherits ClsPaginas
Inherits ClsPaginas
Private Property DtListasPrecios As DataTable
Get
Return If(IsNothing(ViewState("DtListasPrecios")), Nothing, CType(ViewState("DtListasPrecios"), DataTable))
End Get
Set(value As DataTable)
ViewState("DtListasPrecios") = value
End Set
End Property
Private Property DtSubProyectos As DataTable
Get
@@ -26,6 +35,15 @@ Partial Class Ventas_ActualizarPrecios
Set(value As DataTable)
ViewState("DtDatosPrecios") = value
End Set
End Property
Private Property DtPreciosMultiple As DataTable
Get
Return If(IsNothing(ViewState("DtPreciosMultiple")), Nothing, CType(ViewState("DtPreciosMultiple"), DataTable))
End Get
Set(value As DataTable)
ViewState("DtPreciosMultiple") = value
End Set
End Property
Private Property CveSucursal As Integer
@@ -69,6 +87,10 @@ Partial Class Ventas_ActualizarPrecios
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
If UsuarioActual.CveEmpresa = 186 Then
LblModalidad.Visible = True
DivModalidad.Visible = True
End If
CargaCombos()
End If
End Sub
@@ -90,12 +112,15 @@ Partial Class Ventas_ActualizarPrecios
DdlPrecioLista.Items.Clear()
If UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'si manneja precios de lista
If UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'si manneja precios de lista
Dim ObjVta As New ClsVentas
Dim primerItem As String = ""
If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then
DdlPrecioLista.DataSource = ObjVta.DtResultados.Copy()
DdlPrecioListaCarga.DataSource = ObjVta.DtResultados.Copy()
DtListasPrecios = ObjVta.DtResultados.Copy()
DdlPrecioLista.DataSource = DtListasPrecios
DdlPrecioListaCarga.DataSource = DtListasPrecios
DdlMultiplePrecioLista.DataSource = DtListasPrecios
primerItem = ObjVta.DtResultados.FiltroPrimeroValor("CvePrecioLista")
End If
ObjVta.Dispose()
@@ -103,6 +128,19 @@ Partial Class Ventas_ActualizarPrecios
DdlPrecioLista.DataBind()
DdlPrecioListaCarga.DataBind()
DdlMultiplePrecioLista.DataBind()
Dim SeleccionMaxima As Integer = 14
If (DtListasPrecios.Rows.Count - 1) < 14 Then
SeleccionMaxima = DtListasPrecios.Rows.Count - 1
End If
Dim sbMultiple As New StringBuilder
For Each Row As DataRow In DtListasPrecios.FiltraPorIndices(0, SeleccionMaxima).Rows
sbMultiple.AppendFormat("{0},", Row("CvePrecioLista"))
Next
DdlMultiplePrecioLista.SelectedValuesIfExistM(sbMultiple.ToString(), True)
If (DdlPrecioLista.Items.Count = 1) Then
DdlPrecioLista.Items.FindByValue(primerItem).Selected = True
@@ -149,7 +187,7 @@ Partial Class Ventas_ActualizarPrecios
DdlMarca.DataBind()
LblMarca.Visible = True
DdlMarca.Visible = True
DivMarca.Visible = True
End If
DdlMarca.Items.Insert(0, New ListItem("Todos", "-1"))
@@ -157,7 +195,7 @@ Partial Class Ventas_ActualizarPrecios
Private Sub CargarModelos()
If UsuarioActual.Empresa.Funcionalidad(558).ToString = "1" Then
lblModelo.Visible = True
DdlModelo.Visible = True
DivModelo.Visible = True
Dim ObjGeneral As New ClsGenerales
If ObjGeneral.GetModelos(UsuarioActual.CveEmpresa) Then
DdlModelo.DataSource = ObjGeneral.DtResultados
@@ -169,7 +207,7 @@ Partial Class Ventas_ActualizarPrecios
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
Dim objPS As New ClsProductosServicios
Dim CveProveedor As Integer = -1
Dim CvePS As Integer = -1
Dim Marcas As String = If(DdlMarca.GetSelectedValuesM = "", "-1", DdlMarca.GetSelectedValuesM)
@@ -180,28 +218,64 @@ Partial Class Ventas_ActualizarPrecios
If DdlProveedor.txtValue.Value.ToEntero > 0 Then
CveProveedor = DdlProveedor.txtValue.Value.ToEntero
End If
If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, DdlPrecioLista.SelectedValue.ToEntero, DDlClasificacion.SelectedValue.ToEntero, CvePS,
CveProveedor:=CveProveedor, Estado:=DdlEstado.SelectedValue.ToEntero, Marcas:=Marcas, CveModelo:=DdlModelo.SelectedValue.ToEntero) Then
DtDatosPrecios = objPS.DtResultados
GVPrecios.DataSource = DtDatosPrecios
End If
objPS.Dispose()
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'Empresa Acumuladores
GVPrecios.Columns(2).Visible = True
End If
If UsuarioActual.CveEmpresa = 153 Then 'Empresa servec
GVPrecios.Columns(11).Visible = True
End If
'POR LISTA DE PRECIO
If DdlModalidad.SelectedValue = "1" Then
Dim objPS As New ClsProductosServicios
If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, DdlPrecioLista.SelectedValue.ToEntero, DDlClasificacion.SelectedValue.ToEntero, CvePS,
CveProveedor:=CveProveedor, Estado:=DdlEstado.SelectedValue.ToEntero, Marcas:=Marcas, CveModelo:=DdlModelo.SelectedValue.ToEntero) Then
DtDatosPrecios = objPS.DtResultados
GVPrecios.DataSource = DtDatosPrecios
End If
objPS.Dispose()
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'Empresa Acumuladores
GVPrecios.Columns(2).Visible = True
End If
If UsuarioActual.CveEmpresa = 153 Then 'Empresa servec
GVPrecios.Columns(11).Visible = True
End If
dvDatos.Visible = True
dvMultiple.Visible = False
DivActualizarPrecio.Visible = True
GVPrecios.DataBind()
End If
'MULTIPLE LISTAS DE PRECIO
If DdlModalidad.SelectedValue = "2" Then
Dim ListasPrecios As String = If(DdlMultiplePrecioLista.GetSelectedValuesM = "", "-1", DdlMultiplePrecioLista.GetSelectedValuesM)
Dim objPS As New ClsProductosServicios
If objPS.GetPSMultiplesPreciosLista(UsuarioActual.CveEmpresa, ListasPrecios:=ListasPrecios, CveClasificacion:=DDlClasificacion.SelectedValue.ToEntero, CvePS:=CvePS,
CveProveedor:=CveProveedor, Estado:=DdlEstado.SelectedValue.ToEntero, Marcas:=Marcas, CveModelo:=DdlModelo.SelectedValue.ToEntero) Then
DtPreciosMultiple = objPS.DtResultados.Copy()
GvMultiple.DataSource = DtPreciosMultiple
End If
objPS.Dispose()
dvDatos.Visible = False
dvMultiple.Visible = True
DivActualizarPrecio.Visible = False
For colIndex = 2 To GvMultiple.Columns.Count - 1
If colIndex <= DtPreciosMultiple.Columns.Count - 1 Then
GvMultiple.Columns(colIndex).Visible = True
Else
GvMultiple.Columns(colIndex).Visible = False
End If
Next
GvMultiple.DataBind()
End If
dvDatos.Visible = True
GVPrecios.DataBind()
UpDescargar.Update()
UpDatos.Update()
UPPrecioLista.Update()
End Sub
Protected Sub DDlClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaPS()
@@ -743,4 +817,157 @@ Partial Class Ventas_ActualizarPrecios
FileExcel.Save(Response, "Precios.xlsx", SaveOptions.XlsxDefault)
End Sub
Protected Sub GvMultiple_RowCreated(sender As Object, e As GridViewRowEventArgs)
'QUITAR COLUMNA "CvePS"
'e.Row.Cells(1).Visible = False
'If e.Row.RowType = DataControlRowType.Header Then
' For colIndex = 2 To e.Row.Cells.Count - 1
' Dim indiceColumna As Integer = (colIndex)
' Dim LtlId = "LtlLista" + (colIndex - 1).ToString()
' Dim Dr = DtPreciosMultiple.Rows(e.Row.RowIndex)
' If Dr IsNot Nothing Then
' 'VERIFICA QUE EL INDICE DE LA COLUMNA DEL DT NO SEA MAYOR A LA DEL GRIDVIEW
' If indiceColumna <= DtPreciosMultiple.Columns.Count - 1 Then
' Dim cell = e.Row.Cells(colIndex)
' Dim text = cell.Text
' Dim splitValues = text.Split("|"c)
' If splitValues.Length > 1 Then
' Dim CvePrecioLista = splitValues(0)
' Dim PrecioLista = splitValues(1)
' e.Row.FCLiteral(LtlId).Text = PrecioLista
' cell.Attributes.Add("cvepreciolista", CvePrecioLista)
' End If
' End If
' End If
' Next
'End If
End Sub
Protected Sub GvMultiple_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.Header Then
For colIndex = 2 To e.Row.Cells.Count - 1
Dim indiceColumna As Integer = (colIndex)
Dim LtlId = "LtlLista_" + (colIndex - 1).ToString()
If indiceColumna <= DtPreciosMultiple.Columns.Count - 1 Then
Dim text = DtPreciosMultiple.Columns(indiceColumna).ColumnName
Dim splitValues = text.Split("|"c)
If splitValues.Length > 1 Then
Dim CvePrecioLista = splitValues(0)
Dim PrecioLista = splitValues(1)
e.Row.FCLabel(LtlId).Text = PrecioLista
e.Row.FCLabel(LtlId).Attributes.Add("cvepreciolista", CvePrecioLista)
End If
End If
Next
End If
If e.Row.RowType = DataControlRowType.DataRow Then
For colIndex = 2 To e.Row.Cells.Count - 1
Dim indiceColumna As Integer = (colIndex)
Dim TxtId = "TxtPrecio_" + (colIndex - 1).ToString()
Dim Dr = DtPreciosMultiple.Rows(e.Row.RowIndex)
If Dr IsNot Nothing Then
'VERIFICA QUE EL INDICE DE LA COLUMNA DEL DT NO SEA MAYOR A LA DEL GRIDVIEW
If indiceColumna <= DtPreciosMultiple.Columns.Count - 1 Then
Dim Valor = DtPreciosMultiple.Rows(e.Row.RowIndex)(indiceColumna).ToString().ToDecimal()
e.Row.FCTextBox(TxtId).Text = Valor.FormatoNumero(2)
End If
End If
Next
End If
End Sub
Protected Sub LnkGuardarMultiple_Click(sender As Object, e As EventArgs)
Dim TieneError As Boolean = False
Dim ObjPS As New ClsProductosServicios
ObjPS.IniciaTransacSQL()
Try
For Each GvRow As GridViewRow In GvMultiple.Rows
If GvRow.FCCheckBox("chkPS").Checked Then
For colIndex = 2 To GvRow.Cells.Count - 1
Dim indiceColumna As Integer = (colIndex)
Dim LtlId = "LtlLista_" + (colIndex - 1).ToString()
Dim TxtId = "TxtPrecio_" + (colIndex - 1).ToString()
If indiceColumna <= DtPreciosMultiple.Columns.Count - 1 Then
Dim CvePrecioLista As Integer = GvMultiple.HeaderRow.FCLabel(LtlId).Attributes().Item("cvepreciolista").ToEntero()
Dim CvePS = DtPreciosMultiple.Rows(GvRow.RowIndex)("CvePS").ToString().ToEntero()
Dim Precio = GvRow.FCTextBox(TxtId).Text.ToDecimal()
TieneError = Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLista, 0, CvePS, UsuarioActual.CveUsuario, NowADS(), True)
If TieneError Then
Exit For
End If
End If
Next
End If
Next
Catch ex As Exception
OnError("Ocurrió un error al actualizar precios", ex)
TieneError = True
End Try
If Not TieneError Then
Alert("Los Precios de lista de los Productos/Servicios se actualizaron correctamente")
Else
Alert("Ocurrió un error al actualizar precios", TipoMensaje.MsgError)
End If
If TieneError Then
ObjPS.RollBack()
Else
ObjPS.Commit()
End If
ObjPS.Dispose()
If Not TieneError Then
BtnConsultar_Click(Nothing, Nothing)
End If
End Sub
Protected Sub DdlModalidad_SelectedIndexChanged(sender As Object, e As EventArgs)
DivPrecioLista.Visible = DdlModalidad.SelectedValue = "1"
DivMultiplePrecioLista.Visible = DdlModalidad.SelectedValue = "2"
Dim SeleccionMaxima As Integer = 14
If (DtListasPrecios.Rows.Count - 1) < 14 Then
SeleccionMaxima = DtListasPrecios.Rows.Count - 1
End If
Dim sbMultiple As New StringBuilder
For Each Row As DataRow In DtListasPrecios.FiltraPorIndices(0, SeleccionMaxima).Rows
sbMultiple.AppendFormat("{0},", Row("CvePrecioLista"))
Next
DdlMultiplePrecioLista.SelectedValuesIfExistM(sbMultiple.ToString(), True)
UpEncabezado.Update()
End Sub
End Class

View File

@@ -35,8 +35,8 @@
<div class="col-md-12">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveMedico, Medico, CedulaProfesional, FechaNacimiento, Notas, DiasAtencion, Horario, Lugar, Estatus, CveUsuario, FechaIng, CveEmpresa,Telefono, Mail, Especialidad"
EmptyDataText="No se encontraron Medicos Registrados" ToolTip="Listado de Medicos" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None">
DataKeyNames="CveMedico, Medico, CedulaProfesional, FechaNacimiento, Notas, DiasAtencion, Horario, Lugar, Estatus, CveUsuario, FechaIng, CveEmpresa,Telefono, Mail, Especialidad, Celular, Consultorio"
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:TemplateField HeaderText="Medico" ItemStyle-HorizontalAlign="Left" >
<ItemTemplate>
@@ -46,7 +46,7 @@
<asp:TemplateField HeaderText="Cedula Profesional" ItemStyle-HorizontalAlign="Left" >
<ItemTemplate>
<asp:Literal ID="LtlCedulaProfesional" runat="server" Text='<%# Eval("CedulaProfesional") %>'></asp:Literal>
<asp:Literal ID="LtlCedulaProfesional" runat="server" Text='<%# Eval("CedulaProfesional", "{0:N0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
@@ -138,31 +138,31 @@
<div class="row">
<div class="col-md-12">
<div class="form-group form-md-line-input input-iconright">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtMedico" CssClass="form-control " runat="server" MaxLength="250" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtMedico" runat="server" ControlToValidate="TxtMedico" CssClass="help-block errorimput"
<asp:RequiredFieldValidator ID="RfvTxtMedico" runat="server" ControlToValidate="TxtMedico" CssClass="help-block errorimput"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Medico''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarRegistro"></asp:RequiredFieldValidator>
<label for="<%= TxtMedico.ClientID.ToString()%>">Medico:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCedulaProfecional" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtCedulaProfecional" runat="server" ControlToValidate="TxtCedulaProfecional" CssClass="help-block errorimput"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cédula Profecional''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarRegistro"></asp:RequiredFieldValidator>
<label for="<%= TxtCedulaProfecional.ClientID.ToString()%>">Cédula Profesional:</label>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright date date-picker date date-picker" style="min-width: 135px; margin-top:-10px !important;">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCedulaProfecional" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtCedulaProfecional" runat="server" ControlToValidate="TxtCedulaProfecional" CssClass="help-block errorimput"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cédula Profecional''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarRegistro"></asp:RequiredFieldValidator>
<label for="<%= TxtCedulaProfecional.ClientID.ToString()%>">Cédula Profesional:</label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright date date-picker date date-picker" style="min-width: 135px; margin-top: -10px !important;">
<label for="<%= TxtFechaNacimiento.ClientID.ToString()%>" style="color: #888888;">Fecha de Nacimiento: </label>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;margin-top: -5px !important;">
<asp:TextBox ID="TxtFechaNacimiento" CssClass="form-control" MaxLength="20" runat="server" Width="100px" Height="28px"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkFechaNacimiento" class="btn default" Text="<i class='fa fa-calendar'></i>" runat="server" ></asp:LinkButton>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkFechaNacimiento" class="btn default" Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
@@ -172,63 +172,116 @@
<asp:CompareValidator ID="cvFechaNacimiento" runat="server" ControlToValidate="TxtFechaNacimiento" Display="None" ErrorMessage="El campo <b>''Fecha de Nacimiento''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardarRegistro"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaNacimiento" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaNacimiento" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
</div>
</div>
<br />
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtTelefono" CssClass="form-control " runat="server" MaxLength="10" CausesValidation="true"></asp:TextBox>
<ajax:MaskedEditExtender ID="MEETelefono" runat="server" TargetControlID="TxtTelefono" ClearMaskOnLostFocus="false" MaskType="Number" Mask="(999) 999-9999" MessageValidatorTip="true" InputDirection="LeftToRight" ErrorTooltipEnabled="True"></ajax:MaskedEditExtender>
<label for="<%= TxtTelefono.ClientID.ToString()%>">Teléfono:</label>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtTelefono" CssClass="form-control " runat="server" MaxLength="10" CausesValidation="true"></asp:TextBox>
<ajax:MaskedEditExtender ID="MEETelefono" runat="server" TargetControlID="TxtTelefono" ClearMaskOnLostFocus="false" MaskType="Number" Mask="(999) 999-9999" MessageValidatorTip="true" InputDirection="LeftToRight" ErrorTooltipEnabled="True"></ajax:MaskedEditExtender>
<label for="<%= TxtTelefono.ClientID.ToString()%>">Teléfono:</label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCelular" CssClass="form-control " runat="server" MaxLength="10" CausesValidation="true"></asp:TextBox>
<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TxtCelular" ClearMaskOnLostFocus="false" MaskType="Number" Mask="(999) 999-9999" MessageValidatorTip="true" InputDirection="LeftToRight" ErrorTooltipEnabled="True"></ajax:MaskedEditExtender>
<label for="<%= TxtCelular.ClientID.ToString()%>">Celular:</label>
</div>
</div>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtMail" CssClass="form-control " runat="server" MaxLength="300" CausesValidation="true"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FilTxtMail" runat="server" FilterType="Numbers, LowercaseLetters, UppercaseLetters, Custom" ValidChars=".;@_-ñ" TargetControlID="TxtMail" />
<asp:RegularExpressionValidator ID="RETxtMail" runat="server" CssClass="help-block errorimput"
ValidationExpression="(([a-zA-Z0-9ñÑ_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)(\s*;\s*|\s*$))*"
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtMail" CssClass="form-control " runat="server" MaxLength="300" CausesValidation="true"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FilTxtMail" runat="server" FilterType="Numbers, LowercaseLetters, UppercaseLetters, Custom" ValidChars=".;@_-ñ" TargetControlID="TxtMail" />
<asp:RegularExpressionValidator ID="RETxtMail" runat="server" CssClass="help-block errorimput"
ValidationExpression="(([a-zA-Z0-9ñÑ_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)(\s*;\s*|\s*$))*"
ControlToValidate="TxtMail" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Correo''</b> no es válido, por favor ingrése uno correcto." ValidationGroup="GrpGuardarRegistro"></asp:RegularExpressionValidator>
<label for="<%= TxtMail.ClientID.ToString()%>">Correo:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtEspecialidad" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<label for="<%= TxtEspecialidad.ClientID.ToString()%>">Especialidad:</label>
<label for="<%= TxtMail.ClientID.ToString()%>">Correo:</label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtEspecialidad" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<label for="<%= TxtEspecialidad.ClientID.ToString()%>">Especialidad:</label>
</div>
</div>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtNotas" CssClass="form-control " runat="server" MaxLength="250" CausesValidation="true"></asp:TextBox>
<asp:TextBox ID="TxtNotas" CssClass="form-control " runat="server" MaxLength="250" CausesValidation="true"></asp:TextBox>
<label for="<%= TxtNotas.ClientID.ToString()%>">Notas:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtDiasAtencion" CssClass="form-control " runat="server" MaxLength="250" CausesValidation="true"></asp:TextBox>
<label for="<%= TxtDiasAtencion.ClientID.ToString()%>">Días de Atención:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtHorario" CssClass="form-control " runat="server" MaxLength="250" CausesValidation="true"></asp:TextBox>
<label for="<%= TxtHorario.ClientID.ToString()%>">Horario:</label>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtDiasAtencion" CssClass="form-control " runat="server" MaxLength="250" CausesValidation="true"></asp:TextBox>
<label for="<%= TxtDiasAtencion.ClientID.ToString()%>">Días de Atención:</label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtHorario" CssClass="form-control " runat="server" MaxLength="250" CausesValidation="true"></asp:TextBox>
<label for="<%= TxtHorario.ClientID.ToString()%>">Horario:</label>
</div>
</div>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtLugar" CssClass="form-control " runat="server" MaxLength="250" CausesValidation="true"></asp:TextBox>
<label for="<%= TxtLugar.ClientID.ToString()%>">Lugar:</label>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtLugar" CssClass="form-control " runat="server" MaxLength="250" CausesValidation="true"></asp:TextBox>
<label for="<%= TxtLugar.ClientID.ToString()%>">Lugar:</label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtConsultorio" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<label for="<%= TxtConsultorio.ClientID.ToString()%>">Consultorio:</label>
</div>
</div>
</div>
<div class="form-group form-md-line-input input-iconright" id="DVEstatus" runat="server" >
<asp:CheckBox ID="ChkEstatus" CssClass="form-control make-switchsd" data-size="small" runat="server" style="margin-top:7px" ></asp:CheckBox>
<div class="form-group form-md-line-input input-iconright" id="DVEstatus" runat="server">
<asp:CheckBox ID="ChkEstatus" CssClass="form-control make-switchsd" data-size="small" runat="server" Style="margin-top: 7px"></asp:CheckBox>
<label for="<%= ChkEstatus.ClientID.ToString()%>">Activo:</label>
</div>
</div>
</div>

View File

@@ -51,13 +51,16 @@ Partial Class Ventas_CatMedicos
Dim Telefono As String = If(TxtTelefono.Text = "(___) ___-____", "", TxtTelefono.Text)
Dim Celular As String = If(TxtCelular.Text = "(___) ___-____", "", TxtCelular.Text)
If CveMedico > 0 Then
If ObjVentas.UpdateMedico(CveMedico, TxtMedico.Text.Trim, TxtCedulaProfecional.Text.Trim, TxtFechaNacimiento.Text.ToDate, TxtNotas.Text.Trim, TxtDiasAtencion.Text.Trim, TxtHorario.Text.Trim, TxtLugar.Text.Trim, ChkEstatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Telefono, TxtMail.Text, TxtEspecialidad.Text) Then
If ObjVentas.UpdateMedico(CveMedico, TxtMedico.Text.Trim, TxtCedulaProfecional.Text.Trim, TxtFechaNacimiento.Text.ToDate, TxtNotas.Text.Trim, TxtDiasAtencion.Text.Trim, TxtHorario.Text.Trim, TxtLugar.Text.Trim, ChkEstatus.Checked,
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Telefono, TxtMail.Text, TxtEspecialidad.Text, Celular, TxtConsultorio.Text.Trim) Then
ProcesoOK = True
End If
Else
If ObjVentas.AddMedico(TxtMedico.Text.Trim, TxtCedulaProfecional.Text.Trim, TxtFechaNacimiento.Text.ToDate, TxtNotas.Text.Trim, TxtDiasAtencion.Text.Trim, TxtHorario.Text.Trim, TxtLugar.Text.Trim, ChkEstatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Telefono, TxtMail.Text, TxtEspecialidad.Text) Then
If ObjVentas.AddMedico(TxtMedico.Text.Trim, TxtCedulaProfecional.Text.Trim, TxtFechaNacimiento.Text.ToDate, TxtNotas.Text.Trim, TxtDiasAtencion.Text.Trim, TxtHorario.Text.Trim, TxtLugar.Text.Trim, ChkEstatus.Checked, UsuarioActual.CveUsuario,
UsuarioActual.CveEmpresa, Telefono, TxtMail.Text, TxtEspecialidad.Text, Celular, TxtConsultorio.Text.Trim) Then
ProcesoOK = True
End If
End If
@@ -125,11 +128,14 @@ Partial Class Ventas_CatMedicos
TxtDiasAtencion.Text = ""
TxtHorario.Text = ""
TxtLugar.Text = ""
TxtConsultorio.Text = ""
TxtMail.Text = ""
TxtTelefono.Text = ""
TxtCelular.Text = ""
TxtEspecialidad.Text = ""
DVEstatus.Visible = False
ChkEstatus.Checked = True
@@ -153,10 +159,11 @@ Partial Class Ventas_CatMedicos
TxtDiasAtencion.Text = GvRow.DataKey("DiasAtencion")
TxtHorario.Text = GvRow.DataKey("Horario")
TxtLugar.Text = GvRow.DataKey("Lugar")
TxtConsultorio.Text = GvRow.DataKey("Consultorio")
ChkEstatus.Checked = Boolean.Parse(GvRow.DataKey("Estatus"))
TxtMail.Text = GvRow.DataKey("Mail")
TxtTelefono.Text = GvRow.DataKey("Telefono")
TxtCelular.Text = GvRow.DataKey("Celular")
TxtEspecialidad.Text = GvRow.DataKey("Especialidad")
DVEstatus.Visible = True

View File

@@ -731,23 +731,16 @@
</div>
<div class="col-md-6">
<div class="row">
<div class="col-md-8">
<div id="DivTxtCrearPrecioLista" runat="server" visible="false" class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPrecioLista" CssClass="form-control" runat="server" MaxLength="300"></asp:TextBox>
<label for="<%= TxtPrecioLista.ClientID.ToString()%>">Precio Lista: </label>
<i></i>
</div>
<div class="col-md-10">
<div id="DivPrecioLista" runat="server" class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlPrecioLista" runat="server" CssClass="form-control select2me" Width="100%" DataTextField="PrecioLista" DataValueField="CvePrecioLista"></asp:DropDownList>
<label for="<%= DdlPrecioLista.ClientID.ToString()%>">Precio Lista: </label>
<label for="<%= DdlPrecioLista.ClientID.ToString()%>">Precio Lista:</label>
<i></i>
</div>
</div>
<div class="col-md-4">
<div id="DivCrearPrecioLista" runat="server" visible="false" class="form-group">
<label>¿Crear lista?</label>
<asp:CheckBox ID="ChkCrearPrecioLista" runat="server" CssClass="chksino" Text=" " Checked="false" OnCheckedChanged="ChkCrearPrecioLista_CheckedChanged" AutoPostBack="true" />
<div class="col-md-2" id="DivCrearPrecioLista" runat="server" style="padding-top: 8px;" visible="false">
<div class="form-group form-md-line-input input-iconright">
<asp:LinkButton runat="server" ID="LnkAddPrecioLista" CssClass="btn btn-default btn-circle btn-sm" Text="<i class='fa fa-plus' style='color:green'></i>" OnClick="LnkAddPrecioLista_Click"></asp:LinkButton>
</div>
</div>
</div>
@@ -4972,6 +4965,36 @@
</div>
<br />
<div id="DivAgregarPrecioLista" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<asp:UpdatePanel class="modal-content" runat="server">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Agregar lista de precio</h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPrecioLista" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTxtPL" runat="server" ControlToValidate="TxtPrecioLista" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Lista de precio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpListaPrecio"></asp:RequiredFieldValidator>
<label for="TxtPrecioLista">Lista de precio: </label>
<i></i>
</div>
</div>
<div class="modal-footer">
<div class="row">
<div class="col-md-12" style="text-align: right">
<asp:Button ID="BtnGuardarPL" runat="server" CssClass="btn btn-success" Text="Guardar" OnClick="BtnGuardarPL_Click" ValidationGroup="GrpListaPrecio"></asp:Button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<%-- MODAL BITACORA --%>
<div id="ModalBitacora" class="modal ADS fade" role="dialog">
<div class="modal-dialog">

View File

@@ -1438,8 +1438,6 @@ Partial Class Clientes
TxtPagina.Text = ObjClientes.Pagina
'TxtGiro.Text = ObjClientes.Giro
DdlPrecioLista.SelectedValue = ObjClientes.CvePrecioLista.ToString()
ChkCrearPrecioLista.Checked = False
ChkCrearPrecioLista_CheckedChanged(ChkCrearPrecioLista, EventArgs.Empty)
TxtCC.Text = ObjClientes.NotificarA
ChkMail.Checked = ObjClientes.EnviarFactura
@@ -2469,14 +2467,14 @@ Partial Class Clientes
Dim CvePrecioLista As Integer = DdlPrecioLista.SelectedValue.ToEntero()
If DivCrearPrecioLista.Visible AndAlso ChkCrearPrecioLista.Checked Then
CvePrecioListaNuevo = ObjVentas.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text, 0)
If CvePrecioListaNuevo > 0 Then
CvePrecioLista = CvePrecioListaNuevo
Else
ErrorProceso = True
End If
End If
'If DivCrearPrecioLista.Visible AndAlso ChkCrearPrecioLista.Checked Then
' CvePrecioListaNuevo = ObjVentas.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text, 0)
' If CvePrecioListaNuevo > 0 Then
' CvePrecioLista = CvePrecioListaNuevo
' Else
' ErrorProceso = True
' End If
'End If
If Not ErrorProceso Then
'VERIFICA SI ES CLIENTE NUEVO O ACTUALIZACION
@@ -2615,11 +2613,6 @@ Partial Class Clientes
If Not ErrorProceso Then
RecargaGlobal()
'RECARGA GLOBAL DE LISTA DE PRECIOS SI SE GENERO UNO NUEVO
If CvePrecioListaNuevo > 0 Then
GlobalDTPrecioListas(UsuarioActual.CveEmpresa) = Nothing
End If
'NUEVO CLIENTE
If CveClienteNuevo > 0 Then
'JM 05-02-19: CRM ASIGAN CLIENTE A EMPRESACRM
@@ -10277,14 +10270,27 @@ Partial Class Clientes
Private Sub DdlRegimenFiscal_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlRegimenFiscal.SelectedIndexChanged
CargaComboCFDI()
End Sub
Protected Sub ChkCrearPrecioLista_CheckedChanged(sender As Object, e As EventArgs)
If UsuarioActual.CveEmpresa = 186 Then
DivPrecioLista.Visible = Not ChkCrearPrecioLista.Checked
DivTxtCrearPrecioLista.Visible = ChkCrearPrecioLista.Checked
UpDatos.Update()
Protected Sub LnkAddPrecioLista_Click(sender As Object, e As EventArgs)
RegistraScript("$('#DivAgregarPrecioLista').modal('show');")
End Sub
Protected Sub BtnGuardarPL_Click(sender As Object, e As EventArgs)
Dim ObjVentas As New ClsVentas()
Dim CvePrecioListaNuevo = ObjVentas.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text, 0)
If CvePrecioListaNuevo > 0 Then
Alert("La lista de precio se guardo correctamente")
RegistraScript("$('#DivAgregarPrecioLista').modal('hide');")
Else
Alert("Ocurrió un error al guardar la lista de precio", TipoMensaje.MsgError)
End If
'RECARGA GLOBAL DE LISTA DE PRECIOS SI SE GENERO UNO NUEVO
If CvePrecioListaNuevo > 0 Then
GlobalDTPrecioListas(UsuarioActual.CveEmpresa) = Nothing
CargaPrecioLista()
End If
UpDatos.Update()
End Sub
End Class

View File

@@ -7118,7 +7118,7 @@ Partial Class Ventas
Dim ValorAutorizacion As String = UsuarioActual.Empresa.Funcionalidad(595)
'OBLIGAR PAGO DE CONTADO SI EL CLIENTE NO PERMITE CREDITO
If (Not UsuarioActual.Empresa.Funcionalidad(702).Contiene("1", "2")) AndAlso Me.PermiteCredito = False AndAlso ((DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") AndAlso CveVenta < 1) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot", "PA") AndAlso EsCreaApartirDe) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveVenta > 0)) Then
If (Not UsuarioActual.Empresa.Funcionalidad(702).Contiene("1", "2")) AndAlso Me.PermiteCredito = False AndAlso ((DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot") AndAlso CveVenta < 1) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot", "PA") AndAlso EsCreaApartirDe) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveVenta > 0)) Then
RBLPago.SelectedValue = "2"
RBLPago.Items(0).Enabled = False
RBLPago_SelectedIndexChanged(Nothing, Nothing)
@@ -35765,10 +35765,10 @@ Partial Class Ventas
Dim EstatusOrdenServicio As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 1").ToEntero
If ObjOrdenServicio.AddOrdenesServicios(CveCliente, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.Nombre, TxtFecha.Text.Replace(",", "").ToDateTime, $"Venta: {LblSerie.Text}-{TxtFolio.Text}", UsuarioActual.CveUsuario, EstatusOrdenServicio,
If ObjOrdenServicio.AddOrdenesServicios(CveCliente, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.Nombre, TxtFechaOS.Text.Replace(",", "").ToDateTime, $"Venta: {LblSerie.Text}-{TxtFolio.Text}", UsuarioActual.CveUsuario, EstatusOrdenServicio,
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveOSTipo, CveClienteSucursal:=DdlSubProyectoDatos.SelectedValue.ToEntero,
Direccion:="", Telefono:="", CveModeloAuto:=-1, Año:="", CveMedico:=DdlMedico.SelectedValue.ToEntero,
CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=RBLTipoVenta.SelectedValue.ToEntero, FechaCita:=TxtFecha.Text.Replace(",", "").ToDateTime) Then
CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=RBLTipoVenta.SelectedValue.ToEntero, FechaCita:=TxtFechaOS.Text.Replace(",", "").ToDateTime) Then
CveOSVentaMedica = ObjOrdenServicio.CveOS
Else
errorList.Add("Se presento un error al guardar la orden de servicio.")