From 81b1d1b74d165cd9e33c6d32aa9d6c5027946ae7 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Sat, 10 Feb 2024 16:20:01 -0700 Subject: [PATCH] SMS - 2024.02.09 Ventas pago Directo agregar agregar cliente, rep cirugias agregar filtros hospitales y especialidades --- App_Code/ClsOS.vb | 4 ++- Ashx/SIGWeb.ashx | 2 +- OS/RepOSMedicas.aspx | 64 ++++++++++++++++++++++------------------- OS/RepOSMedicas.aspx.vb | 45 ++++++++++++++++++++++++++++- Ventas/Ventas.aspx | 15 +++++++++- Ventas/Ventas.aspx.vb | 61 ++++++++++++++++++++++++++++++++++----- 6 files changed, 151 insertions(+), 40 deletions(-) diff --git a/App_Code/ClsOS.vb b/App_Code/ClsOS.vb index 3e736c02e..2e6ca0934 100644 --- a/App_Code/ClsOS.vb +++ b/App_Code/ClsOS.vb @@ -497,7 +497,7 @@ Public Class ClsOS Public Function GetRepOrdenesServicioMedicasRep(FechaI As Date, FechaF As Date, CveCliente As Integer, CveVendedor As Integer, CveEstatusOrdenServicio As Integer, CveUsuarioAtendio As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, - Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1) As Boolean + Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveEspecialidad As Integer = -1, Optional CveClienteSucursal As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OS_OrdenesServiciosMedicasRepGet") @@ -514,6 +514,8 @@ Public Class ClsOS .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveMedico", SqlDbType.Int).Value = CveMedico .Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento + .Add("@CveEspecialidad", SqlDbType.Int).Value = CveEspecialidad + .Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal End With diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index 82169dccc..9643390ac 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -871,7 +871,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Dim CvePS = IfNull(context.Request("cveps"), "0").ToString.ToEntero Dim objInv As New ClsInventarios - If objInv.GetExistenciasProducto(CvePS, -1, CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm")) Then + If objInv.GetExistenciasProducto(CvePS, -1, CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), BuscarEnTabla:=True) Then ' limpio los almacenes donde no tiene ningun producto existencia For i As Integer = objInv.DtResultados.Columns.Count - 1 To 1 Step -1 diff --git a/OS/RepOSMedicas.aspx b/OS/RepOSMedicas.aspx index 621e7e27c..12630f200 100644 --- a/OS/RepOSMedicas.aspx +++ b/OS/RepOSMedicas.aspx @@ -98,7 +98,7 @@
-
@@ -109,11 +109,11 @@ diff --git a/OS/RepOSMedicas.aspx.vb b/OS/RepOSMedicas.aspx.vb index a231dbf39..830315c54 100644 --- a/OS/RepOSMedicas.aspx.vb +++ b/OS/RepOSMedicas.aspx.vb @@ -80,6 +80,48 @@ Partial Class OS_RepOSMedicas DdlProcedimiento.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ") DdlProcedimiento.DataBind() + + + Dim ObjVentas As New ClsVentas + + If ObjVentas.GetMedicosEspecialidades(-1, UsuarioActual.CveEmpresa, -1) Then + DdlEspecialidad.DataSource = ObjVentas.DtResultados + Else + DdlEspecialidad.DataSource = Nothing + End If + + ObjVentas.Dispose() + + DdlEspecialidad.DataBind() + DdlEspecialidad.Items.Insert(0, New ListItem("Todas", "-1")) + + + Dim objcliente As New ClsClientes + + If objcliente.GetClienteSucursales(-1, UsuarioActual.CveEmpresa) Then + DdlClienteSucursal.DataSource = objcliente.DtResultados + Else + DdlClienteSucursal.DataSource = Nothing + End If + + objcliente.Dispose() + + DdlClienteSucursal.DataBind() + DdlClienteSucursal.Items.Insert(0, New ListItem("Todos", "-1")) + + + + 'Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False) + 'If EsWS Then + ' DdlCliente.setEsWebService(True) + + 'Else + ' DdlCliente.setEsWebService(False) + ' DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) + ' DdlCliente.DataBind() + ' DdlCliente.ddl.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) + 'End If + End Sub @@ -101,7 +143,8 @@ Partial Class OS_RepOSMedicas LnkPersonalizar.Visible = False If ObjOS.GetRepOrdenesServicioMedicasRep(FechaI, FechaF, Cvecliente, DdlVendedor.SelectedValue.ToEntero, DdlEstatusOS.SelectedValue.ToEntero, DdlTecnico.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, - CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero) Then + CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveEspecialidad:=DdlEspecialidad.SelectedValue.ToEntero, + CveClienteSucursal:=DdlClienteSucursal.SelectedValue.ToEntero) Then GvDatos.DataSource = ObjOS.DtResultados If ObjOS.DtResultados IsNot Nothing AndAlso ObjOS.DtResultados.Rows.Count > 0 Then LnkPersonalizar.Visible = True diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 592764f8e..2a4872d79 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -8430,7 +8430,7 @@ <%--Cliente Sucursales --%> -
+
+ <%--Cliente Solo se usa para en PAgo Directo --%> +
+
+
+ Cliente: + + +
+
+
+ + diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index df7f915bc..20e972ed0 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -539,6 +539,20 @@ Partial Class Ventas End Get End Property + + + Private Property CveClienteOS As Integer + Get + If ViewState("CveClienteOS") Is Nothing Then + ViewState("CveClienteOS") = -1 + End If + Return ViewState("CveClienteOS").ToString().ToEntero() + End Get + Set(value As Integer) + ViewState("CveClienteOS") = value + End Set + End Property + Private Property CveClienteSucursal As Integer Get If ViewState("CveClienteSucursal") Is Nothing Then @@ -36256,6 +36270,17 @@ Partial Class Ventas DdlClienteSucursal.DataBind() DdlClienteSucursal.Items.Insert(0, New ListItem("Seleccione uno", "-1")) + Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False) + If EsWS Then + DdlClientesModal.setEsWebService(True) + + Else + DdlClientesModal.setEsWebService(False) + DdlClientesModal.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) + DdlClientesModal.DataBind() + DdlClientesModal.ddl.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) + End If + End Sub Protected Sub ChkRequiereTecnico_CheckedChanged(sender As Object, e As EventArgs) @@ -36272,7 +36297,7 @@ Partial Class Ventas If RBLTipoVenta.SelectedValue.ToEntero > 0 Then DvModalTipoVentaPasoTipo.Visible = False - DvModalTipoVentaPasoCliente.Visible = True + DvModalTipoVentaClientesucursal.Visible = True DvModalTipoVentaPasoRequiereOS.Visible = True DvModalTipoVentaPasoMedicoProcedimiento.Visible = True @@ -36298,6 +36323,7 @@ Partial Class Ventas ChkRequiereTecnicoModal.Checked = True ChkRequiereTecnicoModal.Enabled = False DvModalRequiereOSFecha.Visible = True + DvModalTipoVentaCliente.Visible = True Case "3" 'A-Vista ChkRequiereTecnicoModal.Checked = False DvModalTipoVentaPasoRequiereOS.Visible = False @@ -36387,7 +36413,8 @@ Partial Class Ventas LnkDvModalTipoVentaAceptar.Visible = False DvModalTipoVentaPasoTipo.Visible = True - DvModalTipoVentaPasoCliente.Visible = False + DvModalTipoVentaClientesucursal.Visible = False + DvModalTipoVentaCliente.Visible = False DvModalTipoVentaPasoRequiereOS.Visible = False DvModalTipoVentaPasoMedicoProcedimiento.Visible = False @@ -36420,15 +36447,35 @@ Partial Class Ventas Protected Sub LnkDvModalTipoVentaAceptar_Click(sender As Object, e As EventArgs) + If RBLTipoVenta.SelectedValue.ToEntero = 2 Then + + If DdlClientesModal.SelectedValue.ToEntero > 0 Then + ViewState("CveCliente") = DdlClientesModal.SelectedValue.ToEntero + Else + Alert("Debe de seleccionar un cliente.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If - If DdlClienteSucursalCliente() > 0 Then - ViewState("CveCliente") = DdlClienteSucursalCliente() + If DdlClienteSucursalCliente() > 0 Then + CveClienteOS = DdlClienteSucursalCliente() + Else + Alert("Debe de seleccionar un hospital.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + Else - Alert("Debe de seleccionar un cliente.", TipoMensaje.MsgAdvertencia) - Exit Sub + If DdlClienteSucursalCliente() > 0 Then + ViewState("CveCliente") = DdlClienteSucursalCliente() + CveClienteOS = CveCliente + Else + Alert("Debe de seleccionar un cliente.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If End If + + If ChkRequiereTecnicoModal.Checked Then If Not IsDate(TxtFechaModal.Text.Replace(",", "")) Then Alert("El campo fecha no es valido.", TipoMensaje.MsgAdvertencia) @@ -36640,7 +36687,7 @@ Partial Class Ventas Dim EstatusOrdenServicio As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 1").ToEntero - If ObjOrdenServicio.AddOrdenesServicios(CveCliente, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.Nombre, TxtFechaOS.Text.Replace(",", "").ToDateTime, $"Venta: {LblSerie.Text}-{TxtFolio.Text}", UsuarioActual.CveUsuario, EstatusOrdenServicio, + If ObjOrdenServicio.AddOrdenesServicios(CveClienteOS, 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,