Commit 49762fda by Tuukka Kivilahti

MOYA-22 laskujen vanheneminen

1 parent f3910dbc
......@@ -12,5 +12,6 @@
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry combineaccessrules="false" kind="src" path="/MoyaBeansClient"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
......@@ -12,5 +12,6 @@
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry combineaccessrules="false" kind="src" path="/MoyaDatabase"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
......@@ -449,7 +449,6 @@ public class Bill extends GenericEntity {
if(expires == null)
return false;
return Calendar.getInstance().after(expires);
}
......
eclipse.preferences.version=1
encoding/<project>=UTF-8
......@@ -13,5 +13,6 @@
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry combineaccessrules="false" kind="src" path="/MoyaBeansClient"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7
<!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:p="http://primefaces.org/ui" 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>
......@@ -14,7 +14,7 @@
<ui:define name="content">
<h:form id="billform">
<h:panelGrid columns="2">
<p:panelGrid columns="2">
<h:outputLabel for="paidDate" value="#{i18n['bill.paidDate']}:" />
<h:inputText id="paidDate" value="#{billEditView.bill.paidDate}">
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
......@@ -61,54 +61,50 @@
<h:outputLabel for="notes" value="#{i18n['bill.notes']}:" />
<h:inputTextarea id="notes" cols="50" rows="5" value="#{billEditView.bill.notes}" />
<h:commandButton id="commitbtn" action="#{billEditView.save()}" value="#{i18n['bill.save']}" />
</h:panelGrid>
<p:commandButton id="commitbtn" action="#{billEditView.save()}" value="#{i18n['bill.save']}" />
</p:panelGrid>
<h:dataTable border="1" id="user" value="#{billEditView.bill.billLines}" var="billine">
<h:column>
<p:dataTable border="1" id="user" value="#{billEditView.bill.billLines}" var="billine">
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n[billine.name]}" />
<h:outputText value="#{i18n['billine.name']}" />
</f:facet>
<h:inputText value="#{billine.name}" />
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['billine.unitPrice']}" />
</f:facet>
<h:inputText value="#{billine.unitPrice}" size="6" />
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['billine.quantity']}" />
</f:facet>
<h:inputText value="#{billine.quantity}" size="6" />
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['billine.unitName']}" />
</f:facet>
<h:inputText value="#{billine.unitName}" size="5" />
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['billine.vat']}" />
</f:facet>
<h:inputText value="#{billine.vat}" size="4" />
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['billine.referencedProduct']}" />
</f:facet>
<h:outputText value="#{billine.lineProduct.name}" />
</h:column>
</p:column>
</h:dataTable>
</p: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>
......
......@@ -2,7 +2,7 @@
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:tools="http://java.sun.com/jsf/composite/tools"
xmlns:bill="http://java.sun.com/jsf/composite/cditools/bills" xmlns:f="http://java.sun.com/jsf/core">
xmlns:bill="http://java.sun.com/jsf/composite/cditools/bills" xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core">
<h:body>
......@@ -58,6 +58,20 @@
</tr>
</table>
</ui:fragment>
<ui:fragment rendered="#{!billEditView.bill.expired}">
<h:form>
<p:commandButton id="cancelbtn" onclick="confirmation.show()" value="#{i18n['bill.cancel']}" />
<p:confirmDialog id="confirmDialog" message="#{i18n['generic.sure.message']}" header="#{i18n['generic.sure.header']}" severity="alert" widgetVar="confirmation">
<p:commandButton value="#{i18n['generic.sure.yes']}" onclick="confirmation.hide()" actionListener="#{billEditView.expireBill()}" ajax="false" />
<p:commandButton value="#{i18n['generic.sure.no']}" onclick="confirmation.hide()" type="button" />
</p:confirmDialog>
</h:form>
</ui:fragment>
</ui:define>
</ui:composition>
......
......@@ -2,7 +2,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools">
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools">
<composite:interface>
</composite:interface>
......@@ -15,7 +15,7 @@
<p:dataTable styleClass="bordertable" id="billList" value="#{billListView.bills}" var="bill"
rowStyleClass="#{bill.expired ? 'expired' : null}" >
<h:column rendered="#{billListView.canWriteBill}">
<p:column rendered="#{billListView.canWriteBill}">
<f:facet name="header">
<h:outputText value="${i18n['bill.payer']}" />
</f:facet>
......@@ -23,56 +23,59 @@
<f:param name="userid" value="#{bill.user.user.id}" />
</h:link>
<h:outputText rendered="#{not billListView.canWriteBill}" value="#{bill.addr1}" />
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="${i18n['bill.sentDate']}" />
</f:facet>
<h:outputText value="#{bill.sentDateTime}">
<f:convertDateTime pattern="#{sessionHandler.dateFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText>
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="${i18n['bill.billNumber']}" />
</f:facet>
<h:outputText value="#{bill.billNumber}" />
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="${i18n['bill.referencenumber']}" />
</f:facet>
<h:outputText value="#{bill.referenceNumberBase}">
<f:converter binding="#{referenceNumberConverter}" />
</h:outputText>
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="${i18n['bill.totalPrice']}" />
</f:facet>
<h:outputText value="#{bill.totalPrice()}">
<f:convertNumber currencyCode="EUR" maxFractionDigits="2" minFractionDigits="2" type="currency" />
</h:outputText>
</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>
</p:column>
<p:column>
<ui:fragment rendered="#{!bill.expired}">
<a href="#{request.contextPath}/PrintBill?billid=#{bill.id}" target="_blank">#{i18n['bill.printBill']}</a>
</ui:fragment>
</p:column>
<p:column>
<h:link outcome="/bill/showBill" value="#{i18n['bill.show']}">
<f:param name="billid" value="#{bill.id}" />
</h:link>
</h:column>
<h:column rendered="#{billListView.canWriteBill}">
</p:column>
<p:column rendered="#{billListView.canWriteBill}">
<h:link outcome="/bill/edit" value="#{i18n['bill.edit']}">
<f:param name="billid" value="#{bill.id}" />
</h:link>
</h:column>
<h:column rendered="#{billListView.canWriteBill}">
</p:column>
<p:column rendered="#{billListView.canWriteBill}">
<h:commandButton rendered="#{bill.paidDate == null}" action="#{billListView.markPaid()}" value="#{i18n['bill.markPaid']}">
<f:ajax render="@form" />
</h:commandButton>
<h:outputText rendered="#{bill.paidDate != null}" value="#{i18n['bill.isPaid']}" />
</h:column>
</p:column>
</p:dataTable>
......
......@@ -10,7 +10,7 @@
</composite:interface>
<composite:implementation>
<h:panelGrid columns="2" columnClasses="topalign,topalign" style="#{bill.expired ? 'expired' : null}">
<h:panelGrid columns="2" columnClasses="topalign,topalign" styleClass="#{cc.attrs.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}" />
......@@ -34,8 +34,12 @@
<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:outputLabel rendered="#{cc.attrs.bill != null}" for="expires" value="#{i18n['bill.expires']}:" />
<h:outputText rendered="#{cc.attrs.bill != null}" id="expires" value="#{cc.attrs.bill.expires.time}">
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText>
<h:outputText rendered="#{cc.attrs.bill.expired}" id="expired" value="#{i18n['bill.isExpired']}" />
</h:panelGrid>
......
......@@ -130,3 +130,7 @@ vertical-align: top;
label {
}
.expired {
color: #c0c0c0;
}
......@@ -221,3 +221,7 @@ h1 {
{
vertical-align:top;
}
.expired {
color: #c0c0c0;
}
......@@ -294,4 +294,9 @@ button.ui-button span
line-height: 1;
padding: .4em .5em;
}
\ No newline at end of file
}
.expired {
color: #c0c0c0;
}
......@@ -287,3 +287,7 @@ padding: 5px;
padding-left: 1em;
vertical-align: top;
}
.expired {
color: #c0c0c0;
}
\ No newline at end of file
......@@ -235,4 +235,8 @@ table.bordertable td,table.bordertable th {
table.bordertable {
border-collapse: collapse;
}
.expired {
color: #c0c0c0;
}
\ No newline at end of file
......@@ -140,6 +140,10 @@ label {
}
.expired {
color: #c0c0c0;
}
/* input {
border: 1px solid #ccc;
padding: 3px 6px;
......
......@@ -16,7 +16,12 @@ actionlog.tasklist.header = Tasklist
actionlog.time = Time
actionlog.user = User
bill.save = Save
bill.billAmount = Amount
bill.billNumber = Number
bill.cancel = Cancel bill
bill.expires = Expires
bill.isExpired = Bill is expired
bill.save = Save
bortalApplication.BILL = Creating, and managing bills
bortalApplication.COMPO = Managing compos
......@@ -110,6 +115,13 @@ navi.auth.login = frontpage
navi.auth.loginerror = frontpage
navi.auth.logout = frontpage
page.bill.billSummary.header = Summary of bills
page.bill.edit.header = Edit bill
page.bill.list.header = Bills
page.bill.listAll.header = Bills
page.bill.placemap.header = Place map
page.bill.show.header = Bill info
pagegroup.auth.login = frontpage
passwordChanged.body = You can now login with the new password.
......
......@@ -59,10 +59,13 @@ bill.address = Payers address
bill.billAmount = Bill amount
bill.billIsPaid = Bill is paid
bill.billLines = Products
bill.billNumber = Bill number
bill.billNumber = Number
bill.billPaidDate = Paid date
bill.cancel = Cancel bill
bill.deliveryTerms = Delivery terms
bill.edit = edit
bill.expires = Expires
bill.isExpired = Bill is expired
bill.isPaid = Paid
bill.markPaid = Mark paid
bill.markedPaid = Bill marked paid
......@@ -409,6 +412,7 @@ page.auth.notauthorized.pagegroup = frontpage
page.auth.resetPassword.header = Reset password
page.bill.billSummary.header = Summary of bills
page.bill.edit.header = Edit bill
page.bill.list.header = Bills
page.bill.listAll.header = Bills
page.bill.placemap.header = Place map
page.bill.show.header = Bill info
......
......@@ -61,10 +61,13 @@ bill.billIsPaid = Lasku on maksettu
bill.billLines = Tuotteet
bill.billMarkedPaidMail.message = Laskusi numero {0} on merkitty maksetuksi. Voit nyt siirty\u00E4 lippukauppaan varamaan haluamasi paikat. Tervetuloa tapahtumaan!
bill.billMarkedPaidMail.subject = Lasku merkitty maksetuksi
bill.billNumber = Laskun numero
bill.billNumber = Numero
bill.billPaidDate = Maksup\u00E4iv\u00E4
bill.cancel = Peruuta lasku
bill.deliveryTerms = Toimitusehdot
bill.edit = Muokkaa
bill.expires = Vanhentuu
bill.isExpired = Lasku on vanhentunut
bill.isPaid = Maksettu
bill.markPaid = Maksettu
bill.markedPaid = Lasku merkitty maksetuksi.
......@@ -83,7 +86,7 @@ bill.save = Tallenna
bill.sentDate = P\u00E4iv\u00E4ys
bill.show = N\u00E4yt\u00E4
bill.theirReference = Asiakkaan viite
bill.totalPrice = Laskun summa
bill.totalPrice = Summa
bill.totalprice = Yhteens\u00E4
billLine.eventuser = Asiakas
......@@ -421,7 +424,10 @@ page.auth.logout.header = Uloskirjautuminen
page.auth.logoutsuccess.header = Logout
page.auth.resetPassword.header = Nollaa salasana
page.bill.billSummary.header = Laskujen yhteenveto
page.bill.edit.header = Muokkaa laskua
page.bill.list.header = Laskut
page.bill.listAll.header = Laskut
page.bill.placemap.header = Paikkakartta
page.bill.show.header = Laskun tiedot
page.checkout.cancel.header = Maksu peruutettu.
page.checkout.delayed.header = Viiv\u00E4stetty maksu
......
......@@ -117,10 +117,11 @@ public class BillEditView extends GenericCDIView {
this.vmreturn = vmreturn;
}
public String expireBill() {
public void expireBill() {
System.out.println("EXPIRE BILL; WE ARE THERE");
bill.markExpired();
System.out.println(""+ bill.getExpires().getTime());
this.save();
return null;
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!