This commit is contained in:
2024-04-20 14:40:04 -07:00
5 changed files with 187 additions and 71 deletions

View File

@@ -1588,7 +1588,7 @@ Public Class ClsInventarios
End Function
Public Function GetKardex(Entrada As Boolean, Salida As Boolean, CvePS As Integer, FechaI As String, FechaF As String, CveAlmacen As Integer, CveTiposAlmacen As String, CveUnidadMedida As Integer, CveUsuario As Integer, CveEmpresa As Integer,
Optional AgruparAlmacen As Boolean = False, Optional Serie As String = "-1", Optional CveAlmacenes As String = "-1") As Boolean
Optional AgruparAlmacen As Boolean = False, Optional Serie As String = "-1", Optional CveAlmacenes As String = "-1", Optional CveMarca As Integer = -1, Optional CveProveedor As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_KardexGet")
@@ -1607,6 +1607,8 @@ Public Class ClsInventarios
.Add("@AgruparAlmacen", SqlDbType.Bit).Value = AgruparAlmacen
.Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@CveAlmacenes", SqlDbType.VarChar).Value = CveAlmacenes
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
End With
@@ -1626,7 +1628,8 @@ Public Class ClsInventarios
End Function
Public Function GetKardexPSNavegacion(Entrada As Boolean, Salida As Boolean, CvePS As Integer, FechaI As String, FechaF As String, CveAlmacen As Integer, CveTiposAlmacen As String, CveUnidadMedida As Integer, CveUsuario As Integer, CveEmpresa As Integer,
Optional CveAlmacenes As String = "-1", Optional Siguiente As Boolean = True, Optional CodigoInicio As String = "-1", Optional CodigoFin As String = "-1") As Boolean
Optional CveAlmacenes As String = "-1", Optional Siguiente As Boolean = True, Optional CodigoInicio As String = "-1", Optional CodigoFin As String = "-1", Optional CveMarca As Integer = -1,
Optional CveProveedor As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -1647,6 +1650,8 @@ Public Class ClsInventarios
.Add("@Siguiente", SqlDbType.Bit).Value = Siguiente
.Add("@CodigoInicio", SqlDbType.VarChar).Value = CodigoInicio
.Add("@CodigoFin", SqlDbType.VarChar).Value = CodigoFin
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
End With

View File

@@ -194,7 +194,7 @@
</div>
</div>
<label class="col-md-1 " style="max-width: 70px;">Fecha Fin:</label>
<label class="col-md-1 " style="max-width: 85px;">Fecha Fin:</label>
<div class="col-md-1" style="min-width: 115px;">
<div style="display: inline-block; vertical-align: text-bottom;">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 105px !important; padding: 0px;">
@@ -228,7 +228,7 @@
</asp:DropDownList>
</div>
<label class="col-md-1 truncate">Unidad Medida:</label>
<label class="col-md-1 truncate" style="max-width: 80px;">Unidad Medida:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlUnidadMedida" runat="server" CssClass="select2me " Style="width: 200px !important;" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida">
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
@@ -260,8 +260,19 @@
<div class="row" runat="server" visible="false" id="DVFiltroCodigo">
<div class="col-md-1">Código Inicio:</div>
<div class="col-md-2"><asp:TextBox runat="server" ID="TxtCodigoInicio" Height="26px"></asp:TextBox></div>
<div class="col-md-1">Código Fin:</div>
<div class="col-md-1" style="max-width: 80px;">Código Fin:</div>
<div class="col-md-2"><asp:TextBox runat="server" ID="TxtCodigoFinal" Height="26px"></asp:TextBox></div>
<div class="col-md-1" style="max-width: 85px;">Marca</div>
<div class="col-md-1" style="min-width: 150px;">
<asp:DropDownList ID="DdlMarca" CssClass="form-control input-sm select2me" CssStyle="width: 100%;" Width="100%" runat="server" DataTextField="Marca" DataValueField="CveMarca" >
<asp:ListItem Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1" style="max-width: 85px;">Proveedor:</div>
<div class="col-md-1" style="min-width: 150px;">
<ADS:Dropdownlost ID="DdlProveedores" runat="server" CssStyle="width: 100%;" Width="100%" DataTextField="RazonSocial" DataValueField="CveProveedor"></ADS:Dropdownlost>
</div>
<div class="col-md-1" runat="server" id="DVNavegar" >
<div class="row">
<div class="col-md-5">

