diff --git a/wnprc_billing/src/org/labkey/wnprc_billing/invoice/InvoicePDF.java b/wnprc_billing/src/org/labkey/wnprc_billing/invoice/InvoicePDF.java index dbce9a04a..c7612c4e7 100644 --- a/wnprc_billing/src/org/labkey/wnprc_billing/invoice/InvoicePDF.java +++ b/wnprc_billing/src/org/labkey/wnprc_billing/invoice/InvoicePDF.java @@ -83,7 +83,7 @@ public void createLineItems(List invoicedItems, boolean includeSub calendarItem.setTime(invoicedItem.getDate()); boolean isDateChange = isFirstItem || calendarCurrent.get(Calendar.DAY_OF_MONTH) != calendarItem.get(Calendar.DAY_OF_MONTH); - boolean isGroupChange = false; + boolean isGroupChange; if(invoicedItem.getGroupName()== null){ isGroupChange = currentGroup != null; } @@ -188,17 +188,9 @@ protected List getLineItemsFromInvoicedItem(InvoicedItem invo addDetailsToLineItem(commentLines.get(0), invoicedItem); } - if (itemLines.size() > 0) { - for (FormattedLineItem itemLine : itemLines) { - formattedLineItems.add(itemLine); - } - } + formattedLineItems.addAll(itemLines); + formattedLineItems.addAll(commentLines); - if (commentLines.size() > 0) { - for (FormattedLineItem commentLine : commentLines) { - formattedLineItems.add(commentLine); - } - } return formattedLineItems; } @@ -219,7 +211,7 @@ public void Footer() } catch (IOException e) { - throw new UnexpectedException(e); + throw UnexpectedException.wrap(e); } } @@ -387,7 +379,7 @@ public void Header() } catch (IOException e) { - throw new UnexpectedException(e); + throw UnexpectedException.wrap(e); } }