Commit 7f918cb6 by Riku Silvola

foodies

1 parent 21855fb7
......@@ -183,8 +183,8 @@ public class FoodWave extends GenericEntity {
retval += getAccountEvents().size();
}
if (getBillLines() != null) {
retval += getBillLines().size();
if (getUnpaidBillLineCount() != null) {
retval += getUnpaidBillLineCount();
}
return retval;
......@@ -193,5 +193,14 @@ public class FoodWave extends GenericEntity {
public void setMaximumFoods(Integer 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 @@
<f:facet name="header">
<h:outputText value="${i18n['foodWave.unconfirmedOrders']}" />
</f:facet>
<h:outputText value="#{foodwave.billLines.size()}" />
<h:outputText value="#{foodwave.getUnpaidBillLineCount()}" />
</p:column>
<p:column>
<f:facet name="header">
......
......@@ -5,6 +5,7 @@ import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
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!