Merge branch 'master' of http://jperez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -312,7 +312,7 @@
|
||||
</ajax:TabPanel>
|
||||
|
||||
|
||||
<ajax:TabPanel ID="TabEspeciliadad" runat="server" HeaderText="Especialidades" ClientIDMode="Static" Visible="false">
|
||||
<%-- <ajax:TabPanel ID="TabEspeciliadad" runat="server" HeaderText="Especialidades" ClientIDMode="Static" Visible="false">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:UpdatePanel ID="UpEspecialidad" runat="server" UpdateMode="Conditional">
|
||||
@@ -372,7 +372,7 @@
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
</ajax:TabPanel>--%>
|
||||
|
||||
</ajax:TabContainer>
|
||||
</ContentTemplate>
|
||||
@@ -383,7 +383,7 @@
|
||||
|
||||
|
||||
<div id="DVAgregarMedico" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 450px;">
|
||||
<div class="modal-dialog" style="min-width: 450px;">
|
||||
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModal" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header ">
|
||||
|
||||
@@ -35,16 +35,40 @@ Partial Class Ventas_CatMedicos
|
||||
|
||||
|
||||
|
||||
|
||||
Public Property EsFrame As Boolean
|
||||
Get
|
||||
If ViewState("EsFrame") Is Nothing Then
|
||||
ViewState("EsFrame") = False
|
||||
End If
|
||||
Return Boolean.Parse(ViewState("EsFrame").ToString)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("EsFrame") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
If Request("EsFrame") IsNot Nothing AndAlso Request("EsFrame").ToEntero = 1 Then
|
||||
EsFrame = True
|
||||
End If
|
||||
|
||||
CargaCombos()
|
||||
CargaDatos()
|
||||
CargaEspecialidad()
|
||||
CargaSubEspecialidad(-1)
|
||||
BtnConsultar_Click(Nothing, Nothing)
|
||||
|
||||
If EsFrame Then
|
||||
LnkAgregarMedico_Click(Nothing, Nothing)
|
||||
Else
|
||||
CargaDatos()
|
||||
BtnConsultar_Click(Nothing, Nothing)
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -72,6 +96,7 @@ Partial Class Ventas_CatMedicos
|
||||
End Sub
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
|
||||
Dim ProcesoOK = False
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
@@ -86,7 +111,7 @@ Partial Class Ventas_CatMedicos
|
||||
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, DdlEspecialidad.SelectedValue.ToEntero, Celular, TxtConsultorio.Text.Trim, DdlSubEspecialidad.SelectedValue.ToEntero, TxtTorre.Text.Trim) Then
|
||||
UsuarioActual.CveEmpresa, Telefono, TxtMail.Text, DdlEspecialidad.SelectedValue.ToEntero, Celular, TxtConsultorio.Text.Trim, DdlSubEspecialidad.SelectedValue.ToEntero, TxtTorre.Text.Trim) > 0 Then
|
||||
ProcesoOK = True
|
||||
End If
|
||||
End If
|
||||
@@ -102,6 +127,8 @@ Partial Class Ventas_CatMedicos
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
#Region "G V D A T O S"
|
||||
@@ -284,12 +311,12 @@ Partial Class Ventas_CatMedicos
|
||||
SbFiltros.AppendFormat($"Fecha Inicio: {txtFechaI.Text} Fecha Fin: {txtFechaF.Text}|")
|
||||
GvDatos.ExportToExcelGembox("CatMedicos", UsuarioActual, "Catálogo de Médicos", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
|
||||
GvDatos.Columns(10).Visible = True
|
||||
ElseIf Tabs.ActiveTabIndex = 2 Then
|
||||
GvEspecialidad.Columns(4).Visible = False
|
||||
Dim SbFiltros As New StringBuilder()
|
||||
SbFiltros.AppendFormat($"Fecha Inicio: {txtFechaI.Text} Fecha Fin: {txtFechaF.Text}|")
|
||||
GvEspecialidad.ExportToExcelGembox("CatEspecialidades", UsuarioActual, "Catálogo de Especialidades", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
|
||||
GvEspecialidad.Columns(4).Visible = True
|
||||
'ElseIf Tabs.ActiveTabIndex = 2 Then
|
||||
' GvEspecialidad.Columns(4).Visible = False
|
||||
' Dim SbFiltros As New StringBuilder()
|
||||
' SbFiltros.AppendFormat($"Fecha Inicio: {txtFechaI.Text} Fecha Fin: {txtFechaF.Text}|")
|
||||
' GvEspecialidad.ExportToExcelGembox("CatEspecialidades", UsuarioActual, "Catálogo de Especialidades", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
|
||||
'GvEspecialidad.Columns(4).Visible = True
|
||||
End If
|
||||
|
||||
|
||||
@@ -392,21 +419,21 @@ Partial Class Ventas_CatMedicos
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
If ObjVentas.GetMedicosEspecialidades(-1, UsuarioActual.CveEmpresa, -1) Then
|
||||
GvEspecialidad.DataSource = ObjVentas.DtResultados
|
||||
'GvEspecialidad.DataSource = ObjVentas.DtResultados
|
||||
DdlEspecialidad.DataSource = ObjVentas.DtResultados
|
||||
Else
|
||||
GvEspecialidad.DataSource = Nothing
|
||||
'GvEspecialidad.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
|
||||
GvEspecialidad.DataBind()
|
||||
'GvEspecialidad.DataBind()
|
||||
|
||||
DdlEspecialidad.DataBind()
|
||||
DdlEspecialidad.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||
|
||||
UpModal.Update()
|
||||
UpEspecialidad.Update()
|
||||
'UpEspecialidad.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -294,7 +294,7 @@
|
||||
CssClass="ScrollAD table table-striped table-hover Widthall" data-heighterror="320" data-freezecols="0" data-freezerows="0" GridLines="None"
|
||||
DataKeyNames="CveVenta,TipoDocto,Saldo,DescripcionVenta">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Descripcion" DataField="DescripcionVenta" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Descripción" DataField="DescripcionVenta" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Folio" DataField="SerieFolio" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Fecha/Hora" DataField="Fecha" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Importe" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
<%@ Page Title="Ventas - Facturación" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Ventas.aspx.vb" Inherits="Ventas" EnableEventValidation="false" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
|
||||
<%@ Register Src="~/UserControl/AddMedico.ascx" TagPrefix="UserControl" TagName="AddMedico" %>
|
||||
<%@ Register Src="~/UserControl/AddProcedimiento.ascx" TagPrefix="UserControl" TagName="AddProcedimiento" %>
|
||||
|
||||
|
||||
<%--Necesario para el modal que no se cierra--%>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
@@ -603,6 +607,20 @@
|
||||
<asp:TextBox ID="TxtFechaOS" type="datetime-local" runat="server" CssClass="make-switchsd" CausesValidation="true" Style="width: 130px"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
<tr runat="server" id="TrVentasMedicas3" visible="false">
|
||||
<td runat="server" id="Td6" visible="true">
|
||||
<b>Paciente:</b>
|
||||
</td>
|
||||
<td runat="server">
|
||||
<asp:TextBox ID="TxtPaciente" runat="server" CssClass="make-switchsd" Style="width: 130px" MaxLength="50"></asp:TextBox>
|
||||
</td>
|
||||
<td runat="server" id="Td9" visible="true">
|
||||
<b>Episodio:</b>
|
||||
</td>
|
||||
<td runat="server">
|
||||
<asp:TextBox ID="TxtEpisodio" runat="server" CssClass="make-switchsd" Style="width: 130px" MaxLength="20"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -8427,36 +8445,14 @@
|
||||
</div>
|
||||
|
||||
|
||||
<%--Cliente--%>
|
||||
<%-- <div runat="server" visible="False" id="DvModalTipoVentaPasoClienteEliminar">
|
||||
<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">Hospital:</asp:Label>
|
||||
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientesWS" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;" Onselectedindexchange="DdlClientesWS_selectedindexchange"></ADS:Dropdownlost>
|
||||
</div>
|
||||
</div>
|
||||
</div>--%>
|
||||
|
||||
|
||||
<%--Sucursales--%>
|
||||
<%-- <div runat="server" visible="False" id="DvModalClientesucursal">
|
||||
<div class="row">
|
||||
|
||||
<div class="form-group col-md-12 form-md-line-input input-iconright ">
|
||||
<asp:DropDownList ID="DdlSucursalClienteModal" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="SucursalCliente" DataValueField="CveClienteSucursal">
|
||||
<asp:ListItem Value="-1">Seleccione uno</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlSucursalClienteModal">Sucursal:</asp:Label>
|
||||
</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 ">
|
||||
<div class="form-group col-md-5 form-md-line-input input-iconright ">
|
||||
<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>
|
||||
@@ -8465,7 +8461,10 @@
|
||||
<ajax:ValidatorCalloutExtender ID="VCRfvDdlMedicoModal" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlMedicoModal" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlMedicoModal">Médico:</asp:Label>
|
||||
</div>
|
||||
<div class="form-group col-md-6 form-md-line-input input-iconright ">
|
||||
<div class="form-group col-md-1 form-md-line-input input-iconright ">
|
||||
<asp:LinkButton runat="server" ID="LnkAddMedicoModal" OnClick="LnkAddMedicoModal_Click" CssClass="btn btn-default btn-circle btn-sm" Text="<i class='fa fa-plus' style='color:green'></i>" style="margin-top:8px!important" ></asp:LinkButton>
|
||||
</div>
|
||||
<div class="form-group col-md-5 form-md-line-input input-iconright ">
|
||||
<asp:DropDownList ID="DdlProcedimientoModal" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Procedimiento" DataValueField="CveProcedimiento"
|
||||
OnSelectedIndexChanged="DdlProcedimientoModal_SelectedIndexChanged" AutoPostBack="true">
|
||||
<asp:ListItem Value="-1">Seleccione uno</asp:ListItem>
|
||||
@@ -8476,6 +8475,9 @@
|
||||
<ajax:ValidatorCalloutExtender ID="VCRfvDdlProcedimientoModal" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlProcedimientoModal" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlProcedimientoModal">Procedimiento:</asp:Label>
|
||||
</div>
|
||||
<div class="form-group col-md-1 form-md-line-input input-iconright ">
|
||||
<asp:LinkButton runat="server" ID="LnkAddProcedimientoModal" OnClick="LnkAddProcedimientoModal_Click" CssClass="btn btn-default btn-circle btn-sm" Text="<i class='fa fa-plus' style='color:green'></i>" style="margin-top:8px!important"></asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -8531,8 +8533,44 @@
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="DvModalAddMedico" class="modal ADS fade" role="dialog">
|
||||
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAddMedico" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="modal-content" style="max-width:600px!important;max-height:505px!important">
|
||||
<UserControl:AddMedico runat="server" ID="AddMedicoControl" />
|
||||
</div>
|
||||
<asp:Button ID="BtnRecargaMedicos" Style="display: none;" ClientIDMode="Static" runat="server" OnClick="BtnRecargaMedicos_Click" />
|
||||
<asp:HiddenField ID="HdnCveMedicoNuevo" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
<div id="DvModalAddProcedimiento" class="modal ADS fade" role="dialog">
|
||||
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAddProcedimiento" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content" style="max-width:600px!important;max-height:505px!important">
|
||||
<UserControl:AddProcedimiento runat="server" ID="AddProcedimientoControl" />
|
||||
</div>
|
||||
<asp:Button ID="BtnRecargaProcedimientos" Style="display: none;" ClientIDMode="Static" runat="server" OnClick="BtnRecargaProcedimientos_Click" />
|
||||
<asp:HiddenField ID="HdnCveProcedimientoNuevo" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="/Metronic/assets/global/scripts/jquery-sortable.js"></script>
|
||||
@@ -10457,7 +10495,17 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
function fncRegargaMedicos(CveNuevoMedico) {
|
||||
|
||||
$("#HdnCveMedicoNuevo").val(CveNuevoMedico)
|
||||
$('#BtnRecargaMedicos').click();
|
||||
}
|
||||
|
||||
function fncRegargaProcedimientos(CveProcedimientoNuevo) {
|
||||
|
||||
$("#HdnCveProcedimientoNuevo").val(CveProcedimientoNuevo)
|
||||
$('#BtnRecargaProcedimientos').click();
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@@ -5876,13 +5876,21 @@ Partial Class Ventas
|
||||
|
||||
CveTipoVenta = If(DbRowVenta("CveTipoVenta").ToString.ToEntero > 0, DbRowVenta("CveTipoVenta").ToString.ToEntero, -1)
|
||||
|
||||
TrVentasMedicas3.Visible = True
|
||||
|
||||
If DbRowVenta("CveMedico").ToString.ToEntero > 0 AndAlso CveTipoVenta.Contiene(1, 2, 3, 5) Then
|
||||
TrVentasMedicas1.Visible = True
|
||||
|
||||
DdlMedico.SelectedValueExist(DbRowVenta("CveMedico").ToString)
|
||||
DdlProcedimiento.SelectedValueExist(DbRowVenta("CveProcedimiento").ToString)
|
||||
TxtPaciente.Text = DbRowVenta("Paciente").ToString
|
||||
TxtEpisodio.Text = DbRowVenta("Episodio").ToString
|
||||
|
||||
DdlMedico.Enabled = False
|
||||
DdlProcedimiento.Enabled = False
|
||||
TxtPaciente.Enabled = False
|
||||
TxtEpisodio.Enabled = False
|
||||
|
||||
|
||||
If DbRowVenta("FechaParaSurtir").ToString().ToDate() > DateTime.MinValue Then
|
||||
TrVentasMedicas2.Visible = True
|
||||
@@ -13335,7 +13343,8 @@ Partial Class Ventas
|
||||
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,
|
||||
CveMedico:=CveMedico, CveProcedimiento:=CveProcedimiento, CveTipoVenta:=CveTipoVentaGuardar, RequiereOS:=ChkRequiereTecnico.Checked, FechaParaSurtir:=factura.FechaParaSurtir) Then
|
||||
CveMedico:=CveMedico, CveProcedimiento:=CveProcedimiento, CveTipoVenta:=CveTipoVentaGuardar, RequiereOS:=ChkRequiereTecnico.Checked, FechaParaSurtir:=factura.FechaParaSurtir,
|
||||
Paciente:=TxtPaciente.Text, Episodio:=TxtEpisodio.Text) 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
|
||||
@@ -17615,7 +17624,7 @@ Partial Class Ventas
|
||||
Protected Sub LbAgregar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LbAgregar.Click
|
||||
AgregarPS()
|
||||
End Sub
|
||||
Private Function ValidaAgregarPS(CvePS As Integer, CveUM As Integer, PU As Double, CveTipoPS As Integer) As Boolean 'NO TOCAR - IPP
|
||||
Private Function ValidaAgregarPS(CvePS As Integer, CveUM As Integer, PU As Double, CveTipoPS As Integer, Optional CantidadModal As Decimal = 0D, Optional PSValidarModal As String = "") As Boolean 'NO TOCAR - IPP
|
||||
|
||||
'VALIDA PARAMETROS
|
||||
If CvePS <= 0 Or CveUM <= 0 Then
|
||||
@@ -17623,6 +17632,10 @@ Partial Class Ventas
|
||||
Return False
|
||||
End If
|
||||
|
||||
If PSValidarModal.Trim.Length > 0 Then
|
||||
HdnPS.Value = PSValidarModal
|
||||
End If
|
||||
|
||||
If HdnPS.Value = "" Or HdnPS.Value = "-1" Then
|
||||
Alert("Es necesario seleccionar el Producto o Servicio a facturar.", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
@@ -17703,11 +17716,11 @@ Partial Class Ventas
|
||||
|
||||
End If
|
||||
|
||||
If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Then
|
||||
If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Or UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
|
||||
'VALIDA EXISTENCIA
|
||||
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119, 153, 140}) Then
|
||||
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119, 153, 140, 186}) Then
|
||||
If CveVenta <= 0 OrElse Me.EsCreaApartirDe Then
|
||||
If Existencia - TmpDT.SUM("Cantidad", $"CvePS = {CvePS} AND (EntregaDirecta IS NULL OR EntregaDirecta < 1)") < TxtCantidad.Text.ToDouble Then
|
||||
If Existencia - TmpDT.SUM("Cantidad", $"CvePS = {CvePS} AND (EntregaDirecta IS NULL OR EntregaDirecta < 1)") < (If(CantidadModal > 0, CantidadModal, TxtCantidad.Text.ToDouble)) Then
|
||||
Alert("No cuenta con la cantidad suficiente en inventario. Cuenta con " + Existencia.FormatoNumero(2) + ".", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
@@ -17722,7 +17735,7 @@ Partial Class Ventas
|
||||
|
||||
'SUMA LO YA RESTADO EN PENDIENTE POR SURTIR QUE PERTENESCA A LA VENTA.
|
||||
'PARA QUE NO RESTE LA EXISTENCIA 2 VECES Y PUEDAS COMPARAR LO REAL
|
||||
If (Existencia + CantidadVenta) - TmpDT.SUM("Cantidad", $"CvePS = {CvePS} And (EntregaDirecta Is NULL Or EntregaDirecta < 1)") < TxtCantidad.Text.ToDouble Then
|
||||
If (Existencia + CantidadVenta) - TmpDT.SUM("Cantidad", $"CvePS = {CvePS} And (EntregaDirecta Is NULL Or EntregaDirecta < 1)") < (If(CantidadModal > 0, CantidadModal, TxtCantidad.Text.ToDouble)) Then
|
||||
Alert("No cuenta con la cantidad suficiente en inventario. Cuenta con " + Existencia.FormatoNumero(2) + ".", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
@@ -21689,6 +21702,8 @@ Partial Class Ventas
|
||||
TrVentasMedicas1.Visible = True
|
||||
DdlMedico.Enabled = True
|
||||
DdlProcedimiento.Enabled = True
|
||||
TxtPaciente.Enabled = True
|
||||
TxtEpisodio.Enabled = True
|
||||
End If
|
||||
|
||||
|
||||
@@ -21863,7 +21878,8 @@ Partial Class Ventas
|
||||
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(),
|
||||
CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:=DdlTipoComprobante.SelectedValue, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal,
|
||||
OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(),
|
||||
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, FechaParaSurtir:=FechaParaSurtir) Then
|
||||
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero,
|
||||
FechaParaSurtir:=FechaParaSurtir, Paciente:=TxtPaciente.Text, Episodio:=TxtEpisodio.Text) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
@@ -33699,6 +33715,8 @@ Partial Class Ventas
|
||||
TrVentasMedicas1.Visible = True
|
||||
DdlMedico.Enabled = True
|
||||
DdlProcedimiento.Enabled = True
|
||||
TxtPaciente.Enabled = True
|
||||
TxtEpisodio.Enabled = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(289) Then
|
||||
@@ -33755,7 +33773,8 @@ Partial Class Ventas
|
||||
|
||||
If Not ObjVentas.UpdateObservacionesVenta(Me.CveVenta, UsuarioActual.CveEmpresa, DdlVendedor.SelectedValue.ToEntero(), TxtObsFact.Text, RblPaqueteria.SelectedValue.ToEntero(), TxtCorreoNotificaciones.Text,
|
||||
TxtObsAlmacen.Text, TxtPedidoContrato.Text, TxtOrdenCompra.Text, TxtFechaPago.Text, DdlUsoCFDI.SelectedValue.ToEntero, DescripcionVenta:=TxtDescripcionVenta.Text.Trim,
|
||||
CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, FechaParaSurtir:=FechaParaSurtir) Then
|
||||
CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, FechaParaSurtir:=FechaParaSurtir, Paciente:=TxtPaciente.Text,
|
||||
Episodio:=TxtEpisodio.Text) Then
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
@@ -36112,6 +36131,7 @@ Partial Class Ventas
|
||||
|
||||
TrVentasMedicas1.Visible = True
|
||||
TrVentasMedicas2.Visible = True
|
||||
TrVentasMedicas3.Visible = True
|
||||
|
||||
For Each item As ListItem In RBLTipoVenta.Items
|
||||
item.Text = $"  {item.Text}"
|
||||
@@ -36120,7 +36140,7 @@ Partial Class Ventas
|
||||
RegistraScript("$('#DvModalTipoVenta').modal({ backdrop: 'static', keyboard: false });")
|
||||
End Sub
|
||||
|
||||
Private Sub CargaProcedimientos()
|
||||
Private Sub CargaProcedimientos(Optional CveProcedimientSeleccion As Integer = -1)
|
||||
DdlProcedimiento.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
||||
DdlProcedimiento.DataBind()
|
||||
|
||||
@@ -36128,17 +36148,35 @@ Partial Class Ventas
|
||||
DdlProcedimientoModal.DataBind()
|
||||
|
||||
|
||||
If CveProcedimientSeleccion > 0 Then
|
||||
DdlProcedimientoModal.SelectedValueExist(CveProcedimientSeleccion)
|
||||
End If
|
||||
|
||||
UpDvModalTipoVenta.Update()
|
||||
UpCliente.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaMedicos()
|
||||
Private Sub CargaMedicos(Optional CveMedicoSeleccion As Integer = -1)
|
||||
|
||||
DdlMedico.ClearSelection()
|
||||
DdlMedico.SelectedValue = Nothing
|
||||
|
||||
DdlMedicoModal.ClearSelection()
|
||||
DdlMedicoModal.SelectedValue = Nothing
|
||||
|
||||
DdlMedico.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
||||
DdlMedico.DataBind()
|
||||
|
||||
DdlMedicoModal.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
||||
DdlMedicoModal.DataBind()
|
||||
|
||||
If CveMedicoSeleccion > 0 Then
|
||||
DdlMedicoModal.SelectedValueExist(CveMedicoSeleccion)
|
||||
End If
|
||||
|
||||
UpDvModalTipoVenta.Update()
|
||||
UpCliente.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -36192,7 +36230,7 @@ Partial Class Ventas
|
||||
|
||||
|
||||
TdFechaOS1.Visible = ChkRequiereTecnico.Checked
|
||||
TdFechaOS2.Visible = ChkRequiereTecnico.Checked
|
||||
|
||||
|
||||
UpCliente.Update()
|
||||
End Sub
|
||||
@@ -36359,6 +36397,27 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
For Each GvRow As GridViewRow In GvProductosProcedimiento.Rows
|
||||
Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidad").Text.ToDecimal
|
||||
Dim CveUnidadMedida As Integer = GvRow.DataKey("CveUnidadMedida").ToEntero
|
||||
Dim Abreviatura As String = GvRow.DataKey("Abreviatura").ToString
|
||||
Dim PU As Decimal = GvRow.DataKey("Precio").ToDecimal
|
||||
Dim CveClasificacion As Integer = GvRow.DataKey("CveClasificacion").ToEntero
|
||||
Dim Clasificacion As String = GvRow.DataKey("Clasificacion").ToString
|
||||
Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
|
||||
Dim CodigoPS As String = GvRow.DataKey("CodigoPS")
|
||||
|
||||
If Cantidad > 0 Then
|
||||
If Not ValidaAgregarPS(CvePS, CveUnidadMedida, PU, 2, Cantidad, CodigoPS) Then
|
||||
Alert("No hay existencia.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
ChkRequiereTecnico.Checked = ChkRequiereTecnicoModal.Checked
|
||||
TxtFechaOS.Text = TxtFechaModal.Text
|
||||
|
||||
@@ -36445,6 +36504,7 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
If CountPsAgregados > 0 Then
|
||||
CalculaTotalesVenta()
|
||||
End If
|
||||
@@ -36512,7 +36572,8 @@ Partial Class Ventas
|
||||
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, CveVentaOS, -1, -1, CveOSTipo, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero,
|
||||
Direccion:="", Telefono:="", CveModeloAuto:=-1, Año:="", CveMedico:=DdlMedico.SelectedValue.ToEntero,
|
||||
CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=RBLTipoVenta.SelectedValue.ToEntero, FechaCita:=TxtFechaOS.Text.Replace(",", "").ToDateTime) Then
|
||||
CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=RBLTipoVenta.SelectedValue.ToEntero, FechaCita:=TxtFechaOS.Text.Replace(",", "").ToDateTime,
|
||||
Paciente:=TxtPaciente.Text, IdentificadorCliente:=TxtEpisodio.Text) Then
|
||||
CveOSVentaMedica = ObjOrdenServicio.CveOS
|
||||
Else
|
||||
errorList.Add("Se presento un error al guardar la orden de servicio.")
|
||||
@@ -36553,6 +36614,36 @@ Partial Class Ventas
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Protected Sub LnkAddMedicoModal_Click(sender As Object, e As EventArgs)
|
||||
'iFrameAddMedicoProcedimiento.Attributes.Add("src", "/Ventas/CatMedicos.aspx?EsFrame=1")
|
||||
AddMedicoControl.CveMedico = -1
|
||||
AddMedicoControl.LimpiarControles()
|
||||
UpModalAddMedico.Update()
|
||||
|
||||
RegistraScript("$('#DvModalAddMedico').modal();")
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkAddProcedimientoModal_Click(sender As Object, e As EventArgs)
|
||||
'iFrameAddMedicoProcedimiento.Attributes.Add("src", "/Ventas/CatProcedimientoDetalle.aspx?CveProcedimiento=-1")
|
||||
|
||||
AddProcedimientoControl.CveProcedimiento = -1
|
||||
AddProcedimientoControl.LimpiarControles()
|
||||
UpModalAddProcedimiento.Update()
|
||||
RegistraScript("$('#DvModalAddProcedimiento').modal();")
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnRecargaMedicos_Click(sender As Object, e As EventArgs)
|
||||
|
||||
CargaMedicos(HdnCveMedicoNuevo.Value.ToEntero)
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnRecargaProcedimientos_Click(sender As Object, e As EventArgs)
|
||||
CargaProcedimientos(HdnCveProcedimientoNuevo.Value.ToEntero)
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
'Protected Sub LnkCancelarSoloCFDI_Click(sender As Object, e As EventArgs)
|
||||
@@ -36632,5 +36723,10 @@ Partial Class Ventas
|
||||
Protected Sub TxtFechaAnticipoCliente_TextChanged(sender As Object, e As EventArgs)
|
||||
CargaAnticipos(CveCliente)
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user