diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 599678e03..9f1b22c04 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -4343,13 +4343,12 @@ Partial Class PopUpVerFactura 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) - + 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) + If Modalidad = "Individual" Then Dim reporteByte As Byte() = GenerarEtiqueta(CvePS, Lote, FechaCaducidad, PS) Dim reader As New PdfReader(reporteByte) @@ -4359,13 +4358,7 @@ Partial Class PopUpVerFactura 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) + Else Dim Cant As Integer = DetalleRow.Item("Cantidad").ToString.ToEntero - 1 For contador As Integer = 0 To Cant @@ -4379,8 +4372,8 @@ Partial Class PopUpVerFactura Copy.AddPage(Copy.GetImportedPage(reader, Cont)) End While Next - Next - End If + End If + Next End If End If d.Close()