Commit e5216936 by Tuukka Kivilahti

ehdoton ehkä, ehkä confligtoi tuomarin kanssa

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