This commit is contained in:
2024-01-29 05:16:55 -07:00
24 changed files with 1111 additions and 307 deletions

View File

@@ -1,5 +1,7 @@
<%@ Page Title="Catálogo de Médicos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatMedicos.aspx.vb" Inherits="Ventas_CatMedicos" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="~/UserControl/AddMedico.ascx" TagPrefix="UserControl" TagName="AddMedico" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
<link href="/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" />
</asp:Content>
@@ -380,9 +382,25 @@
<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" />--%>
<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="DVAgregarMedico" class="modal ADS fade" role="dialog">
<%--<div id="DVAgregarMedico" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="min-width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModal" UpdateMode="Conditional">
<ContentTemplate>
@@ -406,9 +424,7 @@
<div class="row">
<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>--%>
<asp:TextBox ID="TxtCedulaProfecional" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<label for="<%= TxtCedulaProfecional.ClientID.ToString()%>">Cédula Profesional:</label>
</div>
</div>
@@ -563,8 +579,6 @@
</div>
</div>
</div>
</div>
</div>
@@ -576,7 +590,7 @@
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>--%>
<div id="DVAgregarEspecialidad" class="modal ADS fade" role="dialog">
@@ -698,6 +712,12 @@
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script>
function fncRegargaMedicos(CveNuevoMedico) {
$("#HdnCveMedicoNuevo").val(CveNuevoMedico)
$('#BtnRecargaMedicos').click();
}
</script>
</asp:Content>

View File