View File

@@ -118,7 +118,27 @@ Partial Class Inventarios_Kardex
item.Selected = True
End If
Next
If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 Then
CargarMarcas()
End If
DdlProveedores.setEsWebService(True)
DdlProveedores.Attributes.Add("data-metodo", "getproveedores")
DdlProveedores.SelectedText = "Todos"
DdlProveedores.SelectedValue = "-1"
End Sub
Protected Sub CargarMarcas()
DdlMarca.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
DdlMarca.DataBind()
DdlMarca.Items.Insert(0, New ListItem("Todas", "-1"))
End Sub
Private Sub CargaFuncionalidad105()
ddlProducto2.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
@@ -333,7 +353,7 @@ Partial Class Inventarios_Kardex
Dim ObjInventarios As New ClsInventarios
If ObjInventarios.GetKardex(Entrada, Salida, CvePS, FechaI, FechaF, CveAlmacen, CveTiposAlmacen.Substring(0, CveTiposAlmacen.Length - 1), DdlUnidadMedida.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
ChkAgruparAlmacen.Checked, Serie, CveAlmacenes) Then
ChkAgruparAlmacen.Checked, Serie, CveAlmacenes, CveMarca:=DdlMarca.SelectedValue.ToEntero, CveProveedor:=DdlProveedores.SelectedValue.ToEntero) Then
dt = ObjInventarios.DtResultados.Copy
End If
ObjInventarios.Dispose()
@@ -608,7 +628,7 @@ Partial Class Inventarios_Kardex
Dim ObjInventarios As New ClsInventarios
If ObjInventarios.GetKardexPSNavegacion(Entrada, Salida, CvePS, FechaI, FechaF, CveAlmacen, CveTiposAlmacen.Substring(0, CveTiposAlmacen.Length - 1), DdlUnidadMedida.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
CveAlmacenes, Siguiente:=Siguiente, CodigoInicio:=CodigoInicio, CodigoFin:=CodigoFin) Then
CveAlmacenes, Siguiente:=Siguiente, CodigoInicio:=CodigoInicio, CodigoFin:=CodigoFin, CveMarca:=DdlMarca.SelectedValue.ToEntero, CveProveedor:=DdlProveedores.SelectedValue.ToEntero) Then
dt = ObjInventarios.DtResultados.Copy
End If
ObjInventarios.Dispose()
@@ -618,6 +638,7 @@ Partial Class Inventarios_Kardex
ddlProducto2.SelectedText = dt.Rows(0)("CodigoPS").ToString
ddlProducto2.txtValue.Value = dt.Rows(0)("CvePS").ToString
ddlProducto2.txtText.Value = dt.Rows(0)("CodigoPS").ToString
CargaDatos()
UPFiltros.Update()
UPDatos.Update()
End If

View File

