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 6271a0d5
authored
Oct 27, 2012
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hurr.. foooood..
1 parent
e748081d
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
88 additions
and
28 deletions
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/MenuBean.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/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/MenuBean.java
View file @
6271a0d
...
@@ -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
(
"/foodmanager/listFoodwaves"
),
ShopPermission
.
MANAGE_FOODWAVES
);
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/listTemplates"
),
ShopPermission
.
MANAGE_FOODWAVES
);
foodnavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/foodadmin/createTemplate"
),
ShopPermission
.
MANAGE_FOODWAVES
);
foodnavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/foodadmin/createTemplate"
),
ShopPermission
.
MANAGE_FOODWAVES
);
foodnavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/foodadmin/editTemplate"
),
ShopPermission
.
MANAGE_FOODWAVES
).
setVisible
(
false
);
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/listOrders"
),
ShopPermission
.
MANAGE_FOODWAVES
).
setVisible
(
false
);
}
}
@Override
@Override
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Bill.java
View file @
6271a0d
...
@@ -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
));
}
}
}
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/BillLine.java
View file @
6271a0d
...
@@ -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,7 +103,6 @@ public class BillLine extends GenericEntity {
...
@@ -102,7 +103,6 @@ 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
);
}
}
...
@@ -118,12 +118,19 @@ public class BillLine extends GenericEntity {
...
@@ -118,12 +118,19 @@ public class BillLine extends GenericEntity {
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 miinuspuolinen rivi discountin mukaan?
* Discounttia luotaessa lasketaan productin hinnasta jokin kiva
* miinuspuolinen rivi discountin mukaan?
*
*
* Kommentteja plz!
* Kommentteja plz!
*
*
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/FoodWave.java
View file @
6271a0d
...
@@ -21,8 +21,6 @@ import javax.persistence.TemporalType;
...
@@ -21,8 +21,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
;
/**
/**
*
*
*/
*/
...
@@ -209,5 +207,5 @@ public class FoodWave extends GenericEntity {
...
@@ -209,5 +207,5 @@ public class FoodWave extends GenericEntity {
}
}
return
i
;
return
i
;
}
}
}
}
code/LanBortalWeb/WebContent/foodmanager/listOrders.xhtml
View file @
6271a0d
...
@@ -81,14 +81,7 @@
...
@@ -81,14 +81,7 @@
</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>
...
@@ -171,6 +164,48 @@
...
@@ -171,6 +164,48 @@
</p:dataTable>
</p:dataTable>
</h:form>
</h:form>
<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>
<!-- <foodwave:summary foodwaveProductSummaries="#{foodWaveView.productSummaries}" foodwave="#{foodWaveView.selectedFoodWave}"/>
<!-- <foodwave:summary foodwaveProductSummaries="#{foodWaveView.productSummaries}" foodwave="#{foodWaveView.selectedFoodWave}"/>
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_en.properties
View file @
6271a0d
...
@@ -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 @
6271a0d
...
@@ -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 @
6271a0d
...
@@ -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 @
6271a0d
...
@@ -154,7 +154,7 @@ public class FoodWaveView extends GenericCDIView {
...
@@ -154,7 +154,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 +186,17 @@ public class FoodWaveView extends GenericCDIView {
...
@@ -186,17 +186,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
())
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/helpers/FoodwaveProductSummary.java
View file @
6271a0d
...
@@ -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