From 85a65dd637f37eec0367514b51c499fa6df47904 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Fri, 23 Feb 2024 08:38:28 -0700 Subject: [PATCH] SMS - 2024.02.22 --- App_Code/ClsOS.vb | 6 +- Inventarios/EntradasSalidas.aspx.vb | 1 + Inventarios/PaquetesArmadoDesarmado.aspx | 21 ++- Inventarios/PaquetesArmadoDesarmado.aspx.vb | 140 ++++++++++++++++++-- OS/Asignaciones.aspx | 2 + OS/Asignaciones.aspx.vb | 1 + OS/OrdenesServicios.aspx | 22 +++ OS/OrdenesServicios.aspx.vb | 6 +- 8 files changed, 181 insertions(+), 18 deletions(-) diff --git a/App_Code/ClsOS.vb b/App_Code/ClsOS.vb index 2e6ca0934..a36292b85 100644 --- a/App_Code/ClsOS.vb +++ b/App_Code/ClsOS.vb @@ -73,7 +73,7 @@ Public Class ClsOS Public Property CveVenta As Integer = -1 Public Property Paciente As String Public Property IdentificadorCliente As String - + Public Property FolioAdicional As String Private Class Especificaciones Public CveValor As Integer Public CvePSCaracteristica As Integer @@ -595,6 +595,7 @@ Public Class ClsOS Me.Paciente = Data.Rows(0)("Paciente").ToString Me.IdentificadorCliente = Data.Rows(0)("IdentificadorCliente").ToString Me.CveVenta = Data.Rows(0)("CveVenta").ToString.ToEntero + Me.FolioAdicional = Data.Rows(0)("FolioAdicional").ToString End If Retorno = True @@ -1308,7 +1309,7 @@ Public Class ClsOS Return Retorno End Function - Public Function UpdateVentaOS(CveVenta As Integer, CveOS As Integer, Optional Paciente As String = "-1", Optional Episodio As String = "-1") As Boolean + Public Function UpdateVentaOS(CveVenta As Integer, CveOS As Integer, Optional Paciente As String = "-1", Optional Episodio As String = "-1", Optional FolioAdicional As String = "") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OS_UpdateVentaOS") @@ -1318,6 +1319,7 @@ Public Class ClsOS .Add("@CveOS", SqlDbType.Int).Value = CveOS .Add("@Paciente", SqlDbType.VarChar).Value = Paciente .Add("@Episodio", SqlDbType.VarChar).Value = Episodio + .Add("@FolioAdicional", SqlDbType.VarChar).Value = FolioAdicional End With Try diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 403b0c491..d61738a69 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -406,6 +406,7 @@ Partial Class Inventarios_EntradasSalidas EsConsumoInterno = False EsNuevoMov = False CvePrePoliza = -1 + CveEntregaAlmacen = -1 CreaDT() CargaCombos() diff --git a/Inventarios/PaquetesArmadoDesarmado.aspx b/Inventarios/PaquetesArmadoDesarmado.aspx index 21ddd8875..eae51d129 100644 --- a/Inventarios/PaquetesArmadoDesarmado.aspx +++ b/Inventarios/PaquetesArmadoDesarmado.aspx @@ -220,26 +220,42 @@ DataKeyNames="Cantidad,CvePS,CveUM,Consec,AplicaSeccion,AplicaSerie,AplicaCaducidad,AplicaLote,CodigoPS" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron datos con los filtros especificados" CssClass="table table-striped table-hover Widthall" BorderColor="#D3D3D3" GridLines="None"> - - + <%--0--%> + + <%--1--%> + + <%--2--%> + <%--3--%> + <%--4--%> + <%--5--%> + <%--6--%> + + + + + + + + <%--7--%> + <%--8--%> @@ -273,6 +289,7 @@ + <%--9--%> diff --git a/Inventarios/PaquetesArmadoDesarmado.aspx.vb b/Inventarios/PaquetesArmadoDesarmado.aspx.vb index 4e1ff1e29..30f4d5d8d 100644 --- a/Inventarios/PaquetesArmadoDesarmado.aspx.vb +++ b/Inventarios/PaquetesArmadoDesarmado.aspx.vb @@ -363,8 +363,15 @@ Partial Class Inventarios_PaquetesArmadoDesarmado GvDatosArmado.Columns(4).Visible = DtDatosArmado.MAX("AplicaSerie", "") = "True" GvDatosArmado.Columns(5).Visible = DtDatosArmado.MAX("AplicaSeccion") = "True" - GvDatosArmado.Columns(6).Visible = DtDatosArmado.MAX("AplicaLote") = "True" - GvDatosArmado.Columns(7).Visible = DtDatosArmado.MAX("AplicaCaducidad") = "True" + GvDatosArmado.Columns(7).Visible = DtDatosArmado.MAX("AplicaLote") = "True" + GvDatosArmado.Columns(8).Visible = DtDatosArmado.MAX("AplicaCaducidad") = "True" + + If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then + GvDatosArmado.Columns(6).Visible = True + GvDatosArmado.Columns(7).Visible = False + GvDatosArmado.Columns(8).Visible = False + End If + 'If ErrorExistencias Then ' GvDatosArmado.Columns(4).Visible = False @@ -476,6 +483,13 @@ Partial Class Inventarios_PaquetesArmadoDesarmado GvDatosArmado.Columns(6).Visible = DtDatosDesArmado.MAX("AplicaLote") = "True" GvDatosArmado.Columns(7).Visible = DtDatosDesArmado.MAX("AplicaCaducidad") = "True" + + If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then + GvDatosArmado.Columns(6).Visible = True + GvDatosArmado.Columns(7).Visible = False + GvDatosArmado.Columns(8).Visible = False + End If + BtnGuadarDesarmado.Visible = True TotalDesarmado.Visible = True @@ -534,21 +548,48 @@ Partial Class Inventarios_PaquetesArmadoDesarmado End If - If gvr.DataKey("AplicaLote") = "True" Then - If gvr.FCTextBox("TxtLote").Text.Trim = "" Then - Alert("Es necesario ingresas todos los lotes de los componentes.", TipoMensaje.MsgAdvertencia) - Exit Sub + If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then + + Dim DdlCaducidadProducto As DropDownList = gvr.FCDropDownList("DdlCaducidadProducto") + Dim ArrayCaducidad As String() = DdlCaducidadProducto.SelectedValue.Split("|"c) + Dim Lote As String = ArrayCaducidad(0) + Dim FechaCaducidad As String = ArrayCaducidad(1) + + If gvr.DataKey("AplicaLote") = "True" Then + If Lote = "" Then + Alert("Es necesario ingresas todos los lotes de los componentes.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + End If + + If gvr.DataKey("AplicaCaducidad") = "True" Then + + If FechaCaducidad.ToDate <= MinFecha Then + Alert("Es necesario ingresas todos las fechas de caducidad de los componentes.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + End If + + Else + If gvr.DataKey("AplicaLote") = "True" Then + If gvr.FCTextBox("TxtLote").Text.Trim = "" Then + Alert("Es necesario ingresas todos los lotes de los componentes.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + End If + + If gvr.DataKey("AplicaCaducidad") = "True" Then + + If gvr.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha Then + Alert("Es necesario ingresas todos las fechas de caducidad de los componentes.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + End If End If - If gvr.DataKey("AplicaCaducidad") = "True" Then - If gvr.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha Then - Alert("Es necesario ingresas todos las fechas de caducidad de los componentes.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - - End If Next Case 2 ' DESARMADO @@ -645,6 +686,15 @@ Partial Class Inventarios_PaquetesArmadoDesarmado FechaCaducidad = If(CBool(GvRow.DataKey("AplicaCaducidad")) AndAlso GvRow.FCTextBox("TxtCaducidad").ToString().ToDate > MinFecha, GvRow.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha) Lote = If(CBool(GvRow.DataKey("AplicaLote")), GvRow.FCTextBox("TxtLote").Text.Trim, "-1") + If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then + + Dim DdlCaducidadProducto As DropDownList = GvRow.FCDropDownList("DdlCaducidadProducto") + Dim ArrayCaducidad As String() = DdlCaducidadProducto.SelectedValue.Split("|"c) + Lote = ArrayCaducidad(0) + FechaCaducidad = ArrayCaducidad(1).ToDate + + End If + Dim Existencia As Decimal = ObjInventarioVal.GetExistenciasPS(GvRow.DataKey("CvePS").ToEntero, GvRow.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenArmado.SelectedValue.ToEntero(), FechaMovto:=TxtFechaArmado.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:="-1", Lote:=Lote, FechaCaducidad:=FechaCaducidad) @@ -750,6 +800,16 @@ Partial Class Inventarios_PaquetesArmadoDesarmado If Gvr.DataKey("Cantidad").ToString.ToDouble > 0 Then Dim Lote As String = If(Gvr.FCTextBox("TxtLote").Text = "", "-1", Gvr.FCTextBox("TxtLote").Text) Dim FechaCaducidad As String = If(Gvr.FCTextBox("TxtCaducidad").Text = "", "-1", Gvr.FCTextBox("TxtCaducidad").Text) + + If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then + + Dim DdlCaducidadProducto As DropDownList = Gvr.FCDropDownList("DdlCaducidadProducto") + Dim ArrayCaducidad As String() = DdlCaducidadProducto.SelectedValue.Split("|"c) + Lote = ArrayCaducidad(0) + FechaCaducidad = ArrayCaducidad(1) + + End If + Dim CveSeccionAlmacen As Integer = Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero() If CBool(Gvr.DataKey("AplicaSerie")) Then For Each Dr As DataRow In DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr.DataKey("Consec").ToEntero)).Rows @@ -1134,10 +1194,64 @@ Partial Class Inventarios_PaquetesArmadoDesarmado e.Row.FCButton("BtnDividir").CommandArgument = e.Row.RowIndex.ToString() e.Row.FCTextBox("TxtDividir").Attributes.Add("onkeyup", String.Format("LimitaCantidad({0},this,'{1}');", e.Row.DBCampo("Cantidad"), e.Row.FCButton("BtnDividir").ClientID)) + + 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 + End If End Sub + Protected Sub DdlCaducidadProducto_SelectedIndexChanged(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, DropDownList)).NamingContainer, GridViewRow) + + Dim AplicaLote As Boolean = Boolean.Parse(GvRow.DataKey("AplicaLote")) + Dim AplicaCaducidad As Boolean = Boolean.Parse(GvRow.DataKey("AplicaCaducidad")) + Dim DdlCaducidadProducto As DropDownList = GvRow.FCDropDownList("DdlCaducidadProducto") + + Dim ArrayCaducidad As String() = DdlCaducidadProducto.SelectedValue.Split("|"c) + Dim Lote As String = ArrayCaducidad(0) + Dim FechaCaducidad As String = ArrayCaducidad(1) + + + + If AplicaLote Then + GvRow.FCTextBox("TxtLote").Text = Lote + End If + + If AplicaCaducidad Then + GvRow.FCTextBox("TxtCaducidad").Text = FechaCaducidad + End If + + UpDatosArmado.Update() + + End Sub + + Private Sub CargarCaducidadProducto(CvePS As Integer, ByRef DdlLoteFechaCaducidad As DropDownList) + + Dim almacenes As String = DdlAlmacenArmado.SelectedValue + If almacenes = "" Then + almacenes = "-1" + End If + + Dim ObjInventarios As New ClsInventarios + + If ObjInventarios.GetExistenciasCaducidad(CvePS, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, almacenes) Then + + For Each dr As DataRow In ObjInventarios.DtResultados.Rows + DdlLoteFechaCaducidad.Items.Add(New ListItem($"Lote: {dr("Lote").ToString} - Cad: {dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}", $"{dr("Lote").ToString}|{dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}")) + Next + + End If + ObjInventarios.Dispose() + + End Sub + + Protected Sub Dividir(sender As Object, e As EventArgs) Dim index2 As Integer = 0 diff --git a/OS/Asignaciones.aspx b/OS/Asignaciones.aspx index de229e14f..94bcafe1c 100644 --- a/OS/Asignaciones.aspx +++ b/OS/Asignaciones.aspx @@ -234,6 +234,8 @@ + <%--11--%> + diff --git a/OS/Asignaciones.aspx.vb b/OS/Asignaciones.aspx.vb index 606b38ad7..c43b6ebb1 100644 --- a/OS/Asignaciones.aspx.vb +++ b/OS/Asignaciones.aspx.vb @@ -100,6 +100,7 @@ Partial Class OS_Asignaciones GvNA.Columns(7).Visible = True GvNA.Columns(8).Visible = True + GvNA.Columns(11).Visible = True GvNA.Columns(2).HeaderText = "Hospital" diff --git a/OS/OrdenesServicios.aspx b/OS/OrdenesServicios.aspx index bbe58e696..9473ff5d1 100644 --- a/OS/OrdenesServicios.aspx +++ b/OS/OrdenesServicios.aspx @@ -290,6 +290,27 @@ +
+ +
+ Folio Adicional: +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+ @@ -1321,6 +1342,7 @@ +
diff --git a/OS/OrdenesServicios.aspx.vb b/OS/OrdenesServicios.aspx.vb index 3546aa177..c287ceff2 100644 --- a/OS/OrdenesServicios.aspx.vb +++ b/OS/OrdenesServicios.aspx.vb @@ -733,6 +733,10 @@ Partial Class OS_OrdenesServicios TxtPaciente.Text = ObjOS.Paciente TxtIdentificadorCliente.Text = ObjOS.IdentificadorCliente + LblFolioAdicional.Text = ObjOS.FolioAdicional + DivFolioAdicional.Visible = If(ObjOS.FolioAdicional.Trim.Length > 0, True, False) + + CargaEventoBitacora() CargaHistorial() @@ -3314,7 +3318,7 @@ Partial Class OS_OrdenesServicios ProcesoOK = False End If If ProcesoOK Then - If Not ObjOS.UpdateVentaOS(Respuesta.CveVenta, CveOS, TxtPacienteModal.Text.Trim, TxtEpisodioModal.Text.Trim) Then + If Not ObjOS.UpdateVentaOS(Respuesta.CveVenta, CveOS, TxtPacienteModal.Text.Trim, TxtEpisodioModal.Text.Trim, FolioAdicional:=TxtFolioRemisionModal.Text.Trim) Then ProcesoOK = False End If End If