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 5be509b8
authored
Nov 17, 2012
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'devel' of codecrew.fi:bortal into devel
2 parents
f8a3c834
a4e00182
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
62 additions
and
30 deletions
code/LanBortalDatabase/src/fi/insomnia/bortal/model/InventoryEvent.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Product.java
code/LanBortalWeb/WebContent/resources/cditools/products/list.xhtml
code/LanBortalWeb/WebContent/useradmin/accountEvents.xhtml
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_en.properties
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_fi.properties
code/LanBortalDatabase/src/fi/insomnia/bortal/model/InventoryEvent.java
View file @
5be509b
package
fi
.
insomnia
.
bortal
.
model
;
package
fi
.
insomnia
.
bortal
.
model
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.Date
;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
...
@@ -13,7 +14,7 @@ import org.eclipse.persistence.annotations.OptimisticLocking;
...
@@ -13,7 +14,7 @@ import org.eclipse.persistence.annotations.OptimisticLocking;
import
org.eclipse.persistence.annotations.OptimisticLockingType
;
import
org.eclipse.persistence.annotations.OptimisticLockingType
;
@Entity
@Entity
@Table
(
name
=
"inventory_event"
)
@Table
(
name
=
"inventory_event
s
"
)
@OptimisticLocking
(
type
=
OptimisticLockingType
.
CHANGED_COLUMNS
)
@OptimisticLocking
(
type
=
OptimisticLockingType
.
CHANGED_COLUMNS
)
public
class
InventoryEvent
extends
GenericEntity
{
public
class
InventoryEvent
extends
GenericEntity
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
@@ -41,22 +42,14 @@ public class InventoryEvent extends GenericEntity {
...
@@ -41,22 +42,14 @@ public class InventoryEvent extends GenericEntity {
this
.
info
=
info
;
this
.
info
=
info
;
}
}
public
int
getCount
()
{
return
count
;
}
public
void
setCount
(
int
count
)
{
this
.
count
=
count
;
}
@JoinColumn
(
name
=
"product_id"
)
@JoinColumn
(
name
=
"product_id"
)
private
Product
product
;
private
Product
product
;
@Column
(
name
=
"info"
,
nullable
=
true
)
@Column
(
name
=
"info"
,
nullable
=
true
)
private
String
info
;
private
String
info
;
@Column
(
name
=
"
count"
,
nullable
=
false
)
@Column
(
name
=
"
quantity"
,
nullable
=
false
,
precision
=
24
,
scale
=
4
)
private
int
count
;
private
BigDecimal
quantity
;
...
@@ -76,5 +69,13 @@ public class InventoryEvent extends GenericEntity {
...
@@ -76,5 +69,13 @@ public class InventoryEvent extends GenericEntity {
this
.
created
=
created
;
this
.
created
=
created
;
}
}
public
BigDecimal
getQuantity
()
{
return
quantity
;
}
public
void
setQuantity
(
BigDecimal
quantity
)
{
this
.
quantity
=
quantity
;
}
}
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Product.java
View file @
5be509b
...
@@ -91,7 +91,7 @@ public class Product extends GenericEntity {
...
@@ -91,7 +91,7 @@ public class Product extends GenericEntity {
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"product"
)
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"product"
)
private
List
<
AccountEvent
>
accountEvents
;
private
List
<
AccountEvent
>
accountEvents
;
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"product"
)
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"product"
)
private
List
<
InventoryEvent
>
inventoryEvents
;
private
List
<
InventoryEvent
>
inventoryEvents
;
...
@@ -171,6 +171,23 @@ public class Product extends GenericEntity {
...
@@ -171,6 +171,23 @@ public class Product extends GenericEntity {
return
ret
;
return
ret
;
}
}
public
BigDecimal
getInventoryCount
()
{
BigDecimal
ret
=
new
BigDecimal
(
0
);
if
(
accountEvents
!=
null
)
{
for
(
AccountEvent
ae
:
accountEvents
)
{
ret
=
ret
.
subtract
(
ae
.
getQuantity
());
}
}
if
(
inventoryEvents
!=
null
)
{
for
(
InventoryEvent
ie
:
inventoryEvents
)
{
ret
=
ret
.
add
(
ie
.
getQuantity
());
}
}
return
ret
;
}
public
String
getName
()
{
public
String
getName
()
{
return
name
;
return
name
;
}
}
...
...
code/LanBortalWeb/WebContent/resources/cditools/products/list.xhtml
View file @
5be509b
...
@@ -48,6 +48,15 @@
...
@@ -48,6 +48,15 @@
<f:convertNumber
minFractionDigits=
"0"
maxFractionDigits=
"2"
/>
<f:convertNumber
minFractionDigits=
"0"
maxFractionDigits=
"2"
/>
</h:outputText>
</h:outputText>
</h:column>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['product.inventoryQuantity']}"
/>
</f:facet>
<h:outputText
value=
"#{product.inventoryCount}"
>
<f:convertNumber
minFractionDigits=
"0"
maxFractionDigits=
"2"
/>
</h:outputText>
</h:column>
</h:dataTable>
</h:dataTable>
</h:form>
</h:form>
...
...
code/LanBortalWeb/WebContent/useradmin/accountEvents.xhtml
View file @
5be509b
...
@@ -65,6 +65,7 @@
...
@@ -65,6 +65,7 @@
<f:convertDateTime
pattern=
"#{sessionHandler.datetimeFormat}"
timeZone=
"#{sessionHandler.timezone}"
/>
<f:convertDateTime
pattern=
"#{sessionHandler.datetimeFormat}"
timeZone=
"#{sessionHandler.timezone}"
/>
</h:outputText>
</h:outputText>
</h:column>
</h:column>
<h:column>
<h:column>
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_en.properties
View file @
5be509b
...
@@ -5,15 +5,16 @@ acc_line.product = Product
...
@@ -5,15 +5,16 @@ acc_line.product = Product
acc_line.quantity
=
Quantity
acc_line.quantity
=
Quantity
acc_line.time
=
Transaction Date
acc_line.time
=
Transaction Date
accountEvent.commit
=
Save
accountEvent.commit
=
Save
accountEvent.delivered
=
Delivered
accountEvent.delivered
=
Delivered
accountEvent.edit
=
Edit
accountEvent.edit
=
Edit
accountEvent.eventTime
=
Time
accountEvent.eventTime
=
Time
accountEvent.productname
=
Product
accountEvent.inventoryQuantity
=
Inventory Count
accountEvent.quantity
=
Count
accountEvent.productname
=
Product
accountEvent.seller
=
Sold by
accountEvent.quantity
=
Count
accountEvent.total
=
Total
accountEvent.seller
=
Sold by
accountEvent.unitPrice
=
Unit price
accountEvent.total
=
Total
accountEvent.unitPrice
=
Unit price
actionlog.create.header
=
Create new actionmessage
actionlog.create.header
=
Create new actionmessage
actionlog.create.message
=
Message
actionlog.create.message
=
Message
...
@@ -527,6 +528,7 @@ product.color = Color in UI
...
@@ -527,6 +528,7 @@ product.color = Color in UI
product.create
=
Create product
product.create
=
Create product
product.createDiscount
=
Add volumediscount
product.createDiscount
=
Add volumediscount
product.edit
=
edit
product.edit
=
edit
product.inventoryQuantity
=
Inventory count
product.name
=
Name of product
product.name
=
Name of product
product.paid
=
Paid
product.paid
=
Paid
product.prepaid
=
Prepaid
product.prepaid
=
Prepaid
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_fi.properties
View file @
5be509b
...
@@ -5,15 +5,16 @@ acc_line.product = Tuote
...
@@ -5,15 +5,16 @@ acc_line.product = Tuote
acc_line.quantity
=
M
\u
00E4
\u
00E4r
\u
00E4
acc_line.quantity
=
M
\u
00E4
\u
00E4r
\u
00E4
acc_line.time
=
Ostoaika
acc_line.time
=
Ostoaika
accountEvent.commit
=
Tallenna
accountEvent.commit
=
Tallenna
accountEvent.delivered
=
Toimitettu
accountEvent.delivered
=
Toimitettu
accountEvent.edit
=
Muokkaa
accountEvent.edit
=
Muokkaa
accountEvent.eventTime
=
Aika
accountEvent.eventTime
=
Aika
accountEvent.productname
=
Tuote
accountEvent.inventoryQuantity
=
Varastossa
accountEvent.quantity
=
Lkm
accountEvent.productname
=
Tuote
accountEvent.seller
=
Myyj
\u
00E4
accountEvent.quantity
=
Lkm
accountEvent.total
=
Yhteens
\u
00E4
accountEvent.seller
=
Myyj
\u
00E4
accountEvent.unitPrice
=
Yksikk
\u
00F6hinta
accountEvent.total
=
Yhteens
\u
00E4
accountEvent.unitPrice
=
Yksikk
\u
00F6hinta
actionlog.create.header
=
Luo uusi ActionMessage
actionlog.create.header
=
Luo uusi ActionMessage
actionlog.create.message
=
Viesti
actionlog.create.message
=
Viesti
...
@@ -510,6 +511,7 @@ product.color = V\u00E4ri k\u00E4ytt\u00F6liittym\u00E4ss\u00E4
...
@@ -510,6 +511,7 @@ product.color = V\u00E4ri k\u00E4ytt\u00F6liittym\u00E4ss\u00E4
product.create
=
Luo tuote
product.create
=
Luo tuote
product.createDiscount
=
Lis
\u
00E4
\u
00E4 m
\u
00E4
\u
00E4r
\u
00E4alennus
product.createDiscount
=
Lis
\u
00E4
\u
00E4 m
\u
00E4
\u
00E4r
\u
00E4alennus
product.edit
=
Muokkaa
product.edit
=
Muokkaa
product.inventoryQuantity
=
Varastotilanne
product.name
=
Tuotteen nimi
product.name
=
Tuotteen nimi
product.paid
=
Maksettu
product.paid
=
Maksettu
product.prepaid
=
Prepaid
product.prepaid
=
Prepaid
...
...
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