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 9059afb5
authored
Oct 27, 2012
by
Riku Silvola
Browse files
Options
Browse Files
Download
Plain Diff
color me closed too
2 parents
ac80b22a
5c881099
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
247 additions
and
170 deletions
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/FoodWaveBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/MenuBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/facade/FoodWaveFacade.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Bill.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/BillLine.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/FoodWave.java
code/LanBortalWeb/WebContent/WEB-INF/web.xml
code/LanBortalWeb/WebContent/foodadmin/editTemplate.xhtml
code/LanBortalWeb/WebContent/foodmanager/listFoodwaves.xhtml
code/LanBortalWeb/WebContent/foodmanager/listOrders.xhtml
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_en.properties
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_fi.properties
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/FoodWaveFoodView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/FoodWaveView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/helpers/FoodwaveProductSummary.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/FoodWaveBean.java
View file @
9059afb
...
@@ -80,7 +80,8 @@ public class FoodWaveBean implements FoodWaveBeanLocal {
...
@@ -80,7 +80,8 @@ public class FoodWaveBean implements FoodWaveBeanLocal {
@Override
@Override
public
FoodWave
merge
(
FoodWave
foodWave
)
{
public
FoodWave
merge
(
FoodWave
foodWave
)
{
return
foodWaveFacade
.
merge
(
foodWave
);
foodWave
=
foodWaveFacade
.
merge
(
foodWave
);
return
foodWave
;
}
}
@Override
@Override
...
...
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/MenuBean.java
View file @
9059afb
...
@@ -202,13 +202,13 @@ public class MenuBean implements MenuBeanLocal {
...
@@ -202,13 +202,13 @@ public class MenuBean implements MenuBeanLocal {
MenuNavigation
foodnavi
=
adminnavi
.
addPage
(
null
,
null
);
MenuNavigation
foodnavi
=
adminnavi
.
addPage
(
null
,
null
);
foodnavi
.
setKey
(
"topnavi.foodwave"
);
foodnavi
.
setKey
(
"topnavi.foodwave"
);
foodnavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/foodadmin/createTemplate"
),
ShopPermission
.
MANAGE_FOODWAVES
);
foodnavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/foodadmin/listTemplates"
),
ShopPermission
.
MANAGE_FOODWAVES
);
foodnavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/foodadmin/editTemplate"
),
ShopPermission
.
MANAGE_FOODWAVES
).
setVisible
(
false
);
foodnavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/foodmanager/listFoodwaves"
),
ShopPermission
.
MANAGE_FOODWAVES
);
foodnavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/foodmanager/listFoodwaves"
),
ShopPermission
.
MANAGE_FOODWAVES
);
foodnavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/foodmanager/listOrders"
),
ShopPermission
.
MANAGE_FOODWAVES
).
setVisible
(
false
);
foodnavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/foodmanager/listOrders"
),
ShopPermission
.
MANAGE_FOODWAVES
).
setVisible
(
false
);
foodnavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/foodadmin/listTemplates"
),
ShopPermission
.
MANAGE_FOODWAVES
);
foodnavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/foodadmin/createTemplate"
),
ShopPermission
.
MANAGE_FOODWAVES
);
foodnavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/foodadmin/editTemplate"
),
ShopPermission
.
MANAGE_FOODWAVES
).
setVisible
(
false
);
}
}
@Override
@Override
...
...
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/facade/FoodWaveFacade.java
View file @
9059afb
package
fi
.
insomnia
.
bortal
.
facade
;
package
fi
.
insomnia
.
bortal
.
facade
;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
javax.ejb.EJB
;
import
javax.ejb.EJB
;
...
@@ -41,7 +42,7 @@ public class FoodWaveFacade extends IntegerPkGenericFacade<FoodWave> {
...
@@ -41,7 +42,7 @@ public class FoodWaveFacade extends IntegerPkGenericFacade<FoodWave> {
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaQuery
<
FoodWave
>
cq
=
cb
.
createQuery
(
FoodWave
.
class
);
CriteriaQuery
<
FoodWave
>
cq
=
cb
.
createQuery
(
FoodWave
.
class
);
Root
<
FoodWave
>
root
=
cq
.
from
(
FoodWave
.
class
);
Root
<
FoodWave
>
root
=
cq
.
from
(
FoodWave
.
class
);
cq
.
where
(
cb
.
greaterThan
(
root
.
get
(
FoodWave_
.
time
),
Calendar
.
getInstanc
e
()),
cb
.
isFalse
(
root
.
get
(
FoodWave_
.
closed
)),
cb
.
equal
(
root
.
get
(
FoodWave_
.
template
).
get
(
FoodWaveTemplate_
.
event
),
eventBean
.
getCurrentEvent
()));
cq
.
where
(
cb
.
greaterThan
(
root
.
get
(
FoodWave_
.
time
),
new
Dat
e
()),
cb
.
isFalse
(
root
.
get
(
FoodWave_
.
closed
)),
cb
.
equal
(
root
.
get
(
FoodWave_
.
template
).
get
(
FoodWaveTemplate_
.
event
),
eventBean
.
getCurrentEvent
()));
return
getEm
().
createQuery
(
cq
).
getResultList
();
return
getEm
().
createQuery
(
cq
).
getResultList
();
}
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Bill.java
View file @
9059afb
...
@@ -357,9 +357,7 @@ public class Bill extends GenericEntity {
...
@@ -357,9 +357,7 @@ public class Bill extends GenericEntity {
this
.
getBillLines
().
add
(
new
BillLine
(
this
,
product
,
count
,
foodwave
));
this
.
getBillLines
().
add
(
new
BillLine
(
this
,
product
,
count
,
foodwave
));
for
(
Discount
disc
:
product
.
getActiveDiscounts
(
count
,
sentDate
))
{
for
(
Discount
disc
:
product
.
getActiveDiscounts
(
count
,
sentDate
))
{
this
.
getBillLines
().
add
(
new
BillLine
(
this
,
product
,
disc
,
count
));
this
.
getBillLines
().
add
(
new
BillLine
(
this
,
product
,
disc
,
count
));
}
}
}
}
...
@@ -419,7 +417,7 @@ public class Bill extends GenericEntity {
...
@@ -419,7 +417,7 @@ public class Bill extends GenericEntity {
boolean
ret
=
false
;
boolean
ret
=
false
;
for
(
BillLine
bl
:
billLines
)
for
(
BillLine
bl
:
billLines
)
{
{
if
(
bl
.
getFoodwave
()
!=
null
&&
(
bl
.
getFoodwave
().
getClosed
()
||
bl
.
getFoodwave
().
getTime
().
before
(
Calendar
.
getInstanc
e
())))
if
(
bl
.
getFoodwave
()
!=
null
&&
(
bl
.
getFoodwave
().
getClosed
()
||
bl
.
getFoodwave
().
getTime
().
before
(
new
Dat
e
())))
{
{
ret
=
true
;
ret
=
true
;
break
;
break
;
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/BillLine.java
View file @
9059afb
...
@@ -7,6 +7,7 @@ package fi.insomnia.bortal.model;
...
@@ -7,6 +7,7 @@ package fi.insomnia.bortal.model;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.math.RoundingMode
;
import
java.util.ArrayList
;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Entity
;
...
@@ -102,12 +103,11 @@ public class BillLine extends GenericEntity {
...
@@ -102,12 +103,11 @@ public class BillLine extends GenericEntity {
super
();
super
();
}
}
public
BillLine
(
Bill
bill2
,
Product
product
,
BigDecimal
count
)
{
public
BillLine
(
Bill
bill2
,
Product
product
,
BigDecimal
count
)
{
this
(
bill2
,
product
,
count
,
null
);
this
(
bill2
,
product
,
count
,
null
);
}
}
public
BillLine
(
Bill
bill2
,
Product
product
,
BigDecimal
count
,
FoodWave
foodwave
)
{
public
BillLine
(
Bill
bill2
,
Product
product
,
BigDecimal
count
,
FoodWave
foodwave
)
{
super
();
super
();
this
.
bill
=
bill2
;
this
.
bill
=
bill2
;
this
.
lineProduct
=
product
;
this
.
lineProduct
=
product
;
...
@@ -117,13 +117,20 @@ public class BillLine extends GenericEntity {
...
@@ -117,13 +117,20 @@ public class BillLine extends GenericEntity {
this
.
setUnitPrice
(
product
.
getPrice
().
abs
());
this
.
setUnitPrice
(
product
.
getPrice
().
abs
());
this
.
setVat
(
product
.
getVat
());
this
.
setVat
(
product
.
getVat
());
this
.
setFoodwave
(
foodwave
);
this
.
setFoodwave
(
foodwave
);
if
(
foodwave
!=
null
)
{
if
(
foodwave
.
getBillLines
()
==
null
)
{
foodwave
.
setBillLines
(
new
ArrayList
<
BillLine
>());
}
if
(!
foodwave
.
getBillLines
().
contains
(
this
))
{
foodwave
.
getBillLines
().
add
(
this
);
}
}
}
}
/**
/**
* Discounttia luotaessa lasketaan productin hinnasta jokin kiva
*
Discounttia luotaessa lasketaan productin hinnasta jokin kiva
miinuspuolinen rivi discountin mukaan?
* miinuspuolinen rivi discountin mukaan?
*
*
* Kommentteja plz!
* Kommentteja plz!
*
*
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/FoodWave.java
View file @
9059afb
...
@@ -6,6 +6,7 @@ package fi.insomnia.bortal.model;
...
@@ -6,6 +6,7 @@ package fi.insomnia.bortal.model;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
...
@@ -21,8 +22,6 @@ import javax.persistence.TemporalType;
...
@@ -21,8 +22,6 @@ import javax.persistence.TemporalType;
import
org.eclipse.persistence.annotations.OptimisticLocking
;
import
org.eclipse.persistence.annotations.OptimisticLocking
;
import
org.eclipse.persistence.annotations.OptimisticLockingType
;
import
org.eclipse.persistence.annotations.OptimisticLockingType
;
import
com.sun.istack.internal.logging.Logger
;
/**
/**
*
*
*/
*/
...
@@ -42,7 +41,7 @@ public class FoodWave extends GenericEntity {
...
@@ -42,7 +41,7 @@ public class FoodWave extends GenericEntity {
@Column
(
name
=
"wave_time"
)
@Column
(
name
=
"wave_time"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Calendar
time
;
private
Date
time
;
@Column
(
name
=
"max_foods"
)
@Column
(
name
=
"max_foods"
)
private
Integer
maximumFoods
;
private
Integer
maximumFoods
;
...
@@ -86,11 +85,11 @@ public class FoodWave extends GenericEntity {
...
@@ -86,11 +85,11 @@ public class FoodWave extends GenericEntity {
this
.
description
=
waveDescription
;
this
.
description
=
waveDescription
;
}
}
public
Calendar
getTime
()
{
public
Date
getTime
()
{
return
time
;
return
time
;
}
}
public
void
setTime
(
Calendar
waveTime
)
{
public
void
setTime
(
Date
waveTime
)
{
this
.
time
=
waveTime
;
this
.
time
=
waveTime
;
}
}
...
@@ -143,7 +142,7 @@ public class FoodWave extends GenericEntity {
...
@@ -143,7 +142,7 @@ public class FoodWave extends GenericEntity {
return
false
;
return
false
;
}
}
if
(
getTime
().
before
(
Calendar
.
getInstanc
e
()))
{
if
(
getTime
().
before
(
new
Dat
e
()))
{
return
false
;
return
false
;
}
}
...
@@ -182,17 +181,12 @@ public class FoodWave extends GenericEntity {
...
@@ -182,17 +181,12 @@ public class FoodWave extends GenericEntity {
this
.
billLines
=
billLines
;
this
.
billLines
=
billLines
;
}
}
public
int
getReservedCount
()
{
public
Integer
getReservedCount
()
{
int
retval
=
0
;
Integer
retval
=
0
;
if
(
getAccountEvents
()
!=
null
)
{
retval
+=
getAccountEvents
().
size
();
}
if
(
getUnpaidBillLineCount
()
!=
null
)
{
retval
+=
getUnpaidBillLineCount
();
}
retval
+=
getOrderedCount
();
retval
+=
getUnpaidCount
();
return
retval
;
return
retval
;
}
}
...
@@ -200,14 +194,30 @@ public class FoodWave extends GenericEntity {
...
@@ -200,14 +194,30 @@ public class FoodWave extends GenericEntity {
this
.
maximumFoods
=
maximumFoods
;
this
.
maximumFoods
=
maximumFoods
;
}
}
public
Integer
getUnpaid
BillLine
Count
()
{
public
Integer
getUnpaidCount
()
{
Integer
i
=
0
;
Integer
ret
=
0
;
for
(
BillLine
line
:
getBillLines
())
{
for
(
BillLine
line
:
getBillLines
())
{
if
(!
line
.
getBill
().
isPaid
())
{
if
(!
line
.
getBill
().
isPaid
())
{
++
i
;
ret
+=
line
.
getQuantity
().
intValue
()
;
}
}
}
}
return
i
;
return
ret
;
}
public
Integer
getOrderedCount
()
{
Integer
ret
=
0
;
if
(
getAccountEvents
()
!=
null
)
{
for
(
AccountEvent
ae
:
getAccountEvents
())
{
ret
+=
ae
.
getQuantity
().
intValue
();
}
}
return
ret
;
}
}
}
}
code/LanBortalWeb/WebContent/WEB-INF/web.xml
View file @
9059afb
...
@@ -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>
...
...
code/LanBortalWeb/WebContent/foodadmin/editTemplate.xhtml
View file @
9059afb
...
@@ -80,6 +80,7 @@
...
@@ -80,6 +80,7 @@
value=
"#{foodWaveView.template.products}"
var=
"product"
value=
"#{foodWaveView.template.products}"
var=
"product"
editable=
"true"
>
editable=
"true"
>
<p:ajax
event=
"rowEdit"
listener=
"#{foodWaveView.onEdit}"
/>
<p:ajax
event=
"rowEdit"
listener=
"#{foodWaveView.onEdit}"
/>
<p:column
headerText=
"#{i18n['foodwavetemplate.productname']}"
>
<p:column
headerText=
"#{i18n['foodwavetemplate.productname']}"
>
...
...
code/LanBortalWeb/WebContent/foodmanager/listFoodwaves.xhtml
View file @
9059afb
...
@@ -12,52 +12,74 @@
...
@@ -12,52 +12,74 @@
<h1>
#{i18n['foodWave.list']}
</h1>
<h1>
#{i18n['foodWave.list']}
</h1>
</ui:define>
</ui:define>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<h:form>
<p:dataTable
styleClass=
"bordertable"
value=
"#{foodWaveView.foodWaves}"
var=
"foodwave"
rowStyleClass=
"#{foodWave.closed ? 'old' : null}"
>
<p:dataTable
styleClass=
"bordertable"
value=
"#{foodWaveView.foodWaves}"
sortBy=
"#{foodwave.time}"
sortOrder=
"ascending"
var=
"foodwave"
editable=
"true"
>
<p:column>
<p:ajax
event=
"rowEdit"
listener=
"#{foodWaveView.onEditFoodWave}"
rowStyleClass=
"#{foodWave.closed ? 'old' : null} />
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['foodWave.time']}"
/>
<p:column sortBy="
#{
foodwave
.
time
}"
>
</f:facet>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{foodwave.time.time}"
>
<h:outputText
value=
"${i18n['foodWave.time']}"
/>
<f:convertDateTime
pattern=
"#{sessionHandler.datetimeFormat}"
timeZone=
"#{sessionHandler.timezone}"
/>
</f:facet>
</h:outputText>
<p:cellEditor>
</p:column>
<f:facet
name=
"output"
>
<p:column>
<h:outputText
value=
"#{foodwave.time}"
>
<f:facet
name=
"header"
>
<f:convertDateTime
pattern=
"#{sessionHandler.datetimeFormat}"
timeZone=
"#{sessionHandler.timezone}"
/>
<h:outputText
value=
"${i18n['foodWave.template.name']}"
/>
</h:outputText>
</f:facet>
</f:facet>
<h:outputText
value=
"#{foodwave.template.name}"
/>
<f:facet
name=
"input"
>
</p:column>
<p:calendar
id=
"startTime"
value=
"#{foodwave.time}"
pattern=
"#{sessionHandler.datetimeFormat}"
/>
<p:column>
</f:facet>
<f:facet
name=
"header"
>
</p:cellEditor>
<h:outputLabel
id=
"name"
value=
"${i18n['foodWave.name']}"
/>
</p:column>
</f:facet>
<p:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{foodwave.name}"
/>
<h:outputText
value=
"${i18n['foodWave.template.name']}"
/>
</p:column>
</f:facet>
<p:column
styleClass=
"text-center"
>
<h:outputText
value=
"#{foodwave.template.name}"
/>
<f:facet
name=
"header"
>
</p:column>
<h:outputText
value=
"${i18n['foodWave.paid']}"
/>
<p:column>
</f:facet>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{foodwave.accountEvents.size()}"
/>
<h:outputLabel
id=
"name"
value=
"${i18n['foodWave.name']}"
/>
</p:column>
</f:facet>
<p:column
styleClass=
"text-center"
>
<p:cellEditor>
<f:facet
name=
"header"
>
<f:facet
name=
"output"
>
<h:outputText
value=
"${i18n['foodWave.unconfirmedOrders']}"
/>
<h:outputText
value=
"#{foodwave.name}"
/>
</f:facet>
</f:facet>
<h:outputText
value=
"#{foodwave.unpaidBillLineCount}"
/>
<f:facet
name=
"input"
>
</p:column>
<p:inputText
value=
"#{foodwave.name}"
style=
"width:100%"
required=
"true"
requiredMessage=
"Name required"
/>
<p:column>
</f:facet>
<f:facet
name=
"header"
>
</p:cellEditor>
<h:outputText
value=
"${i18n['foodWave.totalReserved']}"
/>
</p:column>
</f:facet>
<p:column
styleClass=
"text-center"
>
<h:outputText
value=
"#{foodwave.reservedCount}"
/>
/
<h:outputText
value=
"#{foodwave.maximumFoods}"
/>
<f:facet
name=
"header"
>
</p:column>
<h:outputText
value=
"${i18n['foodWave.paid']}"
/>
</f:facet>
<h:outputText
value=
"#{foodwave.accountEvents.size()}"
/>
</p:column>
<p:column
styleClass=
"text-center"
>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['foodWave.unconfirmedOrders']}"
/>
</f:facet>
<h:outputText
value=
"#{foodwave.unpaidBillLineCount}"
/>
</p:column>
<p:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['foodWave.totalReserved']}"
/>
</f:facet>
<h:outputText
value=
"#{foodwave.reservedCount}"
/>
/
<h:outputText
value=
"#{foodwave.maximumFoods}"
/>
</p:column>
<p:column>
<h:link
outcome=
"/foodmanager/listOrders"
value=
"#{i18n['foodWave.show']}"
>
<f:param
name=
"foodwaveid"
value=
"#{foodwave.id}"
/>
</h:link>
</p:column>
<<<<<<
< HEAD
=======
<
p:column
>
<
p:column
>
<h:link
outcome=
"/foodmanager/listOrders"
value=
"#{i18n['foodWave.show']}"
>
<p:rowEditor
/
>
<
f:param
name=
"foodwaveid"
value=
"#{foodwave.id}"
/
>
<
/p:column
>
</h:link>
</p:column>
>>>>>>> 5c881099ad3e46541138670b63f9506684ecd1e2
<!--
<!--
<p:column>
<p:column>
<h:outputText value="#{foodwave.closed.toString()}" />
<h:outputText value="#{foodwave.closed.toString()}" />
...
@@ -68,12 +90,11 @@
...
@@ -68,12 +90,11 @@
value="#{i18n['foodWave.closeNow']}"
value="#{i18n['foodWave.closeNow']}"
action="#{foodwave.toggleClosed}" />
action="#{foodwave.toggleClosed}" />
</p:column> -->
</p:column> -->
</p:dataTable>
</p:dataTable>
</h:form>
</ui:define>
</ui:define>
</ui:composition>
</ui:composition>
</h:body>
</h:body>
</html>
</html>
\ No newline at end of file
code/LanBortalWeb/WebContent/foodmanager/listOrders.xhtml
View file @
9059afb
<!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: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: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>
<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}"
/>
<f:event
type=
"preRenderView"
<f:event
type=
"preRenderView"
listener=
"#{foodWaveView.initFoodWaveOrderList}"
/>
listener=
"#{foodWaveView.initFoodWaveOrderList}"
/>
<!-- <f:event type="preRenderView" listener="#{foodWaveView.initFoodwaveAccountEventList}" /> -->
<!-- <f:event type="preRenderView" listener="#{foodWaveView.initFoodwaveAccountEventList}" /> -->
</f:metadata>
</f:metadata>
...
@@ -22,45 +13,41 @@
...
@@ -22,45 +13,41 @@
</ui:define>
</ui:define>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<h:form>
<h:form>
<p:dataTable
styleClass=
"bordertable"
<p:dataTable
styleClass=
"bordertable"
value=
"#{foodWaveView.accountEventLines}"
var=
"acc_line"
sortBy=
"#{acc_line.user.nick}"
>
value=
"#{foodWaveView.accountEventLines}"
var=
"acc_line"
>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputLabel
value=
"#{i18n['foodWave.accountevents']}"
/>
<h:outputLabel
value=
"#{i18n['foodWave.accountevents']}"
/>
</f:facet>
</f:facet>
<p:column>
<p:column
sortBy=
"#{acc_line.eventTime.getTime()}"
>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputLabel
value=
"#{i18n['acc_line.time']}"
/>
<h:outputLabel
value=
"#{i18n['acc_line.time']}"
/>
</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}"
timeZone=
"#{sessionHandler.timezone}"
/>
<f:convertDateTime
pattern=
"#{sessionHandler.datetimeFormat}"
timeZone=
"#{sessionHandler.timezone}"
/>
</h:outputText>
</h:outputText>
</p:column>
</p:column>
<p:column>
<p:column
sortBy=
"#{acc_line.quantity}"
>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputLabel
value=
"#{i18n['acc_line.quantity']}"
/>
<h:outputLabel
value=
"#{i18n['acc_line.quantity']}"
/>
</f:facet>
</f:facet>
<h:outputText
style=
"text-align: center;"
<h:outputText
style=
"text-align: center;"
value=
"#{acc_line.quantity}"
>
value=
"#{acc_line.quantity}"
>
<f:convertNumber
minFractionDigits=
"2"
maxFractionDigits=
"2"
/>
<f:convertNumber
minFractionDigits=
"2"
maxFractionDigits=
"2"
/>
</h:outputText>
</h:outputText>
</p:column>
</p:column>
<p:column>
<p:column
sortBy=
"#{acc_line.product.name}"
>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputLabel
value=
"#{i18n['acc_line.product']}"
/>
<h:outputLabel
value=
"#{i18n['acc_line.product']}"
/>
</f:facet>
</f:facet>
<h:outputText
value=
"#{acc_line.product.name}"
/>
<h:outputText
value=
"#{acc_line.product.name}"
/>
</p:column>
</p:column>
<p:column>
<p:column
sortBy=
"#{acc_line.user.wholeName}"
>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputLabel
value=
"#{i18n['acc_line.eventuser']}"
/>
<h:outputLabel
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
value=
"#{acc_line.user.id}"
/>
<f:param
value=
"#{acc_line.user.id}"
/>
</h:link>
</h:link>
</p:column>
</p:column>
<p:column>
<p:column
sortBy=
"#{acc_line.user.nick}"
>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputLabel
value=
"#{i18n['acc_line.nick']}"
/>
<h:outputLabel
value=
"#{i18n['acc_line.nick']}"
/>
</f:facet>
</f:facet>
...
@@ -68,37 +55,25 @@
...
@@ -68,37 +55,25 @@
<f:param
value=
"#{acc_line.user.id}"
/>
<f:param
value=
"#{acc_line.user.id}"
/>
</h:link>
</h:link>
</p:column>
</p:column>
<p:column>
<p:column
sortBy=
"#{acc_line.eventDelivered}"
>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputLabel
value=
"#{i18n['accountEvent.delivered']}"
/>
<h:outputLabel
value=
"#{i18n['accountEvent.delivered']}"
/>
</f:facet>
</f:facet>
<h:outputText
rendered=
"#{acc_line.eventDelivered}"
<h:outputText
rendered=
"#{acc_line.eventDelivered}"
value=
"#{i18n['accountEvent.delivered']}"
/>
value=
"#{i18n['accountEvent.delivered']}"
/>
<h:commandButton
rendered=
"#{not acc_line.eventDelivered}"
value=
"#{i18n['accountEvent.deliver']}"
action=
"#{foodWaveView.deliverAccountEvent}"
/>
<h:commandButton
rendered=
"#{not acc_line.eventDelivered}"
value=
"#{i18n['accountEvent.deliver']}"
action=
"#{foodWaveView.deliverAccountEvent}"
/>
</p:column>
</p:column>
</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>
<h:form>
<h:form>
<p:dataTable
styleClass=
"bordertable"
<p:dataTable
styleClass=
"bordertable"
value=
"#{foodWaveView.billLines}"
var=
"bill_line"
sortBy=
"#{bill_line.bill.user.nick}"
>
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']}"
/>
</f:facet>
</f:facet>
<p:column>
<p:column
sortBy=
"#{bill_line.bill.sentDate.getTime()}"
>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputLabel
value=
"#{i18n['billLine.time']}"
/>
<h:outputLabel
value=
"#{i18n['billLine.time']}"
/>
</f:facet>
</f:facet>
...
@@ -106,62 +81,56 @@
...
@@ -106,62 +81,56 @@
<f:convertDateTime
pattern=
"#{sessionHandler.datetimeFormat}"
/>
<f:convertDateTime
pattern=
"#{sessionHandler.datetimeFormat}"
/>
</h:outputText>
</h:outputText>
</p:column>
</p:column>
<p:column>
<p:column
sortBy=
"#{bill_line.quantity}"
>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputLabel
value=
"#{i18n['billLine.quantity']}"
/>
<h:outputLabel
value=
"#{i18n['billLine.quantity']}"
/>
</f:facet>
</f:facet>
<h:outputText
style=
"text-align: center;"
<h:outputText
style=
"text-align: center;"
value=
"#{bill_line.quantity}"
>
value=
"#{bill_line.quantity}"
>
<f:convertNumber
minFractionDigits=
"2"
maxFractionDigits=
"2"
/>
<f:convertNumber
minFractionDigits=
"2"
maxFractionDigits=
"2"
/>
</h:outputText>
</h:outputText>
</p:column>
</p:column>
<p:column>
<p:column
sortBy=
"#{bill_line.name}"
>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputLabel
value=
"#{i18n['billLine.product']}"
/>
<h:outputLabel
value=
"#{i18n['billLine.product']}"
/>
</f:facet>
</f:facet>
<h:outputText
value=
"#{bill_line.name}"
/>
<h:outputText
value=
"#{bill_line.name}"
/>
</p:column>
</p:column>
<p:column>
<p:column
sortBy=
"#{bill_line.bill.user.wholeName}"
>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputLabel
value=
"#{i18n['billLine.eventuser']}"
/>
<h:outputLabel
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>
<p:column>
<p:column
sortBy=
"#{bill_line.bill.user.nick}"
>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputLabel
value=
"#{i18n['billLine.nick']}"
/>
<h:outputLabel
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>
<p:column>
<p:column
sortBy=
"#{bill_line.linePrice}"
>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputLabel
value=
"#{i18n['billLine.price']}"
/>
<h:outputLabel
value=
"#{i18n['billLine.price']}"
/>
</f:facet>
</f:facet>
<h:outputText
style=
"text-align: center;"
<h:outputText
style=
"text-align: center;"
value=
"#{bill_line.linePrice}"
>
value=
"#{bill_line.linePrice}"
>
<f:convertNumber
minFractionDigits=
"2"
maxFractionDigits=
"2"
/>
<f:convertNumber
minFractionDigits=
"2"
maxFractionDigits=
"2"
/>
</h:outputText>
</h:outputText>
</p:column>
</p:column>
<p:column>
<p:column
sortBy=
"#{bill_line.bill.totalPrice}"
>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputLabel
value=
"#{i18n['bill.totalprice']}"
/>
<h:outputLabel
value=
"#{i18n['bill.totalprice']}"
/>
</f:facet>
</f:facet>
<h:outputText
style=
"text-align: center;"
<h:outputText
style=
"text-align: center;"
value=
"#{bill_line.bill.totalPrice}"
>
value=
"#{bill_line.bill.totalPrice}"
>
<f:convertNumber
minFractionDigits=
"2"
maxFractionDigits=
"2"
/>
<f:convertNumber
minFractionDigits=
"2"
maxFractionDigits=
"2"
/>
</h:outputText>
</h:outputText>
</p:column>
</p:column>
<p:column>
<p:column>
<h:commandButton
value=
"#{i18n['bill.markPaid']}"
<h:commandButton
value=
"#{i18n['bill.markPaid']}"
action=
"#{foodWaveView.markBillPaid}"
/>
action=
"#{foodWaveView.markBillPaid}"
/>
</p:column>
</p:column>
<!--
<!--
<p:column>
<p:column>
...
@@ -171,13 +140,53 @@
...
@@ -171,13 +140,53 @@
</p:dataTable>
</p:dataTable>
</h:form>
</h:form>
<!-- <foodwave:summary foodwaveProductSummaries="#{foodWaveView.productSummaries}" foodwave="#{foodWaveView.selectedFoodWave}"/>
<h2>
#{i18n['foodwave.summaryView']}
</h2>
-->
<div>
<h:outputLabel
value=
"#{i18n['foodwave.price']}: "
/>
<h:outputText
value=
"#{foodWaveView.foodwavePrice}"
/>
</div>
<div>
<h:outputLabel
value=
"#{i18n['foodwave.foodwaveBuyInPrice']}: "
/>
<h:outputText
value=
"#{foodWaveView.foodwaveBuyInPrice}"
/>
</div>
<p:dataTable
var=
"summ"
value=
"#{foodWaveView.productSummaries}"
>
<p:column>
<f:facet
name=
"header"
>
<h:outputLabel
value=
"#{i18n['product.name']}"
/>
</f:facet>
<h:outputText
value=
"#{summ.product.name}"
/>
</p:column>
<p:column>
<f:facet
name=
"header"
>
<h:outputLabel
value=
"#{i18n['foodwave.totalCount']}"
/>
</f:facet>
<h:outputText
value=
"#{summ.count}"
>
<f:convertNumber
minFractionDigits=
"0"
/>
</h:outputText>
</p:column>
<p:column>
<f:facet
name=
"header"
>
<h:outputLabel
value=
"#{i18n['foodwave.totalPrice']}"
/>
</f:facet>
<h:outputText
value=
"#{summ.summaryPrice}"
>
<f:convertNumber
minFractionDigits=
"0"
/>
</h:outputText>
</p:column>
<p:column>
<f:facet
name=
"header"
>
<h:outputLabel
value=
"#{i18n['foodwave.buyInPrice']}"
/>
</f:facet>
<h:outputText
value=
"#{summ.buyInPrice}"
>
<f:convertNumber
minFractionDigits=
"0"
/>
</h:outputText>
</p:column>
</p:dataTable>
</ui:define>
</ui:define>
</ui:composition>
</ui:composition>
</h:body>
</h:body>
</html>
</html>
\ No newline at end of file
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_en.properties
View file @
9059afb
...
@@ -218,7 +218,11 @@ foodshop.buyFromCounter = Pay at info
...
@@ -218,7 +218,11 @@ foodshop.buyFromCounter = Pay at info
foodshop.buyFromInternet
=
Pay at Internet
foodshop.buyFromInternet
=
Pay at Internet
foodshop.total
=
Total
foodshop.total
=
Total
foodwave.foodwaveBuyInPrice
=
Total buy in price
foodwave.markPaid
=
Foodwave marked paid
foodwave.orders
=
Foodwave Orders
foodwave.orders
=
Foodwave Orders
foodwave.price
=
Foodwave price
foodwave.summaryView
=
Foodwave summary
foodwave.template.basicinfo
=
Template Information
foodwave.template.basicinfo
=
Template Information
foodwave.template.description
=
Description
foodwave.template.description
=
Description
foodwave.template.edit.title
=
Foodwave Template Editor
foodwave.template.edit.title
=
Foodwave Template Editor
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_fi.properties
View file @
9059afb
...
@@ -216,7 +216,10 @@ foodshop.buyFromCounter = Maksa infossa
...
@@ -216,7 +216,10 @@ foodshop.buyFromCounter = Maksa infossa
foodshop.buyFromInternet
=
Maksa Internetiss
\u
00E4
foodshop.buyFromInternet
=
Maksa Internetiss
\u
00E4
foodshop.total
=
Yhteens
\u
00E4
foodshop.total
=
Yhteens
\u
00E4
foodwave.foodwaveBuyInPrice
=
Sis
\u
00E4
\u
00E4nostohinta
foodwave.markPaid
=
Merkitty maksetuksi
foodwave.orders
=
Maksetut Tilaukset
foodwave.orders
=
Maksetut Tilaukset
foodwave.price
=
Tilausten kokonaishinta
foodwave.template.basicinfo
=
Template Infot
foodwave.template.basicinfo
=
Template Infot
foodwave.template.description
=
Kuvaus
foodwave.template.description
=
Kuvaus
foodwave.template.edit.title
=
Foodwave Template Editori
foodwave.template.edit.title
=
Foodwave Template Editori
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/FoodWaveFoodView.java
View file @
9059afb
...
@@ -141,6 +141,7 @@ public class FoodWaveFoodView extends GenericCDIView {
...
@@ -141,6 +141,7 @@ public class FoodWaveFoodView extends GenericCDIView {
bill
.
addProduct
(
shopitem
.
getProduct
(),
shopitem
.
getCount
(),
getFoodWave
());
bill
.
addProduct
(
shopitem
.
getProduct
(),
shopitem
.
getCount
(),
getFoodWave
());
}
}
}
}
billBean
.
createBill
(
bill
);
billBean
.
createBill
(
bill
);
return
bill
;
return
bill
;
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/FoodWaveView.java
View file @
9059afb
...
@@ -67,7 +67,7 @@ public class FoodWaveView extends GenericCDIView {
...
@@ -67,7 +67,7 @@ public class FoodWaveView extends GenericCDIView {
private
Integer
foodWaveId
;
private
Integer
foodWaveId
;
private
ListDataModel
<
AccountEvent
>
accountEventLines
;
private
ListDataModel
<
AccountEvent
>
accountEventLines
;
private
List
<
FoodWave
>
foodWaves
;
private
List
DataModel
<
FoodWave
>
foodWaves
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FoodWaveView
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FoodWaveView
.
class
);
public
List
<
Product
>
getProducts
()
{
public
List
<
Product
>
getProducts
()
{
...
@@ -79,6 +79,11 @@ public class FoodWaveView extends GenericCDIView {
...
@@ -79,6 +79,11 @@ public class FoodWaveView extends GenericCDIView {
public
void
onEdit
()
{
public
void
onEdit
()
{
this
.
foodWaveBean
.
saveTemplate
(
template
);
this
.
foodWaveBean
.
saveTemplate
(
template
);
}
}
public
void
onEditFoodWave
()
{
FoodWave
fw
=
foodWaves
.
getRowData
();
this
.
foodWaveBean
.
merge
(
fw
);
}
public
void
initTemplateList
()
{
public
void
initTemplateList
()
{
super
.
requirePermissions
(
ShopPermission
.
SHOP_FOODWAVE
);
super
.
requirePermissions
(
ShopPermission
.
SHOP_FOODWAVE
);
...
@@ -87,7 +92,11 @@ public class FoodWaveView extends GenericCDIView {
...
@@ -87,7 +92,11 @@ public class FoodWaveView extends GenericCDIView {
public
void
initFoodwaveManagerList
()
{
public
void
initFoodwaveManagerList
()
{
if
(
super
.
requirePermissions
(
ShopPermission
.
MANAGE_FOODWAVES
))
if
(
super
.
requirePermissions
(
ShopPermission
.
MANAGE_FOODWAVES
))
{
{
foodWaves
=
foodWaveBean
.
getEventFoodWaves
();
if
(
foodWaves
==
null
)
{
super
.
beginConversation
();
foodWaves
=
new
ListDataModel
<
FoodWave
>(
foodWaveBean
.
getEventFoodWaves
());
}
}
}
}
}
...
@@ -95,7 +104,7 @@ public class FoodWaveView extends GenericCDIView {
...
@@ -95,7 +104,7 @@ public class FoodWaveView extends GenericCDIView {
public
String
createFoodwave
()
{
public
String
createFoodwave
()
{
Calendar
c
=
Calendar
.
getInstance
();
Calendar
c
=
Calendar
.
getInstance
();
c
.
setTime
(
startDate
);
c
.
setTime
(
startDate
);
selectedFoodWave
.
setTime
(
c
);
selectedFoodWave
.
setTime
(
c
.
getTime
()
);
foodWaveBean
.
createFoodWave
(
selectedFoodWave
);
foodWaveBean
.
createFoodWave
(
selectedFoodWave
);
initFoodwaveManagerList
();
initFoodwaveManagerList
();
...
@@ -110,9 +119,9 @@ public class FoodWaveView extends GenericCDIView {
...
@@ -110,9 +119,9 @@ public class FoodWaveView extends GenericCDIView {
if
(
templateId
!=
null
)
if
(
templateId
!=
null
)
{
{
template
=
foodWaveBean
.
findTemplate
(
templateId
);
template
=
foodWaveBean
.
findTemplate
(
templateId
);
foodWaves
=
template
.
getFoodwaves
(
);
foodWaves
=
new
ListDataModel
<
FoodWave
>(
template
.
getFoodwaves
()
);
}
else
{
}
else
{
foodWaves
=
foodWaveBean
.
getOpenFoodWaves
(
);
foodWaves
=
new
ListDataModel
<
FoodWave
>(
foodWaveBean
.
getOpenFoodWaves
()
);
}
}
super
.
beginConversation
();
super
.
beginConversation
();
}
}
...
@@ -154,7 +163,7 @@ public class FoodWaveView extends GenericCDIView {
...
@@ -154,7 +163,7 @@ public class FoodWaveView extends GenericCDIView {
for
(
AccountEvent
ae
:
getSelectedFoodWave
().
getAccountEvents
())
{
for
(
AccountEvent
ae
:
getSelectedFoodWave
().
getAccountEvents
())
{
if
(!
pmap
.
containsKey
(
ae
.
getProduct
()))
{
if
(!
pmap
.
containsKey
(
ae
.
getProduct
()))
{
pmap
.
put
(
ae
.
getProduct
(),
new
FoodwaveProductSummary
(
ae
.
getProduct
()
,
new
BigDecimal
(
0
),
new
BigDecimal
(
0
)
));
pmap
.
put
(
ae
.
getProduct
(),
new
FoodwaveProductSummary
(
ae
.
getProduct
()));
}
}
System
.
out
.
println
(
".."
);
System
.
out
.
println
(
".."
);
...
@@ -186,17 +195,17 @@ public class FoodWaveView extends GenericCDIView {
...
@@ -186,17 +195,17 @@ public class FoodWaveView extends GenericCDIView {
this
.
currentProduct
=
currentProduct
;
this
.
currentProduct
=
currentProduct
;
}
}
public
BigDecimal
getFood
W
avePrice
()
public
BigDecimal
getFood
w
avePrice
()
{
{
BigDecimal
ret
=
BigDecimal
.
ZERO
;
BigDecimal
ret
=
BigDecimal
.
ZERO
;
for
(
AccountEvent
ac
:
selectedFoodWave
.
getAccountEvents
())
for
(
AccountEvent
ac
:
selectedFoodWave
.
getAccountEvents
())
{
{
ret
=
ret
.
add
(
ac
.
getTotal
());
ret
=
ret
.
add
(
ac
.
getTotal
());
}
}
return
ret
;
return
ret
.
negate
()
;
}
}
public
BigDecimal
getBuyInPrice
()
public
BigDecimal
get
Foodwave
BuyInPrice
()
{
{
BigDecimal
ret
=
BigDecimal
.
ZERO
;
BigDecimal
ret
=
BigDecimal
.
ZERO
;
for
(
AccountEvent
ac
:
selectedFoodWave
.
getAccountEvents
())
for
(
AccountEvent
ac
:
selectedFoodWave
.
getAccountEvents
())
...
@@ -335,11 +344,11 @@ public class FoodWaveView extends GenericCDIView {
...
@@ -335,11 +344,11 @@ public class FoodWaveView extends GenericCDIView {
this
.
billLines
=
billLines
;
this
.
billLines
=
billLines
;
}
}
public
void
setFoodWaves
(
List
<
FoodWave
>
foodWaves
)
{
public
void
setFoodWaves
(
List
DataModel
<
FoodWave
>
foodWaves
)
{
this
.
foodWaves
=
foodWaves
;
this
.
foodWaves
=
foodWaves
;
}
}
public
List
<
FoodWave
>
getFoodWaves
()
{
public
List
DataModel
<
FoodWave
>
getFoodWaves
()
{
return
foodWaves
;
return
foodWaves
;
}
}
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/helpers/FoodwaveProductSummary.java
View file @
9059afb
...
@@ -10,11 +10,13 @@ public class FoodwaveProductSummary {
...
@@ -10,11 +10,13 @@ public class FoodwaveProductSummary {
private
Product
product
;
private
Product
product
;
private
BigDecimal
count
;
private
BigDecimal
count
;
private
BigDecimal
summaryPrice
;
private
BigDecimal
summaryPrice
;
private
BigDecimal
buyInPrice
;
public
FoodwaveProductSummary
(
Product
product
,
BigDecimal
count
,
BigDecimal
summaryPrice
)
{
public
FoodwaveProductSummary
(
Product
product
)
{
setProduct
(
product
);
setProduct
(
product
);
setCount
(
count
);
setCount
(
BigDecimal
.
ZERO
);
setSummaryPrice
(
summaryPrice
);
setSummaryPrice
(
BigDecimal
.
ZERO
);
buyInPrice
=
BigDecimal
.
ZERO
;
}
}
public
Product
getProduct
()
{
public
Product
getProduct
()
{
...
@@ -43,8 +45,20 @@ public class FoodwaveProductSummary {
...
@@ -43,8 +45,20 @@ public class FoodwaveProductSummary {
public
void
add
(
AccountEvent
ae
)
{
public
void
add
(
AccountEvent
ae
)
{
setCount
(
getCount
().
add
(
ae
.
getQuantity
()));
setCount
(
getCount
().
add
(
ae
.
getQuantity
()));
setSummaryPrice
(
getSummaryPrice
().
add
((
ae
.
getTotal
().
negate
())));
setSummaryPrice
(
getSummaryPrice
().
add
((
ae
.
getTotal
().
negate
())));
if
(
product
.
getBuyInPrice
()
!=
null
)
{
buyInPrice
=
buyInPrice
.
add
(
getProduct
().
getBuyInPrice
());
}
}
public
BigDecimal
getBuyInPrice
()
{
return
buyInPrice
;
}
public
void
setBuyInPrice
(
BigDecimal
buyInPrice
)
{
this
.
buyInPrice
=
buyInPrice
;
}
}
}
}
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