nuevo reporte de etiquetas para la recepción de almacén
This commit is contained in:
@@ -6,6 +6,8 @@ Imports System.Data
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports System.Xml
|
||||
Imports System.IO
|
||||
Imports iTextSharp.text
|
||||
Imports iTextSharp.text.pdf
|
||||
|
||||
Imports Stimulsoft.Report
|
||||
Imports Stimulsoft.Report.Components
|
||||
@@ -283,6 +285,12 @@ Partial Class PopUpVerFactura
|
||||
End If
|
||||
End If
|
||||
|
||||
If UrlParametros("OP").ToString = "Etiqueta" Then
|
||||
If UrlParametros("CVEMOVIMIENTO") IsNot Nothing AndAlso UrlParametros("CVEMOVIMIENTO").ToString.ToEntero > 0 Then
|
||||
ImprimirEtiqueta(UrlParametros("CVEMOVIMIENTO").ToString.ToEntero, UrlParametros("MODALIDAD").ToString)
|
||||
End If
|
||||
End If
|
||||
|
||||
'IMPRIME OC
|
||||
If UrlParametros("OP").ToString = "OC" Then
|
||||
If UrlParametros("CVEOC") IsNot Nothing AndAlso UrlParametros("CVEOC").ToString.ToEntero > 0 Then
|
||||
@@ -4320,7 +4328,89 @@ Partial Class PopUpVerFactura
|
||||
ImprimirPDF($"Empresas/{UsuarioActual.CveEmpresa}/Formatos/EntregasPorRealizar.rdlc", DtPaqueteriasGuias, RepParams, "Entregas por realizar", "PDF", RDSName:="DsInventarios")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "OP = Etiqueta - Etiquetas de recepcion"
|
||||
Private Sub ImprimirEtiqueta(CveMovimiento As Integer, Modalidad As String)
|
||||
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
|
||||
Dim All As Byte()
|
||||
Using ms As New MemoryStream
|
||||
Using d As New Document
|
||||
Using Copy As New PdfCopy(d, ms)
|
||||
d.Open()
|
||||
If ObjInventarios.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||
If ObjInventarios.DtResultados IsNot Nothing Then
|
||||
If Modalidad = "Individual" Then
|
||||
For Each DetalleRow As DataRow In ObjInventarios.DtResultados.Rows
|
||||
Dim CvePS As Integer = DetalleRow.Item("CvePS").ToString.ToEntero
|
||||
Dim Lote As String = DetalleRow.Item("Lote").ToString
|
||||
Dim FechaCaducidad As String = DetalleRow.Item("FechaCaducidad").ToString
|
||||
Dim PS As String = String.Format("{0} - {1}", DetalleRow.Item("Codigo").ToString, DetalleRow.Item("PS").ToString)
|
||||
|
||||
Dim reporteByte As Byte() = GenerarEtiqueta(CvePS, Lote, FechaCaducidad, PS)
|
||||
|
||||
Dim reader As New PdfReader(reporteByte)
|
||||
Dim Paginas As Integer = reader.NumberOfPages
|
||||
Dim Contador As Integer = 0
|
||||
While Contador < Paginas
|
||||
Contador += 1
|
||||
Copy.AddPage(Copy.GetImportedPage(reader, Contador))
|
||||
End While
|
||||
Next
|
||||
Else
|
||||
For Each DetalleRow As DataRow In ObjInventarios.DtResultados.Rows
|
||||
Dim CvePS As Integer = DetalleRow.Item("CvePS").ToString.ToEntero
|
||||
Dim Lote As String = DetalleRow.Item("Lote").ToString
|
||||
Dim FechaCaducidad As String = DetalleRow.Item("FechaCaducidad").ToString
|
||||
Dim PS As String = String.Format("{0} - {1}", DetalleRow.Item("Codigo").ToString, DetalleRow.Item("PS").ToString)
|
||||
Dim Cant As Integer = DetalleRow.Item("Cantidad").ToString.ToEntero - 1
|
||||
|
||||
For contador As Integer = 0 To Cant
|
||||
Dim reporteByte As Byte() = GenerarEtiqueta(CvePS, Lote, FechaCaducidad, PS)
|
||||
|
||||
Dim reader As New PdfReader(reporteByte)
|
||||
Dim Paginas As Integer = reader.NumberOfPages
|
||||
Dim Cont As Integer = 0
|
||||
While Cont < Paginas
|
||||
Cont += 1
|
||||
Copy.AddPage(Copy.GetImportedPage(reader, Cont))
|
||||
End While
|
||||
Next
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
d.Close()
|
||||
|
||||
End Using
|
||||
End Using
|
||||
All = ms.ToArray()
|
||||
End Using
|
||||
ImprimirbytesPDF(All, "Etiquetas")
|
||||
|
||||
|
||||
If Modalidad = "Individual" Then
|
||||
Else
|
||||
|
||||
End If
|
||||
ObjInventarios.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Function GenerarEtiqueta(CvePS As Integer, Lote As String, FechaCaducidad As String, PS As String) As Byte()
|
||||
Dim QrDescarga As String = ""
|
||||
Dim Cfdi As New RVCFDI33.GeneraCFDI()
|
||||
Dim b As Byte() = Cfdi.ConvertirQrCode(String.Format("?CvePS={0}&Lote={1}&Fecha={2}", CvePS, Lote, FechaCaducidad))
|
||||
QrDescarga = Convert.ToBase64String(b)
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("QR", QrDescarga))
|
||||
params.Add(New ReportParameter("PS", PS))
|
||||
params.Add(New ReportParameter("Lote", Lote))
|
||||
params.Add(New ReportParameter("FechaCad", FechaCaducidad))
|
||||
Return StreamPDF("Empresas/Grales/Formatos/EtiquetaDeRecepcion.rdlc", New DataTable, params)
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
@@ -3353,6 +3353,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
If CveMovimiento > 0 AndAlso CveMovimientoSalidaTraspaso <= 0 Then
|
||||
Msg.AppendFormat("Movimiento Registrado: Folio: <b>{0}</b>", link)
|
||||
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento)))
|
||||
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Etiqueta Individual</a> ", Encripta(String.Format("OP=Etiqueta&CveMovimiento={0}&Modalidad={1}", CveMovimiento, "Individual")))
|
||||
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Etiqueta Por Caja</a> ", Encripta(String.Format("OP=Etiqueta&CveMovimiento={0}&Modalidad={1}", CveMovimiento, "Caja")))
|
||||
'SI GENERO UN TRASPASO AL ALMACEN DE DEVOLUCION
|
||||
ElseIf CveMovimiento > 0 AndAlso CveMovimientoSalidaTraspaso > 0 Then
|
||||
Msg.AppendFormat("Movimiento de Salida: Folio: <b>{0}</b>", String.Format("<a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovimientoSalidaTraspaso, FolioSalidaTraspaso))
|
||||
|
||||
Reference in New Issue
Block a user