Commit 543f6031 by Tuomas Riihimäki

foo

1 parent 311dcf23
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:foodwave="http://java.sun.com/jsf/composite/cditools/foodwave" xmlns:users="http://java.sun.com/jsf/composite/cditools/user" xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:foodwave="http://java.sun.com/jsf/composite/cditools/foodwave"
xmlns:users="http://java.sun.com/jsf/composite/cditools/user"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:p="http://primefaces.org/ui"> xmlns:p="http://primefaces.org/ui">
<h:body> <h:body>
<ui:composition <ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
template="/layout/#{sessionHandler.layout}/template.xhtml">
<f:metadata> <f:metadata>
<f:viewParam name="foodwaveid" value="#{foodWaveView.foodWaveId}" <f:viewParam name="foodwaveid" value="#{foodWaveView.foodWaveId}" />
required="true" /> <f:event type="preRenderView" listener="#{foodWaveView.initFoodWaveOrderList}" />
<f:event type="preRenderView"
listener="#{foodWaveView.initFoodWaveOrderList}" />
<!-- <f:event type="preRenderView" listener="#{foodWaveView.initFoodwaveAccountEventList}" /> --> <!-- <f:event type="preRenderView" listener="#{foodWaveView.initFoodwaveAccountEventList}" /> -->
</f:metadata> </f:metadata>
...@@ -23,7 +15,7 @@ ...@@ -23,7 +15,7 @@
</ui:define> </ui:define>
<ui:define name="content"> <ui:define name="content">
<h:form> <h:form>
<p:dataTable styleClass="bordertable" value="#{foodWaveView.billLines}" var="bill_line"> <p:dataTable styleClass="bordertable" value="#{foodWaveView.billLines}" var="bill_line">
<f:facet name="header"> <f:facet name="header">
<h:outputLabel value="#{i18n['foodWave.billLines']}" /> <h:outputLabel value="#{i18n['foodWave.billLines']}" />
...@@ -52,8 +44,7 @@ ...@@ -52,8 +44,7 @@
<f:facet name="header"> <f:facet name="header">
<h:outputLabel id="name" value="#{i18n['billLine.eventuser']}" /> <h:outputLabel id="name" value="#{i18n['billLine.eventuser']}" />
</f:facet> </f:facet>
<h:link outcome="/useradmin/edit" <h:link outcome="/useradmin/edit" value="#{bill_line.bill.user.wholeName}">
value="#{bill_line.bill.user.wholeName}">
<f:param name="userid" value="#{bill_line.bill.user.id}" /> <f:param name="userid" value="#{bill_line.bill.user.id}" />
</h:link> </h:link>
</p:column> </p:column>
...@@ -61,8 +52,7 @@ ...@@ -61,8 +52,7 @@
<f:facet name="header"> <f:facet name="header">
<h:outputLabel id="name" value="#{i18n['billLine.nick']}" /> <h:outputLabel id="name" value="#{i18n['billLine.nick']}" />
</f:facet> </f:facet>
<h:link outcome="/useradmin/edit" <h:link outcome="/useradmin/edit" value="#{bill_line.bill.user.nick}">
value="#{bill_line.bill.user.nick}">
<f:param name="userid" value="#{bill_line.bill.user.id}" /> <f:param name="userid" value="#{bill_line.bill.user.id}" />
</h:link> </h:link>
</p:column> </p:column>
...@@ -92,7 +82,9 @@ ...@@ -92,7 +82,9 @@
<br /> <br />
<br /> <br />
<h1><h:outputLabel value="#{i18n['foodwave.orders']" /></h1> <h1>
<h:outputLabel value="#{i18n['foodwave.orders']}" />
</h1>
<p:dataTable styleClass="bordertable" value="#{foodWaveView.accountEventLines}" var="acc_lines"> <p:dataTable styleClass="bordertable" value="#{foodWaveView.accountEventLines}" var="acc_lines">
<f:facet name="header"> <f:facet name="header">
...@@ -122,8 +114,7 @@ ...@@ -122,8 +114,7 @@
<f:facet name="header"> <f:facet name="header">
<h:outputLabel id="name" value="${i18n['acc_line.eventuser']}" /> <h:outputLabel id="name" value="${i18n['acc_line.eventuser']}" />
</f:facet> </f:facet>
<h:link outcome="/useradmin/edit" <h:link outcome="/useradmin/edit" value="#{acc_line.user.wholeName}">
value="#{acc_line.user.wholeName}">
<f:param name="userid" value="#{acc_line.user.id}" /> <f:param name="userid" value="#{acc_line.user.id}" />
</h:link> </h:link>
</p:column> </p:column>
...@@ -131,8 +122,7 @@ ...@@ -131,8 +122,7 @@
<f:facet name="header"> <f:facet name="header">
<h:outputLabel id="name" value="${i18n['acc_line.nick']}" /> <h:outputLabel id="name" value="${i18n['acc_line.nick']}" />
</f:facet> </f:facet>
<h:link outcome="/useradmin/edit" <h:link outcome="/useradmin/edit" value="#{acc_line.user.nick}">
value="#{acc_line.user.nick}">
<f:param name="userid" value="#{acc_line.user.id}" /> <f:param name="userid" value="#{acc_line.user.id}" />
</h:link> </h:link>
</p:column> </p:column>
...@@ -141,7 +131,7 @@ ...@@ -141,7 +131,7 @@
<h:outputLabel id="name" value="${i18n['accountEvent.delivered']}" /> <h:outputLabel id="name" value="${i18n['accountEvent.delivered']}" />
</f:facet> </f:facet>
<h:outputText rendered="#{acc_line.delivered}" value="#{i18n['accountEvent.delivered']}" /> <h:outputText rendered="#{acc_line.delivered}" value="#{i18n['accountEvent.delivered']}" />
<h:commandButton rendered="#{not acc_line.delivered}" value=#{i18n['accountEvent.deliver']} action="#{foodWaveView.deliverAccountEvent}" /> <h:commandButton rendered="#{not acc_line.delivered}" value="#{i18n['accountEvent.deliver']}" action="#{foodWaveView.deliverAccountEvent}" />
</p:column> </p:column>
</p:dataTable> </p:dataTable>
......
...@@ -173,17 +173,7 @@ public class ProductShopView extends GenericCDIView { ...@@ -173,17 +173,7 @@ public class ProductShopView extends GenericCDIView {
updateCartLimits(null); updateCartLimits(null);
} }
public BigDecimal getTransactionTotal() public BigDecimal getAccountBalance() {
{
BigDecimal ret = getCartPrice().subtract(getAccountCredits());
if (BigDecimal.ZERO.compareTo(ret) > 0)
{
ret = BigDecimal.ZERO;
}
return ret;
}
public BigDecimal getBalanceAfterTransaction() {
BigDecimal ret = user.getAccountBalance(); BigDecimal ret = user.getAccountBalance();
ret = ret.add(getCash()); ret = ret.add(getCash());
ret = ret.subtract(getTotalPrice()); ret = ret.subtract(getTotalPrice());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!