@@ -1110,13 +1110,13 @@
<asp:TemplateField>
<HeaderTemplate>Fecha</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng") %>'></asp:Literal>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Fecha Agenda</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaInicio") %>'></asp:Literal>
<asp:Literal ID="FechaInicio" runat="server" Text='<%# Eval("FechaInicio") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
@@ -1131,6 +1131,14 @@
<asp:Literal ID="LtlEventoBitacora" runat="server" Text='<%# Eval("Descripcion") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Archivo</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="LinkArchivo" Visible="false" runat="server" CssClass="Texto" OnClick="DownloadFile">
<asp:Image ImageUrl="/Imagenes/Abajo.png" ID="ImgArchivo" runat="server" />
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="Titulos" />
<AlternatingRowStyle CssClass="TextoAlterno" />
@@ -1305,43 +1313,42 @@
<h4 class="modal-title" >Material Utilizado</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright" runat="server" visible="false" id="DvTxtPacienteModal">
<asp:TextBox ID="TxtPacienteModal" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtPacienteModal" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtPacienteModal"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Paciente''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMaterialUtilizado"></asp:RequiredFieldValidator>
<label for="<%= TxtPacienteModal.ClientID.ToString()%>">Paciente:</label>
</div>
<div class="form-group form-md-line-input input-iconright" runat="server" visible="false" id="DvTxtEpisodioModal">
<asp:TextBox ID="TxtEpisodioModal" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="20"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtEpisodioModal" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtEpisodioModal"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Episodio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMaterialUtilizado"></asp:RequiredFieldValidator>
<label for="<%= TxtEpisodioModal.ClientID.ToString()%>">Episodio:</label>
</div>
<div class="form-group form-md-line-input input-iconright" runat="server" visible="false" id="DvTxtFolioRemisionModal">
<asp:TextBox ID="TxtFolioRemisionModal" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="20"></asp:TextBox>
<label for="<%= TxtFolioRemisionModal.ClientID.ToString()%>">Folio:</label>
</div>
<div class="form-group form-md-line-input input-iconright" runat="server">
<asp:TextBox ID="TxtObservacionModal" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="250"></asp:TextBox>
<label for="<%= TxtFolioRemisionModal.ClientID.ToString()%>">Observaciones:</label>
</div>
</div>
<div class="col-md-6">
<asp:TextBox ID="AnexoManerialUtilizado" CssClass="ADSdropzone hidden" data-maxFile="1" Text="" runat="server"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright" runat="server" visible="false" id="DvTxtPacienteModal">
<asp:TextBox ID="TxtPacienteModal" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtPacienteModal" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtPacienteModal"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Paciente''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMaterialUtilizado"></asp:RequiredFieldValidator>
<label for="<%= TxtPacienteModal.ClientID.ToString()%>">Paciente:</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright" runat="server" visible="false" id="DvTxtEpisodioModal">
<asp:TextBox ID="TxtEpisodioModal" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="20"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtEpisodioModal" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtEpisodioModal"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Episodio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMaterialUtilizado"></asp:RequiredFieldValidator>
<label for="<%= TxtEpisodioModal.ClientID.ToString()%>">Episodio:</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright" runat="server" visible="false" id="DvTxtFolioRemisionModal">
<asp:TextBox ID="TxtFolioRemisionModal" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="20"></asp:TextBox>
<label for="<%= TxtFolioRemisionModal.ClientID.ToString()%>">Folio:</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group form-md-line-input input-iconright" runat="server" >
<asp:TextBox ID="TxtObservacionModal" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="250"></asp:TextBox>
<label for="<%= TxtFolioRemisionModal.ClientID.ToString()%>">Observaciones:</label>
</div>
</div>
</div>
<br />
<div class="row">

View File