@@ -51,20 +51,16 @@ Partial Class Ventas_CatMedicos
If Not Page.IsPostBack Then
If Request("EsFrame") IsNot Nothing AndAlso Request("EsFrame").ToEntero = 1 Then
EsFrame = True
End If
CargaCombos()
CargaEspecialidad()
CargaSubEspecialidad(-1)
'CargaEspecialidad()
'CargaSubEspecialidad(-1)
CargaDatos()
BtnConsultar_Click(Nothing, Nothing)
If EsFrame Then
LnkAgregarMedico_Click(Nothing, Nothing)
Else
CargaDatos()
BtnConsultar_Click(Nothing, Nothing)
End If
End If
@@ -95,41 +91,41 @@ Partial Class Ventas_CatMedicos
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
'Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ProcesoOK = False
Dim ObjVentas As New ClsVentas
' Dim ProcesoOK = False
' Dim ObjVentas As New ClsVentas
Dim Telefono As String = If(TxtTelefono.Text = "(___) ___-____", "", TxtTelefono.Text)
Dim Celular As String = If(TxtCelular.Text = "(___) ___-____", "", TxtCelular.Text)
' 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, DdlEspecialidad.SelectedValue.ToEntero, Celular, TxtConsultorio.Text.Trim, DdlSubEspecialidad.SelectedValue.ToEntero, TxtTorre.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, DdlEspecialidad.SelectedValue.ToEntero, Celular, TxtConsultorio.Text.Trim, DdlSubEspecialidad.SelectedValue.ToEntero, TxtTorre.Text.Trim) > 0 Then
ProcesoOK = True
End If
End If
' 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, DdlEspecialidad.SelectedValue.ToEntero, Celular, TxtConsultorio.Text.Trim, DdlSubEspecialidad.SelectedValue.ToEntero, TxtTorre.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, DdlEspecialidad.SelectedValue.ToEntero, Celular, TxtConsultorio.Text.Trim, DdlSubEspecialidad.SelectedValue.ToEntero, TxtTorre.Text.Trim) > 0 Then
' ProcesoOK = True
' End If
' End If
ObjVentas.Dispose()
' ObjVentas.Dispose()
If ProcesoOK Then
Alert($"Medico {If(CveMedico > 0, "Actualizado", "Guardado")} Correctamente.")
RegistraScript("$('#DVAgregarMedico').modal('hide');")
CargaDatos()
CargaGlobal()
UpDatos.Update()
End If
' If ProcesoOK Then
' Alert($"Medico {If(CveMedico > 0, "Actualizado", "Guardado")} Correctamente.")
' RegistraScript("$('#DVAgregarMedico').modal('hide');")
' CargaDatos()
' CargaGlobal()
' UpDatos.Update()
' End If
End Sub
'End Sub
#Region "G V D A T O S"
@@ -171,36 +167,10 @@ Partial Class Ventas_CatMedicos
Public Sub LnkAgregarMedico_Click(sender As Object, e As EventArgs)
LbAgregar.Text = "Agregar"
LtlTituloModal.Text = "Agregar Médico"
TxtMedico.Text = ""
TxtCedulaProfecional.Text = ""
TxtFechaNacimiento.Text = ""
TxtNotas.Text = ""
TxtDiasAtencion.Text = ""
TxtHorario.Text = ""
TxtLugar.Text = ""
TxtConsultorio.Text = ""
TxtMail.Text = ""
TxtTelefono.Text = ""
TxtCelular.Text = ""
DdlEspecialidad.SelectedValueExist(-1)
DdlSubEspecialidad.SelectedValueExist(-1)
TxtTorre.Text = ""
DVUsuarioFechaIng.Visible = False
TxtFechaIng.Text = ""
TxtUsuario.Text = ""
DVEstatus.Visible = False
ChkEstatus.Checked = True
UpModal.Update()
CveMedico = -1
RegistraScript("$('#DVAgregarMedico').modal();")
AddMedicoControl.CveMedico = -1
AddMedicoControl.LimpiarControles()
UpModalAddMedico.Update()
RegistraScript("$('#DvModalAddMedico').modal();")
End Sub
Public Sub Edit_Click(sender As Object, e As EventArgs)
@@ -209,34 +179,41 @@ Partial Class Ventas_CatMedicos
CveMedico = GvRow.DataKey("CveMedico").ToEntero
TxtMedico.Text = GvRow.DataKey("Medico")
TxtCedulaProfecional.Text = GvRow.DataKey("CedulaProfesional")
TxtFechaNacimiento.Text = GvRow.DataKey("FechaNacimiento").ToDate().ToString("dd/MM/yyyy")
TxtNotas.Text = GvRow.DataKey("Notas")
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")
DdlEspecialidad.SelectedValueExist(-1)
DdlEspecialidad.SelectedValueExist(GvRow.DataKey("CveMedicoEspecialidad").ToEntero)
CargaSubEspecialidad(GvRow.DataKey("CveMedicoEspecialidad").ToEntero)
DdlSubEspecialidad.SelectedValueExist(GvRow.DataKey("CveMedicoSubEspecialidad").ToEntero)
TxtTorre.Text = GvRow.DataKey("Torre")
AddMedicoControl.PreparaEdicion(CveMedico, GvRow.DataKey("Medico"), GvRow.DataKey("CedulaProfesional"), GvRow.DataKey("FechaNacimiento").ToDate(), GvRow.DataKey("Notas"), GvRow.DataKey("DiasAtencion"),
GvRow.DataKey("Horario"), GvRow.DataKey("Lugar"), GvRow.DataKey("Consultorio"), Boolean.Parse(GvRow.DataKey("Estatus")), GvRow.DataKey("Mail"), GvRow.DataKey("Telefono"),
GvRow.DataKey("Celular"), GvRow.DataKey("CveMedicoEspecialidad").ToEntero, GvRow.DataKey("CveMedicoSubEspecialidad").ToEntero, GvRow.DataKey("Torre"),
GvRow.DataKey("FechaIng").ToDateTime, GvRow.DataKey("Usuario"))
DVUsuarioFechaIng.Visible = True
TxtFechaIng.Text = GvRow.DataKey("FechaIng").ToDateTime.ToString("dd/MM/yyyy hh:mm:ss tt")
TxtUsuario.Text = GvRow.DataKey("Usuario")
DVEstatus.Visible = True
LbAgregar.Text = "Actualizar"
LtlTituloModal.Text = $"Actualizar Médico {TxtCedulaProfecional.Text}"
'TxtMedico.Text = GvRow.DataKey("Medico")
'TxtCedulaProfecional.Text = GvRow.DataKey("CedulaProfesional")
'TxtFechaNacimiento.Text = GvRow.DataKey("FechaNacimiento").ToDate().ToString("dd/MM/yyyy")
'TxtNotas.Text = GvRow.DataKey("Notas")
'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")
'DdlEspecialidad.SelectedValueExist(-1)
'DdlEspecialidad.SelectedValueExist(GvRow.DataKey("CveMedicoEspecialidad").ToEntero)
'CargaSubEspecialidad(GvRow.DataKey("CveMedicoEspecialidad").ToEntero)
'DdlSubEspecialidad.SelectedValueExist(GvRow.DataKey("CveMedicoSubEspecialidad").ToEntero)
'TxtTorre.Text = GvRow.DataKey("Torre")
UpModal.Update()
RegistraScript("$('#DVAgregarMedico').modal();")
'DVUsuarioFechaIng.Visible = True
'TxtFechaIng.Text = GvRow.DataKey("FechaIng").ToDateTime.ToString("dd/MM/yyyy hh:mm:ss tt")
'TxtUsuario.Text = GvRow.DataKey("Usuario")
'DVEstatus.Visible = True
'LbAgregar.Text = "Actualizar"
'LtlTituloModal.Text = $"Actualizar Médico {TxtCedulaProfecional.Text}"
'UpModal.Update()
UpModalAddMedico.Update()
RegistraScript("$('#DvModalAddMedico').modal();")
End Sub
@@ -402,7 +379,7 @@ Partial Class Ventas_CatMedicos
ObjVentas.Dispose()
If ProcesoOK Then
CargaEspecialidad()
'CargaEspecialidad()
Alert($"Especialidad {If(CveMedicoEspecialidad > 0, "actualizada", "agregada")} correctamente.")
RegistraScript("$('#DVAgregarEspecialidad').modal('hide');")
End If
@@ -415,47 +392,47 @@ Partial Class Ventas_CatMedicos
UpModalEspecialidad.Update()
End Sub
Sub CargaEspecialidad()
Dim ObjVentas As New ClsVentas
'Sub CargaEspecialidad()
' Dim ObjVentas As New ClsVentas
If ObjVentas.GetMedicosEspecialidades(-1, UsuarioActual.CveEmpresa, -1) Then
'GvEspecialidad.DataSource = ObjVentas.DtResultados
DdlEspecialidad.DataSource = ObjVentas.DtResultados
Else
'GvEspecialidad.DataSource = Nothing
End If
' If ObjVentas.GetMedicosEspecialidades(-1, UsuarioActual.CveEmpresa, -1) Then
' 'GvEspecialidad.DataSource = ObjVentas.DtResultados
' DdlEspecialidad.DataSource = ObjVentas.DtResultados
' Else
' 'GvEspecialidad.DataSource = Nothing
' End If
ObjVentas.Dispose()
' ObjVentas.Dispose()
'GvEspecialidad.DataBind()
' 'GvEspecialidad.DataBind()
DdlEspecialidad.DataBind()
DdlEspecialidad.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
' DdlEspecialidad.DataBind()
' DdlEspecialidad.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
UpModal.Update()
'UpEspecialidad.Update()
' UpModal.Update()
' 'UpEspecialidad.Update()
End Sub
'End Sub
Sub CargaSubEspecialidad(CveMedicoEspecialidad As Integer)
Dim ObjVentas As New ClsVentas
'Sub CargaSubEspecialidad(CveMedicoEspecialidad As Integer)
' Dim ObjVentas As New ClsVentas
If ObjVentas.GetMedicosSubEspecialidades(-1, UsuarioActual.CveEmpresa, -1) Then
If CveMedicoEspecialidad > 0 Then
DdlSubEspecialidad.DataSource = ObjVentas.DtResultados.FiltraParametros($"CveMedicoEspecialidad = {CveMedicoEspecialidad}")
Else
DdlSubEspecialidad.DataSource = ObjVentas.DtResultados
End If
End If
' If ObjVentas.GetMedicosSubEspecialidades(-1, UsuarioActual.CveEmpresa, -1) Then
' If CveMedicoEspecialidad > 0 Then
' DdlSubEspecialidad.DataSource = ObjVentas.DtResultados.FiltraParametros($"CveMedicoEspecialidad = {CveMedicoEspecialidad}")
' Else
' DdlSubEspecialidad.DataSource = ObjVentas.DtResultados
' End If
' End If
ObjVentas.Dispose()
' ObjVentas.Dispose()
DdlSubEspecialidad.DataBind()
DdlSubEspecialidad.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
UpModal.Update()
' DdlSubEspecialidad.DataBind()
' DdlSubEspecialidad.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
' UpModal.Update()
End Sub
'End Sub
Protected Sub LnkEditarEspecialidad_Click(sender As Object, e As EventArgs)
@@ -491,7 +468,7 @@ Partial Class Ventas_CatMedicos
ObjVentas.Dispose()
If ProcesoOK Then
CargaEspecialidad()
'CargaEspecialidad()
Alert("Especialidad eliminada correctamente")
End If
@@ -502,14 +479,14 @@ Partial Class Ventas_CatMedicos
Protected Sub DdlEspecialidad_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaSubEspecialidad(DdlEspecialidad.SelectedValue.ToEntero)
'Protected Sub DdlEspecialidad_SelectedIndexChanged(sender As Object, e As EventArgs)
' CargaSubEspecialidad(DdlEspecialidad.SelectedValue.ToEntero)
'End Sub
Protected Sub BtnRecargaMedicos_Click(sender As Object, e As EventArgs)
CargaDatos()
End Sub
End Class

