diff --git a/Inventarios/EntregaAlmacen.aspx b/Inventarios/EntregaAlmacen.aspx index 787910cdd..39ebbe52f 100644 --- a/Inventarios/EntregaAlmacen.aspx +++ b/Inventarios/EntregaAlmacen.aspx @@ -1150,6 +1150,17 @@ } + function fncCantidad(checkbox, numeroMax, idTbCantidadF) { + + var $textbox = $('#' + idTbCantidadF); + + if ($(checkbox).is(':checked')) { + $textbox.val(numeroMax); + } else { + $textbox.val(0); + } + } + diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 7e9b55a25..b2012351d 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -5,6 +5,7 @@ Imports System.Data Imports System.Data.SqlClient Imports System.IO Imports System.Web.Management +Imports DocumentFormat.OpenXml.InkML Imports Extensiones Imports Microsoft.Reporting.WebForms Imports MoreLinq @@ -1237,13 +1238,13 @@ Partial Class Inventarios_EntregaAlmacen If BloqueCantidad Then e.Row.FCTextBox("TbCantidadF").Enabled = False + Else + e.Row.FCCheckBox("cbInv").Attributes.Add("onclick", $"fncCantidad(this,{e.Row.DBCampo("CantidadF")},'{e.Row.FCTextBox("TbCantidadF").ClientID}')") End If If Boolean.Parse(e.Row.DataKey("AplicaLote")) Or Boolean.Parse(e.Row.DataKey("AplicaCaducidad")) Then - CargarCaducidadProducto(e.Row.DataKey("CvePS").ToEntero, e.Row.FCDropDownList("DdlCaducidadProducto")) - End If diff --git a/UserControl/AddMedico.ascx b/UserControl/AddMedico.ascx index cb4e00d56..80bdcd6e0 100644 --- a/UserControl/AddMedico.ascx +++ b/UserControl/AddMedico.ascx @@ -184,7 +184,7 @@ - + diff --git a/UserControl/AddMedico.ascx.vb b/UserControl/AddMedico.ascx.vb index 9dc3626fa..277a05b03 100644 --- a/UserControl/AddMedico.ascx.vb +++ b/UserControl/AddMedico.ascx.vb @@ -68,8 +68,7 @@ Partial Class UserControl_AddMedico Private Sub UserControl_AddMedico_Load(sender As Object, e As EventArgs) Handles Me.Load If Not Page.IsPostBack Then - CargaCombos() - CargaCombosMedicoClientesucursal() + End If End Sub @@ -80,6 +79,10 @@ Partial Class UserControl_AddMedico End Sub Sub CargaVendedores() + DdlVendedor.ClearSelection() + DdlVendedor.SelectedValue = Nothing + DdlVendedor.Items.Clear() + Dim ObjVendedores As New ClsVtaVendedores If ObjVendedores.GetVendedores(UsuarioActual.CveEmpresa) Then DdlVendedor.DataSource = ObjVendedores.DtResultados.FiltraParametros("VendedorTipo = 1") @@ -93,6 +96,11 @@ Partial Class UserControl_AddMedico Sub CargaEspecialidad() + + DdlEspecialidad.ClearSelection() + DdlEspecialidad.SelectedValue = Nothing + DdlEspecialidad.Items.Clear() + Dim ObjVentas As New ClsVentas If ObjVentas.GetMedicosEspecialidades(-1, UsuarioActual.CveEmpresa, -1) Then @@ -114,6 +122,10 @@ Partial Class UserControl_AddMedico Sub CargaSubEspecialidad(CveMedicoEspecialidad As Integer) + + DdlSubEspecialidad.ClearSelection() + DdlSubEspecialidad.SelectedValue = Nothing + DdlSubEspecialidad.Items.Clear() Dim ObjVentas As New ClsVentas If ObjVentas.GetMedicosSubEspecialidades(-1, UsuarioActual.CveEmpresa, -1) Then @@ -138,6 +150,9 @@ Partial Class UserControl_AddMedico Public Sub LimpiarControles() + CargaCombos() + CargaCombosMedicoClientesucursal() + CveMedico = -1 CrearDTMedicosClientesSucursales() CveMedicoClienteSucursal = -1 @@ -197,6 +212,9 @@ Partial Class UserControl_AddMedico Public Sub PreparaEdicion(CveMedicoEditar As Integer, Nombre As String, APaterno As String, AMaterno As String, CedulaProfecional As String, FechaNacimiento As Date, Notas As String, Estatus As Boolean, Mail As String, Telefono As String, Celular As String, CveMedicoEspecialidad As Integer, CveMedicoSubEspecialidad As Integer, FechaIng As DateTime, Usuario As String, CveVendedor As Integer) + CargaCombos() + CargaCombosMedicoClientesucursal() + CveMedico = CveMedicoEditar TxtNombre.Text = Nombre TxtAPaterno.Text = APaterno @@ -305,8 +323,12 @@ Partial Class UserControl_AddMedico End Function Private Sub CargaCombosMedicoClientesucursal() - Dim objcliente As New ClsClientes + DdlClienteSucursal.ClearSelection() + DdlClienteSucursal.SelectedValue = Nothing + DdlClienteSucursal.Items.Clear() + + Dim objcliente As New ClsClientes If objcliente.GetClienteSucursales(-1, UsuarioActual.CveEmpresa) Then DdlClienteSucursal.DataSource = objcliente.DtResultados Else @@ -352,19 +374,39 @@ Partial Class UserControl_AddMedico Dim TieneError As Boolean = False - - Dim SBDiasAtencion As New StringBuilder() Dim DiasAtencion As String = "" - If ChkLunes.Checked Then SBDiasAtencion.AppendFormat("1-") Else SBDiasAtencion.AppendFormat("0-") - If ChkMartes.Checked Then SBDiasAtencion.AppendFormat("1-") Else SBDiasAtencion.AppendFormat("0-") - If ChkMiercoles.Checked Then SBDiasAtencion.AppendFormat("1-") Else SBDiasAtencion.AppendFormat("0-") - If ChkJueves.Checked Then SBDiasAtencion.AppendFormat("1-") Else SBDiasAtencion.AppendFormat("0-") - If ChkViernes.Checked Then SBDiasAtencion.AppendFormat("1-") Else SBDiasAtencion.AppendFormat("0-") - If ChkSabado.Checked Then SBDiasAtencion.AppendFormat("1-") Else SBDiasAtencion.AppendFormat("0-") - If ChkDomingo.Checked Then SBDiasAtencion.AppendFormat("1") Else SBDiasAtencion.AppendFormat("0") + Dim ListaDiasAntencion As New List(Of String) + If ChkLunes.Checked Then + ListaDiasAntencion.Add("L") + End If + + If ChkMartes.Checked Then + ListaDiasAntencion.Add("M") + End If + + If ChkMiercoles.Checked Then + ListaDiasAntencion.Add("MI") + End If + + If ChkJueves.Checked Then + ListaDiasAntencion.Add("J") + End If + + If ChkViernes.Checked Then + ListaDiasAntencion.Add("V") + End If + + If ChkSabado.Checked Then + ListaDiasAntencion.Add("S") + End If + + If ChkDomingo.Checked Then + ListaDiasAntencion.Add("D") + End If + + DiasAtencion = String.Join(", ", ListaDiasAntencion) - DiasAtencion = SBDiasAtencion.ToString() If CveMedico > 0 Then Dim objVenta As New ClsVentas @@ -458,6 +500,8 @@ Partial Class UserControl_AddMedico Protected Sub LnkEditarClienteSucursal_Click(sender As Object, e As EventArgs) + LimpiarcontrolesDetalle() + Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) Dim CveCliente As Integer = GvRow.DataKey("CveCliente").ToEntero @@ -481,22 +525,26 @@ Partial Class UserControl_AddMedico TxtTorre.Text = GvRow.DataKey("Torre") TxtAsistenteNombre.Text = GvRow.DataKey("AsistenteNombre") + Dim DiasAtencionArray As String() = GvRow.DataKey("DiasAtencion").Split(New Char() {","c}) - Dim array As String() = GvRow.DataKey("DiasAtencion").Split(New Char() {"-"c}) - - If array.Length = 7 Then - If array(0) = "1" Then ChkLunes.Checked = True - If array(1) = "1" Then ChkMartes.Checked = True - If array(2) = "1" Then ChkMiercoles.Checked = True - If array(3) = "1" Then ChkJueves.Checked = True - If array(4) = "1" Then ChkViernes.Checked = True - If array(5) = "1" Then ChkSabado.Checked = True - If array(6) = "1" Then ChkDomingo.Checked = True - - - End If - - + For Each s As String In DiasAtencionArray + Select Case s.Trim() + Case "L" + ChkLunes.Checked = True + Case "M" + ChkMartes.Checked = True + Case "MI" + ChkMiercoles.Checked = True + Case "J" + ChkJueves.Checked = True + Case "V" + ChkViernes.Checked = True + Case "S" + ChkSabado.Checked = True + Case "D" + ChkDomingo.Checked = True + End Select + Next RegistraScript(" $('#DVMedicoClienteSucursal').modal('show');") UpModalMedicoClienteSucursal.Update() diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 7a5a0f5b9..25c926220 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2,6 +2,7 @@ Option Strict On Option Infer On +Imports System.Activities.Expressions Imports System.Data Imports System.Data.SqlClient Imports System.Diagnostics @@ -31913,7 +31914,7 @@ Partial Class Ventas CveMetodoPago = Dr("CveMetodoPago33").ToString().ToEntero() Next - If EsRemisionMedica Then + If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 AndAlso 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), "") @@ -36949,8 +36950,14 @@ Partial Class Ventas If DdlClientesModal.SelectedValue.ToEntero > 0 Then ViewState("CveCliente") = DdlClientesModal.SelectedValue.ToEntero Else - Alert("Debe de seleccionar un cliente.", TipoMensaje.MsgAdvertencia) - Exit Sub + Dim CveClientePublicoGeneral As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCliente", " RFC = 'XAXX010101000' ").ToEntero + + If CveClientePublicoGeneral > 0 Then + ViewState("CveCliente") = CveClientePublicoGeneral + Else + Alert("Debe de seleccionar un cliente.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If End If