Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Max Mecklin
/
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 c01e8242
authored
Oct 27, 2012
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added buy in price
1 parent
7c6cc2c4
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
58 additions
and
18 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/listFoodwaves.xhtml
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 @
c01e824
...
...
@@ -193,6 +193,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 @
c01e824
...
...
@@ -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 @
c01e824
...
...
@@ -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/listFoodwaves.xhtml
View file @
c01e824
...
...
@@ -56,7 +56,7 @@
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['foodWave.unconfirmedOrders']}"
/>
</f:facet>
<h:outputText
value=
"#{foodwave.
getUnpaidBillLineCount()
}"
/>
<h:outputText
value=
"#{foodwave.
unpaidBillLineCount
}"
/>
</p:column>
<p:column>
<f:facet
name=
"header"
>
...
...
code/LanBortalWeb/WebContent/foodmanager/listOrders.xhtml
View file @
c01e824
...
...
@@ -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 @
c01e824
...
...
@@ -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 @
c01e824
...
...
@@ -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 @
c01e824
...
...
@@ -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 @
c01e824
...
...
@@ -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 @
c01e824
...
...
@@ -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 @
c01e824
...
...
@@ -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