-
This commit is contained in:
@@ -134,6 +134,9 @@
|
||||
<td>
|
||||
<asp:Label Text="" ID="LbCliente" runat="server" />
|
||||
</td>
|
||||
<td style="text-align:right">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Folio:</td>
|
||||
@@ -141,18 +144,23 @@
|
||||
<asp:HyperLink ID="HLFolio" Target="_blank" runat="server" />
|
||||
<%--<asp:Label Text="" ID="LbFolio" runat="server" />--%>
|
||||
</td>
|
||||
<td>
|
||||
<asp:LinkButton ID="BtnArchivoAdjunto" runat="server" Visible="false" Text="" Font-Size="14px" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="trObsGral" runat="server" visible="false">
|
||||
<td>Observaciones Grales:</td>
|
||||
<td>
|
||||
<asp:Label Text="" ID="LbObservaciones" runat="server" />
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr id="trObsAlmacen" runat="server" visible="false">
|
||||
<td>Observaciones Almacén:</td>
|
||||
<td>
|
||||
<asp:Label Text="" ID="LbObservacionesAlmacen" runat="server" />
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr id="trDireccionEnvio" runat="server" visible="false">
|
||||
<td>Dirección Envío:</td>
|
||||
@@ -160,12 +168,16 @@
|
||||
<asp:Label Text="" ID="LblDirEnvio" runat="server" />
|
||||
<asp:LinkButton ID="LnkEditarDir" runat="server" OnClick="LnkEditarDir_Click" AlternateText="Editar Dirección" ToolTip="Editar Dirección" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="BtnArchivoAdjunto" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -350,6 +350,21 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
|
||||
|
||||
Private Property Adjunto As String
|
||||
Get
|
||||
If ViewState("Adjunto") Is Nothing Then
|
||||
ViewState("Adjunto") = ""
|
||||
End If
|
||||
Return ViewState("Adjunto").ToString()
|
||||
End Get
|
||||
|
||||
Set(value As String)
|
||||
ViewState("Adjunto") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
@@ -617,7 +632,11 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
CveVentaAD = -2
|
||||
CargaVentaPorSurtir(DdlFolio.SelectedValue.ToEntero())
|
||||
End Sub
|
||||
Private Sub CargaVentaPorSurtir(CveVenta As Integer, Optional CveAlmacen As Integer = -1, Optional CveOS As Integer = -1)
|
||||
Private Sub CargaVentaPorSurtir(CveVenta As Integer, Optional CveAlmacen As Integer = -1, Optional CveOS As Integer = -1)
|
||||
|
||||
Adjunto = ""
|
||||
BtnArchivoAdjunto.Visible = False
|
||||
|
||||
LbSurtida.Visible = False
|
||||
CveContrato = -1
|
||||
CveSubProyecto = -1
|
||||
@@ -701,8 +720,26 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
'ClienteEntregaPersonal(CveCliente)
|
||||
CveSubProyecto = drE("CveSubProyecto").ToString().ToEntero()
|
||||
EsInterno = CBool(DtDatos.Rows(0)("EsInterno").ToString())
|
||||
CveDireccionEnvio = drE("CveDireccionEnvio").ToString.ToEntero
|
||||
|
||||
CveDireccionEnvio = drE("CveDireccionEnvio").ToString.ToEntero
|
||||
|
||||
|
||||
Adjunto = drE("Adjunto").ToString()
|
||||
|
||||
If Adjunto.Trim.Length > 0 Then
|
||||
|
||||
Dim ruta As String = HttpContext.Current.Request.ApplicationPath
|
||||
ruta = String.Format("{0}Ventas", UsuarioActual.Empresa.Ruta)
|
||||
ruta += $"/{Adjunto}"
|
||||
|
||||
If File.Exists(ruta) Then
|
||||
BtnArchivoAdjunto.Visible = True
|
||||
BtnArchivoAdjunto.Text = $"Adjunto: {Adjunto}"
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
If CveDireccionEnvio > 0 Then
|
||||
trDireccionEnvio.Visible = True
|
||||
'carga la dirección de envío
|
||||
@@ -870,6 +907,8 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
If CveAlmacen <= 0 Then CargaGvDatos()
|
||||
|
||||
UpVenta.Update()
|
||||
|
||||
End Sub
|
||||
Private Sub CargaTraspasoPorSurtir(CveTraspaso As Integer)
|
||||
LbSurtida.Visible = False
|
||||
@@ -4540,5 +4579,36 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End Function
|
||||
|
||||
|
||||
Protected Sub BtnArchivoAdjunto_Click(sender As Object, e As System.EventArgs) Handles BtnArchivoAdjunto.Click
|
||||
Dim ruta As String = HttpContext.Current.Request.ApplicationPath
|
||||
ruta = String.Format("{0}Ventas", UsuarioActual.Empresa.Ruta)
|
||||
ruta += $"/{Adjunto}"
|
||||
|
||||
Dim Archivo As New System.IO.FileInfo(ruta)
|
||||
|
||||
Try
|
||||
If Archivo IsNot Nothing Then
|
||||
If Archivo.Exists Then
|
||||
|
||||
HttpContext.Current.Response.Clear()
|
||||
HttpContext.Current.Response.ClearContent()
|
||||
HttpContext.Current.Response.ContentType = "application/octet-stream"
|
||||
HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name))
|
||||
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
|
||||
HttpContext.Current.Response.TransmitFile(ruta)
|
||||
Response.Flush() ' send it to the client to download
|
||||
HttpContext.Current.Response.SuppressContent = True
|
||||
HttpContext.Current.ApplicationInstance.CompleteRequest()
|
||||
Response.End()
|
||||
|
||||
Else
|
||||
Alert("El archivo no existe", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End If
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -500,7 +500,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
' DdlProducto.Visible = False
|
||||
'End If
|
||||
|
||||
CargaPS()
|
||||
FiltraPS()
|
||||
|
||||
'Folio
|
||||
SiguienteFolio(If(ChkTransitorio.Checked, 9, 8))
|
||||
@@ -508,6 +508,17 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
'DdlProducto.DataBind()
|
||||
CargarCamiones()
|
||||
End Sub
|
||||
Private Sub FiltraPS()
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso DdlAlmacenOrigen.SelectedValue.ToEntero() > 0 Then
|
||||
Dim DtAlmacen = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenOrigen.SelectedValue.ToEntero())
|
||||
If DtAlmacen IsNot Nothing Then
|
||||
Dim CveSubProyecto As Integer = DtAlmacen.FiltroPrimeroValor("CveSubProyecto").ToEntero()
|
||||
CargaPS(CveSubProyecto)
|
||||
End If
|
||||
Else
|
||||
CargaPS(-1)
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaAlmacenOrigen()
|
||||
DdlAlmacenOrigen.Enabled = True
|
||||
DdlAlmacenOrigen.Items.Clear()
|
||||
@@ -517,7 +528,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
DdlAlmacenOrigen.DataBind()
|
||||
DdlAlmacenOrigen.SelectedValueExist(UsuarioActual.CveAlmacen)
|
||||
End Sub
|
||||
Private Sub CargaPS()
|
||||
Private Sub CargaPS(CveSubProyecto As Integer)
|
||||
|
||||
Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
|
||||
DdlProducto2.setEsWebService(EsWS)
|
||||
@@ -526,8 +537,8 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
'DdlProducto2.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue)
|
||||
If UsuarioActual.Empresa.Funcionalidad(141) = "1" Then
|
||||
DdlProducto2.ddlWS.Attributes.Add("data-pagina", "inv/traspaso")
|
||||
DdlProducto2.ddlWS.Attributes.Add("data-cvesubproyecto", CveSubProyecto.ToString())
|
||||
DdlProducto2.ddlWS.Attributes.Add("Data-onresult", "CargaExistenciaAlmacenes")
|
||||
CargaExistenciasSucursal()
|
||||
DdlAlmacenOrigen.AutoPostBack = True
|
||||
End If
|
||||
Else
|
||||
@@ -538,8 +549,8 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
End Sub
|
||||
|
||||
Private Sub CargaExistenciasSucursal()
|
||||
DdlProducto2.Attributes.Remove("Data-cvesubproyecto")
|
||||
DdlProducto2.Attributes.Add("Data-cvesubproyecto", GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen = {DdlAlmacenOrigen.SelectedValue}"))
|
||||
DdlProducto2.Attributes.Clear()
|
||||
FiltraPS()
|
||||
End Sub
|
||||
Private Sub SiguienteFolio(CveConcepto As Integer)
|
||||
'Dim Inv As New ClsInventarios
|
||||
@@ -2991,8 +3002,8 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
ProductosNoCargados.AppendFormat("{0},", RowPS("PSCodigo").ToString())
|
||||
End If
|
||||
|
||||
Else
|
||||
RowsNoCargados = RowsNoCargados + 1
|
||||
Else
|
||||
RowsNoCargados = RowsNoCargados + 1
|
||||
ProductosNoCargados.AppendFormat("{0},", RowExcel("Producto").ToString())
|
||||
End If
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user