View File

@@ -4144,6 +4144,7 @@
<asp:UpdatePanel ID="UpFacturar" runat="server" class="portlet light xspadding bordered " style="max-width: 300px;" align="right" UpdateMode="Conditional">
<Triggers>
<asp:PostBackTrigger ControlID="BtnVistaPrevia" />
<asp:PostBackTrigger ControlID="LBVistaPrevia" />
</Triggers>
<ContentTemplate>
@@ -4185,6 +4186,9 @@
Facturar <i class="fa fa-angle-down"></i>
</button>
<ul class="dropdown-menu">
<li>
<asp:LinkButton ID="LBVistaPrevia" Text="Vista Previa" OnClick="LBVistaPrevia_Click" runat="server" Visible="false" />
</li>
<li>
<asp:LinkButton ID="LBFacturarIngreso" Text="Ingreso" OnClick="LBFacturarIngreso_Click" runat="server" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea facturar como tipo ingreso?" data-btn-ok-label="si" />
</li>
@@ -8675,16 +8679,20 @@
}
//FUNCIONES PARA COMERCIO EXTERIOR
function CalculaTotalUSD(TotalUSD, ValorUnitario, TxtCantidad) {
TotalUSD.innerText = FormatoNumero(ToDouble(ValorUnitario.value) * ToDouble(TxtCantidad.value), 2);
}
function CalculaPU_USD(TxtValorUnitario, TotalUSD, TxtCantidad) {
TxtValorUnitario.value = FormatoNumero(ToDouble(TotalUSD) / ToDouble(TxtCantidad.value), 6);
if(ToDouble(TxtCantidad.value) > 0){
TxtValorUnitario.value = ((ToDouble(TotalUSD) / ToDouble(TxtCantidad.value)).toFixed(6)).toString();
}else{
TxtValorUnitario.value = "0";
}
}
function CalculaCantidad_USD(TxtValorUnitario, TotalUSD, TxtCantidad) {
TxtCantidad.value = FormatoNumero(ToDouble(TotalUSD) / ToDouble(TxtValorUnitario.value), 6);
if (ToDouble(TxtValorUnitario.value) > 0) {
TxtCantidad.value = ((ToDouble(TotalUSD) / ToDouble(TxtValorUnitario.value)).toFixed(6)).toString();
}else{
TxtCantidad.value = "0";
}
}
function LimitaCantidadAplicaDev(Cantidad, TxtCantidadAplicaDevolucion) {

View File

@@ -2599,11 +2599,10 @@ Partial Class Ventas
CargaMedicos()
CargaProcedimientos()
CargaDdlClientesSucursal()
LBVistaPrevia.Visible = True
End If
'SI USUARIO USA AMORTIZACIÓN CONTABLE, se carga las tablas para usarlas mas adelante
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
@@ -11497,7 +11496,7 @@ Partial Class Ventas
End Function
Private Sub CreaObjetosVenta(Optional VistaPrevia As Boolean = False, Optional EsCancelacion As Boolean = False, Optional TipoDoctoViejo As String = "")
Private Sub CreaObjetosVenta(Optional VistaPrevia As Boolean = False, Optional EsCancelacion As Boolean = False, Optional TipoDoctoViejo As String = "", Optional TipoDoctoVistaPrevia As String = "")
If Me.CveVenta > 0 AndAlso NuevaFactura <> 1 Then
ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=EsCancelacion)
@@ -11521,6 +11520,11 @@ Partial Class Ventas
ObjFactura.Moneda = DdlMoneda.SelectedItem.Text
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {DdlMoneda.SelectedValue}")
ObjFactura.TipoDocto = If(IfNull(ViewState("CveRemision"), 0).ToString().ToEntero() > 0, "Ing", DdlTipoComprobante.SelectedValue)
If VistaPrevia AndAlso Not String.IsNullOrEmpty(TipoDoctoVistaPrevia) Then
ObjFactura.TipoDocto = TipoDoctoVistaPrevia
End If
ObjFactura.FacturarSucursal = (Me.FacturarSucursal AndAlso DdlSucursalCliente.SelectedValue.ToEntero() > 0 AndAlso (Me.ClienteSucursal IsNot Nothing AndAlso Not String.IsNullOrEmpty(Me.ClienteSucursal.RFC)))
ObjFactura.VentaDesglosaIEPS = Me.VentaDesglosaIEPS
@@ -16940,6 +16944,21 @@ Partial Class Ventas
CvePrecioListaPS = CvePrecioListaSugerido
End If
Dim CvePrecioListaPredeterminada = -1
Dim AplicaPredeterminado As Boolean = False
If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso RBLTipoVenta.SelectedValue = "2" Then
AplicaPredeterminado = True
CvePrecioListaPredeterminada = GlobalDTPrecioListas(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "Predeterminada = True").ToEntero()
If CvePrecioListaPredeterminada > 0 Then
CvePrecioListaPS = CvePrecioListaPredeterminada
End If
End If
If AplicaPredeterminado AndAlso CvePrecioListaPredeterminada <= 0 Then
Alert("No hay una lista de precios predeterminada", TipoMensaje.MsgAdvertencia)
End If
If CvePrecioListaPS > 0 Then
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then
@@ -16949,6 +16968,10 @@ Partial Class Ventas
ObjPS.Dispose()
End If
If AplicaPredeterminado AndAlso PrecioSugerido <= 0 Then
Alert("El producto y/o servicio no tiene asignado un valor en la lista de precios predeterminada", TipoMensaje.MsgAdvertencia)
End If
If PrecioSugerido = 0 Then
Dim ObjInventarios As New ClsInventarios
Dim CostoPS As Decimal = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDecimal, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1)
@@ -24469,8 +24492,9 @@ Partial Class Ventas
ChkDevAlm.Checked = True
End If
'LOS PEDIDOS SE DEBE CANCELAR EN UN PROCESO DISTINTO
If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso ObjFacturaCancelacion.TipoDocto = "Ped" Then
ChkDevAlm.Checked = True
ChkDevAlm.Checked = False
End If
resp = ObjFacturaCancelacion.CancelarFactura(ChkDevAlm.Checked, ListaRemisionesCancelar, CveMotivoCancelacion:=DdlMotivoCancelacion.SelectedValue.ToEntero(), Motivo:=TxtMotivoCancelacion.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion)
@@ -36088,6 +36112,8 @@ Partial Class Ventas
Dim dRow As DataRow = objVenta.DtResultados.Rows(0)
DdlMedico.SelectedValueExist(dRow("CveMedico").ToString.ToEntero)
DdlProcedimiento.SelectedValueExist(dRow("CveProcedimiento").ToString.ToEntero)
TxtPaciente.Text = dRow("Paciente").ToString
TxtEpisodio.Text = dRow("Episodio").ToString
SeEstaFActurandoVentaMedica = True
CveTipoVenta = dRow("CveTipoVenta").ToString.ToEntero
ChkRequiereTecnico_CheckedChanged(Nothing, Nothing)
@@ -36704,9 +36730,18 @@ Partial Class Ventas
CargaAnticipos(CveCliente)
End Sub
Protected Sub LBVistaPrevia_Click(sender As Object, e As EventArgs)
CreaObjetosVenta(True, TipoDoctoVistaPrevia:="Ing")
If ObjFactura Is Nothing Or (ObjFactura.Cliente Is Nothing And Not CveEmpresaCRM > 0) Then
Alert("Ocurrió un error al procesar los datos para la vista previa. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgError)
ObjFactura = Nothing
Exit Sub
End If
Dim CartaPorte As Modelos.MSubReportData = Nothing
ImprimirbytesPDF(PdfFactura(ObjFactura, Guardar:=False, SubReportData:=CartaPorte), "Factura", "PDF")
End Sub
End Class