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 7b399077
authored
Oct 26, 2012
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bill foodwave payment check
1 parent
454f7c0e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
3 deletions
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/BillBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/CheckoutFiBean.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Bill.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/BillBean.java
View file @
7b39907
...
...
@@ -205,6 +205,12 @@ public class BillBean implements BillBeanLocal {
if
(
bill
.
getAccountEvent
()
!=
null
||
bill
.
getPaidDate
()
!=
null
)
{
throw
new
EJBException
(
"Bill already marked paid!"
);
}
if
(
bill
.
isFoowavePaymentOver
())
{
throw
new
EJBException
(
"Trying to mark paid a closed or left foodwave"
);
}
bill
=
billFacade
.
reload
(
bill
);
Product
creditproduct
=
productBean
.
findCreditProduct
();
...
...
@@ -222,7 +228,7 @@ public class BillBean implements BillBeanLocal {
bill
.
setPaidDate
(
when
.
getTime
());
// bill = billFacade.merge(bill);
boolean
checked
=
false
;
for
(
BillLine
bl
:
bill
.
getBillLines
())
{
Product
prod
=
bl
.
getLineProduct
();
...
...
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/CheckoutFiBean.java
View file @
7b39907
...
...
@@ -107,6 +107,11 @@ public class CheckoutFiBean implements CheckoutFiBeanLocal {
@RolesAllowed
(
BillPermission
.
S_CREATE_VERKKOMAKSU
)
public
List
<
CheckoutBank
>
getToken
(
Bill
bill
)
{
if
(
bill
.
isFoowavePaymentOver
())
{
return
null
;
}
final
LanEventPrivateProperty
expire
=
eventbean
.
getPrivateProperty
(
LanEventPrivatePropertyKey
.
CHECKOUT_FI_KEY_EXPIRE
);
final
String
merchantid
=
eventbean
.
getPrivatePropertyString
(
LanEventPrivatePropertyKey
.
CHECKOUT_FI_MERCHANT_ID
);
final
String
merchantPassword
=
eventbean
.
getPrivatePropertyString
(
LanEventPrivatePropertyKey
.
CHECKOUT_FI_MERCHANT_PASSWORD
);
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Bill.java
View file @
7b39907
...
...
@@ -132,7 +132,7 @@ public class Bill extends GenericEntity {
@ManyToOne
(
optional
=
false
)
@JoinColumn
(
updatable
=
false
,
name
=
"eventuser_id"
)
private
EventUser
user
;
@SuppressWarnings
(
"unused"
)
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
Bill
.
class
);
...
...
@@ -338,7 +338,7 @@ public class Bill extends GenericEntity {
public
void
addProduct
(
Product
product
,
BigDecimal
count
)
{
this
.
addProduct
(
product
,
count
,
null
);
}
public
void
addProduct
(
Product
product
,
BigDecimal
count
,
FoodWave
foodwave
)
{
// If bill number > 0 bill has been sent and extra privileges are needed
// to modify.
...
...
@@ -411,4 +411,16 @@ public class Bill extends GenericEntity {
this
.
sentDate
=
sentDate
;
}
public
boolean
isFoowavePaymentOver
()
{
boolean
ret
=
false
;
for
(
BillLine
bl
:
billLines
)
{
if
(
bl
.
getFoodwave
()
!=
null
&&
(
bl
.
getFoodwave
().
getClosed
()
||
bl
.
getFoodwave
().
getTime
().
after
(
Calendar
.
getInstance
())))
{
ret
=
true
;
break
;
}
}
return
ret
;
}
}
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