Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -76,11 +76,17 @@ Public Class ClsVentas
|
||||
SqlTransacc.Rollback()
|
||||
End Sub
|
||||
|
||||
Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing)
|
||||
Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing, Optional UsuarioActual As Usuario = Nothing)
|
||||
|
||||
If TransaccionCompartida Is Nothing Then
|
||||
SqlConexion = New SqlConnection
|
||||
SqlConexion.ConnectionString = ClsPaginas.UsuarioActualRutaDB
|
||||
|
||||
If UsuarioActual IsNot Nothing Then
|
||||
SqlConexion.ConnectionString = UsuarioActual.RutaDB
|
||||
Else
|
||||
SqlConexion.ConnectionString = ClsPaginas.UsuarioActualRutaDB
|
||||
End If
|
||||
|
||||
Try
|
||||
SqlConexion.Open()
|
||||
Catch ex As Exception
|
||||
|
||||
@@ -646,7 +646,7 @@ Partial Class Bancos_IE
|
||||
If UsuarioActual.Empresa.Funcionalidad(590) = "1" Then
|
||||
DivOtrosIngresosEgresos.Visible = True
|
||||
End If
|
||||
If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso UsuarioActual.CveRol = 1 Then
|
||||
If UsuarioActual.CveRol = 1 Then
|
||||
ChkAnticipoPuntual.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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
|
||||
@@ -10772,7 +10772,7 @@ Partial Class Ventas
|
||||
Else
|
||||
Dim capturedContext = HttpContext.Current
|
||||
Dim strURLHOST As String = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
|
||||
Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, Factura, UsuarioActual, strURLHOST, EsHilo:=True, Contexto:=capturedContext))
|
||||
Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, Factura, UsuarioActual, strURLHOST, UsarDescargaDesdePopUpVerFactura:=True))
|
||||
Hilo.Start()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
@@ -10905,10 +10905,6 @@ Partial Class Ventas
|
||||
|
||||
GeneraPDFCotizacion(ChkEnviarFactura.Checked) ' MANDA CORREO
|
||||
End If
|
||||
ElseIf DdlTipoComprobante.SelectedValue = "Rem" Then
|
||||
If UsuarioActual.CveEmpresa.Contiene(81, 109) Then
|
||||
EnviaPDFRemision(ChkEnviarFactura.Checked)
|
||||
End If
|
||||
End If
|
||||
|
||||
'ENVIA CORREO CON DETALLE DEL CONTRATO
|
||||
@@ -16310,13 +16306,7 @@ Partial Class Ventas
|
||||
''' <param name="strURLHOST"></param>
|
||||
''' <param name="CorreoCRM"></param>
|
||||
''' <param name="UsarDescargaDesdePopUpVerFactura"></param>
|
||||
Private Sub GeneraPDFFactura(EnviaCorreo As Boolean, Factura As Modelos.Factura, UsuarioActual As Usuario, strURLHOST As String, Optional CorreoCRM As String = "", Optional UsarDescargaDesdePopUpVerFactura As Boolean = True,
|
||||
Optional EsHilo As Boolean = False, Optional Contexto As HttpContext = Nothing)
|
||||
|
||||
If EsHilo Then
|
||||
HttpContext.Current = Contexto
|
||||
HttpContext.Current.Session("UsuarioSIG") = UsuarioActual
|
||||
End If
|
||||
Private Sub GeneraPDFFactura(EnviaCorreo As Boolean, Factura As Modelos.Factura, UsuarioActual As Usuario, strURLHOST As String, Optional CorreoCRM As String = "", Optional UsarDescargaDesdePopUpVerFactura As Boolean = True)
|
||||
|
||||
'GUARDA PDF
|
||||
Dim LocalSerieFolio As String = String.Empty
|
||||
@@ -16368,7 +16358,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
If ErrorCorreo Then
|
||||
Dim ObjVentas As New ClsVentas
|
||||
Dim ObjVentas As New ClsVentas(UsuarioActual:=UsuarioActual)
|
||||
If EnviaCorreo Then
|
||||
ObjVentas.UpdateVentaMail(3, CveVenta)
|
||||
Else
|
||||
@@ -16428,8 +16418,7 @@ Partial Class Ventas
|
||||
Try
|
||||
' BytesPdfCotizacion(CveVenta)
|
||||
Dim capturedContext = HttpContext.Current
|
||||
Dim Hilo As New System.Threading.Thread(Sub() MandaMails(UsuarioActual, CveVenta, DdlTipoComprobante.SelectedValue.ToString(), LocalSerieFolio, ChkEnviarFactura.Checked, ArchivoXML, ArchivoPDF, ArchivoAdjunto, CorreoContactoCRM:=CorreoContactoCRM,
|
||||
EsHilo:=True, Contexto:=capturedContext))
|
||||
Dim Hilo As New System.Threading.Thread(Sub() MandaMails(UsuarioActual, CveVenta, DdlTipoComprobante.SelectedValue.ToString(), LocalSerieFolio, ChkEnviarFactura.Checked, ArchivoXML, ArchivoPDF, ArchivoAdjunto, CorreoContactoCRM:=CorreoContactoCRM))
|
||||
Hilo.Start()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió error al mandar Mail", ex)
|
||||
@@ -16444,55 +16433,6 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Private Sub EnviaPDFRemision(EnviaCorreo As Boolean)
|
||||
'MANDA CORREO
|
||||
If EnviaCorreo Then
|
||||
|
||||
'GUARDA PDF
|
||||
Dim pdf As Byte() = Nothing
|
||||
Dim LocalSerieFolio As String = String.Empty
|
||||
Dim LocalTipoDocto As String = String.Empty
|
||||
|
||||
'TIMBRADO NUEVO
|
||||
Try
|
||||
pdf = PdfFactura(ObjFactura, AplicaPagare:="1")
|
||||
Catch ex As Exception
|
||||
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgError)
|
||||
End Try
|
||||
|
||||
If CveVenta > 0 Then
|
||||
ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False, CargaDTDetalle:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False)
|
||||
End If
|
||||
|
||||
LocalSerieFolio = ObjFactura.SerieFolio
|
||||
LocalTipoDocto = ObjFactura.TipoDocto
|
||||
Dim ArchivoAdjunto As String = ""
|
||||
|
||||
Dim ArchivoXML As String = String.Format("{0}XML\{1}\{2}.xml", UsuarioActual.Empresa.Ruta, LocalTipoDocto, LocalSerieFolio)
|
||||
Dim ArchivoPDF As String = String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, LocalTipoDocto, LocalSerieFolio)
|
||||
If Adjunto <> "" Then
|
||||
ArchivoAdjunto = String.Format("{0}Ventas\{1}", UsuarioActual.Empresa.Ruta, Adjunto)
|
||||
End If
|
||||
|
||||
Try
|
||||
' BytesPdfCotizacion(CveVenta)
|
||||
Dim capturedContext = HttpContext.Current
|
||||
Dim Hilo As New System.Threading.Thread(Sub() MandaMails(UsuarioActual, CveVenta, DdlTipoComprobante.SelectedValue.ToString(), LocalSerieFolio, ChkEnviarFactura.Checked, ArchivoXML, ArchivoPDF, ArchivoAdjunto,
|
||||
EsHilo:=True, Contexto:=capturedContext))
|
||||
Hilo.Start()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió error al mandar Mail", ex)
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ChkEnviarFactura.Checked Then
|
||||
ObjVentas.UpdateVentaMail(3, CveVenta)
|
||||
Else
|
||||
ObjVentas.UpdateVentaMail(0, CveVenta)
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
End Try
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " ANTICIPOS "
|
||||
@@ -17118,7 +17058,7 @@ Partial Class Ventas
|
||||
|
||||
For Each gvr As GridViewRow In GVAnticipos.Rows
|
||||
If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked AndAlso gvr.DataKey("CveConceptoContable").ToEntero().Contiene(12, 66, 277) Then
|
||||
Amortizacion += gvr.FCTextBox(String.Format("TxtAnticipo{0}", gvr.RowIndex)).Text.ToDecimal ' - ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("TotalAnticipo").ToDecimal) * gvr.DataKey("IVAAnticipo").ToDecimal)
|
||||
Amortizacion += gvr.FCTextBox(String.Format("TxtAnticipo{0}", gvr.RowIndex)).Text.ToDecimal
|
||||
End If
|
||||
Next
|
||||
|
||||
@@ -17313,7 +17253,7 @@ Partial Class Ventas
|
||||
Dim capturedContext = HttpContext.Current
|
||||
Dim strURLHOST As String = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
|
||||
Dim Factura As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False, CargaDTDetalle:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False, VerificaAlmacen:=False)
|
||||
Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, Factura, UsuarioActual, strURLHOST, EsHilo:=True, Contexto:=capturedContext))
|
||||
Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, Factura, UsuarioActual, strURLHOST, UsarDescargaDesdePopUpVerFactura:=True))
|
||||
Hilo.Start()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al enviar el PDF", ex)
|
||||
@@ -21927,13 +21867,7 @@ Partial Class Ventas
|
||||
#End Region
|
||||
|
||||
#Region " MANDA CORREO "
|
||||
Private Sub MandaMails(UsuarioActual As Usuario, CveVenta As Integer, TipoDocto As String, SerieFolio As String, EnviarFactura As Boolean, XML As String, PDF As String, Adjunto As String, Optional CorreoContactoCRM As String = "",
|
||||
Optional EsHilo As Boolean = False, Optional Contexto As HttpContext = Nothing)
|
||||
|
||||
If EsHilo Then
|
||||
HttpContext.Current = Contexto
|
||||
HttpContext.Current.Session("UsuarioSIG") = UsuarioActual
|
||||
End If
|
||||
Private Sub MandaMails(UsuarioActual As Usuario, CveVenta As Integer, TipoDocto As String, SerieFolio As String, EnviarFactura As Boolean, XML As String, PDF As String, Adjunto As String, Optional CorreoContactoCRM As String = "")
|
||||
|
||||
Dim ObjMail As New ClsSisMail()
|
||||
Dim ResultadoMail As Integer = 0
|
||||
@@ -22066,7 +22000,7 @@ Partial Class Ventas
|
||||
OnError("Ocurrió error al mandar el Mail", ex)
|
||||
ResultadoMail = 3
|
||||
Finally
|
||||
Dim ObjVentas As New ClsVentas
|
||||
Dim ObjVentas As New ClsVentas(UsuarioActual:=UsuarioActual)
|
||||
ObjVentas.UpdateVentaMail(ResultadoMail, CveVenta)
|
||||
ObjVentas.Dispose()
|
||||
End Try
|
||||
|
||||
Reference in New Issue
Block a user