Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Antti Väyrynen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 543f6031
authored
Oct 26, 2012
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
foo
1 parent
311dcf23
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
118 additions
and
138 deletions
code/LanBortalWeb/WebContent/foodmanager/listOrders.xhtml
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/ProductShopView.java
code/LanBortalWeb/WebContent/foodmanager/listOrders.xhtml
View file @
543f603
<!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"
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: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"
<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: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"
>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<f:metadata>
<f:viewParam
name=
"foodwaveid"
value=
"#{foodWaveView.foodWaveId}"
required=
"true"
/>
<f:event
type=
"preRenderView"
listener=
"#{foodWaveView.initFoodWaveOrderList}"
/>
<f:viewParam
name=
"foodwaveid"
value=
"#{foodWaveView.foodWaveId}"
/>
<f:event
type=
"preRenderView"
listener=
"#{foodWaveView.initFoodWaveOrderList}"
/>
<!-- <f:event type="preRenderView" listener="#{foodWaveView.initFoodwaveAccountEventList}" /> -->
</f:metadata>
...
...
@@ -23,129 +15,127 @@
</ui:define>
<ui:define
name=
"content"
>
<h:form>
<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>
<h:form>
<p:dataTable
styleClass=
"bordertable"
value=
"#{foodWaveView.billLines}"
var=
"bill_line"
>
<f:facet
name=
"header"
>
<h:outputLabel
value=
"#{i18n['
billLine.product
']}"
/>
<h:outputLabel
value=
"#{i18n['
foodWave.billLines
']}"
/>
</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>
<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>
<f:facet
name=
"header"
>
<h:outputLabel
value=
"#{i18n['bill.totalprice']}"
/>
</f:facet>
<h:outputText
value=
"#{bill_line.bill.totalPrice}"
/>
</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"
>
<h:outputLabel
value=
"#{i18n['billLine.product']}"
/>
</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>
<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>
<h:commandButton
value=
"#{i18n['bill.markPaid']}"
action=
"#{foodWaveView.markBillPaid}"
/>
</p:column>
<!--
<p:column>
<f:facet
name=
"header"
>
<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>
<h:commandButton value="#{i18n['bill.remove']}" action="foodWaveView.markBillRemoved" />
</p:column> -->
</p:dataTable>
<br
/>
<br
/>
<h1><h:outputLabel
value=
"#{i18n['foodwave.orders']"
/></h1>
<p:dataTable
styleClass=
"bordertable"
value=
"#{foodWaveView.accountEventLines}"
var=
"acc_lines"
>
<f:facet
name=
"header"
>
<h:outputLabel
value=
"#{i18n['foodWave.accountevents']}"
/>
</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>
</p:dataTable>
<br
/>
<br
/>
<h1>
<h:outputLabel
value=
"#{i18n['foodwave.orders']}"
/>
</h1>
<p:dataTable
styleClass=
"bordertable"
value=
"#{foodWaveView.accountEventLines}"
var=
"acc_lines"
>
<f:facet
name=
"header"
>
<h:outputLabel
id=
"name"
value=
"${i18n['accountEvent.delivered
']}"
/>
<h:outputLabel
value=
"#{i18n['foodWave.accountevents
']}"
/>
</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>
<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"
>
<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>
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/ProductShopView.java
View file @
543f603
...
...
@@ -166,24 +166,14 @@ public class ProductShopView extends GenericCDIView {
}
n
.
updateLimit
(
l
);
}
}
public
void
updateAllCartLimits
()
{
updateCartLimits
(
null
);
}
public
BigDecimal
getTransactionTotal
()
{
BigDecimal
ret
=
getCartPrice
().
subtract
(
getAccountCredits
());
if
(
BigDecimal
.
ZERO
.
compareTo
(
ret
)
>
0
)
{
ret
=
BigDecimal
.
ZERO
;
}
return
ret
;
}
public
BigDecimal
getBalanceAfterTransaction
()
{
public
BigDecimal
getAccountBalance
()
{
BigDecimal
ret
=
user
.
getAccountBalance
();
ret
=
ret
.
add
(
getCash
());
ret
=
ret
.
subtract
(
getTotalPrice
());
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment