Commit e5216936 by Tuukka Kivilahti

ehdoton ehkä, ehkä confligtoi tuomarin kanssa

1 parent 46de4485
...@@ -182,17 +182,12 @@ public class FoodWave extends GenericEntity { ...@@ -182,17 +182,12 @@ public class FoodWave extends GenericEntity {
this.billLines = billLines; this.billLines = billLines;
} }
public int getReservedCount() { public Integer getReservedCount() {
int retval = 0; Integer retval = 0;
if (getAccountEvents() != null) {
retval += getAccountEvents().size();
}
if (getUnpaidBillLineCount() != null) {
retval += getUnpaidBillLineCount();
}
retval += getOrderedCount();
retval += getUnpaidCount();
return retval; return retval;
} }
...@@ -200,14 +195,30 @@ public class FoodWave extends GenericEntity { ...@@ -200,14 +195,30 @@ public class FoodWave extends GenericEntity {
this.maximumFoods = maximumFoods; this.maximumFoods = maximumFoods;
} }
public Integer getUnpaidBillLineCount() { public Integer getUnpaidCount() {
Integer i = 0; Integer ret = 0;
for (BillLine line : getBillLines()) { for (BillLine line : getBillLines()) {
if (!line.getBill().isPaid()) { if (!line.getBill().isPaid()) {
++i; ret += line.getQuantity().intValue();
} }
} }
return i; return ret;
}
public Integer getOrderedCount() {
Integer ret = 0;
if (getAccountEvents() != null) {
for(AccountEvent ae : getAccountEvents()) {
ret += ae.getQuantity().intValue();
}
}
return ret;
}
} }
}
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
</session-config> </session-config>
<context-param> <context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name> <param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Production</param-value> <!-- <param-value>Production</param-value> -->
<!-- <param-value>Development</param-value>--> <param-value>Development</param-value>
</context-param> </context-param>
<context-param> <context-param>
......
...@@ -49,13 +49,13 @@ ...@@ -49,13 +49,13 @@
<f:facet name="header"> <f:facet name="header">
<h:outputText value="${i18n['foodWave.paid']}" /> <h:outputText value="${i18n['foodWave.paid']}" />
</f:facet> </f:facet>
<h:outputText value="#{foodwave.accountEvents.size()}" /> <h:outputText value="#{foodwave.orderedCount}" />
</p:column> </p:column>
<p:column styleClass="text-center"> <p:column styleClass="text-center">
<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.unpaidBillLineCount}" /> <h:outputText value="#{foodwave.unpaidCount}" />
</p:column> </p:column>
<p:column> <p:column>
<f:facet name="header"> <f:facet name="header">
......
...@@ -83,11 +83,11 @@ ...@@ -83,11 +83,11 @@
</h:form> </h:form>
<div> <div>
<h:outputLabel value="#{i18n['foodwave.price']}" /> <h:outputLabel value="#{i18n['foodwave.price']}" />
<h:outputText value="#{foodWaveView.foodwavePrice}" /> <h:outputText value="#{foodWaveView.foodWavePrice}" />
</div> </div>
<div> <div>
<h:outputLabel value="#{i18n['foodwave.buyInPrice']}" /> <h:outputLabel value="#{i18n['foodwave.buyInPrice']}" />
<h:outputText value="#{foodWaveView.foodwaveBuyInPrice}" /> <h:outputText value="#{foodWaveView.buyInPrice}" />
</div> </div>
<br></br> <br></br>
<br></br> <br></br>
...@@ -173,8 +173,8 @@ ...@@ -173,8 +173,8 @@
<!-- <foodwave:summary foodwaveProductSummaries="#{foodWaveView.productSummaries}" foodwave="#{foodWaveView.selectedFoodWave}"/> <foodwave:summary foodwaveProductSummaries="#{foodWaveView.productSummaries}" foodwave="#{foodWaveView.selectedFoodWave}"/>
-->
</ui:define> </ui:define>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!