Commit d1d18d22 by Riku Silvola

accountevents and stuff are nice

1 parent 0335b31b
...@@ -86,6 +86,10 @@ public class ProductPBean { ...@@ -86,6 +86,10 @@ public class ProductPBean {
if (foodwave != null) { if (foodwave != null) {
ret.setFoodWave(foodwave); ret.setFoodWave(foodwave);
if(foodwave.getAccountEvents() == null) {
foodwave.setAccountEvents(new ArrayList<AccountEvent>());
}
foodwave.getAccountEvents().add(ret);
} }
List<DiscountInstance> accEventdiscounts = ret.getDiscountInstances(); List<DiscountInstance> accEventdiscounts = ret.getDiscountInstances();
......
...@@ -117,6 +117,8 @@ public class BillLine extends GenericEntity { ...@@ -117,6 +117,8 @@ public class BillLine extends GenericEntity {
this.setUnitPrice(product.getPrice().abs()); this.setUnitPrice(product.getPrice().abs());
this.setVat(product.getVat()); this.setVat(product.getVat());
this.setFoodwave(foodwave); this.setFoodwave(foodwave);
} }
......
...@@ -6,8 +6,9 @@ ...@@ -6,8 +6,9 @@
<h:body> <h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml"> <ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
<f:metadata> <f:metadata>
<f:event type="preRenderView" listener="#{foodWaveView.initFoodwaveBillLineList}" /> <f:viewParam name="foodwaveid" value="#{foodWaveView.foodWaveId}" required="true"/>
<f:event type="preRenderView" listener="#{foodWaveView.initFoodwaveAccountEventList}" /> <f:event type="preRenderView" listener="#{foodWaveView.initFoodWaveOrderList}" />
<!-- <f:event type="preRenderView" listener="#{foodWaveView.initFoodwaveAccountEventList}" /> -->
</f:metadata> </f:metadata>
<ui:define name="title"> <ui:define name="title">
...@@ -32,14 +33,14 @@ ...@@ -32,14 +33,14 @@
</f:facet> </f:facet>
<h:link outcome="/foodmanager/listOrders" <h:link outcome="/foodmanager/listOrders"
value="#{foodwave.template.name}"> value="#{foodwave.template.name}">
<f:param name="foodwaveid" value="#{billLine.quantiny}" /> <f:param name="foodwaveid" value="#{foodWaveView.billLines.rowCount}" />
</h:link> </h:link>
</h:column> </h:column>
<h:column> <h:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="${i18n['billLine.unitprice']}" /> <h:outputText value="${i18n['billLine.unitprice']}" />
</f:facet> </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}" /> <f:param name="foodwaveid" value="#{foodwave.id}" />
</h:link> </h:link>
</h:column> </h:column>
...@@ -47,18 +48,18 @@ ...@@ -47,18 +48,18 @@
<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:link outcome="/foodmanager/listOrders" value="#{foodwave.billLines.size()}"> <h:link outcome="/foodmanager/listOrders" value="#{foodWaveView.billLines.size()}">
<f:param name="foodwaveid" value="#{foodwave.id}" /> <f:param name="foodwaveid" value="#{foodwave.id}" />
</h:link> </h:link>
</h:column> </h:column><!--
<h:column> <h:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="${i18n['foodWave.totalReserved']}" /> <h:outputText value="${i18n['foodWave.totalReserved']}" />
</f:facet> </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}" /> <f:param name="foodwaveid" value="#{foodwave.id}" />
</h:link> </h:link>
</h:column> </h:column> -->
<h:column> <h:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="${i18n['foodWave.time']}" /> <h:outputText value="${i18n['foodWave.time']}" />
......
...@@ -17,6 +17,8 @@ import fi.insomnia.bortal.beans.EventBeanLocal; ...@@ -17,6 +17,8 @@ import fi.insomnia.bortal.beans.EventBeanLocal;
import fi.insomnia.bortal.beans.FoodWaveBeanLocal; import fi.insomnia.bortal.beans.FoodWaveBeanLocal;
import fi.insomnia.bortal.beans.ProductBeanLocal; import fi.insomnia.bortal.beans.ProductBeanLocal;
import fi.insomnia.bortal.enums.apps.ShopPermission; 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.FoodWave;
import fi.insomnia.bortal.model.FoodWaveTemplate; import fi.insomnia.bortal.model.FoodWaveTemplate;
import fi.insomnia.bortal.model.Product; import fi.insomnia.bortal.model.Product;
...@@ -50,6 +52,10 @@ public class FoodWaveView extends GenericCDIView { ...@@ -50,6 +52,10 @@ public class FoodWaveView extends GenericCDIView {
private Date startDate; private Date startDate;
private Product currentProduct; private Product currentProduct;
private ListDataModel<BillLine> billLines;
private Integer foodWaveId;
private ListDataModel<AccountEvent> accountEventLines;
public List<Product> getProducts() { public List<Product> getProducts() {
...@@ -133,6 +139,18 @@ public class FoodWaveView extends GenericCDIView { ...@@ -133,6 +139,18 @@ public class FoodWaveView extends GenericCDIView {
this.foodWaves = new ListDataModel<FoodWave>(foodWaveBean.getEventFoodWaves()); 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() { public String editTemplate() {
setTemplate(getTemplates().getRowData()); setTemplate(getTemplates().getRowData());
return "/foodadmin/editTemplate"; return "/foodadmin/editTemplate";
...@@ -219,4 +237,20 @@ public class FoodWaveView extends GenericCDIView { ...@@ -219,4 +237,20 @@ public class FoodWaveView extends GenericCDIView {
public void setStartDate(Date startDate) { public void setStartDate(Date startDate) {
this.startDate = 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!