Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Linnea Samila
/
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 2e0e359f
authored
Mar 30, 2013
by
Tuukka Kivilahti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asdf
1 parent
a24d2da5
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
109 additions
and
16 deletions
code/MoyaDatabase/src/META-INF/persistence.xml
code/MoyaDatabase/src/fi/codecrew/moya/model/Bill.java
code/MoyaWeb/WebContent/bill/edit.xhtml
code/MoyaWeb/WebContent/bill/showBill.xhtml
code/MoyaWeb/WebContent/resources/cditools/bills/list.xhtml
code/MoyaWeb/WebContent/resources/cditools/bills/showBill.xhtml
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n.properties
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_en.properties
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_en_ST.properties
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_fi.properties
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_fi_IN.properties
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/shop/BillEditView.java
code/MoyaDatabase/src/META-INF/persistence.xml
View file @
2e0e359
...
...
@@ -2,7 +2,7 @@
<persistence
version=
"1.0"
xmlns=
"http://java.sun.com/xml/ns/persistence"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
>
<persistence-unit
name=
"
Bortal
Db"
transaction-type=
"JTA"
>
<persistence-unit
name=
"
Moya
Db"
transaction-type=
"JTA"
>
<jta-data-source>
jdbc/moyaDb
</jta-data-source>
<properties>
<property
name=
"eclipselink.ddl-generation"
value=
"create-tables"
/>
...
...
code/MoyaDatabase/src/fi/codecrew/moya/model/Bill.java
View file @
2e0e359
...
...
@@ -96,6 +96,10 @@ public class Bill extends GenericEntity {
private
String
deliveryTerms
=
""
;
@Column
(
name
=
"delay_intrest"
,
nullable
=
false
)
private
Integer
delayIntrest
=
11
;
@Column
(
name
=
"expires"
,
nullable
=
true
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Calendar
expires
=
null
;
/**
* Notes for the event organisators about the bill.
...
...
@@ -200,11 +204,15 @@ public class Bill extends GenericEntity {
}
public
Bill
(
LanEvent
event
)
{
this
();
this
.
event
=
event
;
}
public
Bill
()
{
super
();
this
.
expires
=
Calendar
.
getInstance
();
this
.
expires
.
setTimeInMillis
((
System
.
currentTimeMillis
()
+
1814400000
l
));
// 3vk
}
public
Calendar
getDueDate
()
{
...
...
@@ -378,6 +386,9 @@ public class Bill extends GenericEntity {
}
public
void
setPaidDate
(
Date
paidDate
)
{
if
(
paidDate
!=
null
)
expires
=
null
;
this
.
paidDate
=
paidDate
;
}
...
...
@@ -425,4 +436,31 @@ public class Bill extends GenericEntity {
}
return
ret
;
}
public
Calendar
getExpires
()
{
return
expires
;
}
public
void
setExpires
(
Calendar
expires
)
{
this
.
expires
=
expires
;
}
public
boolean
isExpired
()
{
if
(
expires
==
null
)
return
false
;
return
Calendar
.
getInstance
().
after
(
expires
);
}
public
void
markExpired
()
{
if
(
isExpired
()
||
isPaid
())
return
;
expires
=
Calendar
.
getInstance
();
}
}
code/MoyaWeb/WebContent/bill/edit.xhtml
View file @
2e0e359
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:users=
"http://java.sun.com/jsf/composite/tools/user"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:users=
"http://java.sun.com/jsf/composite/tools/user"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<f:metadata>
...
...
@@ -104,7 +103,15 @@
</h:column>
</h:dataTable>
<p:confirmDialog
id=
"confirmDialog"
message=
"#{i18n['generic.sure.message}"
header=
"#{i18n['generic.sure.header']}"
severity=
"alert"
widgetVar=
"confirmation"
>
<p:commandButton
id=
"confirm"
value=
"#{i18n['generic.sure.yes']}"
update=
"messages"
oncomplete=
"confirmation.hide()"
actionListener=
"#{billEditView.expireBill}"
/>
<p:commandButton
id=
"decline"
value=
"#{i18n['generic.sure.no']}"
onclick=
"confirmation.hide()"
type=
"button"
/>
</p:confirmDialog>
</h:form>
</ui:define>
</ui:composition>
</h:body>
...
...
code/MoyaWeb/WebContent/bill/showBill.xhtml
View file @
2e0e359
...
...
@@ -23,10 +23,11 @@
<f:convertDateTime
pattern=
"#{sessionHandler.datetimeFormat}"
timeZone=
"#{sessionHandler.timezone}"
/>
</h:outputText>
</ui:fragment>
<bill:showBill
bill=
"#{billEditView.bill}"
/>
<ui:fragment
rendered=
"#{!billEditView.bill.paid and billEditView.verkkomaksuFiAvailable}"
>
<ui:fragment
rendered=
"#{!billEditView.bill.paid and
!billEditView.bill.expired and
billEditView.verkkomaksuFiAvailable}"
>
<div
id=
"svm-payment"
>
<a
href=
"#{billEditView.verkkomaksuFiToken.url}"
>
</a>
</div>
...
...
@@ -38,7 +39,7 @@
});
</script>
</ui:fragment>
<ui:fragment
rendered=
"#{!billEditView.bill.paid and billEditView.checkoutFiAvailable}"
>
<ui:fragment
rendered=
"#{!billEditView.bill.paid and
!billEditView.bill.expired and
billEditView.checkoutFiAvailable}"
>
<table
border=
"0"
>
<tr>
...
...
code/MoyaWeb/WebContent/resources/cditools/bills/list.xhtml
View file @
2e0e359
...
...
@@ -11,7 +11,10 @@
<h:outputText
rendered=
"#{billListView.bills.rowCount le 0}"
value=
"#{i18n['bills.noBills']}"
/>
<h:form
rendered=
"#{billListView.bills.rowCount gt 0}"
>
<h:dataTable
styleClass=
"bordertable"
id=
"billList"
value=
"#{billListView.bills}"
var=
"bill"
>
<p:dataTable
styleClass=
"bordertable"
id=
"billList"
value=
"#{billListView.bills}"
var=
"bill"
rowStyleClass=
"#{bill.expired ? 'expired' : null}"
>
<h:column
rendered=
"#{billListView.canWriteBill}"
>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['bill.payer']}"
/>
...
...
@@ -51,7 +54,7 @@
<f:convertNumber
currencyCode=
"EUR"
maxFractionDigits=
"2"
minFractionDigits=
"2"
type=
"currency"
/>
</h:outputText>
</h:column>
<h:column>
<h:column
rendered=
"#{!bill.expired}"
>
<a
href=
"#{request.contextPath}/PrintBill?billid=#{bill.id}"
target=
"_blank"
>
#{i18n['bill.printBill']}
</a>
</h:column>
<h:column>
...
...
@@ -71,7 +74,7 @@
<h:outputText
rendered=
"#{bill.paidDate != null}"
value=
"#{i18n['bill.isPaid']}"
/>
</h:column>
</
h
:dataTable>
</
p
:dataTable>
</h:form>
...
...
code/MoyaWeb/WebContent/resources/cditools/bills/showBill.xhtml
View file @
2e0e359
...
...
@@ -10,7 +10,7 @@
</composite:interface>
<composite:implementation>
<h:panelGrid
columns=
"2"
columnClasses=
"topalign,topalign"
>
<h:panelGrid
columns=
"2"
columnClasses=
"topalign,topalign"
style=
"#{bill.expired ? 'expired' : null}"
>
<h:panelGrid
columns=
"2"
columnClasses=
"topalign,topalign"
>
<h:outputLabel
for=
"billnr"
value=
"#{i18n['bill.billNumber']}:"
/>
<h:outputText
id=
"billnr"
value=
"#{cc.attrs.bill.billNumber}"
/>
...
...
@@ -33,6 +33,10 @@
<h:outputLabel
for=
"noticetime"
value=
"#{i18n['bill.noticetime']}:"
/>
<h:outputText
id=
"noticetime"
value=
"#{cc.attrs.bill.noticetime}"
/>
<h:outputLabel
rendered=
"#{cc.attrs.bill not null}"
for=
"expires"
value=
"#{i18n['bill.expires']}:"
/>
<h:outputText
rendered=
"#{cc.attrs.bill not null}"
id=
"expires"
value=
"#{cc.attrs.bill.expires}"
/>
<h:outputText
rendered=
"#{cc.attrs.bill.expired}"
id=
"expired"
value=
"#{i18n['bill.isExpired']}"
/>
</h:panelGrid>
<h:panelGrid
columns=
"2"
columnClasses=
"topalign,topalign"
>
...
...
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n.properties
View file @
2e0e359
#Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
#Sat Mar 30 17:56:44 EET 2013
actionlog.create.header
=
Create new actionmessage
actionlog.create.message
=
Message
...
...
@@ -14,6 +16,8 @@ actionlog.tasklist.header = Tasklist
actionlog.time
=
Time
actionlog.user
=
User
bill.save
=
Save
bortalApplication.BILL
=
Creating, and managing bills
bortalApplication.COMPO
=
Managing compos
bortalApplication.CONTENT
=
Product & shop management
...
...
@@ -76,6 +80,11 @@ error.error = You have encountered an error.
eventorg.create
=
Create
generic.sure.header
=
Confirmation
generic.sure.message
=
Are you sure?
generic.sure.no
=
No
generic.sure.yes
=
Yes
global.cancel
=
Cancel
global.copyright
=
Codecrew Ry
global.notAuthorizedExecute
=
You are not authorized to do that!!
...
...
@@ -95,8 +104,6 @@ loginerror.header = Login failed
loginerror.message
=
Username of password incorrect.
loginerror.resetpassword
=
Reset password
#Bill number
# Validationmessages
map.id
=
#
navi.auth.login
=
frontpage
...
...
@@ -136,6 +143,6 @@ resetMail.username = Username
resetmailSent.body
=
Email has been sent containing a link where you can change the password.
resetmailSent.header
=
Email sent
subnavi.cards
=
\
t\t
subnavi.cards
=
\
u0009\u0009
user.unauthenticated
=
Kirjautumaton
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_en.properties
View file @
2e0e359
#Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
#Sat Mar 30 17:56:44 EET 2013
acc_line.eventuser
=
Customer
acc_line.nick
=
Nick
...
...
@@ -75,6 +77,7 @@ bill.printBill = Print bill
bill.receiverAddress
=
Receiver address
bill.referenceNumberBase
=
Reference number base
bill.referencenumber
=
Reference nr.
bill.save
=
Save
bill.sentDate
=
Sent date
bill.show
=
Show
bill.theirReference
=
Clients reference
...
...
@@ -274,6 +277,11 @@ game.gamepoints = Game points
gamepoints
=
Gamepoints
generic.sure.header
=
Confirmation
generic.sure.message
=
Are you sure?
generic.sure.no
=
No
generic.sure.yes
=
Yes
global.cancel
=
Cancel
global.copyright
=
Codecrew Ry
global.eventname
=
Event name
...
...
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_en_ST.properties
View file @
2e0e359
#Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
#Bill number
# Validationmessages
#Sat Mar 30 17:56:44 EET 2013
actionlog.create.header
=
Create new actionmessage
actionlog.create.message
=
Message
...
...
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_fi.properties
View file @
2e0e359
#Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
#Sat Mar 30 17:56:44 EET 2013
acc_line.eventuser
=
Asiakas
acc_line.nick
=
Nimimerkki
...
...
@@ -77,6 +79,7 @@ bill.printBill = Tulosta lasku
bill.receiverAddress
=
Kauppiaan osoite
bill.referenceNumberBase
=
Viitenumeropohja
bill.referencenumber
=
Viitenumero
bill.save
=
Tallenna
bill.sentDate
=
P
\u
00E4iv
\u
00E4ys
bill.show
=
N
\u
00E4yt
\u
00E4
bill.theirReference
=
Asiakkaan viite
...
...
@@ -274,6 +277,11 @@ game.gamepoints = Insomnia Game pisteet:
gamepoints
=
Pelipisteit
\u
00E4
generic.sure.header
=
Varmistusikkuna
generic.sure.message
=
Oletko aivan varma?
generic.sure.no
=
Ei
generic.sure.yes
=
Kyll
\u
00E4
global.cancel
=
Peruuta
global.copyright
=
Codecrew Ry
global.eventname
=
Tapahtumanimi
...
...
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_fi_IN.properties
View file @
2e0e359
#Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
#Bill number
# Validationmessages
#Sat Mar 30 17:56:44 EET 2013
actionlog.create.header
=
Luo uusi ActionMessage
actionlog.create.message
=
Viesti
...
...
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/shop/BillEditView.java
View file @
2e0e359
...
...
@@ -116,4 +116,23 @@ public class BillEditView extends GenericCDIView {
public
void
setVmreturn
(
VerkkomaksutReturnEntry
vmreturn
)
{
this
.
vmreturn
=
vmreturn
;
}
public
String
expireBill
()
{
bill
.
markExpired
();
this
.
save
();
return
null
;
}
}
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