Commit e748081d by Riku Silvola

Merge branch 'master' of codecrew.fi:bortal

2 parents 395704b7 c01e8242
...@@ -199,6 +199,7 @@ public class FoodWave extends GenericEntity { ...@@ -199,6 +199,7 @@ public class FoodWave extends GenericEntity {
public void setMaximumFoods(Integer maximumFoods) { public void setMaximumFoods(Integer maximumFoods) {
this.maximumFoods = maximumFoods; this.maximumFoods = maximumFoods;
} }
public Integer getUnpaidBillLineCount() { public Integer getUnpaidBillLineCount() {
Integer i = 0; Integer i = 0;
for (BillLine line : getBillLines()) { for (BillLine line : getBillLines()) {
......
...@@ -61,6 +61,9 @@ public class Product extends GenericEntity { ...@@ -61,6 +61,9 @@ public class Product extends GenericEntity {
@Column(name = "price", nullable = false, precision = 24, scale = 4) @Column(name = "price", nullable = false, precision = 24, scale = 4)
private BigDecimal price = BigDecimal.ZERO; private BigDecimal price = BigDecimal.ZERO;
@Column(name = "buy_in_price", nullable = true, precision = 24, scale = 4)
private BigDecimal buyInPrice = BigDecimal.ZERO;
@Column(name = "sort", nullable = false) @Column(name = "sort", nullable = false)
private int sort; private int sort;
...@@ -293,4 +296,12 @@ public class Product extends GenericEntity { ...@@ -293,4 +296,12 @@ public class Product extends GenericEntity {
this.description = description; this.description = description;
} }
public BigDecimal getBuyInPrice() {
return buyInPrice;
}
public void setBuyInPrice(BigDecimal buyInPrice) {
this.buyInPrice = buyInPrice;
}
} }
...@@ -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>
......
...@@ -33,8 +33,7 @@ ...@@ -33,8 +33,7 @@
</f:facet> </f:facet>
<h:outputText style="text-align: center;" <h:outputText style="text-align: center;"
value="#{acc_line.eventTime.getTime()}"> value="#{acc_line.eventTime.getTime()}">
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
timeZone="#{sessionHandler.timezone}" />
</h:outputText> </h:outputText>
</p:column> </p:column>
<p:column> <p:column>
...@@ -82,7 +81,14 @@ ...@@ -82,7 +81,14 @@
</p:dataTable> </p:dataTable>
</h:form> </h:form>
<div>
<h:outputLabel value="#{i18n['foodwave.price']}" />
<h:outputText value="#{foodWaveView.foodwavePrice}" />
</div>
<div>
<h:outputLabel value="#{i18n['foodwave.buyInPrice']}" />
<h:outputText value="#{foodWaveView.foodwaveBuyInPrice}" />
</div>
<br></br> <br></br>
<br></br> <br></br>
...@@ -165,10 +171,7 @@ ...@@ -165,10 +171,7 @@
</p:dataTable> </p:dataTable>
</h:form> </h:form>
<br />
<br />
<br />
<br />
<!-- <foodwave:summary foodwaveProductSummaries="#{foodWaveView.productSummaries}" foodwave="#{foodWaveView.selectedFoodWave}"/> <!-- <foodwave:summary foodwaveProductSummaries="#{foodWaveView.productSummaries}" foodwave="#{foodWaveView.selectedFoodWave}"/>
--> -->
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<h:outputText value="${i18n['foodWave.time']}" /> <h:outputText value="${i18n['foodWave.time']}" />
</f:facet> </f:facet>
<h:outputText value="#{foodwave.time.time}"> <h:outputText value="#{foodwave.time.time}">
<f:convertDateTime pattern="hh:mm d/M/yy" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText> </h:outputText>
</p:column> </p:column>
</p:dataTable> </p:dataTable>
......
...@@ -21,6 +21,10 @@ ...@@ -21,6 +21,10 @@
<h:outputLabel for="price" value="#{i18n['product.price']}:" /> <h:outputLabel for="price" value="#{i18n['product.price']}:" />
<h:inputText id="price" value="#{productView.product.price}" /> <h:inputText id="price" value="#{productView.product.price}" />
<h:message for="price" /> <h:message for="price" />
<h:outputLabel for="buyInPrice" value="#{i18n['product.buyInPrice']}:" />
<h:inputText id="buyInPrice" value="#{productView.product.buyInPrice}" />
<h:message for="buyInPrice" />
<h:outputLabel for="unitName" value="#{i18n['product.unitName']}:" /> <h:outputLabel for="unitName" value="#{i18n['product.unitName']}:" />
<h:inputText id="unitName" value="#{productView.product.unitName}" /> <h:inputText id="unitName" value="#{productView.product.unitName}" />
......
...@@ -46,9 +46,7 @@ ...@@ -46,9 +46,7 @@
<f:facet name="header"> <f:facet name="header">
<h:outputText id="count" value="${i18n['product.cart.count']}" /> <h:outputText id="count" value="${i18n['product.cart.count']}" />
</f:facet> </f:facet>
<h:commandButton action="#{productShopView.addMinusTen}" value="#{i18n['productshop.minusTen']}">
<f:ajax render="@form" />
</h:commandButton>
<h:commandButton action="#{productShopView.addMinusOne}" value="#{i18n['productshop.minusOne']}"> <h:commandButton action="#{productShopView.addMinusOne}" value="#{i18n['productshop.minusOne']}">
<f:ajax render="@form" /> <f:ajax render="@form" />
</h:commandButton> </h:commandButton>
...@@ -59,9 +57,7 @@ ...@@ -59,9 +57,7 @@
<h:commandButton action="#{productShopView.addOne}" value="#{i18n['productshop.plusOne']}"> <h:commandButton action="#{productShopView.addOne}" value="#{i18n['productshop.plusOne']}">
<f:ajax render="@form" /> <f:ajax render="@form" />
</h:commandButton> </h:commandButton>
<h:commandButton action="#{productShopView.addTen}" value="#{i18n['productshop.plusTen']}">
<f:ajax render="@form" />
</h:commandButton>
</h:column> </h:column>
<h:column rendered="#{productShopView.hasLimits}"> <h:column rendered="#{productShopView.hasLimits}">
<f:facet name="header"> <f:facet name="header">
......
...@@ -196,6 +196,7 @@ eventorganiser.name = Eventorganiser ...@@ -196,6 +196,7 @@ eventorganiser.name = Eventorganiser
food = Food food = Food
foodWave.accountevents = Accountevents
foodWave.billLines = Pending Online Payments foodWave.billLines = Pending Online Payments
foodWave.description = Description foodWave.description = Description
foodWave.list = FoodWave Listing foodWave.list = FoodWave Listing
...@@ -498,6 +499,7 @@ poll.save = Send answers ...@@ -498,6 +499,7 @@ poll.save = Send answers
product.barcode = Barcode product.barcode = Barcode
product.billed = Billed product.billed = Billed
product.boughtTotal = Products billed product.boughtTotal = Products billed
product.buyInPrice = Buy in price
product.cart.count = To shoppingcart product.cart.count = To shoppingcart
product.cashed = Cashpaid product.cashed = Cashpaid
product.color = Color in UI product.color = Color in UI
......
...@@ -194,6 +194,7 @@ eventorganiser.name = Tapahtumaj\u00E4rjest\u00E4j\u00E4 ...@@ -194,6 +194,7 @@ eventorganiser.name = Tapahtumaj\u00E4rjest\u00E4j\u00E4
food = Ruoka food = Ruoka
foodWave.accountevents = Maksetut tilaukset
foodWave.billLines = Maksamattomat Verkkomaksut foodWave.billLines = Maksamattomat Verkkomaksut
foodWave.description = Kuvaus foodWave.description = Kuvaus
foodWave.list = Ruokatilausten listaus foodWave.list = Ruokatilausten listaus
......
...@@ -5,7 +5,6 @@ import java.util.ArrayList; ...@@ -5,7 +5,6 @@ import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.TreeSet; import java.util.TreeSet;
...@@ -187,6 +186,29 @@ public class FoodWaveView extends GenericCDIView { ...@@ -187,6 +186,29 @@ public class FoodWaveView extends GenericCDIView {
this.currentProduct = currentProduct; this.currentProduct = currentProduct;
} }
public BigDecimal getFoodWavePrice()
{
BigDecimal ret = BigDecimal.ZERO;
for (AccountEvent ac : selectedFoodWave.getAccountEvents())
{
ret = ret.add(ac.getTotal());
}
return ret;
}
public BigDecimal getBuyInPrice()
{
BigDecimal ret = BigDecimal.ZERO;
for (AccountEvent ac : selectedFoodWave.getAccountEvents())
{
if (ac.getProduct() != null && ac.getProduct().getBuyInPrice() != null)
{
ret = ret.add(ac.getQuantity().multiply(ac.getProduct().getBuyInPrice()));
}
}
return ret;
}
// public void initUserFoodWaveList() { // public void initUserFoodWaveList() {
// this.foodWaves = new // this.foodWaves = new
// ListDataModel<FoodWave>(foodWaveBean.getOpenFoodWaves()); // ListDataModel<FoodWave>(foodWaveBean.getOpenFoodWaves());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!