Commit d1d18d22 by Riku Silvola

accountevents and stuff are nice

1 parent 0335b31b
......@@ -86,6 +86,10 @@ public class ProductPBean {
if (foodwave != null) {
ret.setFoodWave(foodwave);
if(foodwave.getAccountEvents() == null) {
foodwave.setAccountEvents(new ArrayList<AccountEvent>());
}
foodwave.getAccountEvents().add(ret);
}
List<DiscountInstance> accEventdiscounts = ret.getDiscountInstances();
......
......@@ -117,6 +117,8 @@ public class BillLine extends GenericEntity {
this.setUnitPrice(product.getPrice().abs());
this.setVat(product.getVat());
this.setFoodwave(foodwave);
}
......
......@@ -6,8 +6,9 @@
<h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
<f:metadata>
<f:event type="preRenderView" listener="#{foodWaveView.initFoodwaveBillLineList}" />
<f:event type="preRenderView" listener="#{foodWaveView.initFoodwaveAccountEventList}" />
<f:viewParam name="foodwaveid" value="#{foodWaveView.foodWaveId}" required="true"/>
<f:event type="preRenderView" listener="#{foodWaveView.initFoodWaveOrderList}" />
<!-- <f:event type="preRenderView" listener="#{foodWaveView.initFoodwaveAccountEventList}" /> -->
</f:metadata>
<ui:define name="title">
......@@ -32,14 +33,14 @@
</f:facet>
<h:link outcome="/foodmanager/listOrders"
value="#{foodwave.template.name}">
<f:param name="foodwaveid" value="#{billLine.quantiny}" />
<f:param name="foodwaveid" value="#{foodWaveView.billLines.rowCount}" />
</h:link>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['billLine.unitprice']}" />
</f:facet>
<h:link outcome="/foodmanager/listOrders" value="#{billLine.unitprice}">
<h:link outcome="/foodmanager/listOrders" value="#{foodWaveView.currentProduct.price}">
<f:param name="foodwaveid" value="#{foodwave.id}" />
</h:link>
</h:column>
......@@ -47,18 +48,18 @@
<f:facet name="header">
<h:outputText value="${i18n['foodWave.unconfirmedOrders']}" />
</f:facet>
<h:link outcome="/foodmanager/listOrders" value="#{foodwave.billLines.size()}">
<h:link outcome="/foodmanager/listOrders" value="#{foodWaveView.billLines.size()}">
<f:param name="foodwaveid" value="#{foodwave.id}" />
</h:link>
</h:column>
</h:column><!--
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['foodWave.totalReserved']}" />
</f:facet>
<h:link outcome="/foodmanager/listOrders" value="#{foodwave.reservedCount}">
<h:link outcome="/foodmanager/listOrders" value="#{foodWaveView.currentProduct.totalreserved}">
<f:param name="foodwaveid" value="#{foodwave.id}" />
</h:link>
</h:column>
</h:column> -->
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['foodWave.time']}" />
......
......@@ -17,6 +17,8 @@ import fi.insomnia.bortal.beans.EventBeanLocal;
import fi.insomnia.bortal.beans.FoodWaveBeanLocal;
import fi.insomnia.bortal.beans.ProductBeanLocal;
import fi.insomnia.bortal.enums.apps.ShopPermission;
import fi.insomnia.bortal.model.AccountEvent;
import fi.insomnia.bortal.model.BillLine;
import fi.insomnia.bortal.model.FoodWave;
import fi.insomnia.bortal.model.FoodWaveTemplate;
import fi.insomnia.bortal.model.Product;
......@@ -50,6 +52,10 @@ public class FoodWaveView extends GenericCDIView {
private Date startDate;
private Product currentProduct;
private ListDataModel<BillLine> billLines;
private Integer foodWaveId;
private ListDataModel<AccountEvent> accountEventLines;
public List<Product> getProducts() {
......@@ -132,6 +138,18 @@ public class FoodWaveView extends GenericCDIView {
public void initFoodwaveManagerList() {
this.foodWaves = new ListDataModel<FoodWave>(foodWaveBean.getEventFoodWaves());
}
public void initFoodWaveOrderList() {
if (foodWaveId != null) {
setSelectedFoodWave(foodWaveBean.findFoodwave(foodWaveId));
this.setBillLines(new ListDataModel<BillLine>(selectedFoodWave.getBillLines()));
this.accountEventLines = new ListDataModel<AccountEvent>(selectedFoodWave.getAccountEvents());
super.beginConversation();
}
}
public String editTemplate() {
setTemplate(getTemplates().getRowData());
......@@ -219,4 +237,20 @@ public class FoodWaveView extends GenericCDIView {
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Integer getFoodWaveId() {
return foodWaveId;
}
public void setFoodWaveId(Integer foodWaveId) {
this.foodWaveId = foodWaveId;
}
public ListDataModel<BillLine> getBillLines() {
return billLines;
}
public void setBillLines(ListDataModel<BillLine> billLines) {
this.billLines = billLines;
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!