Commit 7f918cb6 by Riku Silvola

foodies

1 parent 21855fb7
...@@ -183,8 +183,8 @@ public class FoodWave extends GenericEntity { ...@@ -183,8 +183,8 @@ public class FoodWave extends GenericEntity {
retval += getAccountEvents().size(); retval += getAccountEvents().size();
} }
if (getBillLines() != null) { if (getUnpaidBillLineCount() != null) {
retval += getBillLines().size(); retval += getUnpaidBillLineCount();
} }
return retval; return retval;
...@@ -193,5 +193,14 @@ public class FoodWave extends GenericEntity { ...@@ -193,5 +193,14 @@ public class FoodWave extends GenericEntity {
public void setMaximumFoods(Integer maximumFoods) { public void setMaximumFoods(Integer maximumFoods) {
this.maximumFoods = maximumFoods; this.maximumFoods = maximumFoods;
} }
public Integer getUnpaidBillLineCount() {
Integer i = 0;
for (BillLine line : getBillLines()) {
if (!line.getBill().isPaid()) {
++i;
}
}
return i;
}
} }
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<f:facet name="header"> <f:facet name="header">
<h:outputText value="${i18n['foodWave.unconfirmedOrders']}" /> <h:outputText value="${i18n['foodWave.unconfirmedOrders']}" />
</f:facet> </f:facet>
<h:outputText value="#{foodwave.billLines.size()}" /> <h:outputText value="#{foodwave.getUnpaidBillLineCount()}" />
</p:column> </p:column>
<p:column> <p:column>
<f:facet name="header"> <f:facet name="header">
......
...@@ -5,6 +5,7 @@ import java.util.ArrayList; ...@@ -5,6 +5,7 @@ import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.TreeSet; import java.util.TreeSet;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!