Ventas medicas fuera de linea
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
padding: 0px 5px;
|
||||
}
|
||||
|
||||
.nolineheight {
|
||||
.nolineheight {ChkRequiereTecnico
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
@@ -559,6 +559,41 @@
|
||||
<td colspan="3">
|
||||
<asp:TextBox ID="TxtDescripcionVenta" runat="server" Rows="2" TextMode="MultiLine" Width="100%" MaxLength="300" CssClass="form-control input-sm" Enabled="false"></asp:TextBox></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr runat="server" id="TrVentasMedicas1" visible="false">
|
||||
<td><b>Médico:</b></td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlMedico" CssClass="form-control select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Medico" DataValueField="CveMedico">
|
||||
<asp:ListItem Value="-1">Seleccione uno</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
<td><b>Procedimiento:</b></td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlProcedimiento" CssClass="form-control select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Procedimiento" DataValueField="CveProcedimiento" Width="130px">
|
||||
<asp:ListItem Value="-1">Seleccione uno</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr runat="server" id="TrVentasMedicas2" visible="false">
|
||||
<td runat="server" id="TdRequiereTecnico1" visible="false">
|
||||
<b>Requiere Técnico:</b>
|
||||
</td>
|
||||
<td runat="server" id="TdRequiereTecnico2" visible="false">
|
||||
<asp:CheckBox ID="ChkRequiereTecnico" runat="server" OnCheckedChanged="ChkRequiereTecnico_CheckedChanged" AutoPostBack="true" />
|
||||
</td>
|
||||
<td runat="server" id="TdFechaOS1" visible ="false">
|
||||
<b>Fecha de Orden:</b>
|
||||
</td>
|
||||
<td runat="server" id="TdFechaOS2" visible ="false">
|
||||
<asp:TextBox ID="TxtFechaOS" type="datetime-local" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 130px" step="1"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -5328,7 +5363,7 @@
|
||||
<div style="max-height: 300px; overflow-y: auto;">
|
||||
<asp:GridView ID="GvRem" runat="server" AutoGenerateColumns="false" GridLines="None"
|
||||
CssClass="table table-grid table-striped table-advance table-hover Widthall"
|
||||
DataKeyNames="CveVenta, SubTotal, IVA,Total, CveContrato,Surtido" AllowPaging="False">
|
||||
DataKeyNames="CveVenta, SubTotal, IVA,Total, CveContrato,Surtido,Medico,Procedimiento" AllowPaging="False">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
@@ -5348,7 +5383,7 @@
|
||||
</asp:GridView>
|
||||
|
||||
<asp:GridView ID="GvRemPS" runat="server" AutoGenerateColumns="false" GridLines="None" Visible="false" CssClass="table table-grid table-striped table-advance table-hover Widthall"
|
||||
DataKeyNames="CveVentaDetalle, PU, Total, Cantidad, CveContrato,Surtido" AllowPaging="False">
|
||||
DataKeyNames="CveVentaDetalle, PU, Total, Cantidad, CveContrato,Surtido,Medico,Procedimiento" AllowPaging="False">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
@@ -8366,6 +8401,105 @@
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="DvModalTipoVenta" class="modal ADS fade" role="dialog">
|
||||
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpDvModalTipoVenta" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">
|
||||
<asp:Label ID="LblDvModalTipoVentaTitulo" runat="server">Tipo de Venta</asp:Label>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body" style="min-height: 233.45px">
|
||||
|
||||
<%--Tipo Venta--%>
|
||||
<div class="row" runat="server" visible="True" id="DvModalTipoVentaPasoTipo" >
|
||||
<div class="col-md-4" >
|
||||
</div>
|
||||
<div class="col-md-4" style="text-align:left!important" >
|
||||
<asp:RadioButtonList ID="RBLTipoVenta" DataTextField="TipoVenta" RepeatDirection="Vertical" DataValueField="CveTipoVenta" runat="server" AutoPostBack="true" OnSelectedIndexChanged="RBLTipoVenta_SelectedIndexChanged">
|
||||
</asp:RadioButtonList>
|
||||
</div>
|
||||
<div class="col-md-4" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<%--Cliente--%>
|
||||
<div runat="server" visible="False" id="DvModalTipoVentaPasoCliente">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12 form-md-line-input input-iconright ">
|
||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlClientesWS">Cliente:</asp:Label>
|
||||
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientesWS" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;" ></ADS:Dropdownlost>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%--Medico Procedimiento--%>
|
||||
<div runat="server" visible="False" id="DvModalTipoVentaPasoMedicoProcedimiento">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6 form-md-line-input input-iconright ">
|
||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlMedicoModal">Médico:</asp:Label>
|
||||
<asp:DropDownList ID="DdlMedicoModal" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Medico" DataValueField="CveMedico" >
|
||||
<asp:ListItem Value="-1">Seleccione uno</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlMedicoModal" runat="server" CssClass="help-block errorimput" Display="None" InitialValue="-1"
|
||||
ControlToValidate="DdlMedicoModal" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Medico''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModalVentaMedica"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCRfvDdlMedicoModal" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlMedicoModal" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="form-group col-md-6 form-md-line-input input-iconright ">
|
||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlProcedimientoModal">Procedimiento:</asp:Label>
|
||||
<asp:DropDownList ID="DdlProcedimientoModal" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Procedimiento" DataValueField="CveProcedimiento" >
|
||||
<asp:ListItem Value="-1">Seleccione uno</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlProcedimientoModal" runat="server" CssClass="help-block errorimput" Display="None" InitialValue="-1"
|
||||
ControlToValidate="DdlProcedimientoModal" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Procedimiento''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModalVentaMedica"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCRfvDdlProcedimientoModal" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlProcedimientoModal" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<%-- Requiere Os y Fecha OS --%>
|
||||
<div runat="server" visible="False" id="DvModalTipoVentaPasoRequiereOS">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6 form-md-line-input input-iconright ">
|
||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlMedicoModal">Requiere Técnico:</asp:Label>
|
||||
<asp:CheckBox ID="ChkRequiereTecnicoModal" runat="server" CssClass="form-control" OnCheckedChanged="ChkRequiereTecnicoModal_CheckedChanged" AutoPostBack="true" />
|
||||
</div>
|
||||
<div class="form-group col-md-6 form-md-line-input input-iconright " runat="server" id="DvModalRequiereOSFecha" visible="false">
|
||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="TxtFechaModal">Fecha De Orden:</asp:Label>
|
||||
<asp:TextBox ID="TxtFechaModal" type="datetime-local" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 100%" step="1"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:LinkButton ID="LnkDvModalTipoVentaAceptar" ClientIDMode="Static" runat="server" CssClass="btn btn-primary" OnClick="LnkDvModalTipoVentaAceptar_Click" Text="Aceptar" Visible="false" ValidationGroup="GrpModalVentaMedica" />
|
||||
<asp:LinkButton ID="LnkDvModalTipoVentaCancelar" ClientIDMode="Static" runat="server" CssClass="btn btn-default" OnClick="LnkDvModalTipoVentaCancelar_Click" Text="Cancelar" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="/Metronic/assets/global/scripts/jquery-sortable.js"></script>
|
||||
|
||||
@@ -978,6 +978,15 @@ Partial Class Ventas
|
||||
Return ViewState("CveOS").ToString().ToEntero()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Property CveOSVentaMedica As Integer
|
||||
Get
|
||||
Return ViewState("CveOSVentaMedica").ToString().ToEntero()
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveOSVentaMedica") = value
|
||||
End Set
|
||||
End Property
|
||||
Private ReadOnly Property SaldoVenta As Decimal
|
||||
Get
|
||||
Return If(IsNothing(ViewState("SaldoVenta")), 0, ViewState("SaldoVenta").ToString().ToDecimal)
|
||||
@@ -2434,6 +2443,8 @@ Partial Class Ventas
|
||||
CveAlmacenDevolucion = 0
|
||||
Me.CveEstadoCancelacion = 0
|
||||
|
||||
TxtFechaOS.Text = NowADS().ToDateTime.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T")
|
||||
|
||||
txtFechaICot.Text = NowADS().AddMonths(-3).ToShortDateString
|
||||
TxtFechaIRem.Text = NowADS().AddMonths(-3).ToShortDateString
|
||||
TxtFechaIPed.Text = NowADS().AddMonths(-3).ToShortDateString
|
||||
@@ -2582,9 +2593,15 @@ Partial Class Ventas
|
||||
CargaFormaEntrega()
|
||||
CargaCuentasTerminal()
|
||||
CargaDdlNCPS()
|
||||
|
||||
CargarCamiones()
|
||||
|
||||
|
||||
CargaMedicos()
|
||||
CargaProcedimientos()
|
||||
CargaDdlClientes()
|
||||
|
||||
|
||||
|
||||
'SI USUARIO USA AMORTIZACIÓN CONTABLE, se carga las tablas para usarlas mas adelante
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
|
||||
|
||||
@@ -3011,7 +3028,6 @@ Partial Class Ventas
|
||||
CveEstatus = 2
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -3424,6 +3440,12 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If CveVenta <= 0 AndAlso UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 AndAlso Request("VM") IsNot Nothing AndAlso IsNumeric(Request("VM")) AndAlso Request("VM").ToEntero() = 1 Then
|
||||
EsVentaMedica = True
|
||||
CargaTiposVenta()
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -7682,6 +7704,60 @@ Partial Class Ventas
|
||||
'DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
|
||||
DdlClasificacion.DataBind()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub CargaTiposVenta()
|
||||
|
||||
' 
|
||||
'Dim Dttemp = GlobalDTTipoVenta().FiltraParametros("Estatus = 'True' ").FiltraParametros("", {"", ""})
|
||||
|
||||
RBLTipoVenta.DataSource = GlobalDTTipoVenta().FiltraParametros("Estatus = 'True' ")
|
||||
RBLTipoVenta.DataBind()
|
||||
|
||||
TrVentasMedicas1.Visible = True
|
||||
TrVentasMedicas2.Visible = True
|
||||
|
||||
|
||||
For Each item As ListItem In RBLTipoVenta.Items
|
||||
item.Text = $"  {item.Text}"
|
||||
Next
|
||||
|
||||
RegistraScript("$('#DvModalTipoVenta').modal({ backdrop: 'static', keyboard: false });")
|
||||
End Sub
|
||||
|
||||
Private Sub CargaProcedimientos()
|
||||
DdlMedico.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
||||
DdlMedico.DataBind()
|
||||
|
||||
DdlMedicoModal.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
||||
DdlMedicoModal.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaMedicos()
|
||||
DdlProcedimiento.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
||||
DdlProcedimiento.DataBind()
|
||||
|
||||
DdlProcedimientoModal.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
||||
DdlProcedimientoModal.DataBind()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDdlClientes()
|
||||
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
|
||||
DdlClientesWS.setEsWebService(True)
|
||||
Else
|
||||
DdlClientesWS.setEsWebService(False)
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
|
||||
DdlClientesWS.ddl.Items.Clear()
|
||||
DdlClientesWS.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
||||
DdlClientesWS.DataBind()
|
||||
DdlClientesWS.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaPS(CveClasificacion As Integer, Objeto As ADServerControl.Dropdownlost, Optional AplicaParaVenta As Boolean = True)
|
||||
|
||||
Objeto.setEsWebService(UsuarioActual.Empresa.Funcionalidad(141).ToString() = "1")
|
||||
@@ -10099,6 +10175,8 @@ Partial Class Ventas
|
||||
DebeTimbrar = False
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If DebeTimbrar AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Egs", "Ant", "Dev") Then
|
||||
If UsuarioActual.Empresa.TipoFacturacion = "CFDi" AndAlso (UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1) Then
|
||||
|
||||
@@ -13051,7 +13129,8 @@ Partial Class Ventas
|
||||
DiasCredito:=factura.DiasCredito, EsDiasCreditoFijo:=factura.EsDiasCreditoFijo, AnticipoEspecial:=If(TrAntEspecial.Visible, ChkAntEspecial.Checked, False),
|
||||
Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=factura.CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text,
|
||||
FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, FacturarSucursal:=factura.FacturarSucursal, VentaDesglosaIEPS:=factura.VentaDesglosaIEPS, RFCReceptor:=RFCReceptor, Adjunto:=Adjunto, DevolucionImportePagado:=factura.DevolucionImportePagado, EsGarantia:=factura.EsGarantia, ServicioDomicilio:=TrServicioDomicilio.Visible,
|
||||
CveLineaAdicional:=DdlLineaAdicional.SelectedValue.ToEntero(), DescripcionVenta:=DescripcionVenta) Then
|
||||
CveLineaAdicional:=DdlLineaAdicional.SelectedValue.ToEntero(), DescripcionVenta:=DescripcionVenta,
|
||||
CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=RBLTipoVenta.SelectedValue.ToEntero, RequiereOS:=ChkRequiereTecnico.Checked) Then
|
||||
ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
||||
Else
|
||||
If factura.TipoDocto.Contiene("Dev", "Egs") OrElse DtVentasNC IsNot Nothing OrElse CveEstatusRefacturacion > 0 OrElse CveAnticipoPadre > 0 Then
|
||||
@@ -13390,6 +13469,18 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If EsVentaMedica AndAlso ErrorList.Count = 0 AndAlso ChkRequiereTecnico.Checked Then
|
||||
GeneraOS(ObjVentas.IniciaTransacSQL, ErrorList)
|
||||
|
||||
If ErrorList.Count = 0 Then
|
||||
If Not ObjOS.UpdateVentaOS(factura.CveVenta, CveOSVentaMedica) Then
|
||||
ErrorList.Add("Ocurrió un error al guardar la venta en Ordenes de Servicio")
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
'Si viene de OS, Se guarda CveVenta en OS
|
||||
If CveOS > 0 Then
|
||||
If Not ObjOS.UpdateVentaOS(factura.CveVenta, CveOS) Then
|
||||
@@ -30658,6 +30749,8 @@ Partial Class Ventas
|
||||
CambiaTipoComprobante()
|
||||
|
||||
Dim MensajeRemisiones As New StringBuilder
|
||||
Dim MensajeRemisionesMedicas As New StringBuilder
|
||||
Dim EsRemisionMedica As Boolean = False
|
||||
Dim ObsOC As New StringBuilder
|
||||
Dim ObsPedido As New StringBuilder
|
||||
Dim ObsInv As New StringBuilder
|
||||
@@ -30667,6 +30760,17 @@ Partial Class Ventas
|
||||
Dim MetodoPagoDif As Boolean = False
|
||||
|
||||
For Each Dr As DataRow In dtSeleccionadas.Rows
|
||||
|
||||
If Dr("Medico").ToString.Length > 0 Then
|
||||
MensajeRemisionesMedicas.Append($"Dr. {Dr("MEdico").ToString}{vbCrLf}")
|
||||
EsRemisionMedica = True
|
||||
End If
|
||||
If Dr("Medico").ToString.Length > 0 Then
|
||||
MensajeRemisionesMedicas.Append($"Procedimiento {Dr("Procedimiento")}{vbCrLf}")
|
||||
EsRemisionMedica = True
|
||||
End If
|
||||
MensajeRemisionesMedicas.Append($"Rem. {Dr("Folio")} {If(Dr("ObsFact").ToString().Length > 0, $"({Dr("ObsFact")})", "")}{vbCrLf}")
|
||||
|
||||
MensajeRemisiones.AppendFormat("{0} {1}, ", Dr("Folio"), If(Dr("ObsFact").ToString().Length > 0, $"({Dr("ObsFact")})", ""))
|
||||
ObsOC.AppendFormat("{0}, ", Dr("ObsOC"))
|
||||
ObsPedido.AppendFormat("{0}, ", Dr("ObsPedido"))
|
||||
@@ -30677,7 +30781,14 @@ Partial Class Ventas
|
||||
End If
|
||||
CveMetodoPago = Dr("CveMetodoPago33").ToString().ToEntero()
|
||||
Next
|
||||
TxtObsFact.Text = If(MensajeRemisiones.ToString().Length > 0, MensajeRemisiones.ToString().Substring(0, MensajeRemisiones.ToString().Length - 2), "")
|
||||
|
||||
If EsRemisionMedica Then
|
||||
TxtObsFact.Text = If(MensajeRemisionesMedicas.ToString().Length > 0, MensajeRemisionesMedicas.ToString().Substring(0, MensajeRemisionesMedicas.ToString().Length - 2), "")
|
||||
Else
|
||||
TxtObsFact.Text = If(MensajeRemisiones.ToString().Length > 0, MensajeRemisiones.ToString().Substring(0, MensajeRemisiones.ToString().Length - 2), "")
|
||||
End If
|
||||
|
||||
|
||||
TxtOrdenCompra.Text = If(ObsOC.ToString().Length > 0, ObsOC.ToString().Substring(0, ObsOC.ToString().Length - 2), "")
|
||||
TxtPedidoContrato.Text = If(ObsPedido.ToString().Length > 0, ObsPedido.ToString().Substring(0, ObsPedido.ToString().Length - 2), "")
|
||||
TxtObsAlmacen.Text = If(ObsInv.ToString().Length > 0, ObsInv.ToString().Substring(0, ObsInv.ToString().Length - 2), "")
|
||||
@@ -34444,6 +34555,22 @@ Partial Class Ventas
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property EsVentaMedica As Boolean
|
||||
Get
|
||||
If ViewState("EsVentaMedica") Is Nothing Then
|
||||
ViewState("EsVentaMedica") = False
|
||||
End If
|
||||
|
||||
Return Boolean.Parse(ViewState("EsVentaMedica").ToString)
|
||||
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("EsVentaMedica") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
'Property SucursalOrigenCP As Modelos.SucursalModel
|
||||
' Get
|
||||
' If ViewState("SucursalOrigenCP") Is Nothing Then
|
||||
@@ -35407,5 +35534,229 @@ Partial Class Ventas
|
||||
DdlFormaCliente.DataBind()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "VENTAS MEDICAS"
|
||||
|
||||
Protected Sub ChkRequiereTecnico_CheckedChanged(sender As Object, e As EventArgs)
|
||||
TdFechaOS2.Visible = ChkRequiereTecnicoModal.Checked
|
||||
UpCliente.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub RBLTipoVenta_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
|
||||
If RBLTipoVenta.SelectedValue.ToEntero > 0 Then
|
||||
|
||||
DvModalTipoVentaPasoTipo.Visible = False
|
||||
DvModalTipoVentaPasoCliente.Visible = True
|
||||
DvModalTipoVentaPasoRequiereOS.Visible = True
|
||||
DvModalTipoVentaPasoMedicoProcedimiento.Visible = True
|
||||
TxtFechaModal.Text = NowADS.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T")
|
||||
LnkDvModalTipoVentaAceptar.Visible = True
|
||||
|
||||
'si es A - Vista o ,Fuera De Linea requiere tecnico
|
||||
If RBLTipoVenta.SelectedValue.ToEntero.Contiene(1, 3) Then
|
||||
ChkRequiereTecnicoModal.Checked = True
|
||||
ChkRequiereTecnicoModal.Enabled = False
|
||||
DvModalRequiereOSFecha.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
UpDvModalTipoVenta.Update()
|
||||
End Sub
|
||||
|
||||
'Protected Sub DdlClientesWS_selectedindexchange(sender As Object, e As EventArgs)
|
||||
|
||||
' If DdlClientesWS.SelectedValue.ToEntero > 0 Then
|
||||
|
||||
' DvModalTipoVentaPasoCliente.Visible = False
|
||||
' DvModalTipoVentaPasoRequiereOS.Visible = True
|
||||
|
||||
|
||||
|
||||
' 'si es A - Vista o ,Fuera De Linea requiere tecnico
|
||||
' If RBLTipoVenta.SelectedValue.ToEntero.Contiene(1, 3) Then
|
||||
' ChkRequiereTecnicoModal.Checked = True
|
||||
' ChkRequiereTecnicoModal.Enabled = False
|
||||
' DvModalRequiereOSFecha.Visible = True
|
||||
' End If
|
||||
|
||||
' End If
|
||||
|
||||
' UpDvModalTipoVenta.Update()
|
||||
|
||||
'End Sub
|
||||
|
||||
'Protected Sub DdlMedicoModal_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
' ModalValidaMedicoProcedimiento()
|
||||
'End Sub
|
||||
|
||||
'Protected Sub DdlProcedimientoModal_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
' ModalValidaMedicoProcedimiento()
|
||||
'End Sub
|
||||
|
||||
Protected Sub ModalValidaMedicoProcedimiento()
|
||||
|
||||
If DdlMedicoModal.SelectedValue.ToEntero > 0 AndAlso DdlProcedimientoModal.SelectedValue.ToEntero > 0 Then
|
||||
LnkDvModalTipoVentaAceptar.Visible = True
|
||||
Else
|
||||
LnkDvModalTipoVentaAceptar.Visible = False
|
||||
End If
|
||||
|
||||
UpDvModalTipoVenta.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkDvModalTipoVentaCancelar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
LnkDvModalTipoVentaAceptar.Visible = False
|
||||
|
||||
DvModalTipoVentaPasoTipo.Visible = True
|
||||
DvModalTipoVentaPasoCliente.Visible = False
|
||||
DvModalTipoVentaPasoRequiereOS.Visible = False
|
||||
DvModalTipoVentaPasoMedicoProcedimiento.Visible = False
|
||||
|
||||
ChkRequiereTecnicoModal.Enabled = True
|
||||
|
||||
DdlClientesWS.txtText.Value = ""
|
||||
DdlClientesWS.txtValue.Value = ""
|
||||
DdlClientesWS.ddl.SelectedValueExist(-1)
|
||||
|
||||
DvModalRequiereOSFecha.Visible = False
|
||||
ChkRequiereTecnicoModal.Checked = False
|
||||
|
||||
RBLTipoVenta.SelectedValue = Nothing
|
||||
|
||||
DdlMedicoModal.SelectedValueExist(-1)
|
||||
DdlProcedimientoModal.SelectedValueExist(-1)
|
||||
|
||||
UpDvModalTipoVenta.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub LnkDvModalTipoVentaAceptar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
If DdlClientesWS.SelectedValue.ToEntero > 0 Then
|
||||
ViewState("CveCliente") = DdlClientesWS.SelectedValue.ToEntero
|
||||
Else
|
||||
Alert("Debe de seleccionar un cliente.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If ChkRequiereTecnicoModal.Checked Then
|
||||
If Not IsDate(TxtFechaModal.Text.Replace(",", "")) Then
|
||||
Alert("El campo fecha no es valido.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
ChkRequiereTecnico.Checked = ChkRequiereTecnicoModal.Checked
|
||||
TxtFechaOS.Text = TxtFechaModal.Text
|
||||
|
||||
If ChkRequiereTecnicoModal.Checked Then
|
||||
TdFechaOS1.Visible = True
|
||||
TdFechaOS2.Visible = True
|
||||
Else
|
||||
TdFechaOS1.Visible = False
|
||||
TdFechaOS2.Visible = False
|
||||
End If
|
||||
|
||||
DdlMedico.SelectedValueExist(DdlMedicoModal.SelectedValue)
|
||||
DdlProcedimiento.SelectedValueExist(DdlProcedimientoModal.SelectedValue)
|
||||
|
||||
'si es A - Vista o ,Fuera De Linea requiere tecnico
|
||||
If RBLTipoVenta.SelectedValue.ToEntero.Contiene(1, 3) Then
|
||||
TdFechaOS1.Visible = True
|
||||
TdFechaOS2.Visible = True
|
||||
ChkRequiereTecnico.Checked = True
|
||||
ChkRequiereTecnico.Enabled = False
|
||||
DdlTipoComprobante.SelectedValueExist("Rem")
|
||||
Else
|
||||
|
||||
DdlTipoComprobante.SelectedValueExist("Ing")
|
||||
End If
|
||||
DdlTipoComprobante.Enabled = False
|
||||
|
||||
TdRequiereTecnico1.Visible = True
|
||||
TdRequiereTecnico2.Visible = True
|
||||
|
||||
|
||||
CargaCliente(CveCliente)
|
||||
|
||||
DdlTipoComprobante_SelectedIndexChanged(sender, Nothing)
|
||||
|
||||
RegistraScript("$('#DvModalTipoVenta').modal('hide');")
|
||||
|
||||
UpCliente.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub ChkRequiereTecnicoModal_CheckedChanged(sender As Object, e As EventArgs)
|
||||
|
||||
DvModalRequiereOSFecha.Visible = ChkRequiereTecnicoModal.Checked
|
||||
UpDvModalTipoVenta.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Function GeneraOS(ByRef TransacSQL As SqlTransaction, ByRef errorList As List(Of String)) As Boolean
|
||||
|
||||
|
||||
Dim Errores As Boolean = False
|
||||
|
||||
Dim ObjOrdenServicio As New ClsOS(TransacSQL)
|
||||
|
||||
Dim CveOSTipo As Integer = -1
|
||||
|
||||
If ObjOrdenServicio.GetTipoOrdenesServicios(UsuarioActual.CveEmpresa) Then
|
||||
CveOSTipo = ObjOrdenServicio.DtResultados.FiltroPrimeroValor("CveOrdenServicioTipo", " Estatus = 'Activo' ").ToEntero
|
||||
End If
|
||||
|
||||
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,
|
||||
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
|
||||
CveOSVentaMedica = ObjOrdenServicio.CveOS
|
||||
Else
|
||||
errorList.Add("Se presento un error al guardar la orden de servicio.")
|
||||
Errores = True
|
||||
End If
|
||||
|
||||
Dim CvePSDetalle As Integer = UsuarioActual.Empresa.Funcionalidad(708).ToEntero
|
||||
|
||||
If Not CvePSDetalle > 0 Then
|
||||
errorList.Add("No se tiene asignado un producto para la orden de servicio (FNC 708).")
|
||||
Errores = True
|
||||
End If
|
||||
|
||||
If Not Errores Then
|
||||
|
||||
Dim CveOsDetalle = ObjOrdenServicio.AddOrdenesServiciosDetalle(ObjOrdenServicio.CveOS, CvePSDetalle, 1, -1, -1, $"Venta: {LblSerie.Text}-{TxtFolio.Text}", False, True, False, -1, "-1", "-1", "-1", "", UsuarioActual.CveUsuario, Archivo:="")
|
||||
|
||||
If CveOsDetalle > 0 Then
|
||||
'MENSAJE PRINCIPAL
|
||||
Dim MensajeAlertOS As New StringBuilder
|
||||
MensajeAlertOS.AppendFormat(String.Format("<br/>La Orden de Servicio: <b>{0}</b> se generó correctamente.<br/><br/>", ObjOrdenServicio.Folio))
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=OS&CVEOS={0}", ObjOrdenServicio.CveOS)))
|
||||
Dim Liga = $"document.location.href=""/OS/RepOrdenesServicios.aspx"";"
|
||||
Alert(MensajeAlertOS.ToString, TipoMensaje.MsgInformacion, Liga)
|
||||
Else
|
||||
errorList.Add("Se presento un error al guardar la el detalle de la orden de servicio.")
|
||||
Errores = True
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
Return If(Errores, False, True)
|
||||
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
@@ -321,7 +321,9 @@
|
||||
<asp:Label ID="LblMedioCaptacionCRM" runat="server" Text=""></asp:Label></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
||||
|
||||
<tr runat="server" id="TrVentasMedicas1">
|
||||
<td><b>Medico:</b></td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlMedico" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Medico" DataValueField="CveMedico">
|
||||
@@ -335,7 +337,7 @@
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
<tr >
|
||||
<tr runat="server" id="TrVentasMedicas2">
|
||||
<td runat="server" id="TdRequiereTecnico1" visible="false">
|
||||
<b>Requiere Técnico:</b>
|
||||
</td>
|
||||
@@ -349,6 +351,7 @@
|
||||
<asp:TextBox ID="TxtFecha" type="datetime-local" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 100%" step="1"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1522,9 +1525,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlPS">Producto Servicio:</asp:Label>
|
||||
<ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width: 100%;" CssClass="DdlPS " CssClassDdl="form-control select2me " IncluyeTodos="false" DataTextField="PSCodigo" DataValueField="CvePS" data-onresult="CargaExistenciaAlmacenes" />
|
||||
<label for="<%= DdlPS.ClientID.ToString()%>">Producto Servicio:</label>
|
||||
<%--<label for="<%= DdlPS.ClientID.ToString()%>">Producto Servicio:</label>--%>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1591,29 +1597,98 @@
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
<div id="DvModalTipoVenta" class="modal ADS fade" role="dialog">
|
||||
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpDvModalTipoVenta" UpdateMode="Conditional" RenderMode="Inline">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpDvModalTipoVenta" UpdateMode="Conditional" >
|
||||
<ContentTemplate>
|
||||
<div id="DvModalTipoVenta" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
|
||||
|
||||
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">Tipo de Venta</h4>
|
||||
<h4 class="modal-title">
|
||||
<asp:Label ID=""></asp:Label>
|
||||
Tipo de Venta
|
||||
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:RadioButtonList ID="RBLTipoVenta" DataTextField="TipoVenta" DataValueField="CveTipoVenta" runat="server" AutoPostBack="true" OnSelectedIndexChanged="RBLTipoVenta_SelectedIndexChanged">
|
||||
</asp:RadioButtonList>
|
||||
<div class="modal-body" style="min-height:130.15px">
|
||||
|
||||
<%--Tipo Venta--%>
|
||||
<div runat="server" visible="True" id="DvModalTipoVentaPasoTipo">
|
||||
<asp:RadioButtonList ID="RBLTipoVenta" DataTextField="TipoVenta" RepeatDirection="Horizontal" DataValueField="CveTipoVenta" runat="server" AutoPostBack="true" OnSelectedIndexChanged="RBLTipoVenta_SelectedIndexChanged">
|
||||
</asp:RadioButtonList>
|
||||
</div>
|
||||
|
||||
<%--Cliente--%>
|
||||
<div runat="server" visible="False" id="DvModalTipoVentaPasoCliente">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12 form-md-line-input input-iconright selectmodal">
|
||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlClientesWS">Cliente:</asp:Label>
|
||||
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientesWS" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 90%;" Onselectedindexchange="DdlClientesWS_selectedindexchange" ></ADS:Dropdownlost>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%-- Requiere Os y Fecha OS --%>
|
||||
<div runat="server" visible="False" id="DvModalTipoVentaPasoRequiereOS">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6 form-md-line-input input-iconright selectmodal">
|
||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlMedicoModal">Requiere Técnico::</asp:Label>
|
||||
<asp:CheckBox ID="ChkRequiereTecnicoModal" runat="server" CssClass="form-control" OnCheckedChanged="ChkRequiereTecnicoModal_CheckedChanged" AutoPostBack="true" />
|
||||
</div>
|
||||
<div class="form-group col-md-6 form-md-line-input input-iconright selectmodal" runat="server" id="DvModalRequiereOSFecha" visible ="false">
|
||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="TxtFechaModal">Fecha De Orden:</asp:Label>
|
||||
<asp:TextBox ID="TxtFechaModal" type="datetime-local" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 100%" step="1"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12" style="text-align:right;margin-top:5px!">
|
||||
<asp:LinkButton ID="LnkDvModalTipoVentaSeuigenteRequiereTecnico" ClientIDMode="Static" runat="server" CssClass="btn btn-primary" OnClick="LnkDvModalTipoVentaSeuigenteRequiereTecnico_Click" Text="Siguiente"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<%--Medico Procedimiento--%>
|
||||
<div runat="server" visible="False" id="DvModalTipoVentaPasoMedicoProcedimiento">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6 form-md-line-input input-iconright selectmodal">
|
||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlMedicoModal">Medico:</asp:Label>
|
||||
<asp:DropDownList ID="DdlMedicoModal" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Medico" DataValueField="CveMedico"
|
||||
AutoPostBack="true" OnSelectedIndexChanged="DdlMedicoModal_SelectedIndexChanged">
|
||||
<asp:ListItem Value="-1">Seleccione uno</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="form-group col-md-6 form-md-line-input input-iconright selectmodal">
|
||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlProcedimientoModal">Procedimiento:</asp:Label>
|
||||
<asp:DropDownList ID="DdlProcedimientoModal" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Procedimiento" DataValueField="CveProcedimiento"
|
||||
AutoPostBack="true" OnSelectedIndexChanged="DdlProcedimientoModal_SelectedIndexChanged">
|
||||
<asp:ListItem Value="-1">Seleccione uno</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:LinkButton ID="LnkDvModalTipoVentaAceptar" ClientIDMode="Static" runat="server" CssClass="btn btn-primary" OnClick="LnkDvModalTipoVentaAceptar_Click" Text="Aceptar" Visible="false" />
|
||||
<asp:LinkButton ID="LnkDvModalTipoVentaCancelar" ClientIDMode="Static" runat="server" CssClass="btn btn-default" OnClick="LnkDvModalTipoVentaCancelar_Click" Text="Cancelar" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</div>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
|
||||
@@ -2414,7 +2414,7 @@ Partial Class VentasMedicas
|
||||
Me.CveEstadoCancelacion = 0
|
||||
|
||||
|
||||
TxtFecha.Text = NowADS().ToDateTime.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T")
|
||||
TxtFechaOS.Text = NowADS().ToDateTime.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T")
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(177) Then
|
||||
DdlTipoComprobante.Items.Insert(4, New ListItem("Pedido de Contrato", "Ped"))
|
||||
@@ -2422,11 +2422,7 @@ Partial Class VentasMedicas
|
||||
|
||||
|
||||
|
||||
'If UsuarioActual.Empresa.Funcionalidad(595) = "1" Then
|
||||
' ImgDescPU.Visible = False
|
||||
' ImgDescConcepto.Visible = False
|
||||
' DdlTipoComprobante.Items.Insert(DdlTipoComprobante.Items.Count, New ListItem("Autorización", "PA"))
|
||||
'End If
|
||||
|
||||
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
LnkAgregarCliente.Visible = False
|
||||
@@ -2439,18 +2435,8 @@ Partial Class VentasMedicas
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'If UsuarioActual.Empresa.Funcionalidad(561).ToString() = "1" Then
|
||||
' thPoliza.Visible = True
|
||||
' thPoliza2.Visible = True
|
||||
'End If
|
||||
|
||||
|
||||
|
||||
|
||||
SetValues()
|
||||
|
||||
CvePresupuesto = 0
|
||||
|
||||
'MODALIDADES
|
||||
@@ -2473,8 +2459,7 @@ Partial Class VentasMedicas
|
||||
LblUsuario.Text = UsuarioActual.Usuario
|
||||
LblFechaRegistro.Text = NowADS().ToShortDateString()
|
||||
|
||||
'ImgDescPU.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '0'; $get('LblPrecio1').style.display = ''; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $get('TrMotivoDescuento').style.display = '';")
|
||||
'ImgDescConcepto.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '1'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = ''; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $get('TrMotivoDescuento').style.display = '';")
|
||||
|
||||
ImgDescTotal.Visible = False
|
||||
|
||||
ImgDescTotal.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '2'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = ''; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = 'none'; $get('BtnAplicarDescG').style.display = ''; $get('TrMotivoDescuento').style.display = '';")
|
||||
@@ -2501,6 +2486,7 @@ Partial Class VentasMedicas
|
||||
CargaAgentes()
|
||||
CargaProcedimientos()
|
||||
CargaTiposVenta()
|
||||
CargaDdlClientes()
|
||||
|
||||
|
||||
|
||||
@@ -2833,6 +2819,20 @@ Partial Class VentasMedicas
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDdlClientes()
|
||||
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
|
||||
DdlClientesWS.setEsWebService(True)
|
||||
Else
|
||||
DdlClientesWS.setEsWebService(False)
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
|
||||
DdlClientesWS.ddl.Items.Clear()
|
||||
DdlClientesWS.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
||||
DdlClientesWS.DataBind()
|
||||
DdlClientesWS.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub BloqueaClasificaciones()
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then
|
||||
@@ -4337,11 +4337,18 @@ Partial Class VentasMedicas
|
||||
Private Sub CargaProcedimientos()
|
||||
DdlMedico.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
||||
DdlMedico.DataBind()
|
||||
|
||||
DdlMedicoModal.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
||||
DdlMedicoModal.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaAgentes()
|
||||
DdlProcedimiento.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
||||
DdlProcedimiento.DataBind()
|
||||
|
||||
DdlProcedimientoModal.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
||||
DdlProcedimientoModal.DataBind()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaPSRemision(CveClasificacion As Integer, Objeto As ADServerControl.Dropdownlost)
|
||||
@@ -14283,29 +14290,152 @@ Partial Class VentasMedicas
|
||||
CargaFormaPago(DdlMetodoPago33.SelectedValue.ToEntero())
|
||||
End Sub
|
||||
|
||||
Protected Sub ChkRequiereTecnico_CheckedChanged(sender As Object, e As EventArgs)
|
||||
TdFechaOS2.Visible = ChkRequiereTecnicoModal.Checked
|
||||
UpCliente.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub RBLTipoVenta_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
|
||||
If RBLTipoVenta.SelectedValue.ToEntero > 0 Then
|
||||
DvModalTipoVentaPasoTipo.Visible = False
|
||||
DvModalTipoVentaPasoCliente.Visible = True
|
||||
'DvModalTipoVentaPasoRequiereOS.Visible = False
|
||||
'DvModalTipoVentaPasoMedicoProcedimiento.Visible = False
|
||||
End If
|
||||
UpDvModalTipoVenta.Update()
|
||||
End Sub
|
||||
|
||||
If RBLTipoVenta.SelectedValue.ToEntero = 2 Then
|
||||
TdRequiereTecnico1.Visible = True
|
||||
TdRequiereTecnico2.Visible = True
|
||||
Protected Sub DdlClientesWS_selectedindexchange(sender As Object, e As EventArgs)
|
||||
|
||||
If DdlClientesWS.SelectedValue.ToEntero > 0 Then
|
||||
|
||||
DvModalTipoVentaPasoCliente.Visible = False
|
||||
DvModalTipoVentaPasoRequiereOS.Visible = True
|
||||
|
||||
TxtFechaModal.Text = NowADS.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T")
|
||||
|
||||
'si es A - Vista o ,Fuera De Linea requiere tecnico
|
||||
If RBLTipoVenta.SelectedValue.ToEntero.Contiene(1, 3) Then
|
||||
ChkRequiereTecnicoModal.Checked = True
|
||||
ChkRequiereTecnicoModal.Enabled = False
|
||||
DvModalRequiereOSFecha.Visible = True
|
||||
End If
|
||||
|
||||
RegistraScript("$('#DvModalTipoVenta').modal('hide');")
|
||||
UpCliente.Update()
|
||||
End If
|
||||
|
||||
UpDvModalTipoVenta.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub ChkRequiereTecnico_CheckedChanged(sender As Object, e As EventArgs)
|
||||
Protected Sub LnkDvModalTipoVentaSeuigenteRequiereTecnico_Click(sender As Object, e As EventArgs)
|
||||
|
||||
TdFechaOS1.Visible = ChkRequiereTecnico.Checked
|
||||
TdFechaOS2.Visible = ChkRequiereTecnico.Checked
|
||||
If ChkRequiereTecnicoModal.Checked Then
|
||||
If Not IsDate(TxtFechaModal.Text.Replace(",", "")) Then
|
||||
Alert("El campo fecha no es valido.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
DvModalTipoVentaPasoRequiereOS.Visible = False
|
||||
DvModalTipoVentaPasoMedicoProcedimiento.Visible = True
|
||||
|
||||
UpDvModalTipoVenta.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlMedicoModal_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
ModalValidaMedicoProcedimiento()
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlProcedimientoModal_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
ModalValidaMedicoProcedimiento()
|
||||
End Sub
|
||||
|
||||
Protected Sub ModalValidaMedicoProcedimiento()
|
||||
|
||||
If DdlMedicoModal.SelectedValue.ToEntero > 0 AndAlso DdlProcedimientoModal.SelectedValue.ToEntero > 0 Then
|
||||
LnkDvModalTipoVentaAceptar.Visible = True
|
||||
Else
|
||||
LnkDvModalTipoVentaAceptar.Visible = False
|
||||
End If
|
||||
|
||||
UpDvModalTipoVenta.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkDvModalTipoVentaCancelar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
LnkDvModalTipoVentaAceptar.Visible = False
|
||||
|
||||
DvModalTipoVentaPasoTipo.Visible = True
|
||||
DvModalTipoVentaPasoCliente.Visible = False
|
||||
DvModalTipoVentaPasoRequiereOS.Visible = False
|
||||
DvModalTipoVentaPasoMedicoProcedimiento.Visible = False
|
||||
|
||||
DdlClientesWS.txtText.Value = ""
|
||||
DdlClientesWS.txtValue.Value = ""
|
||||
DdlClientesWS.ddl.SelectedValueExist(-1)
|
||||
|
||||
DvModalRequiereOSFecha.Visible = False
|
||||
ChkRequiereTecnicoModal.Checked = False
|
||||
|
||||
RBLTipoVenta.SelectedValue = Nothing
|
||||
|
||||
DdlMedicoModal.SelectedValueExist(-1)
|
||||
DdlProcedimientoModal.SelectedValueExist(-1)
|
||||
|
||||
UpDvModalTipoVenta.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub LnkDvModalTipoVentaAceptar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
ChkRequiereTecnico.Checked = ChkRequiereTecnicoModal.Checked
|
||||
TxtFecha.Text = TxtFechaModal.Text
|
||||
|
||||
If ChkRequiereTecnicoModal.Checked Then
|
||||
TdFechaOS1.Visible = True
|
||||
TdFechaOS2.Visible = True
|
||||
Else
|
||||
TdFechaOS1.Visible = False
|
||||
TdFechaOS2.Visible = False
|
||||
End If
|
||||
|
||||
DdlMedico.SelectedValueExist(DdlMedicoModal.SelectedValue)
|
||||
DdlProcedimiento.SelectedValueExist(DdlProcedimientoModal.SelectedValue)
|
||||
|
||||
'si es A - Vista o ,Fuera De Linea requiere tecnico
|
||||
If RBLTipoVenta.SelectedValue.ToEntero.Contiene(1, 3) Then
|
||||
TdFechaOS1.Visible = True
|
||||
TdFechaOS2.Visible = True
|
||||
ChkRequiereTecnico.Checked = True
|
||||
ChkRequiereTecnico.Enabled = False
|
||||
End If
|
||||
|
||||
TdRequiereTecnico1.Visible = True
|
||||
TdRequiereTecnico2.Visible = True
|
||||
|
||||
CargaCliente(DdlClientesWS.SelectedValue.ToEntero)
|
||||
|
||||
RegistraScript("$('#DvModalTipoVenta').modal('hide');")
|
||||
|
||||
UpCliente.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub ChkRequiereTecnicoModal_CheckedChanged(sender As Object, e As EventArgs)
|
||||
|
||||
DvModalRequiereOSFecha.Visible = ChkRequiereTecnicoModal.Checked
|
||||
UpDvModalTipoVenta.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user