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 e748081d
authored
Oct 27, 2012
by
Riku Silvola
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of codecrew.fi:bortal
2 parents
395704b7
c01e8242
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
57 additions
and
17 deletions
code/LanBortalDatabase/src/fi/insomnia/bortal/model/FoodWave.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Product.java
code/LanBortalWeb/WebContent/WEB-INF/web.xml
code/LanBortalWeb/WebContent/foodmanager/listOrders.xhtml
code/LanBortalWeb/WebContent/resources/cditools/foodwave/list.xhtml
code/LanBortalWeb/WebContent/resources/cditools/products/edit.xhtml
code/LanBortalWeb/WebContent/resources/cditools/products/shop.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/FoodWaveView.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/FoodWave.java
View file @
e748081
...
...
@@ -199,6 +199,7 @@ public class FoodWave extends GenericEntity {
public
void
setMaximumFoods
(
Integer
maximumFoods
)
{
this
.
maximumFoods
=
maximumFoods
;
}
public
Integer
getUnpaidBillLineCount
()
{
Integer
i
=
0
;
for
(
BillLine
line
:
getBillLines
())
{
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Product.java
View file @
e748081
...
...
@@ -61,6 +61,9 @@ public class Product extends GenericEntity {
@Column
(
name
=
"price"
,
nullable
=
false
,
precision
=
24
,
scale
=
4
)
private
BigDecimal
price
=
BigDecimal
.
ZERO
;
@Column
(
name
=
"buy_in_price"
,
nullable
=
true
,
precision
=
24
,
scale
=
4
)
private
BigDecimal
buyInPrice
=
BigDecimal
.
ZERO
;
@Column
(
name
=
"sort"
,
nullable
=
false
)
private
int
sort
;
...
...
@@ -293,4 +296,12 @@ public class Product extends GenericEntity {
this
.
description
=
description
;
}
public
BigDecimal
getBuyInPrice
()
{
return
buyInPrice
;
}
public
void
setBuyInPrice
(
BigDecimal
buyInPrice
)
{
this
.
buyInPrice
=
buyInPrice
;
}
}
code/LanBortalWeb/WebContent/WEB-INF/web.xml
View file @
e748081
...
...
@@ -9,9 +9,9 @@
</session-config>
<context-param>
<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>
...
...
code/LanBortalWeb/WebContent/foodmanager/listOrders.xhtml
View file @
e748081
...
...
@@ -33,8 +33,7 @@
</f:facet>
<h:outputText
style=
"text-align: center;"
value=
"#{acc_line.eventTime.getTime()}"
>
<f:convertDateTime
pattern=
"#{sessionHandler.datetimeFormat}"
timeZone=
"#{sessionHandler.timezone}"
/>
<f:convertDateTime
pattern=
"#{sessionHandler.datetimeFormat}"
timeZone=
"#{sessionHandler.timezone}"
/>
</h:outputText>
</p:column>
<p:column>
...
...
@@ -82,7 +81,14 @@
</p:dataTable>
</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>
...
...
@@ -165,10 +171,7 @@
</p:dataTable>
</h:form>
<br
/>
<br
/>
<br
/>
<br
/>
<!-- <foodwave:summary foodwaveProductSummaries="#{foodWaveView.productSummaries}" foodwave="#{foodWaveView.selectedFoodWave}"/>
-->
...
...
code/LanBortalWeb/WebContent/resources/cditools/foodwave/list.xhtml
View file @
e748081
...
...
@@ -45,7 +45,7 @@
<h:outputText
value=
"${i18n['foodWave.time']}"
/>
</f:facet>
<h:outputText
value=
"#{foodwave.time.time}"
>
<f:convertDateTime
pattern=
"
hh:mm d/M/yy
"
/>
<f:convertDateTime
pattern=
"
#{sessionHandler.datetimeFormat}"
timeZone=
"#{sessionHandler.timezone}
"
/>
</h:outputText>
</p:column>
</p:dataTable>
...
...
code/LanBortalWeb/WebContent/resources/cditools/products/edit.xhtml
View file @
e748081
...
...
@@ -21,6 +21,10 @@
<h:outputLabel
for=
"price"
value=
"#{i18n['product.price']}:"
/>
<h:inputText
id=
"price"
value=
"#{productView.product.price}"
/>
<h:message
for=
"price"
/>
<h:outputLabel
for=
"buyInPrice"
value=
"#{i18n['product.buyInPrice']}:"
/>
<h:inputText
id=
"buyInPrice"
value=
"#{productView.product.buyInPrice}"
/>
<h:message
for=
"buyInPrice"
/>
<h:outputLabel
for=
"unitName"
value=
"#{i18n['product.unitName']}:"
/>
<h:inputText
id=
"unitName"
value=
"#{productView.product.unitName}"
/>
...
...
code/LanBortalWeb/WebContent/resources/cditools/products/shop.xhtml
View file @
e748081
...
...
@@ -46,9 +46,7 @@
<f:facet
name=
"header"
>
<h:outputText
id=
"count"
value=
"${i18n['product.cart.count']}"
/>
</f:facet>
<h:commandButton
action=
"#{productShopView.addMinusTen}"
value=
"#{i18n['productshop.minusTen']}"
>
<f:ajax
render=
"@form"
/>
</h:commandButton>
<h:commandButton
action=
"#{productShopView.addMinusOne}"
value=
"#{i18n['productshop.minusOne']}"
>
<f:ajax
render=
"@form"
/>
</h:commandButton>
...
...
@@ -59,9 +57,7 @@
<h:commandButton
action=
"#{productShopView.addOne}"
value=
"#{i18n['productshop.plusOne']}"
>
<f:ajax
render=
"@form"
/>
</h:commandButton>
<h:commandButton
action=
"#{productShopView.addTen}"
value=
"#{i18n['productshop.plusTen']}"
>
<f:ajax
render=
"@form"
/>
</h:commandButton>
</h:column>
<h:column
rendered=
"#{productShopView.hasLimits}"
>
<f:facet
name=
"header"
>
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_en.properties
View file @
e748081
...
...
@@ -196,6 +196,7 @@ eventorganiser.name = Eventorganiser
food
=
Food
foodWave.accountevents
=
Accountevents
foodWave.billLines
=
Pending Online Payments
foodWave.description
=
Description
foodWave.list
=
FoodWave Listing
...
...
@@ -498,6 +499,7 @@ poll.save = Send answers
product.barcode
=
Barcode
product.billed
=
Billed
product.boughtTotal
=
Products billed
product.buyInPrice
=
Buy in price
product.cart.count
=
To shoppingcart
product.cashed
=
Cashpaid
product.color
=
Color in UI
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_fi.properties
View file @
e748081
...
...
@@ -194,6 +194,7 @@ eventorganiser.name = Tapahtumaj\u00E4rjest\u00E4j\u00E4
food
=
Ruoka
foodWave.accountevents
=
Maksetut tilaukset
foodWave.billLines
=
Maksamattomat Verkkomaksut
foodWave.description
=
Kuvaus
foodWave.list
=
Ruokatilausten listaus
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/FoodWaveView.java
View file @
e748081
...
...
@@ -5,7 +5,6 @@ import java.util.ArrayList;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.TreeSet
;
...
...
@@ -187,6 +186,29 @@ public class FoodWaveView extends GenericCDIView {
this
.
currentProduct
=
currentProduct
;
}
public
BigDecimal
getFoodWavePrice
()
{
BigDecimal
ret
=
BigDecimal
.
ZERO
;
for
(
AccountEvent
ac
:
selectedFoodWave
.
getAccountEvents
())
{
ret
=
ret
.
add
(
ac
.
getTotal
());
}
return
ret
;
}
public
BigDecimal
getBuyInPrice
()
{
BigDecimal
ret
=
BigDecimal
.
ZERO
;
for
(
AccountEvent
ac
:
selectedFoodWave
.
getAccountEvents
())
{
if
(
ac
.
getProduct
()
!=
null
&&
ac
.
getProduct
().
getBuyInPrice
()
!=
null
)
{
ret
=
ret
.
add
(
ac
.
getQuantity
().
multiply
(
ac
.
getProduct
().
getBuyInPrice
()));
}
}
return
ret
;
}
// public void initUserFoodWaveList() {
// this.foodWaves = new
// ListDataModel<FoodWave>(foodWaveBean.getOpenFoodWaves());
...
...
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