Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 07afd425
authored
Oct 26, 2012
by
Tuukka Kivilahti, TKffTK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
untested
1 parent
87d8f64c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
17 deletions
code/LanBortalDatabase/src/fi/insomnia/bortal/model/AccountEvent.java
code/LanBortalWeb/WebContent/foodmanager/listOrders.xhtml
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/FoodWaveView.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/AccountEvent.java
View file @
07afd42
...
...
@@ -230,4 +230,8 @@ public class AccountEvent extends GenericEntity {
this
.
deliveredCount
=
deliveredCount
;
}
public
boolean
isDelivered
()
{
return
(
delivered
!=
null
);
}
}
code/LanBortalWeb/WebContent/foodmanager/listOrders.xhtml
View file @
07afd42
...
...
@@ -59,6 +59,15 @@
</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}"
/>
...
...
@@ -82,9 +91,10 @@
</p:dataTable>
<br
/>
<br
/>
<!--
<p:dataTable styleClass="bordertable"
value="#{foodWaveView.accountEventLines}" var="acc_lines">
<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>
...
...
@@ -106,7 +116,7 @@
<f:facet
name=
"header"
>
<h:outputLabel
id=
"name"
value=
"${i18n['acc_line.product']}"
/>
</f:facet>
<h:outputText value="#{acc_line.product}" />
<h:outputText
value=
"#{acc_line.product
.name
}"
/>
</p:column>
<p:column>
<f:facet
name=
"header"
>
...
...
@@ -119,15 +129,23 @@
</p:column>
<p:column>
<f:facet
name=
"header"
>
<h:outputLabel id="name" value="${i18n['acc_line.
price
']}" />
<h:outputLabel
id=
"name"
value=
"${i18n['acc_line.
nick
']}"
/>
</f:facet>
<h:outputText value="#{acc_line.total}" />
<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/FoodWaveView.java
View file @
07afd42
...
...
@@ -12,6 +12,7 @@ import javax.faces.model.ListDataModel;
import
javax.inject.Inject
;
import
javax.inject.Named
;
import
fi.insomnia.bortal.beans.AccountEventBeanLocal
;
import
fi.insomnia.bortal.beans.BillBeanLocal
;
import
fi.insomnia.bortal.beans.EventBeanLocal
;
import
fi.insomnia.bortal.beans.FoodWaveBeanLocal
;
...
...
@@ -47,6 +48,9 @@ public class FoodWaveView extends GenericCDIView {
@EJB
private
BillBeanLocal
billbean
;
@EJB
private
AccountEventBeanLocal
accountEventBean
;
private
FoodWave
selectedFoodWave
=
null
;
private
Date
startDate
;
...
...
@@ -173,19 +177,20 @@ public class FoodWaveView extends GenericCDIView {
}
return
null
;
}
public
String
markBillRemoved
()
{
if
(
permbean
.
hasPermission
(
BillPermission
.
WRITE_ALL
)
&&
getBillLines
().
isRowAvailable
())
{
Bill
b
=
getBillLines
().
getRowData
().
getBill
();
}
getBillbean
().
markPaid
(
b
,
Calendar
.
getInstance
());
public
String
deliverAccountEvent
()
{
if
(
getAccountEventLines
().
isRowAvailable
())
{
AccountEvent
e
=
getAccountEventLines
().
getRowData
();
e
.
setDelivered
(
Calendar
.
getInstance
());
e
=
accountEventBean
.
merge
(
e
);
}
return
null
;
}
public
void
initFoodWaveOrderList
()
{
if
(
super
.
requirePermissions
(
ShopPermission
.
MANAGE_FOODWAVES
)
&&
selectedFoodWave
==
null
)
{
...
...
@@ -196,13 +201,16 @@ public class FoodWaveView extends GenericCDIView {
List
<
BillLine
>
tmpLines
=
new
ArrayList
<
BillLine
>();
for
(
BillLine
line
:
selectedFoodWave
.
getBillLines
())
{
if
(
line
.
getBill
().
isPaid
())
{
if
(
!
line
.
getBill
().
isPaid
())
{
tmpLines
.
add
(
line
);
}
}
setBillLines
(
new
ListDataModel
<
BillLine
>(
tmpLines
));
setAccountEventLines
(
new
ListDataModel
<
AccountEvent
>(
selectedFoodWave
.
getAccountEvents
()));
super
.
beginConversation
();
}
...
...
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