Reporte para etiquetas QR en productos con lote y caducidad
This commit is contained in:
@@ -289,6 +289,12 @@ Partial Class PopUpVerFactura
|
||||
If UrlParametros("CVEMOVIMIENTO") IsNot Nothing AndAlso UrlParametros("CVEMOVIMIENTO").ToString.ToEntero > 0 Then
|
||||
ImprimirEtiqueta(UrlParametros("CVEMOVIMIENTO").ToString.ToEntero, UrlParametros("MODALIDAD").ToString)
|
||||
End If
|
||||
End If
|
||||
|
||||
If UrlParametros("OP").ToString = "Etiqueta2" Then
|
||||
If UrlParametros("CVEPS") IsNot Nothing AndAlso UrlParametros("CVEPS").ToString.ToEntero > 0 Then
|
||||
ImprimirEtiqueta2(UrlParametros("CVEPS").ToString.ToEntero, UrlParametros("PS").ToString, UrlParametros("CVEALMACEN").ToString, UrlParametros("MODALIDAD").ToString)
|
||||
End If
|
||||
End If
|
||||
|
||||
'IMPRIME OC
|
||||
@@ -4374,7 +4380,7 @@ Partial Class PopUpVerFactura
|
||||
Private Sub ImprimirEtiqueta(CveMovimiento As Integer, Modalidad As String)
|
||||
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
|
||||
Dim PS As String = ""
|
||||
Dim All As Byte()
|
||||
Using ms As New MemoryStream
|
||||
Using d As New Document
|
||||
@@ -4386,7 +4392,7 @@ Partial Class PopUpVerFactura
|
||||
Dim CvePS As Integer = DetalleRow.Item("CvePS").ToString.ToEntero
|
||||
Dim Lote As String = DetalleRow.Item("Lote").ToString
|
||||
Dim FechaCaducidad As Date = DetalleRow.Item("FechaCaducidad").ToString.ToDate
|
||||
Dim PS As String = String.Format("{0} - {1}", DetalleRow.Item("Codigo").ToString, DetalleRow.Item("PS").ToString)
|
||||
PS = String.Format("{0} - {1}", DetalleRow.Item("Codigo").ToString, DetalleRow.Item("PS").ToString)
|
||||
If Modalidad = "Individual" Then
|
||||
Dim reporteByte As Byte() = GenerarEtiqueta(CvePS, Lote, FechaCaducidad, PS)
|
||||
|
||||
@@ -4421,7 +4427,65 @@ Partial Class PopUpVerFactura
|
||||
End Using
|
||||
All = ms.ToArray()
|
||||
End Using
|
||||
ImprimirbytesPDF(All, "Etiquetas")
|
||||
ImprimirbytesPDF(All, PS.ToString)
|
||||
|
||||
|
||||
If Modalidad = "Individual" Then
|
||||
Else
|
||||
|
||||
End If
|
||||
ObjInventarios.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub ImprimirEtiqueta2(CvePS As Integer, PS As String, CveAlmacen As String, 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.GetExistenciasCaducidad(CvePS, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveAlmacen.ToString) Then
|
||||
If ObjInventarios.DtResultados IsNot Nothing Then
|
||||
For Each DetalleRow As DataRow In ObjInventarios.DtResultados.Rows
|
||||
Dim Lote As String = DetalleRow.Item("Lote").ToString
|
||||
Dim FechaCaducidad As Date = DetalleRow.Item("FechaCaducidad").ToString.ToDate
|
||||
If Modalidad = "Individual" Then
|
||||
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
|
||||
Else
|
||||
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
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
d.Close()
|
||||
|
||||
End Using
|
||||
End Using
|
||||
All = ms.ToArray()
|
||||
End Using
|
||||
ImprimirbytesPDF(All, PS.ToString)
|
||||
|
||||
|
||||
If Modalidad = "Individual" Then
|
||||
@@ -4440,7 +4504,7 @@ Partial Class PopUpVerFactura
|
||||
params.Add(New ReportParameter("QR", QrDescarga))
|
||||
params.Add(New ReportParameter("PS", PS))
|
||||
params.Add(New ReportParameter("Lote", Lote))
|
||||
params.Add(New ReportParameter("FechaCad", FechaCaducidad.ToString()))
|
||||
params.Add(New ReportParameter("FechaCad", FechaCaducidad.ToString("dd/MM/yyyy")))
|
||||
Return StreamPDF("Empresas/Grales/Formatos/EtiquetaDeRecepcion.rdlc", New DataTable, params)
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
Reference in New Issue
Block a user