Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Riina Antikainen
/
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 9497091c
authored
Feb 02, 2018
by
Tuukka Kivilahti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finalizing
1 parent
6dda4622
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
76 additions
and
29 deletions
code/moya-beans/ejbModule/fi/codecrew/moya/beans/BillPBean.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/PermissionBean.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/ProductBean.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/ProductPBean.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/ReaderBean.java
code/moya-web/WebContent/info/cardlessIncoming.xhtml
code/moya-web/src/main/java/fi/codecrew/moya/web/flow/CardlessIncomingView.java
code/moya-web/src/main/java/fi/codecrew/moya/web/helpers/ProductShopItem.java
code/moya-web/src/main/resources/fi/codecrew/moya/resources/i18n.properties
code/moya-web/src/main/resources/fi/codecrew/moya/resources/i18n_en.properties
code/moya-web/src/main/resources/fi/codecrew/moya/resources/i18n_fi.properties
code/pom.xml
code/moya-beans/ejbModule/fi/codecrew/moya/beans/BillPBean.java
View file @
9497091
...
...
@@ -112,7 +112,7 @@ public class BillPBean {
logger
.
debug
(
"Creating Bill prepaidInstant product {}, {}"
,
prod
.
getName
(),
bl
.
getQuantity
());
AccountEvent
ac2
=
productPBean
.
createAccountEvent
(
prod
,
null
,
bl
.
getQuantity
(),
user
,
bill
.
getSentDate
(),
bl
.
getFoodwave
());
AccountEvent
ac2
=
productPBean
.
createAccountEvent
(
prod
,
null
,
bl
.
getQuantity
(),
user
,
bill
.
getSentDate
(),
bl
.
get
Name
()
,
bl
.
get
Foodwave
());
logger
.
info
(
"Created ac from product. {}, userproducts {}"
,
ac2
,
user
.
getAccountEvents
().
size
());
ac2
.
setSeller
(
permbean
.
getCurrentUser
());
...
...
code/moya-beans/ejbModule/fi/codecrew/moya/beans/PermissionBean.java
View file @
9497091
...
...
@@ -22,10 +22,7 @@ import java.security.Principal;
import
javax.annotation.Resource
;
import
javax.annotation.security.DeclareRoles
;
import
javax.ejb.EJB
;
import
javax.ejb.LocalBean
;
import
javax.ejb.SessionContext
;
import
javax.ejb.Stateless
;
import
javax.ejb.*
;
import
javax.resource.spi.IllegalStateException
;
import
fi.codecrew.moya.enums.apps.*
;
...
...
code/moya-beans/ejbModule/fi/codecrew/moya/beans/ProductBean.java
View file @
9497091
...
...
@@ -474,7 +474,7 @@ public class ProductBean implements ProductBeanLocal {
public
AccountEvent
createAccountEvent
(
Product
product
,
BigDecimal
overriddenUnitPrice
,
BigDecimal
quantity
,
EventUser
user
)
{
user
=
eventUserFacade
.
reload
(
user
);
AccountEvent
ret
=
productPBean
.
createAccountEvent
(
product
,
overriddenUnitPrice
,
quantity
,
user
,
new
Date
(),
null
);
AccountEvent
ret
=
productPBean
.
createAccountEvent
(
product
,
overriddenUnitPrice
,
quantity
,
user
,
new
Date
(),
null
,
null
);
cardTemplateBean
.
checkPrintedCard
(
user
);
return
ret
;
}
...
...
@@ -562,7 +562,10 @@ public class ProductBean implements ProductBeanLocal {
continue
;
}
// TODO: pizzas also removed
// foods are handled from different view, remove them from here
if
(
ae
.
getProduct
().
getFoodWaveTemplates
()
!=
null
&&
!
ae
.
getProduct
().
getFoodWaveTemplates
().
isEmpty
())
{
continue
;
}
retlist
.
add
(
ae
);
}
...
...
code/moya-beans/ejbModule/fi/codecrew/moya/beans/ProductPBean.java
View file @
9497091
...
...
@@ -75,8 +75,11 @@ public class ProductPBean {
}
public
AccountEvent
createAccountEvent
(
Product
product
,
BigDecimal
quantity
,
EventUser
user
,
Date
date
)
{
return
this
.
createAccountEvent
(
product
,
null
,
quantity
,
user
,
date
,
null
,
null
);
}
return
this
.
createAccountEvent
(
product
,
null
,
quantity
,
user
,
date
,
null
);
public
AccountEvent
createAccountEvent
(
Product
product
,
BigDecimal
quantity
,
EventUser
user
,
Date
date
,
String
description
)
{
return
this
.
createAccountEvent
(
product
,
null
,
quantity
,
user
,
date
,
description
,
null
);
}
/**
...
...
@@ -95,7 +98,7 @@ public class ProductPBean {
* AccountEvent creation time
* @return The created AccountEvent entity
*/
public
AccountEvent
createAccountEvent
(
Product
product
,
BigDecimal
overriddenUnitPrice
,
BigDecimal
quantity
,
EventUser
user
,
Date
date
,
FoodWave
foodwave
)
{
public
AccountEvent
createAccountEvent
(
Product
product
,
BigDecimal
overriddenUnitPrice
,
BigDecimal
quantity
,
EventUser
user
,
Date
date
,
String
description
,
FoodWave
foodwave
)
{
if
(!
accounteventfacade
.
isAttached
(
product
))
{
product
=
productFacade
.
reload
(
product
);
...
...
@@ -125,6 +128,18 @@ public class ProductPBean {
AccountEvent
ret
=
new
AccountEvent
(
user
,
product
,
unitPrice
,
quantity
,
Calendar
.
getInstance
());
// If product name is edited, move it into the description
if
(
description
!=
null
&&
!
description
.
isEmpty
()
&&
!
product
.
getName
().
equals
(
description
))
{
String
aeDescription
=
description
;
// Remove product name from option descriptions
aeDescription
=
aeDescription
.
replaceFirst
(
"^"
+
product
.
getName
()
+
",?"
,
""
).
trim
();
ret
.
setDescription
(
aeDescription
);
}
// ret.setDelivered(Calendar.getInstance());
ret
.
setSeller
(
permbean
.
getCurrentUser
());
...
...
code/moya-beans/ejbModule/fi/codecrew/moya/beans/ReaderBean.java
View file @
9497091
...
...
@@ -186,7 +186,7 @@ public class ReaderBean implements ReaderBeanLocal {
if
(
reader
.
isAutoproduct
())
{
EventUser
eu
=
userbean
.
getEventUser
(
card
.
getUser
().
getUser
(),
false
);
if
(
eu
!=
null
)
{
AccountEvent
createAc
=
productPBean
.
createAccountEvent
(
reader
.
getAutomaticProduct
(),
reader
.
getAutomaticProductCount
(),
eu
,
new
Date
()
);
AccountEvent
createAc
=
productPBean
.
createAccountEvent
(
reader
.
getAutomaticProduct
(),
reader
.
getAutomaticProductCount
(),
eu
,
new
Date
(),
"Created automatically"
);
readerfacade
.
flush
();
logger
.
info
(
"Creating new accountevent from autoproduct {}"
,
createAc
);
event
.
setNotes
(
"Created automatic account event from reader. "
+
createAc
);
...
...
code/moya-web/WebContent/info/cardlessIncoming.xhtml
View file @
9497091
...
...
@@ -57,9 +57,19 @@
</p:dataTable>
</p:fieldset>
<br
/><br
/><br
/>
<br
/><br
/>
<br
/>
<p:commandButton
value=
"#{i18n['incomingflow.markEverythingGiven']}"
update=
"membershipForm accounteventlistform"
disabled=
"#{cardlessIncomingView.allGiven}"
actionListener=
"#{cardlessIncomingView.giveEverything}"
/>
<br
/><br
/><br
/>
<br
/>
<p:fragment
id=
"ungivenFragment"
>
<span
style=
"color: red; font-size: larger; font-weight: bolder;"
>
<h:outputText
rendered=
"#{cardlessIncomingView.ungivenAccountevents}"
value=
"#{i18n['incomingflow.ungivenProducts']}"
/>
</span>
</p:fragment>
<br
/>
<br
/>
<h:outputText
rendered=
"#{empty cardlessIncomingView.groupMemberships}"
value=
"#{i18n['placegroupview.noMemberships']}"
/>
<p:fieldset
id=
"groupMembershipList"
rendered=
"#{!empty cardlessIncomingView.groupMemberships}"
legend=
"#{i18n['incomingflow.groupmemberships']}"
toggleable=
"true"
collapsed=
"#{fieldsetView.isCollapsed(component.id)}"
>
<p:ajax
event=
"toggle"
listener=
"#{fieldsetView.handleToggle}"
/>
...
...
@@ -124,8 +134,8 @@
<h:outputText
value=
"#{prod.description}"
/>
</p:column>
<p:column>
<p:commandButton
update=
":accounteventlistform"
rendered=
"#{empty prod.delivered}"
actionListener=
"#{cardlessIncomingView.giveAccountEvent}"
value=
"#{i18n['incomingflow.giveAccountEvent']}"
/>
<p:commandButton
update=
":accounteventlistform"
rendered=
"#{!empty prod.delivered}"
actionListener=
"#{cardlessIncomingView.ungiveAccountEvent}"
value=
"#{i18n['incomingflow.ungiveAccountEvent']}"
/>
<p:commandButton
update=
":accounteventlistform
:membershipForm:ungivenFragment
"
rendered=
"#{empty prod.delivered}"
actionListener=
"#{cardlessIncomingView.giveAccountEvent}"
value=
"#{i18n['incomingflow.giveAccountEvent']}"
/>
<p:commandButton
update=
":accounteventlistform
:membershipForm:ungivenFragment
"
rendered=
"#{!empty prod.delivered}"
actionListener=
"#{cardlessIncomingView.ungiveAccountEvent}"
value=
"#{i18n['incomingflow.ungiveAccountEvent']}"
/>
</p:column>
</p:dataTable>
...
...
code/moya-web/src/main/java/fi/codecrew/moya/web/flow/CardlessIncomingView.java
View file @
9497091
...
...
@@ -179,12 +179,6 @@ public class CardlessIncomingView extends GenericCDIView {
}
}
for
(
AccountEvent
ae
:
productBean
.
getDeliverableAccountEvents
(
userview
.
getSelectedUser
()))
{
if
(!
ae
.
isEventDelivered
())
{
productBean
.
markDelivered
(
ae
,
Calendar
.
getInstance
());
}
}
addFaceMessage
(
"incomingflow.allGiven"
,
count
);
memberlist
=
null
;
...
...
@@ -192,6 +186,27 @@ public class CardlessIncomingView extends GenericCDIView {
}
public
boolean
isAllGiven
()
{
List
<
GroupMembership
>
memberships
=
ticketBean
.
findMembershipPrintlistForUser
(
userview
.
getSelectedUser
());
for
(
GroupMembership
gm
:
memberships
)
{
if
(
gm
.
getEnteredEvent
()
!=
null
)
{
return
false
;
}
}
return
true
;
}
public
boolean
isUngivenAccountevents
()
{
List
<
AccountEvent
>
accountEvents
=
productBean
.
getDeliverableAccountEvents
(
userview
.
getSelectedUser
());
for
(
AccountEvent
ae
:
accountEvents
)
{
if
(!
ae
.
isEventDelivered
())
{
return
true
;
}
}
return
false
;
}
...
...
code/moya-web/src/main/java/fi/codecrew/moya/web/helpers/ProductShopItem.java
View file @
9497091
...
...
@@ -302,7 +302,7 @@ public class ProductShopItem implements Serializable {
if
(
option
==
null
)
continue
;
if
(
retString
.
length
()
==
0
)
{
if
(
retString
.
length
()
>
0
)
{
retString
.
append
(
", "
);
}
retString
.
append
(
option
.
getName
());
...
...
code/moya-web/src/main/resources/fi/codecrew/moya/resources/i18n.properties
View file @
9497091
...
...
@@ -384,7 +384,7 @@ incomingflow.giveplace = Mark given
incomingflow.groupmemberships
=
Computer places and tickets
incomingflow.invalidbarcode.message
=
Nothing found with the barcode, you can now add it to the user
incomingflow.invalidbarcode.title
=
Invalid code
incomingflow.markEverythingGiven
=
Give all ungiven item
s
incomingflow.markEverythingGiven
=
Give all ungiven ticket
s
incomingflow.multisearch
=
Multisearch
incomingflow.placesummary
=
Place summary
incomingflow.printedCard
=
Card
...
...
@@ -1619,3 +1619,4 @@ incomingflow.giveAccountEvent=Mark given
incomingflow.ungiveAccountEvent
=
Mark not given
incomingflow.deliverableProducts
=
Products to deliver
placegroupview.accountEventDescription
=
Description
incomingflow.ungivenProducts
=
User has ungiven deliverable products
code/moya-web/src/main/resources/fi/codecrew/moya/resources/i18n_en.properties
View file @
9497091
...
...
@@ -597,7 +597,7 @@ incomingflow.giveplace = Mark given
incomingflow.groupmemberships
=
Computer places and tickets
incomingflow.invalidbarcode.message
=
Nothing found with the barcode, you can now add it to the user
incomingflow.invalidbarcode.title
=
Invalid code
incomingflow.markEverythingGiven
=
Give all ungiven item
s
incomingflow.markEverythingGiven
=
Give all ungiven ticket
s
incomingflow.multisearch
=
Multisearch
incomingflow.placesummary
=
Place summary
incomingflow.printedCard
=
Card
...
...
@@ -1900,3 +1900,4 @@ incomingflow.giveAccountEvent=Mark given
incomingflow.ungiveAccountEvent
=
Mark not given
incomingflow.deliverableProducts
=
Products to deliver
placegroupview.accountEventDescription
=
Description
incomingflow.ungivenProducts
=
User has ungiven deliverable products
code/moya-web/src/main/resources/fi/codecrew/moya/resources/i18n_fi.properties
View file @
9497091
...
...
@@ -598,7 +598,7 @@ incomingflow.giveplace = Merkitse annetuksi
incomingflow.groupmemberships
=
Konepaikat sek
\u
00E4 liput
incomingflow.invalidbarcode.message
=
Piipatulla koodilla ei l
\u
00F6ytynyt mit
\u
00E4
\u
00E4n, voit lis
\u
00E4t
\u
00E4 koodin k
\u
00E4ytt
\u
00E4j
\u
00E4
\u
00E4n
incomingflow.invalidbarcode.title
=
Virheellinen koodi
incomingflow.markEverythingGiven
=
Anna kaikki antamattomat tuottee
t
incomingflow.markEverythingGiven
=
Anna kaikki antamattomat lipu
t
incomingflow.multisearch
=
Monihaku
incomingflow.placesummary
=
Paikkayhteenveto
incomingflow.printedCard
=
Kortti
...
...
@@ -1887,3 +1887,4 @@ incomingflow.giveAccountEvent=Merkitse annetuksi
incomingflow.ungiveAccountEvent
=
Ei olekkaan annettu
incomingflow.deliverableProducts
=
Toimitettavat tuotteet
placegroupview.accountEventDescription
=
Kuvaus
incomingflow.ungivenProducts
=
K
\u
00E4ytt
\u
00E4j
\u
00E4ll
\u
00E4 on toimittamattomia tuotteita
code/pom.xml
View file @
9497091
...
...
@@ -78,6 +78,11 @@
<repositories>
<repository>
<id>
prime-repo
</id>
<name>
PrimeFaces Maven Repository
</name>
<url>
https://repository.primefaces.org
</url>
</repository>
<repository>
<id>
iudex
</id>
<url>
http://iudex.fi/maven/
</url>
</repository>
...
...
@@ -86,11 +91,8 @@
<name>
jvnet-nexus-releases
</name>
<url>
https://maven.java.net/content/repositories/releases/
</url>
</repository>
<repository>
<id>
prime-repo
</id>
<name>
PrimeFaces Maven Repository
</name>
<url>
http://repository.primefaces.org
</url>
</repository>
<!--
-->
<repository>
<id>
apache.snapshots
</id>
<url>
http://repository.apache.org/snapshots/
</url>
...
...
@@ -99,5 +101,7 @@
<id>
clojars.org
</id>
<url>
http://clojars.org/repo
</url>
</repository>
</repositories>
</project>
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