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,129 +15,127 @@ ...@@ -23,129 +15,127 @@
</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">
<h:outputLabel value="#{i18n['foodWave.billLines']}" />
</f:facet>
<p:column>
<f:facet name="header">
<h:outputLabel value="#{i18n['billLine.time']}" />
</f:facet>
<h:outputText value="#{bill_line.bill.sentDate.getTime()}">
<f:convertDateTime pattern="hh:mm d/M/yy" />
</h:outputText>
</p:column>
<p:column>
<f:facet name="header">
<h:outputLabel value="#{i18n['billLine.quantity']}" />
</f:facet>
<h:outputText value="#{bill_line.quantity}" />
</p:column>
<p:column>
<f:facet name="header"> <f:facet name="header">
<h:outputLabel value="#{i18n['billLine.product']}" /> <h:outputLabel value="#{i18n['foodWave.billLines']}" />
</f:facet> </f:facet>
<h:outputText value="#{bill_line.name}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputLabel id="name" value="#{i18n['billLine.eventuser']}" />
</f:facet>
<h:link outcome="/useradmin/edit"
value="#{bill_line.bill.user.wholeName}">
<f:param name="userid" value="#{bill_line.bill.user.id}" />
</h:link>
</p:column>
<p:column> <p:column>
<f:facet name="header"> <f:facet name="header">
<h:outputLabel id="name" value="#{i18n['billLine.nick']}" /> <h:outputLabel value="#{i18n['billLine.time']}" />
</f:facet> </f:facet>
<h:link outcome="/useradmin/edit" <h:outputText value="#{bill_line.bill.sentDate.getTime()}">
value="#{bill_line.bill.user.nick}"> <f:convertDateTime pattern="hh:mm d/M/yy" />
<f:param name="userid" value="#{bill_line.bill.user.id}" /> </h:outputText>
</h:link> </p:column>
</p:column> <p:column>
<p:column> <f:facet name="header">
<f:facet name="header"> <h:outputLabel value="#{i18n['billLine.quantity']}" />
<h:outputLabel value="#{i18n['billLine.price']}" /> </f:facet>
</f:facet> <h:outputText value="#{bill_line.quantity}" />
<h:outputText value="#{bill_line.linePrice}" /> </p:column>
</p:column> <p:column>
<f:facet name="header">
<p:column> <h:outputLabel value="#{i18n['billLine.product']}" />
<f:facet name="header"> </f:facet>
<h:outputLabel value="#{i18n['bill.totalprice']}" /> <h:outputText value="#{bill_line.name}" />
</f:facet> </p:column>
<h:outputText value="#{bill_line.bill.totalPrice}" /> <p:column>
</p:column> <f:facet name="header">
<h:outputLabel id="name" value="#{i18n['billLine.eventuser']}" />
</f:facet>
<h:link outcome="/useradmin/edit" value="#{bill_line.bill.user.wholeName}">
<f:param name="userid" value="#{bill_line.bill.user.id}" />
</h:link>
</p:column>
<p:column>
<f:facet name="header">
<h:outputLabel id="name" value="#{i18n['billLine.nick']}" />
</f:facet>
<h:link outcome="/useradmin/edit" value="#{bill_line.bill.user.nick}">
<f:param name="userid" value="#{bill_line.bill.user.id}" />
</h:link>
</p:column>
<p:column>
<f:facet name="header">
<h:outputLabel value="#{i18n['billLine.price']}" />
</f:facet>
<h:outputText value="#{bill_line.linePrice}" />
</p:column>
<p:column> <p:column>
<h:commandButton value="#{i18n['bill.markPaid']}" action="#{foodWaveView.markBillPaid}" /> <f:facet name="header">
</p:column> <h:outputLabel value="#{i18n['bill.totalprice']}" />
<!-- </f:facet>
<h:outputText value="#{bill_line.bill.totalPrice}" />
</p:column>
<p:column>
<h:commandButton value="#{i18n['bill.markPaid']}" action="#{foodWaveView.markBillPaid}" />
</p:column>
<!--
<p:column> <p:column>
<h:commandButton value="#{i18n['bill.remove']}" action="foodWaveView.markBillRemoved" /> <h:commandButton value="#{i18n['bill.remove']}" action="foodWaveView.markBillRemoved" />
</p:column> --> </p:column> -->
</p:dataTable> </p:dataTable>
<br /> <br />
<br /> <br />
<h1><h:outputLabel value="#{i18n['foodwave.orders']" /></h1> <h1>
<h:outputLabel value="#{i18n['foodwave.orders']}" />
<p:dataTable styleClass="bordertable" value="#{foodWaveView.accountEventLines}" var="acc_lines"> </h1>
<f:facet name="header">
<h:outputLabel value="#{i18n['foodWave.accountevents']}" /> <p:dataTable styleClass="bordertable" value="#{foodWaveView.accountEventLines}" var="acc_lines">
</f:facet>
<p:column>
<f:facet name="header">
<h:outputLabel id="name" value="${i18n['acc_lines.time']}" />
</f:facet>
<h:outputText value="#{acc_line.eventTime.getTime()}">
<f:convertDateTime pattern="hh:mm d/M/yy" />
</h:outputText>
</p:column>
<p:column>
<f:facet name="header">
<h:outputLabel id="name" value="${i18n['acc_line.quantity']}" />
</f:facet>
<h:outputText value="#{acc_line.quantity}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputLabel id="name" value="${i18n['acc_line.product']}" />
</f:facet>
<h:outputText value="#{acc_line.product.name}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputLabel id="name" value="${i18n['acc_line.eventuser']}" />
</f:facet>
<h:link outcome="/useradmin/edit"
value="#{acc_line.user.wholeName}">
<f:param name="userid" value="#{acc_line.user.id}" />
</h:link>
</p:column>
<p:column>
<f:facet name="header">
<h:outputLabel id="name" value="${i18n['acc_line.nick']}" />
</f:facet>
<h:link outcome="/useradmin/edit"
value="#{acc_line.user.nick}">
<f:param name="userid" value="#{acc_line.user.id}" />
</h:link>
</p:column>
<p:column>
<f:facet name="header"> <f:facet name="header">
<h:outputLabel id="name" value="${i18n['accountEvent.delivered']}" /> <h:outputLabel value="#{i18n['foodWave.accountevents']}" />
</f:facet> </f:facet>
<h:outputText rendered="#{acc_line.delivered}" value="#{i18n['accountEvent.delivered']}" /> <p:column>
<h:commandButton rendered="#{not acc_line.delivered}" value=#{i18n['accountEvent.deliver']} action="#{foodWaveView.deliverAccountEvent}" /> <f:facet name="header">
</p:column> <h:outputLabel id="name" value="${i18n['acc_lines.time']}" />
</p:dataTable> </f:facet>
<h:outputText value="#{acc_line.eventTime.getTime()}">
<f:convertDateTime pattern="hh:mm d/M/yy" />
</h:outputText>
</p:column>
<p:column>
<f:facet name="header">
<h:outputLabel id="name" value="${i18n['acc_line.quantity']}" />
</f:facet>
<h:outputText value="#{acc_line.quantity}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputLabel id="name" value="${i18n['acc_line.product']}" />
</f:facet>
<h:outputText value="#{acc_line.product.name}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputLabel id="name" value="${i18n['acc_line.eventuser']}" />
</f:facet>
<h:link outcome="/useradmin/edit" value="#{acc_line.user.wholeName}">
<f:param name="userid" value="#{acc_line.user.id}" />
</h:link>
</p:column>
<p:column>
<f:facet name="header">
<h:outputLabel id="name" value="${i18n['acc_line.nick']}" />
</f:facet>
<h:link outcome="/useradmin/edit" value="#{acc_line.user.nick}">
<f:param name="userid" value="#{acc_line.user.id}" />
</h:link>
</p:column>
<p:column>
<f:facet name="header">
<h:outputLabel id="name" value="${i18n['accountEvent.delivered']}" />
</f:facet>
<h:outputText rendered="#{acc_line.delivered}" value="#{i18n['accountEvent.delivered']}" />
<h:commandButton rendered="#{not acc_line.delivered}" value="#{i18n['accountEvent.deliver']}" action="#{foodWaveView.deliverAccountEvent}" />
</p:column>
</p:dataTable>
</h:form> </h:form>
</ui:define> </ui:define>
......
...@@ -166,24 +166,14 @@ public class ProductShopView extends GenericCDIView { ...@@ -166,24 +166,14 @@ public class ProductShopView extends GenericCDIView {
} }
n.updateLimit(l); n.updateLimit(l);
} }
} }
public void updateAllCartLimits() { public void updateAllCartLimits() {
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!