@@ -4,6 +4,7 @@ Option Strict On
Imports Extensiones
Imports System.IO
Imports System.Data
Imports System.Data.SqlClient
Partial Class OS_OrdenesServicios
Inherits ClsPaginas
@@ -1608,21 +1609,7 @@ Partial Class OS_OrdenesServicios
End If
Return Mostrar
End Function
Protected Sub DownloadFile(ByVal sender As Object, ByVal e As EventArgs)
Dim filePath As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, CType(sender, LinkButton).CommandArgument)
Dim Archivo As New System.IO.FileInfo(filePath)
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.ClearContent()
HttpContext.Current.Response.ContentType = "application/octet-stream"
HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" + Path.GetFileName(filePath))
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
HttpContext.Current.Response.TransmitFile(filePath)
HttpContext.Current.Response.Flush()
HttpContext.Current.Response.End()
Archivo = Nothing
End Sub
Protected Sub BtnPSEspecificaciones_Click(sender As Object, e As EventArgs) Handles BtnPSEspecificaciones.Click
Dim Especificaciones As String = ""
Dim Mostrar As String = ""
@@ -1817,17 +1804,17 @@ Partial Class OS_OrdenesServicios
#End Region
#Region "E V E N T O - B I T A C O R A"
Protected Sub GVEventoBitacora_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEB.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = 200
e.Row.Cells(1).Width = 200
e.Row.Cells(2).Width = 100
e.Row.Cells(3).Width = 500
End If
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
End If
End Sub
'Protected Sub GVEventoBitacora_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEB.RowDataBound
' If e.Row.RowType = DataControlRowType.DataRow Then
' If e.Row.RowIndex = 0 Then
' e.Row.Cells(0).Width = 200
' e.Row.Cells(1).Width = 200
' e.Row.Cells(2).Width = 100
' e.Row.Cells(3).Width = 500
' End If
' e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
' End If
'End Sub
Protected Sub BtnGuardarEventoBitacora_Click(sender As Object, e As EventArgs) Handles BtnGuardarEventoBitacora.Click
Dim ObjEventoBitacora As New ClsOIEventos
@@ -3068,6 +3055,8 @@ Partial Class OS_OrdenesServicios
Protected Sub LnkModalMaterialUtilizado_Click(sender As Object, e As EventArgs)
Dim ProcesoOK As Boolean = True
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
If TxtPacienteModal.Text.Trim.Length = 0 Then
Alert("Debe de proporcionar el paciente.", TipoMensaje.MsgAdvertencia)
@@ -3104,7 +3093,7 @@ Partial Class OS_OrdenesServicios
End If
End If
Dim ProcesoOK As Boolean = True
Dim ObjV As New ClsVentas
Dim ObjOS As New ClsOS(ObjV.IniciaTransacSQL())
Dim ObjInventario As New ClsInventarios(ObjV.IniciaTransacSQL())
@@ -3308,6 +3297,10 @@ Partial Class OS_OrdenesServicios
End If
End If
If ProcesoOK Then
ProcesoOK = GuardarArchivoConfirmacion(ObjV.IniciaTransacSQL, CveOS)
End If
If ProcesoOK Then
ObjV.Commit()
@@ -3323,6 +3316,7 @@ Partial Class OS_OrdenesServicios
End If
RegistraScript("$('#DivModalMaterialUtilizado').modal('hide');")
CargaEventoBitacora()
Else
ObjV.RollBack()
Alert("Se presento un error al guardar el material", TipoMensaje.MsgAdvertencia)
@@ -3332,6 +3326,48 @@ Partial Class OS_OrdenesServicios
End Sub
Private Function GuardarArchivoConfirmacion(ByRef transaccion As SqlTransaction, CveOSActual As Integer) As Boolean
Dim respuesta As Boolean = False
Dim ObjEventoBitacora As New ClsOIEventos(transaccion)
Dim FileExtension As String = "-1"
Dim Filesgral As List(Of Archivo) = AnexoManerialUtilizado.getfiles().Archivos
Dim Filename As String = ""
For Each fileItem As Archivo In Filesgral
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
Filename = fileItem.filename
Next
If Filename = String.Empty Then
respuesta = True
Else
If ObjEventoBitacora.AddEventoBitacora("Documento de Confirmación", String.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveOS:=CveOSActual) Then
If Filename <> "" Then
Try
Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False)
respuesta = True
Catch ex As Exception
Alert("Error al mover archivo de confirmación", TipoMensaje.MsgAdvertencia)
respuesta = False
End Try
End If
AnexoManerialUtilizado.Text = "[]"
End If
End If
Return respuesta
End Function
Private Function GeneraRemision(CveVentaPedido As Integer, ByRef TransaccionSQL As SqlClient.SqlTransaction) As RespuestaFacturacion
Dim Respuesta As New RespuestaFacturacion()
@@ -3428,4 +3464,40 @@ Partial Class OS_OrdenesServicios
ObjOs.Dispose()
End Sub
Protected Sub GVEventoBitacora_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEB.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
'If e.Row.RowIndex = 0 Then
' e.Row.Cells(0).Width = Unit.Pixel(200)
' e.Row.Cells(1).Width = Unit.Pixel(200)
' e.Row.Cells(2).Width = Unit.Pixel(100)
' e.Row.Cells(3).Width = Unit.Pixel(500)
'End If
If e.Row.DBCampo("Archivo").ToString <> "" Then
e.Row.FCLinkButton("LinkArchivo").Visible = True
e.Row.FCLinkButton("LinkArchivo").CommandArgument = String.Format("OI\{0}", e.Row.DBCampo("Archivo").ToString)
ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("LinkArchivo")) 'Registro un evento Postbacktrigger, que recargue toda la pagina para que funcione
End If
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
End If
End Sub
Protected Sub DownloadFile(ByVal sender As Object, ByVal e As EventArgs)
Dim filePath As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, CType(sender, LinkButton).CommandArgument)
Dim Archivo As New System.IO.FileInfo(filePath)
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.ClearContent()
HttpContext.Current.Response.ContentType = "application/octet-stream"
HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" + Path.GetFileName(filePath))
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
HttpContext.Current.Response.TransmitFile(filePath)
HttpContext.Current.Response.Flush()
HttpContext.Current.Response.End()
Archivo = Nothing
End Sub
End Class