This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2022-11-26 15:16:36 -07:00
parent b8fa7f1365
commit 8156264b1e
8 changed files with 2828 additions and 3 deletions

View File

@@ -211,6 +211,9 @@ Partial Class PopUpVerFactura
If Request("onlyPrint").ToString() = "PalletCaja" AndAlso Not IsNothing(Request("CvePallet")) Then
imprimirpallet(Request("CvePallet").ToString.ToEntero())
End If
If Request("onlyPrint").ToString() = "PalletCaja2" AndAlso Not IsNothing(Request("CvePallet")) Then
imprimirpalletWalamart(Request("CvePallet").ToString.ToEntero())
End If
If Request("onlyPrint").ToString() = "manifiesto" AndAlso Not IsNothing(Request("cveEmbarqueManifiesto")) Then
imprimirManifiesto(Request("cveEmbarqueManifiesto").ToString.ToEntero())
@@ -857,6 +860,141 @@ Partial Class PopUpVerFactura
'"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc"
ImprimirPDF("GPS/PalletEtiqueta2.rdlc", lrds, params, "Pallet", Content_Disposition:="Inline")
End Sub
Private Sub imprimirpalletWalamart(cvePallet As Integer)
Dim Envase As String = ""
Dim Tamano As String = ""
Dim Cultivo As String = ""
Dim Cultivoingles As String = ""
Dim noPallet As String = ""
Dim FormatoImpresion As String = ""
Dim Consecutivo As String = ""
Dim Fecha As String = ""
Dim NoCajas As String = ""
Dim NumberOfCode As String = ""
Dim CvetypeImpresion As Integer
Dim NumberSmall As String = ""
Dim NumberBig As String = ""
Dim GTINAll As String = ""
Dim Peso As String = ""
Dim GTIN As String = ""
Dim PLU As String = ""
'Envase = "1 1/9"
'Tamano = "Small"
'Cultivo = "Tomate"
'noPallet = "000001"
Using objnom As New ClsNominas
If objnom.EmbarquePalletGet(cvePallet, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1) And objnom.DtResultados.Rows.Count > 0 Then
Dim row As DataRow = objnom.DtResultados.Rows(0)
Envase = row("Envase").ToString()
Tamano = row("Tamaño").ToString()
Cultivo = row("Cultivo").ToString()
Cultivoingles = row("Cultivoingles").ToString()
noPallet = row("Codigo").ToString()
FormatoImpresion = row("FormatoImpresion").ToString()
Consecutivo = row("Consecutivo").ToString()
NoCajas = row("NoCajas").ToString()
Fecha = String.Format("{0:MMM dd}", row("Fecha")).Replace(".", "").ToUpper()
CvetypeImpresion = row("CvetypeImpresion").ToString().ToEntero()
NumberOfCode = String.Format("(00)00000000000000(00){1:ddMMyy}(00){0}00", Right(String.Format("0{0}", Regex.Match(row("Cuadro").ToString(), "\d+")), 2), row("Fecha"))
'NumberSmall = String.Format("{0:00}", noPallet.ToEntero())
'NumberBig = String.Format("{0:00}", row("Consecutivo").ToString().ToEntero()) ' String.Format("{0:dd}", row("Fecha"))
NumberSmall = row("NumberSmall").ToString()
NumberBig = row("NumberBig").ToString()
GTINAll = row("GTINAll").ToString()
Peso = row("PesoText").ToString()
GTIN = row("GTIN").ToString()
PLU = row("PLU").ToString()
End If
End Using
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("Tamano", Tamano))
params.Add(New ReportParameter("noPallet", noPallet))
params.Add(New ReportParameter("FormatoImpresion", FormatoImpresion))
params.Add(New ReportParameter("Consecutivo", Consecutivo))
params.Add(New ReportParameter("Fecha", Fecha))
params.Add(New ReportParameter("CveFormato", If(Cultivo.ToLower().Contains("tomate"), "3", CvetypeImpresion.ToString())))
params.Add(New ReportParameter("NoCajas", NoCajas))
params.Add(New ReportParameter("NumberOfCode", NumberOfCode))
params.Add(New ReportParameter("Cultivo", If(CvetypeImpresion = 2, Cultivoingles, Cultivo)))
params.Add(New ReportParameter("Envase", If(CvetypeImpresion = 2, "PLU 4062", Envase)))
params.Add(New ReportParameter("NumberSmall", NumberSmall))
params.Add(New ReportParameter("NumberBig", NumberBig))
params.Add(New ReportParameter("GTINAll", GTINAll))
params.Add(New ReportParameter("Peso", Peso))
params.Add(New ReportParameter("GTIN", GTIN))
params.Add(New ReportParameter("PLU", PLU))
Dim tablaReporte As New DataTable
tablaReporte.Columns.Add(New DataColumn("Codigo", GetType(String)))
tablaReporte.Rows.Add(tablaReporte.NewRow)
tablaReporte.Rows.Add(tablaReporte.NewRow)
Dim lrds As New List(Of ReportDataSource)
'img
Dim dtqr As New DataTable
Dim column As DataColumn = New DataColumn("ImagenByte")
column.DataType = System.Type.[GetType]("System.Byte[]")
column.AllowDBNull = True
column.Caption = "ImagenByte"
dtqr.Columns.Add(column)
Dim rowqr As DataRow = dtqr.NewRow()
Dim bcode As New BarcodeLib.Barcode()
Dim img = bcode.Encode(BarcodeLib.TYPE.CODE128, String.Format("{0}", GTIN), 500, 200)
Dim barcodebyte As Byte()
Using ms = New MemoryStream()
img.Save(ms, System.Drawing.Imaging.ImageFormat.Png)
barcodebyte = ms.ToArray()
End Using
rowqr("ImagenByte") = barcodebyte
dtqr.Rows.Add(rowqr)
Dim rds2 As New ReportDataSource With {.Name = "dsImagenes", .Value = dtqr}
rds2.Name = "dsImagenes"
rds2.Value = dtqr
lrds.Add(rds2)
'endimg
Dim dtqr2 As DataTable = dtqr.Clone()
Dim bcode2 As New BarcodeLib.Barcode()
Dim img2 = bcode2.Encode(BarcodeLib.TYPE.CODE128, String.Format("{0}", GTINAll.Replace("(", "").Replace(")", "")), 900, 100)
Dim barcodebyte2 As Byte()
Using ms = New MemoryStream()
img2.Save(ms, System.Drawing.Imaging.ImageFormat.Png)
barcodebyte2 = ms.ToArray()
End Using
Dim rowqr2 As DataRow = dtqr2.NewRow()
rowqr2("ImagenByte") = barcodebyte2
dtqr2.Rows.Add(rowqr2)
Dim rds22 As New ReportDataSource With {.Name = "dsImagenesGTIN", .Value = dtqr2}
lrds.Add(rds22)
Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = tablaReporte}
lrds.Add(rds)
'"Empresas/Grales/Formatos/EquiposGPS.rdlc"
'"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc"
Dim ruta As String = "GPS/PalletEtiquetaWalmart.rdlc"
'If CvetypeImpresion = 2 Then
' ruta = "GPS/PalletEtiqueta_2.rdlc"
'End If
ImprimirPDF(ruta, lrds, params, "Pallet Caja", Content_Disposition:="Inline")
End Sub
Private Sub imprimirpallet(cvePallet As Integer)
Dim Envase As String = ""
Dim Tamano As String = ""