Chorem-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
July 2014
- 2 participants
- 9 discussions
r423 - in trunk/chorem-webmotion/src/main: java/org/chorem/webmotion/actions webapp/WEB-INF/jsp webapp/WEB-INF/jsp/financial
by bpoussin@users.chorem.org 31 Jul '14
by bpoussin@users.chorem.org 31 Jul '14
31 Jul '14
Author: bpoussin
Date: 2014-07-31 16:01:05 +0200 (Thu, 31 Jul 2014)
New Revision: 423
Url: http://forge.chorem.org/projects/chorem/repository/revisions/423
Log:
- add some information (details) on summary page
- fixes some smal syntax error
Modified:
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/DashboardAction.java
trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardSummary.jsp
trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/decorator.jsp
trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp
Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/DashboardAction.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/DashboardAction.java 2014-07-16 14:25:50 UTC (rev 422)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/DashboardAction.java 2014-07-31 14:01:05 UTC (rev 423)
@@ -372,8 +372,37 @@
// WikittyQuery[] annualDebtIncomeQuery = getDebtIncomeQuery(firstDayYear, now, companyId);
// WikittyQuery[] pastAnnualDebtIncomeQuery = getDebtIncomeQuery(lastYearFirstDay, lastYearNow, companyId);
+ // les factures que notre societe aura a payer dans le futur (facture non encore recu)
+ WikittyQuery invoiceExpectedDebtQuery = new ChoremQueryMaker()
+ .select().sum(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_AMOUNT)
+ .and()
+ .exteq(FinancialTransaction.EXT_FINANCIALTRANSACTION)
+ .ne(Invoice.FQ_FIELD_INVOICE_STATUS, InvoiceStatus.CANCELED.name())
+ .or().isNull(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_EMITTEDDATE)
+ .gt(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_EMITTEDDATE, now)
+ .close()
+ .isNull(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_PAYMENTDATE)
+ .containsOne(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_PAYER)
+ .select(Element.ID).filterOnCompanyOrEmployee(companyId)
+ .end().setLimit(WikittyQuery.MAX);
+
+ // les factures que notre societe doit payer mais peu encore attendre (facture recu)
+ WikittyQuery invoiceReceivedDebtQuery = new ChoremQueryMaker()
+ .select().sum(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_AMOUNT)
+ .and()
+ .exteq(FinancialTransaction.EXT_FINANCIALTRANSACTION)
+ .ne(Invoice.FQ_FIELD_INVOICE_STATUS, InvoiceStatus.CANCELED.name())
+ .lt(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_EMITTEDDATE, now)
+ .or().isNull(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_EXPECTEDDATE)
+ .gt(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_EXPECTEDDATE, inOneWeek)
+ .close()
+ .isNull(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_PAYMENTDATE)
+ .containsOne(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_PAYER)
+ .select(Element.ID).filterOnCompanyOrEmployee(companyId)
+ .end().setLimit(WikittyQuery.MAX);
+
// les factures que notre societe doit payer au plus tard dans 7 jours
- WikittyQuery invoiceDebtQuery = new ChoremQueryMaker()
+ WikittyQuery invoiceDueDebtQuery = new ChoremQueryMaker()
.select().sum(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_AMOUNT)
.and()
.exteq(FinancialTransaction.EXT_FINANCIALTRANSACTION)
@@ -384,8 +413,35 @@
.select(Element.ID).filterOnCompanyOrEmployee(companyId)
.end().setLimit(WikittyQuery.MAX);
+ // les factures prevu mais pas encore envoyees
+ WikittyQuery invoiceExpectedIncomeQuery = new ChoremQueryMaker()
+ .select().sum(Invoice.FQ_FIELD_FINANCIALTRANSACTION_AMOUNT)
+ .and()
+ .exteq(FinancialTransaction.EXT_FINANCIALTRANSACTION)
+ .ne(Invoice.FQ_FIELD_INVOICE_STATUS, InvoiceStatus.CANCELED.name())
+ .or().isNull(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_EMITTEDDATE)
+ .gt(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_EMITTEDDATE, now)
+ .close()
+ .isNull(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_PAYMENTDATE)
+ .containsOne(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_BENEFICIARY)
+ .select(Element.ID).filterOnCompanyOrEmployee(companyId)
+ .end().setLimit(WikittyQuery.MAX);
+
+ // les factures envoyer mais pas encore en retard
+ WikittyQuery invoiceEmittedIncomeQuery = new ChoremQueryMaker()
+ .select().sum(Invoice.FQ_FIELD_FINANCIALTRANSACTION_AMOUNT)
+ .and()
+ .exteq(FinancialTransaction.EXT_FINANCIALTRANSACTION)
+ .ne(Invoice.FQ_FIELD_INVOICE_STATUS, InvoiceStatus.CANCELED.name())
+ .lt(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_EMITTEDDATE, now)
+ .gt(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_EXPECTEDDATE, now)
+ .isNull(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_PAYMENTDATE)
+ .containsOne(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_BENEFICIARY)
+ .select(Element.ID).filterOnCompanyOrEmployee(companyId)
+ .end().setLimit(WikittyQuery.MAX);
+
// les factures qu'auraient du payer nos clients (ils sont en retard)
- WikittyQuery invoiceIncomeQuery = new ChoremQueryMaker()
+ WikittyQuery invoiceDueIncomeQuery = new ChoremQueryMaker()
.select().sum(Invoice.FQ_FIELD_FINANCIALTRANSACTION_AMOUNT)
.and()
.exteq(FinancialTransaction.EXT_FINANCIALTRANSACTION)
@@ -405,20 +461,29 @@
WikittyQueryResult<Double>[] invoices =
client.findAllByQuery(Double.class,
- invoiceDebtQuery, invoiceIncomeQuery);
+ invoiceExpectedDebtQuery, invoiceReceivedDebtQuery, invoiceDueDebtQuery,
+ invoiceExpectedIncomeQuery, invoiceEmittedIncomeQuery, invoiceDueIncomeQuery);
WikittyQueryResult<String> touchs =
client.findAllByQuery(touchQuery);
// nombre de facture
- int invoiceDebtNb = invoices[0].getTotalResult();
+ int invoiceExpectedDebtNb = invoices[0].getTotalResult();
+ int invoiceReceivedDebtNb = invoices[1].getTotalResult();
+ int invoiceDueDebtNb = invoices[2].getTotalResult();
// montant total de toutes les factures
- double invoiceDebt = invoices[0].peek();
+ double invoiceExpectedDebt = invoices[0].peek();
+ double invoiceReceivedDebt = invoices[1].peek();
+ double invoiceDueDebt = invoices[2].peek();
// nombre de facture
- int invoiceIncomeNb = invoices[1].getTotalResult();
+ int invoiceExpectedIncomeNb = invoices[3].getTotalResult();
+ int invoiceEmittedIncomeNb = invoices[4].getTotalResult();
+ int invoiceDueIncomeNb = invoices[5].getTotalResult();
// montant total de toutes les factures
- double invoiceIncome = invoices[1].peek();
+ double invoiceExpectedIncome = invoices[3].peek();
+ double invoiceEmittedIncome = invoices[4].peek();
+ double invoiceDueIncome = invoices[5].peek();
int touchNb = touchs.getTotalResult();
@@ -468,10 +533,18 @@
"date", now,
"now", "\"" + WikittyUtil.toString(now) + "\"", //DateFormatUtils.format(now, solRDateFormat),
"inOneWeek", DateFormatUtils.format(inOneWeek, summaryDateFormat),
- "invoiceDebtNb", invoiceDebtNb,
- "invoiceDebt", invoiceDebt,
- "invoiceIncomeNb", invoiceIncomeNb,
- "invoiceIncome", invoiceIncome,
+ "invoiceExpectedDebtNb", invoiceExpectedDebtNb,
+ "invoiceReceivedDebtNb", invoiceReceivedDebtNb,
+ "invoiceDueDebtNb", invoiceDueDebtNb,
+ "invoiceExpectedDebt", invoiceExpectedDebt,
+ "invoiceReceivedDebt", invoiceReceivedDebt,
+ "invoiceDueDebt", invoiceDueDebt,
+ "invoiceExpectedIncomeNb", invoiceExpectedIncomeNb,
+ "invoiceEmittedIncomeNb", invoiceEmittedIncomeNb,
+ "invoiceDueIncomeNb", invoiceDueIncomeNb,
+ "invoiceExpectedIncome", invoiceExpectedIncome,
+ "invoiceEmittedIncome", invoiceEmittedIncome,
+ "invoiceDueIncome", invoiceDueIncome,
"annualDebtIncome", annualDebtIncome,
"pastAnnualDebtIncome", pastAnnualDebtIncome,
"income", income,
Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardSummary.jsp
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardSummary.jsp 2014-07-16 14:25:50 UTC (rev 422)
+++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardSummary.jsp 2014-07-31 14:01:05 UTC (rev 423)
@@ -26,6 +26,137 @@
<%@ taglib uri="/WEB-INF/wikitty.tld" prefix="w"%>
<div class="row">
+ <div class="col-md-1">
+ <p class="calendar">
+ <f:formatDate value="${date}" pattern="dd"/>
+ <span class="saint"><%=org.chorem.Saint.get(new java.util.Date())%></span>
+ <span class="week">semaine <f:formatDate value="${date}" pattern="w"/></span>
+ <em><f:formatDate value="${date}" pattern="MMM"/></em>
+ </p>
+ </div>
+ <div class="col-xs-10">
+ <div class="row">
+ <div class="col-xs-12">
+ factures fournisseurs prévues:
+ <a href='<c:url value="/report?report=invoiceDebt&query=(FinancialTransaction.emittedDate=null or FinancialTransaction.emittedDate>NOW ) and FinancialTransaction.paymentDate=null"/>'>
+ <f:formatNumber type="currency" value="${invoiceExpectedDebt}"/> (${invoiceExpectedDebtNb})</a>
+ reçues:
+ <a href='<c:url value="/report?report=invoiceDebt&query=FinancialTransaction.emittedDate<NOW and (FinancialTransaction.expectedDate=null or FinancialTransaction.expectedDate>NOW+7DAYS ) and FinancialTransaction.paymentDate=null"/>'>
+ <f:formatNumber type="currency" value="${invoiceReceivedDebt}"/> (${invoiceReceivedDebtNb})</a>
+ à payer:
+ <a href='<c:url value="/report?report=invoiceDebt&query=FinancialTransaction.expectedDate<NOW+7DAYS and FinancialTransaction.paymentDate=null"/>'>
+ <strong><f:formatNumber type="currency" value="${invoiceDueDebt}"/> (${invoiceDueDebtNb})</strong></a>
+ total:
+ <a href='<c:url value="/report?report=invoiceDebt&query=FinancialTransaction.paymentDate=null"/>'>
+ <f:formatNumber type="currency" value="${invoiceExpectedDebt+invoiceReceivedDebt+invoiceDueDebt}"/> (${invoiceExpectedDebtNb+invoiceReceivedDebtNb+invoiceDueDebtNb})</a>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-xs-12">
+ factures clients prévues:
+ <a href='<c:url value="/report?report=invoiceIncome&query=(FinancialTransaction.emittedDate=null or FinancialTransaction.emittedDate>NOW ) and FinancialTransaction.paymentDate=null"/>'>
+ <f:formatNumber type="currency" value="${invoiceExpectedIncome}"/> (${invoiceExpectedIncomeNb})</a>
+ envoyées:
+ <a href='<c:url value="/report?report=invoiceIncome&query=FinancialTransaction.emittedDate<NOW and (FinancialTransaction.expectedDate=null or FinancialTransaction.expectedDate>NOW ) and FinancialTransaction.paymentDate=null"/>'>
+ <f:formatNumber type="currency" value="${invoiceEmittedIncome}"/> (${invoiceEmittedIncomeNb})</a>
+ en retard:
+ <a href='<c:url value="/report?report=invoiceIncome&query=FinancialTransaction.expectedDate<NOW and FinancialTransaction.paymentDate=null"/>'>
+ <strong><f:formatNumber type="currency" value="${invoiceDueIncome}"/> (${invoiceDueIncomeNb})</strong></a>
+ total:
+ <a href='<c:url value="/report?report=invoiceDebt&query=FinancialTransaction.paymentDate=null"/>'>
+ <f:formatNumber type="currency" value="${invoiceExpectedIncome+invoiceEmittedIncome+invoiceDueIncome}"/> (${invoiceExpectedIncomeNb+invoiceEmittedIncomeNb+invoiceDueIncomeNb})</a>
+ </div>
+ </div>
+
+ <div class="row spacer"> </div>
+
+ <div class="row">
+ <div class="col-xs-12">
+ Il y a ${touchNb} <a href='<c:url value="/wikitty/search?query=${touchQueryString}"/>'>
+ contact à prendre</a>
+ </div>
+ </div>
+
+ <div class="row spacer"> </div>
+
+ <div class="row">
+ <div class="col-xs-4">
+ Chiffre d'affaire HT:
+ <strong>
+ <a href='<c:url value="/wikitty/search?query=${annualDebtIncome.get('incomesQuery')} or ${annualDebtIncome.get('extraIncomesQuery')} %23limit=2147483647"/>'>
+ <f:formatNumber type="currency" value="${income}"/>
+ </a>
+ </strong>
+ </div>
+ <div class="col-xs-3">
+ N-1: <strong>
+ <a href='<c:url value="/wikitty/search?query=${pastAnnualDebtIncome.get('incomesQuery')} or ${pastAnnualDebtIncome.get('extraIncomesQuery')} %23limit=2147483647"/>'>
+ <f:formatNumber type="currency" value="${pastIncome}"/>
+ </a>
+ </strong>
+ </div>
+ <div class="col-xs-4">
+ Évolution : <f:formatNumber pattern="+#,##0.00;-#,##0.00" value="${income-pastIncome}"/> (<f:formatNumber type="percent" value="${incomeEvolution}"/>)
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-xs-4">
+ Chiffre d'affaire TTC:
+ <strong>
+ <a href='<c:url value="/wikitty/search?query=${annualDebtIncome.get('incomesQuery')} or ${annualDebtIncome.get('extraIncomesQuery')} %23limit=2147483647"/>'>
+ <f:formatNumber type="currency" value="${incomeTTC}"/>
+ </a>
+ </strong>
+ </div>
+ <div class="col-xs-3">
+ N-1: <strong>
+ <a href='<c:url value="/wikitty/search?query=${pastAnnualDebtIncome.get('incomesQuery')} or ${pastAnnualDebtIncome.get('extraIncomesQuery')} %23limit=2147483647"/>'>
+ <f:formatNumber type="currency" value="${pastIncomeTTC}"/>
+ </a>
+ </strong>
+ </div>
+ <div class="col-xs-4">
+ Évolution : <f:formatNumber pattern="+#,##0.00;-#,##0.00" value="${incomeTTC-pastIncomeTTC}"/> (<f:formatNumber type="percent" value="${incomeTTCEvolution}"/>)
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-xs-4">
+ Dépenses TTC:
+ <strong>
+ <a href='<c:url value="/wikitty/search?query=${annualDebtIncome.get('debtsQuery')} %23limit=2147483647"/>'>
+ <f:formatNumber type="currency" value="${debtsTTC}"/>
+ </a>
+ </strong>
+ </div>
+ <div class="col-xs-3">
+ N-1: <strong>
+ <a href='<c:url value="/wikitty/search?query=${pastAnnualDebtIncome.get('debtsQuery')} %23limit=2147483647"/>'>
+ <f:formatNumber type="currency" value="${pastDebtsTTC}"/>
+ </a>
+ </strong>
+ </div>
+ <div class="col-xs-4">
+ Évolution : <f:formatNumber pattern="+#,##0.00;-#,##0.00" value="${debtsTTC-pastDebtsTTC}"/> (<f:formatNumber type="percent" value="${debtsTTCEvolution}"/>)
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-xs-4">
+ Bénéfice/perte:
+ <strong><f:formatNumber type="currency" value="${profitTTC}"/></strong>
+ </div>
+ <div class="col-xs-3">
+ N-1: <strong><f:formatNumber type="currency" value="${pastProfitTTC}"/></strong>
+ </div>
+ <div class="col-xs-4">
+ Évolution : <f:formatNumber pattern="+#,##0.00;-#,##0.00" value="${profitTTC-pastProfitTTC}"/> (<f:formatNumber type="percent" value="${profitTTCEvolution}"/>)
+ </div>
+ </div>
+ </div>
+</div>
+
+
+ <!--
+<div class="row">
<div class="span1">
<p class="calendar">
<f:formatDate value="${date}" pattern="dd"/>
@@ -36,58 +167,143 @@
</div>
<div class="span24">
<ul>
- <li>Il y a ${invoiceDebtNb}
- <a href='<c:url value="/report?report=invoiceDebt&end=${inOneWeek}&query=FinancialTransaction.paymentDate=null"/>'>
- factures à payer</a> pour un montant de
- <f:formatNumber type="currency" value="${invoiceDebt}"/></li>
- <li>Il y a ${invoiceIncomeNb}
- <a href='<c:url value="/report?report=invoiceIncome&useDate=false&query=FinancialTransaction.paymentDate=null and FinancialTransaction.expectedDate<NOW"/>'>
- factures impayées</a> pour un montant de
- <f:formatNumber type="currency" value="${invoiceIncome}"/></li>
+ <li>
+ <ul>
+ <li class="inline">
+ factures fournisseurs prévues:
+ <a href='<c:url value="/report?report=invoiceDebt&query=(FinancialTransaction.emittedDate=null or FinancialTransaction.emittedDate>NOW ) and FinancialTransaction.paymentDate=null"/>'>
+ <f:formatNumber type="currency" value="${invoiceExpectedDebt}"/> (${invoiceExpectedDebtNb})</a>
+ </li>
+ <li class="inline">
+ reçues:
+ <a href='<c:url value="/report?report=invoiceDebt&query=FinancialTransaction.emittedDate<NOW and (FinancialTransaction.expectedDate=null or FinancialTransaction.expectedDate>NOW+7DAYS ) and FinancialTransaction.paymentDate=null"/>'>
+ <f:formatNumber type="currency" value="${invoiceReceivedDebt}"/> (${invoiceReceivedDebtNb})</a>
+ </li>
+ <li class="inline">
+ à payer:
+ <a href='<c:url value="/report?report=invoiceDebt&query=FinancialTransaction.expectedDate<NOW+7DAYS and FinancialTransaction.paymentDate=null"/>'>
+ <f:formatNumber type="currency" value="${invoiceDueDebt}"/> (${invoiceDueDebtNb})</a>
+ </li>
+ <li class="inline last">
+ total:
+ <a href='<c:url value="/report?report=invoiceDebt&query=FinancialTransaction.paymentDate=null"/>'>
+ <f:formatNumber type="currency" value="${invoiceExpectedDebt+invoiceReceivedDebt+invoiceDueDebt}"/> (${invoiceExpectedDebtNb+invoiceReceivedDebtNb+invoiceDueDebtNb})</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ <ul>
+ <li class="inline">
+ factures clients prévues:
+ <a href='<c:url value="/report?report=invoiceIncome&query=(FinancialTransaction.emittedDate=null or FinancialTransaction.emittedDate>NOW ) and FinancialTransaction.paymentDate=null"/>'>
+ <f:formatNumber type="currency" value="${invoiceExpectedIncome}"/> (${invoiceExpectedIncomeNb})</a>
+ </li>
+ <li class="inline">
+ envoyées:
+ <a href='<c:url value="/report?report=invoiceIncome&query=FinancialTransaction.emittedDate<NOW and (FinancialTransaction.expectedDate=null or FinancialTransaction.expectedDate>NOW ) and FinancialTransaction.paymentDate=null"/>'>
+ <f:formatNumber type="currency" value="${invoiceEmittedIncome}"/> (${invoiceEmittedIncomeNb})</a>
+ </li>
+ <li class="inline">
+ en retard:
+ <a href='<c:url value="/report?report=invoiceIncome&query=FinancialTransaction.expectedDate<NOW and FinancialTransaction.paymentDate=null"/>'>
+ <f:formatNumber type="currency" value="${invoiceDueIncome}"/> (${invoiceDueIncomeNb})</a>
+ </li>
+ <li class="inline last">
+ total:
+ <a href='<c:url value="/report?report=invoiceDebt&query=FinancialTransaction.paymentDate=null"/>'>
+ <f:formatNumber type="currency" value="${invoiceExpectedIncome+invoiceEmittedIncome+invoiceDueIncome}"/> (${invoiceExpectedIncomeNb+invoiceEmittedIncomeNb+invoiceDueIncomeNb})</a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+ <ul>
<li>Il y a ${touchNb} <a href='<c:url value="/wikitty/search?query=${touchQueryString}"/>'>
contact à prendre</a></li>
</ul>
<ul>
- <li>Chiffre d'affaire HT:
- <strong>
- <a href='<c:url value="/wikitty/search?query=${annualDebtIncome.get('incomesQuery')} or ${annualDebtIncome.get('extraIncomesQuery')} %23limit=2147483647"/>'>
- <f:formatNumber type="currency" value="${income}"/>
- </a>
- </strong>
- (N-1: <strong>
- <a href='<c:url value="/wikitty/search?query=${pastAnnualDebtIncome.get('incomesQuery')} or ${pastAnnualDebtIncome.get('extraIncomesQuery')} %23limit=2147483647"/>'>
- <f:formatNumber type="currency" value="${pastIncome}"/>
- </a>
- </strong> - Évolution : <f:formatNumber type="percent" value="${incomeEvolution}"/>
+ <li>
+ <ul>
+ <li class="inline">
+ Chiffre d'affaire HT:
+ <strong>
+ <a href='<c:url value="/wikitty/search?query=${annualDebtIncome.get('incomesQuery')} or ${annualDebtIncome.get('extraIncomesQuery')} %23limit=2147483647"/>'>
+ <f:formatNumber type="currency" value="${income}"/>
+ </a>
+ </strong>
+ </li>
+ <li class="inline">
+ N-1: <strong>
+ <a href='<c:url value="/wikitty/search?query=${pastAnnualDebtIncome.get('incomesQuery')} or ${pastAnnualDebtIncome.get('extraIncomesQuery')} %23limit=2147483647"/>'>
+ <f:formatNumber type="currency" value="${pastIncome}"/>
+ </a>
+ </strong>
+ </li>
+ <li class="inline last">
+ Évolution : <f:formatNumber pattern="+#,##0.00;-#,##0.00" value="${income-pastIncome}"/> (<f:formatNumber type="percent" value="${incomeEvolution}"/>)
+ </li>
+ </ul>
</li>
- <li>Chiffre d'affaire TTC:
- <strong>
- <a href='<c:url value="/wikitty/search?query=${annualDebtIncome.get('incomesQuery')} or ${annualDebtIncome.get('extraIncomesQuery')} %23limit=2147483647"/>'>
- <f:formatNumber type="currency" value="${incomeTTC}"/>
- </a>
- </strong>
- (N-1: <strong>
- <a href='<c:url value="/wikitty/search?query=${pastAnnualDebtIncome.get('incomesQuery')} or ${pastAnnualDebtIncome.get('extraIncomesQuery')} %23limit=2147483647"/>'>
- <f:formatNumber type="currency" value="${pastIncomeTTC}"/>
- </a>
- </strong>) - Évolution : <f:formatNumber type="percent" value="${incomeTTCEvolution}"/>
+ <li>
+ <ul>
+ <li class="inline">
+ Chiffre d'affaire TTC:
+ <strong>
+ <a href='<c:url value="/wikitty/search?query=${annualDebtIncome.get('incomesQuery')} or ${annualDebtIncome.get('extraIncomesQuery')} %23limit=2147483647"/>'>
+ <f:formatNumber type="currency" value="${incomeTTC}"/>
+ </a>
+ </strong>
+ </li>
+ <li class="inline">
+ N-1: <strong>
+ <a href='<c:url value="/wikitty/search?query=${pastAnnualDebtIncome.get('incomesQuery')} or ${pastAnnualDebtIncome.get('extraIncomesQuery')} %23limit=2147483647"/>'>
+ <f:formatNumber type="currency" value="${pastIncomeTTC}"/>
+ </a>
+ </strong>
+ </li>
+ <li class="inline last">
+ Évolution : <f:formatNumber pattern="+#,##0.00;-#,##0.00" value="${incomeTTC-pastIncomeTTC}"/> (<f:formatNumber type="percent" value="${incomeTTCEvolution}"/>)
+ </li>
+ </ul>
</li>
- <li>Dépenses TTC:
- <strong>
- <a href='<c:url value="/wikitty/search?query=${annualDebtIncome.get('debtsQuery')} %23limit=2147483647"/>'>
- <f:formatNumber type="currency" value="${debtsTTC}"/>
- </a>
- </strong>
- (N-1: <strong>
- <a href='<c:url value="/wikitty/search?query=${pastAnnualDebtIncome.get('debtsQuery')} %23limit=2147483647"/>'>
- <f:formatNumber type="currency" value="${pastDebtsTTC}"/>
- </a>
- </strong>) - Évolution : <f:formatNumber type="percent" value="${debtsTTCEvolution}"/>
+ <li>
+ <ul>
+ <li class="inline">
+ Dépenses TTC:
+ <strong>
+ <a href='<c:url value="/wikitty/search?query=${annualDebtIncome.get('debtsQuery')} %23limit=2147483647"/>'>
+ <f:formatNumber type="currency" value="${debtsTTC}"/>
+ </a>
+ </strong>
+ </li>
+ <li class="inline">
+ N-1: <strong>
+ <a href='<c:url value="/wikitty/search?query=${pastAnnualDebtIncome.get('debtsQuery')} %23limit=2147483647"/>'>
+ <f:formatNumber type="currency" value="${pastDebtsTTC}"/>
+ </a>
+ </strong>
+ </li>
+ <li class="inline last">
+ Évolution : <f:formatNumber pattern="+#,##0.00;-#,##0.00" value="${debtsTTC-pastDebtsTTC}"/> (<f:formatNumber type="percent" value="${debtsTTCEvolution}"/>)
+ </li>
+ </ul>
</li>
- <li>Bénéfice/perte:
- <strong><f:formatNumber type="currency" value="${profitTTC}"/></strong>
- (N-1: <strong><f:formatNumber type="currency" value="${pastProfitTTC}"/></strong>) - Évolution : <f:formatNumber type="percent" value="${profitTTCEvolution}"/>
+ <li>
+ <ul>
+ <li class="inline">
+ Bénéfice/perte:
+ <strong><f:formatNumber type="currency" value="${profitTTC}"/></strong>
+ </li>
+ <li class="inline">
+ N-1: <strong><f:formatNumber type="currency" value="${pastProfitTTC}"/></strong>
+ </li>
+ <li class="inline last">
+ Évolution : <f:formatNumber pattern="+#,##0.00;-#,##0.00" value="${profitTTC-pastProfitTTC}"/> (<f:formatNumber type="percent" value="${profitTTCEvolution}"/>)
+ </li>
+ </ul>
+ </li>
</ul>
</div>
</div>
+
+ -->
\ No newline at end of file
Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/decorator.jsp
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/decorator.jsp 2014-07-16 14:25:50 UTC (rev 422)
+++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/decorator.jsp 2014-07-31 14:01:05 UTC (rev 423)
@@ -75,7 +75,7 @@
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
- <li class="dropdown nav-group"">
+ <li class="dropdown nav-group">
<a href="<c:url value="/wikitty/search?extension=Company&extension=Person&extension=Employee&extension=Touch"/>">Contact</a>
<a href="#"
class="dropdown-toggle"
@@ -271,12 +271,10 @@
</div>
</c:if>
- <div class="container">
- <div class="well">
+ <div class="container-fluid well">
<c:if test="${not empty slotContent}" >
<jsp:include page="${slotContent}"></jsp:include>
</c:if>
- </div>
</div>
</body>
</html>
Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp 2014-07-16 14:25:50 UTC (rev 422)
+++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp 2014-07-31 14:01:05 UTC (rev 423)
@@ -73,7 +73,7 @@
<th style='width:15%'>Emitted Date</th>
<th style='width:10%'>Project</th>
<th style='width:15%'>Description</th>
- <th style='width:15%%'>Category</th>
+ <th style='width:15%'>Category</th>
<th style='width:7%'>Amount</th>
<th style='width:7%'>VAT</th>
<th style='width:6%'>total</th>
1
0
Author: ymartel
Date: 2014-07-16 16:25:50 +0200 (Wed, 16 Jul 2014)
New Revision: 422
Url: http://forge.chorem.org/projects/chorem/repository/revisions/422
Log:
prepare ExpenseAccount : now, partial save and display
Added:
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/converters/
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/converters/JsonConverter.java
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/converters/JsonHelper.java
trunk/chorem-webmotion/src/test/
trunk/chorem-webmotion/src/test/java/
trunk/chorem-webmotion/src/test/java/org/
trunk/chorem-webmotion/src/test/java/org/chorem/
trunk/chorem-webmotion/src/test/java/org/chorem/webmotion/
trunk/chorem-webmotion/src/test/java/org/chorem/webmotion/converters/
trunk/chorem-webmotion/src/test/java/org/chorem/webmotion/converters/JsonConverterTest.java
trunk/chorem-webmotion/src/test/resources/
trunk/chorem-webmotion/src/test/resources/log4j.properties
Modified:
trunk/chorem-entities/src/main/xmi/chorem-model.properties
trunk/chorem-entities/src/main/xmi/chorem-model.zargo
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/financial/ExpenseAccountAction.java
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/bean/financial/ExpenseAccountBean.java
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/bean/financial/ExpenseAccountEntryBean.java
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/injector/InjectorListener.java
trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountEntryEdit.html
trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp
trunk/chorem-webmotion/src/main/webapp/js/financial/expenseAccount.js
Modified: trunk/chorem-entities/src/main/xmi/chorem-model.properties
===================================================================
--- trunk/chorem-entities/src/main/xmi/chorem-model.properties 2014-07-10 12:57:02 UTC (rev 421)
+++ trunk/chorem-entities/src/main/xmi/chorem-model.properties 2014-07-16 14:25:50 UTC (rev 422)
@@ -192,7 +192,7 @@
# ExpenseAccount
#
org.chorem.entities.ExpenseAccount.class.tagvalue.version=1.0
-org.chorem.entities.ExpenseAccount.class.tagvalue.preload=ExpenseAccount.employee
+org.chorem.entities.ExpenseAccount.class.tagvalue.preload=ExpenseAccount.employee;ExpenseAccount.org.chorem.entities.Employee.class.tagvalue.preload
org.chorem.entities.ExpenseAccount.class.tagvalue.toString=%ExpenseAccount.employee$s - %Interval.beginDate$s/%Interval.endDate$s
org.chorem.entities.ExpenseAccount.class.tagvalue.sortOrder=Interval.beginDate,Interval.endDate
@@ -201,7 +201,7 @@
#
org.chorem.entities.ExpenseAccountEntry.class.tagvalue.version=1.0
org.chorem.entities.ExpenseAccountEntry.class.tagvalue.toString=%FinancialTransaction.reference$tF-%ExpenseAccountEntry.justificationNumber$tF
-org.chorem.entities.ExpenseAccountEntry.class.tagvalue.preload=FinancialTransaction.beneficiary;FinancialTransaction.category
+org.chorem.entities.ExpenseAccountEntry.class.tagvalue.preload=FinancialTransaction.beneficiary;FinancialTransaction.category;FinancialTransaction.target
org.chorem.entities.ExpenseAccountEntry.class.tagvalue.sortOrder=ExpenseAccountEntry.date
#
Modified: trunk/chorem-entities/src/main/xmi/chorem-model.zargo
===================================================================
(Binary files differ)
Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/financial/ExpenseAccountAction.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/financial/ExpenseAccountAction.java 2014-07-10 12:57:02 UTC (rev 421)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/financial/ExpenseAccountAction.java 2014-07-16 14:25:50 UTC (rev 422)
@@ -23,9 +23,8 @@
* #L%
*/
-import java.util.ArrayList;
-import java.util.Calendar;
import java.util.Collection;
+import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Set;
@@ -33,18 +32,16 @@
import com.google.common.base.Function;
import com.google.common.collect.Collections2;
import com.google.common.collect.Lists;
-import com.google.gson.Gson;
import org.apache.commons.lang3.StringUtils;
import org.chorem.ChoremClient;
import org.chorem.entities.Category;
import org.chorem.entities.CategoryImpl;
import org.chorem.entities.Employee;
-import org.chorem.entities.EmployeeImpl;
import org.chorem.entities.ExpenseAccount;
import org.chorem.entities.ExpenseAccountEntry;
import org.chorem.entities.ExpenseAccountEntryImpl;
import org.chorem.entities.ExpenseAccountImpl;
-import org.chorem.entities.Project;
+import org.chorem.entities.Quotation;
import org.chorem.webmotion.PaginatedResult;
import org.chorem.webmotion.bean.financial.ExpenseAccountBean;
import org.chorem.webmotion.bean.financial.ExpenseAccountEntryBean;
@@ -61,22 +58,51 @@
*/
public class ExpenseAccountAction extends WebMotionController {
+ /**
+ * Find all {@link org.chorem.entities.ExpenseAccount} and return their as a {@link org.chorem.webmotion.PaginatedResult} of {@code ExpenseAccountBean}.
+ *
+ * The result is paginated and can be filtered as following :
+ * <ul>
+ * <li>corresponding to a specific month/year : all expense accounts covering this month are returned ;</li>
+ * <li>corresponding to a specific year : in this case, all the ExpenseAccount covering a part of the year are returned;</li>
+ * <li>no year and no month given : in this case, all the ExpenseAccount covering current month are returned;</li>
+ * </ul>
+ *
+ * @param client
+ * @param year
+ * @param month
+ * @param page
+ * @param count
+ * @return
+ */
public PaginatedResult<ExpenseAccountBean> findAllExpenseAccounts(ChoremClient client, Integer year, Integer month, int page, int count) {
- if (month == null) {
- month = DateUtil.getMonth(new Date());
+ Date refStartDate;
+ Date refEndDate;
+
+ if (month == null && year != null) {
+ // only year is given : search for all year
+ refStartDate = DateUtil.createDate(1, 1, year);
+ refEndDate = DateUtil.createDate(31, 12, year);
+
+ } else if (month == null && year == null) {
+ // no month, no year, give current month ?
+ Date today = new Date();
+ refStartDate = DateUtil.setFirstDayOfMonth(today);
+ refEndDate = DateUtil.setLastDayOfMonth(today);
+
+ } else {
+ // we have a month and a year : just search ones corresponding to this month
+ refStartDate = DateUtil.createDate(1, month, year);
+ refEndDate = DateUtil.setLastDayOfMonth(refStartDate);
+
}
- if (year == null) {
- Calendar calendar = Calendar.getInstance();
- year = calendar.get(Calendar.YEAR);
- }
- Date refDate = DateUtil.createDate(1, month, year);
WikittyQuery totalQuery = new WikittyQueryMaker()
.select().count(ExpenseAccount.ELEMENT_FIELD_INTERVAL_BEGINDATE).where().and()
.exteq(ExpenseAccount.EXT_EXPENSEACCOUNT)
- .le(ExpenseAccount.ELEMENT_FIELD_INTERVAL_BEGINDATE, refDate)
- .ge(ExpenseAccount.ELEMENT_FIELD_INTERVAL_ENDDATE, refDate)
+ .le(ExpenseAccount.ELEMENT_FIELD_INTERVAL_BEGINDATE, refEndDate)
+ .ge(ExpenseAccount.ELEMENT_FIELD_INTERVAL_ENDDATE, refStartDate)
.end();
Integer nbExpenseAccounts = client.findByQuery(Integer.class, totalQuery);
@@ -87,8 +113,8 @@
WikittyQuery expAccountsQuery = new WikittyQueryMaker()
.where().and()
.exteq(ExpenseAccount.EXT_EXPENSEACCOUNT)
- .le(ExpenseAccount.ELEMENT_FIELD_INTERVAL_BEGINDATE, refDate)
- .ge(ExpenseAccount.ELEMENT_FIELD_INTERVAL_ENDDATE, refDate)
+ .le(ExpenseAccount.ELEMENT_FIELD_INTERVAL_BEGINDATE, refEndDate)
+ .ge(ExpenseAccount.ELEMENT_FIELD_INTERVAL_ENDDATE, refStartDate)
.end()
.setOffset((page - 1) * count)
.setLimit(page * count);
@@ -100,46 +126,29 @@
paginatedResult = new PaginatedResult<>(Lists.newArrayList(expenseAccountBeans), page, count, nbExpenseAccounts);
} else {
-
- //XXX ymartel 2014/04/09 : create fake datas for test
- Employee employee = client.findAllByExample(new EmployeeImpl(), 0, 1).get(0);
- ExpenseAccountBean fakeOne = new ExpenseAccountBean();
- fakeOne.setId("fake");
- fakeOne.setStartDate(DateUtil.createDate(1, 3, 2014));
- fakeOne.setEndDate(DateUtil.createDate(31, 3, 2014));
- fakeOne.setEmployeeName(employee.toString());
- fakeOne.setEmployeeId(employee.getWikittyId());
- ExpenseAccountBean fakeTwo = new ExpenseAccountBean();
- fakeTwo.setId("fake");
- fakeTwo.setStartDate(DateUtil.createDate(1, 4, 2014));
- fakeTwo.setEndDate(DateUtil.createDate(30, 4, 2014));
- fakeTwo.setEmployeeName(employee.toString());
- fakeTwo.setEmployeeId(employee.getWikittyId());
- ArrayList<ExpenseAccountBean> expenseAccounts = new ArrayList<>();
- expenseAccounts.add(fakeOne);
- expenseAccounts.add(fakeTwo);
- paginatedResult = new PaginatedResult<>(expenseAccounts, 1, count, 0);
+ paginatedResult = new PaginatedResult<>(Collections.EMPTY_LIST, 1, 0, 0);
}
return paginatedResult;
}
- public void saveExpenseAccount(ChoremClient client, String expenseAccountId, ExpenseAccountBean expenseAccount) {
+ public void saveExpenseAccount(ChoremClient client, String expenseAccountId, ExpenseAccountBean expenseAccountBean) {
+
ExpenseAccountImpl expenseAccountWikitty = client.restore(ExpenseAccountImpl.class, expenseAccountId);
- String employeeId = expenseAccount.getEmployeeId();
+ String employeeId = expenseAccountBean.getEmployeeId();
Employee employee = client.restore(Employee.class, employeeId);
if (expenseAccountWikitty == null) {
expenseAccountWikitty = new ExpenseAccountImpl();
expenseAccountWikitty.setEmployee(employee);
}
- expenseAccountWikitty.setBeginDate(expenseAccount.getStartDate());
- expenseAccountWikitty.setEndDate(expenseAccount.getEndDate());
- Set<ExpenseAccountEntryBean> expenseAccountEntries = expenseAccount.getExpenseAccountEntries();
+ expenseAccountWikitty.setBeginDate(expenseAccountBean.getStartDate());
+ expenseAccountWikitty.setEndDate(expenseAccountBean.getEndDate());
+ Set<ExpenseAccountEntryBean> expenseAccountEntries = expenseAccountBean.getExpenseAccountEntries();
if (expenseAccountEntries != null) {
for (ExpenseAccountEntryBean expenseAccountEntryBean : expenseAccountEntries) {
ExpenseAccountEntry expenseAccountEntry = new ExpenseAccountEntryImpl();
expenseAccountEntry.setReference(expenseAccountEntryBean.getJustificationNumber());
- expenseAccountEntry.setEmittedDate(new Date(expenseAccountEntryBean.getEmittedDate()));
+ expenseAccountEntry.setEmittedDate(new Date(expenseAccountEntryBean.getEmittedDate().getTime()));
expenseAccountEntry.setDescription(expenseAccountEntryBean.getDescription());
expenseAccountEntry.setAmount(expenseAccountEntryBean.getAmount());
expenseAccountEntry.setVAT(expenseAccountEntryBean.getVAT());
@@ -177,7 +186,7 @@
}
- Function<ExpenseAccount, ExpenseAccountBean> TRANSFORM_EXPENSE_ACCOUNT_TO_BEAN = new Function<ExpenseAccount, ExpenseAccountBean>() {
+ protected Function<ExpenseAccount, ExpenseAccountBean> TRANSFORM_EXPENSE_ACCOUNT_TO_BEAN = new Function<ExpenseAccount, ExpenseAccountBean>() {
@Override
public ExpenseAccountBean apply(ExpenseAccount expenseAccount) {
ExpenseAccountBean expenseAccountBean = new ExpenseAccountBean();
@@ -188,7 +197,54 @@
expenseAccountBean.setStartDate(expenseAccount.getBeginDate());
expenseAccountBean.setEndDate(expenseAccount.getEndDate());
expenseAccountBean.setEndDate(expenseAccount.getEndDate());
+ Set<ExpenseAccountEntry> expenseAccountEntries = expenseAccount.getExpenseAccountEntry(false);
+ for (ExpenseAccountEntry expenseAccountEntry : expenseAccountEntries) {
+ if (expenseAccountEntry != null) {
+ ExpenseAccountEntryBean expenseAccountEntryBean = TRANSFORM_EXPENSE_ACCOUNT_ENTRY_TO_BEAN.apply(expenseAccountEntry);
+ expenseAccountBean.addExpenseAccountEntry(expenseAccountEntryBean);
+ }
+ }
return expenseAccountBean;
}
};
+
+ protected Function<ExpenseAccountEntry, ExpenseAccountEntryBean> TRANSFORM_EXPENSE_ACCOUNT_ENTRY_TO_BEAN = new Function<ExpenseAccountEntry, ExpenseAccountEntryBean>() {
+
+ @Override
+ public ExpenseAccountEntryBean apply(ExpenseAccountEntry expenseAccountEntry) {
+ ExpenseAccountEntryBean expenseAccountEntryBean = new ExpenseAccountEntryBean();
+
+ Category category = expenseAccountEntry.getCategory(false);
+ if (category != null) {
+ expenseAccountEntryBean.setCategoryId(category.getWikittyId());
+ expenseAccountEntryBean.setCategoryName(category.getName());
+ }
+
+ Date emittedDate = expenseAccountEntry.getEmittedDate();
+ if (emittedDate != null) {
+ expenseAccountEntryBean.setEmittedDate(new Date(emittedDate.getTime()));
+ }
+
+ Date paymentDate = expenseAccountEntry.getPaymentDate();
+ if (paymentDate != null) {
+ expenseAccountEntryBean.setPaymentDate(new Date(paymentDate.getTime()));
+ }
+
+ expenseAccountEntryBean.setDescription(expenseAccountEntry.getDescription());
+ expenseAccountEntryBean.setJustificationNumber(expenseAccountEntry.getReference());
+
+ double amount = expenseAccountEntry.getAmount();
+ double vat = expenseAccountEntry.getVAT();
+ expenseAccountEntryBean.setAmount(amount);
+ expenseAccountEntryBean.setVAT(vat);
+ expenseAccountEntryBean.setTotal(amount + vat);
+
+ Quotation quotation = expenseAccountEntry.getQuotation(false);
+ if (quotation != null) {
+ expenseAccountEntryBean.setProjectId(quotation.getWikittyId());
+ expenseAccountEntryBean.setProjectName(quotation.toString());
+ }
+ return expenseAccountEntryBean;
+ }
+ };
}
Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/bean/financial/ExpenseAccountBean.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/bean/financial/ExpenseAccountBean.java 2014-07-10 12:57:02 UTC (rev 421)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/bean/financial/ExpenseAccountBean.java 2014-07-16 14:25:50 UTC (rev 422)
@@ -25,6 +25,7 @@
import java.io.Serializable;
import java.util.Date;
+import java.util.HashSet;
import java.util.Set;
import com.google.gson.Gson;
@@ -70,7 +71,7 @@
}
public void setStartDate(Date startDate) {
- this.startDate = startDate;
+ this.startDate = new Date(startDate.getTime());
}
public Date getEndDate() {
@@ -78,7 +79,7 @@
}
public void setEndDate(Date endDate) {
- this.endDate = endDate;
+ this.endDate = new Date(endDate.getTime());
}
public Set<ExpenseAccountEntryBean> getExpenseAccountEntries() {
@@ -89,6 +90,13 @@
this.expenseAccountEntries = expenseAccountEntries;
}
+ public void addExpenseAccountEntry(ExpenseAccountEntryBean expenseAccountEntryBean) {
+ if (this.expenseAccountEntries == null) {
+ this.expenseAccountEntries = new HashSet<>();
+ }
+ this.expenseAccountEntries.add(expenseAccountEntryBean);
+ }
+
public String toJson() {
Gson gson = new Gson();
return gson.toJson(this);
Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/bean/financial/ExpenseAccountEntryBean.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/bean/financial/ExpenseAccountEntryBean.java 2014-07-10 12:57:02 UTC (rev 421)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/bean/financial/ExpenseAccountEntryBean.java 2014-07-16 14:25:50 UTC (rev 422)
@@ -24,6 +24,7 @@
*/
import java.io.Serializable;
+import java.util.Date;
/**
* @author ymartel (martel(a)codelutin.com)
@@ -32,8 +33,8 @@
protected String categoryName;
protected String categoryId;
- protected long emittedDate;
- protected long paymentDate;
+ protected Date emittedDate;
+ protected Date paymentDate;
protected String description;
protected String justificationNumber;
protected Double amount;
@@ -58,20 +59,20 @@
this.categoryId = categoryId;
}
- public long getEmittedDate() {
+ public Date getEmittedDate() {
return emittedDate;
}
- public void setEmittedDate(long emittedDate) {
- this.emittedDate = emittedDate;
+ public void setEmittedDate(Date emittedDate) {
+ this.emittedDate = new Date(emittedDate.getTime());
}
- public long getPaymentDate() {
+ public Date getPaymentDate() {
return paymentDate;
}
- public void setPaymentDate(long paymentDate) {
- this.paymentDate = paymentDate;
+ public void setPaymentDate(Date paymentDate) {
+ this.paymentDate = new Date(paymentDate.getTime());
}
public String getDescription() {
Added: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/converters/JsonConverter.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/converters/JsonConverter.java (rev 0)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/converters/JsonConverter.java 2014-07-16 14:25:50 UTC (rev 422)
@@ -0,0 +1,54 @@
+package org.chorem.webmotion.converters;
+
+import org.apache.commons.beanutils.converters.AbstractConverter;
+
+/**
+ * @author ymartel <martel(a)codelutin.com>
+ */
+public class JsonConverter<O> extends AbstractConverter {
+
+ protected Class<O> objectType;
+
+ protected final JsonHelper jsonHelper;
+
+ public static <O> JsonConverter<O> newConverter(Class<O> objectType) {
+ return new JsonConverter<>(objectType);
+ }
+
+ public JsonConverter(Class<O> objectType) {
+
+ this.objectType = objectType;
+ this.jsonHelper = new JsonHelper();
+ }
+
+ @Override
+ protected String convertToString(Object value) throws Throwable {
+
+ String result = jsonHelper.toJson(value);
+ return result;
+ }
+
+ @Override
+ protected <T> T convertToType(Class<T> type, Object value) throws Throwable {
+
+ String stringValue;
+
+ if (value instanceof String) {
+
+ stringValue = (String) value;
+
+ } else {
+
+ stringValue = ((String[]) value)[0];
+ }
+
+ T result = (T) jsonHelper.fromJson(stringValue, type);
+
+ return result;
+ }
+
+ @Override
+ protected Class<O> getDefaultType() {
+ return this.objectType;
+ }
+}
Added: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/converters/JsonHelper.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/converters/JsonHelper.java (rev 0)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/converters/JsonHelper.java 2014-07-16 14:25:50 UTC (rev 422)
@@ -0,0 +1,88 @@
+package org.chorem.webmotion.converters;
+
+import java.lang.reflect.Type;
+import java.util.Date;
+
+import com.google.gson.ExclusionStrategy;
+import com.google.gson.FieldAttributes;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonDeserializationContext;
+import com.google.gson.JsonDeserializer;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonNull;
+import com.google.gson.JsonParseException;
+import com.google.gson.JsonPrimitive;
+import com.google.gson.JsonSerializationContext;
+import com.google.gson.JsonSerializer;
+
+/**
+ * @author ymartel <martel(a)codelutin.com>
+ */
+public class JsonHelper {
+
+ protected final Gson gson;
+
+ public JsonHelper() {
+
+ GsonBuilder gsonBuilder = new GsonBuilder();
+
+ gsonBuilder.setExclusionStrategies(new ExclusionStrategy() {
+ @Override
+ public boolean shouldSkipField(FieldAttributes f) {
+ return false;
+ }
+
+ @Override
+ public boolean shouldSkipClass(Class<?> clazz) {
+ return clazz == Class.class;
+ }
+ });
+
+ gsonBuilder.registerTypeAdapter(Date.class, new JsonSerializer<Date>() {
+
+ @Override
+ public JsonElement serialize(Date src, Type typeOfSrc, JsonSerializationContext context) {
+
+ JsonElement result;
+
+ if (src == null) {
+ result = JsonNull.INSTANCE;
+
+ } else {
+ result = new JsonPrimitive(src.getTime());
+ }
+
+ return result;
+ }
+
+ });
+
+ gsonBuilder.registerTypeAdapter(Date.class, new JsonDeserializer<Date>() {
+ @Override
+ public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
+ return new Date(json.getAsLong());
+ }
+
+ });
+
+ this.gson = gsonBuilder.create();
+ }
+
+ public String toJson(Object model) {
+ String json = gson.toJson(model);
+ return json;
+ }
+
+ public <O> O fromJson(String json, Class<O> type) {
+ O o = gson.fromJson(json, type);
+ return o;
+ }
+
+ public <O> O fromJson(String json, Type type) {
+ O o = gson.fromJson(json, type);
+ return o;
+ }
+
+
+}
Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/injector/InjectorListener.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/injector/InjectorListener.java 2014-07-10 12:57:02 UTC (rev 421)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/injector/InjectorListener.java 2014-07-16 14:25:50 UTC (rev 422)
@@ -23,20 +23,26 @@
package org.chorem.webmotion.injector;
import java.lang.reflect.Array;
-import org.chorem.ChoremClient;
-import org.debux.webmotion.server.WebMotionServerListener;
-import org.debux.webmotion.server.call.Call;
-import org.debux.webmotion.server.call.ServerContext;
-import org.debux.webmotion.server.handler.ExecutorParametersInjectorHandler.Injector;
-import org.debux.webmotion.server.mapping.Mapping;
-
import java.lang.reflect.Type;
import java.util.Collection;
import java.util.Date;
+import java.util.Set;
+
+import com.google.common.collect.Sets;
import org.apache.commons.beanutils.ConversionException;
import org.apache.commons.beanutils.Converter;
import org.apache.commons.lang3.StringUtils;
+import org.chorem.ChoremClient;
import org.chorem.webmotion.ChoremWebMotionUtil;
+import org.chorem.webmotion.PaginatedResult;
+import org.chorem.webmotion.bean.financial.ExpenseAccountBean;
+import org.chorem.webmotion.bean.financial.ExpenseAccountEntryBean;
+import org.chorem.webmotion.converters.JsonConverter;
+import org.debux.webmotion.server.WebMotionServerListener;
+import org.debux.webmotion.server.call.Call;
+import org.debux.webmotion.server.call.ServerContext;
+import org.debux.webmotion.server.handler.ExecutorParametersInjectorHandler.Injector;
+import org.debux.webmotion.server.mapping.Mapping;
import org.nuiton.wikitty.WikittyUtil;
/**
@@ -44,6 +50,12 @@
*/
public class InjectorListener implements WebMotionServerListener {
+ protected static final Set<Class<?>> BEAN_TYPES = Sets.<Class<?>>newHashSet(
+ ExpenseAccountBean.class,
+ ExpenseAccountEntryBean.class,
+ PaginatedResult.class
+ );
+
@Override
public void onStart(Mapping mpng, ServerContext context) {
@@ -60,7 +72,6 @@
}
});
-
// ajout d'un converter pour support tous les formats de date (comme wikitty)
context.addConverter(new Converter() {
@Override
@@ -98,6 +109,11 @@
return result;
}
}, Date.class);
+
+ for (Class<?> beanType : BEAN_TYPES) {
+ context.addConverter(JsonConverter.newConverter(beanType), beanType);
+ }
+
}
@Override
Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountEntryEdit.html
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountEntryEdit.html 2014-07-10 12:57:02 UTC (rev 421)
+++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountEntryEdit.html 2014-07-16 14:25:50 UTC (rev 422)
@@ -1,7 +1,9 @@
<td><input type="text" ng-model="newExpenseAccountEntry.justificationNumber" name="newExpenseAccountEntry.justificationNumber" size="10" style='width:100%'></td>
- <td><input type="date" ng-model="newExpenseAccountEntry.emittedDate" name="newExpenseAccountEntry.emittedDate" size="10" maxlength="10" style='width:90%'></td>
<td>
+ <input class="form-control" type="text" ng-model="newExpenseAccountEntry.emittedDate" datepicker-popup="dd/MM/yyyy" is-open="emittedDateOpened" ng-click="emittedDateOpened = true" size="10" maxlength="10" style='width:90%'>
+ </td>
+ <td>
<input type="text" ng-model="newExpenseAccountEntry.projectName" name="newExpenseAccountEntry.project" size="4" style='width:100%' id="text-newExpenseAccountEntry-project" auto-complete data-source="Project" data-model="newExpenseAccountEntry" data-base-field="project">
<input type="hidden" ng-model="newExpenseAccountEntry.projectId" id="hidden-newExpenseAccountEntry-project"/>
</td>
Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp 2014-07-10 12:57:02 UTC (rev 421)
+++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp 2014-07-16 14:25:50 UTC (rev 422)
@@ -25,8 +25,6 @@
<%@ taglib uri="/WEB-INF/wikitty.tld" prefix="w"%>
<head>
- <script data-require="angular-resource(a)1.2.10" data-semver="1.2.10" src="<c:url value='http://code.angularjs.org/1.2.10/angular-resource.js'/>"></script>
- <link data-require="bootstrap-css@*" data-semver="3.1.1" rel="stylesheet" href="<c:url value='http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css'/>" />
<script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.11.0.js"></script>
<script type="text/javascript" src="<c:url value='/js/financial/expenseAccount.js'/>"></script>
@@ -40,17 +38,31 @@
</head>
<div ng-app='expenseAccountPage' ng-controller="expenseAccountView">
- <div >
- <dl>
- <dd ng-if="expenseAccount && expenseAccount.employeeId"><a href="<c:url value="/wikitty/view/{{expenseAccount.employeeId}}"/>">{{expenseAccount.employeeName}}</a></dd>
- <dd ng-if="!expenseAccount || !expenseAccount.employeeId">
- <input type="text" ng-model="expenseAccount.employeeName" id="text-expenseAccount-employee" auto-complete data-source="Employee" data-model="expenseAccount" data-base-field="employee" />
- <input type="hidden" ng-model="expenseAccount.employeeId" id="hidden-expenseAccount-employee"/>
+ <div >
+ <dl>
+ <dd ng-if="expenseAccount && expenseAccount.employeeId"><a href="<c:url value="/wikitty/view/{{expenseAccount.employeeId}}"/>">{{expenseAccount.employeeName}}</a></dd>
+ <dd ng-if="!expenseAccount || !expenseAccount.employeeId">
+ <input type="text" ng-model="expenseAccount.employeeName" id="text-expenseAccount-employee" auto-complete data-source="Employee" data-model="expenseAccount" data-base-field="employee" />
+ <input type="hidden" ng-model="expenseAccount.employeeId" id="hidden-expenseAccount-employee"/>
+ </dd>
+ <dd ng-if="editPeriod == false">Period from {{expenseAccount.startDate |date}} to {{expenseAccount.endDate |date}}</dd>
+ <dd ng-if="editPeriod == true">
+ <label for="expenseAccountStartDate">Start Date :</label>
+ <input id="expenseAccountBeginDate" class="form-control" type="text"
+ datepicker-popup="dd/MM/yyyy"
+ ng-model="expenseAccount.startDate"
+ is-open="startDateOpened"
+ ng-click="startDateOpened = true" />
+ </dd>
+ <dd ng-if="editPeriod == true">
+ <label for="expenseAccountEndDate">EndDate :</label>
+ <input id="expenseAccountEndDate" class="form-control" type="text"
+ datepicker-popup="dd/MM/yyyy"
+ ng-model="expenseAccount.endDate"
+ is-open="endDateOpened"
+ ng-click="endDateOpened = true" />
- </dd>
- <dd ng-if="editPeriod == false">Period from {{expenseAccount.startDate |date}} to {{expenseAccount.endDate |date}}</dd>
- <dd ng-if="editPeriod == true">StartDate : <input type="date" ng-model="expenseAccount.startDate" name="expenseAccount.startDate"></dd>
- <dd ng-if="editPeriod == true">EndDate : <input type="date" ng-model="expenseAccount.endDate" name="expenseAccount.endDate"></dd>
+ </dd>
</dl>
</div>
Modified: trunk/chorem-webmotion/src/main/webapp/js/financial/expenseAccount.js
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/js/financial/expenseAccount.js 2014-07-10 12:57:02 UTC (rev 421)
+++ trunk/chorem-webmotion/src/main/webapp/js/financial/expenseAccount.js 2014-07-16 14:25:50 UTC (rev 422)
@@ -37,23 +37,34 @@
$scope.expenseAccount.expenseAccountEntries = [];
}
$scope.newExpenseAccountEntry.total = $scope.newExpenseAccountEntry.amount + $scope.newExpenseAccountEntry.VAT;
+
+ if (angular.isDate($scope.newExpenseAccountEntry.emittedDate)) {
+ $scope.newExpenseAccountEntry.emittedDate = $scope.newExpenseAccountEntry.emittedDate.getTime();
+ }
+
$scope.expenseAccount.expenseAccountEntries.push($scope.newExpenseAccountEntry);
$scope.hasChanged = true;
$scope.showNewLine = false;
delete $scope.newExpenseAccountEntry;
- }
+ };
$scope.saveExpenseAccount = function() {
console.log($scope.expenseAccount)
url = $scope.baseURL + "financial/expenseAccounts/" + $scope.expenseAccount.id;
+ if (angular.isDate($scope.expenseAccount.startDate)) {
+ $scope.expenseAccount.startDate = $scope.expenseAccount.startDate.getTime();
+ }
+ if (angular.isDate($scope.expenseAccount.endDate)) {
+ $scope.expenseAccount.endDate = $scope.expenseAccount.endDate.getTime();
+ }
- $resource('url', $scope.expenseAccount, {'update' : {method:'PUT'}}).update(function(result) {
+ $resource('url', { expenseAccountId : $scope.expenseAccount.id, expenseAccountBean : $scope.expenseAccount }, {'update' : {method:'PUT'}}).update(function(result) {
console.log("saved!");
});
- }
+ };
});
Added: trunk/chorem-webmotion/src/test/java/org/chorem/webmotion/converters/JsonConverterTest.java
===================================================================
--- trunk/chorem-webmotion/src/test/java/org/chorem/webmotion/converters/JsonConverterTest.java (rev 0)
+++ trunk/chorem-webmotion/src/test/java/org/chorem/webmotion/converters/JsonConverterTest.java 2014-07-16 14:25:50 UTC (rev 422)
@@ -0,0 +1,50 @@
+package org.chorem.webmotion.converters;
+
+import java.util.Date;
+import java.util.Set;
+
+import org.chorem.webmotion.bean.financial.ExpenseAccountBean;
+import org.chorem.webmotion.bean.financial.ExpenseAccountEntryBean;
+import org.junit.Assert;
+import org.junit.Test;
+import org.nuiton.util.DateUtil;
+
+/**
+ * @author ymartel <martel(a)codelutin.com>
+ */
+public class JsonConverterTest {
+
+ @Test
+ public void testConvertExpenseAccountBeanFromJson() throws Exception {
+
+ String employeeName = "Lucius Fox (WayneCorp)";
+ String employeeId = "f44720a5-f003-4b3f-bfb9-a9189d0ab7d6";
+ Date startDate = DateUtil.createDate(01, 07, 2014);
+ Date endDate = DateUtil.createDate(31, 07, 2014);
+ Date emittedDate = DateUtil.createDate(05, 07, 2014);
+
+ String json = "{"
+ + "\"id\":\"f44720a5-f003-4b3f-bfb9-a9189d0ab7d6\""
+ + ",\"employeeName\":\"" + employeeName + "\""
+ + ",\"employeeId\":\"" + employeeId + "\""
+ + ",\"startDate\":\"" + startDate.getTime() + "\""
+ + ",\"endDate\":\"" + endDate.getTime() + "\""
+ + ",\"expenseAccountEntries\":[{\"justificationNumber\":\"Depl-0507\",\"emittedDate\":\"" + emittedDate.getTime() + "\",\"project\":\"\",\"description\":\"Deplacement\",\"category\":\"\",\"amount\":16,\"VAT\":4,\"total\":20,\"categoryName\":\"Train Hotel Repas Km\",\"categoryId\":\"d6cd6f26-44cb-4a45-a1cf-f41c6dd6fe7f\"}]"
+ + "}";
+ JsonConverter<ExpenseAccountBean> expenseAccountJsonConverter = JsonConverter.newConverter(ExpenseAccountBean.class);
+ ExpenseAccountBean expenseAccount = expenseAccountJsonConverter.convert(ExpenseAccountBean.class, json);
+ Assert.assertNotNull(expenseAccount);
+ Assert.assertNotNull(expenseAccount.getId());
+ Assert.assertEquals(employeeId, expenseAccount.getEmployeeId());
+ Assert.assertEquals(employeeName, expenseAccount.getEmployeeName());
+ Assert.assertEquals(startDate.getTime(), expenseAccount.getStartDate().getTime());
+ Assert.assertEquals(endDate.getTime(), expenseAccount.getEndDate().getTime());
+ Set<ExpenseAccountEntryBean> expenseAccountEntries = expenseAccount.getExpenseAccountEntries();
+ Assert.assertNotNull(expenseAccountEntries);
+ Assert.assertEquals(1, expenseAccountEntries.size());
+ ExpenseAccountEntryBean expenseAccountEntryBean = expenseAccountEntries.iterator().next();
+ Assert.assertEquals(emittedDate.getTime(), expenseAccountEntryBean.getEmittedDate().getTime());
+
+ }
+
+}
Added: trunk/chorem-webmotion/src/test/resources/log4j.properties
===================================================================
--- trunk/chorem-webmotion/src/test/resources/log4j.properties (rev 0)
+++ trunk/chorem-webmotion/src/test/resources/log4j.properties 2014-07-16 14:25:50 UTC (rev 422)
@@ -0,0 +1,36 @@
+###
+# #%L
+# Chorem webmotion
+# $Id: log4j.properties 410 2014-04-09 14:29:44Z ymartel $
+# $HeadURL: https://svn.chorem.org/chorem/trunk/chorem-webmotion/src/main/resources/log… $
+# %%
+# Copyright (C) 2011 - 2012 CodeLutin
+# %%
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# #L%
+###
+# Global logging configuration
+log4j.rootLogger=INFO, stdout
+
+# Console output...
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d %5p [%t] (%F:%L) %M - %m%n
+
+# package level
+log4j.logger.org.chorem=DEBUG
+log4j.logger.org.nuiton=INFO
+log4j.logger.org.debux=ERROR
+log4j.logger.org.apache=ERROR
+#log4j.logger.org.nuiton.wikitty.storage.solr.SolrUtil=DEBUG
1
0
Author: ymartel
Date: 2014-07-10 14:57:02 +0200 (Thu, 10 Jul 2014)
New Revision: 421
Url: http://forge.chorem.org/projects/chorem/repository/revisions/421
Log:
prefer use last stable version of nuiton-js-bootstrap
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-07-10 09:36:45 UTC (rev 420)
+++ trunk/pom.xml 2014-07-10 12:57:02 UTC (rev 421)
@@ -109,7 +109,7 @@
<nuitonjsJquery.version>2.1.1-1</nuitonjsJquery.version>
<nuitonjsJqueryui.version>1.10.4-1</nuitonjsJqueryui.version>
<nuitonjsJqplot.version>1.0.8r1250-1-SNAPSHOT</nuitonjsJqplot.version>
- <nuitonjsBootstrap.version>3.2.0-2-SNAPSHOT</nuitonjsBootstrap.version>
+ <nuitonjsBootstrap.version>3.2.0-1</nuitonjsBootstrap.version>
<!-- license to use -->
<license.licenseName>agpl_v3</license.licenseName>
1
0
10 Jul '14
Author: ymartel
Date: 2014-07-10 11:36:45 +0200 (Thu, 10 Jul 2014)
New Revision: 420
Url: http://forge.chorem.org/projects/chorem/repository/revisions/420
Log:
boostrap migration
Modified:
trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/search.jsp
trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/view.jsp
Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/search.jsp
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/search.jsp 2014-07-10 09:34:48 UTC (rev 419)
+++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/search.jsp 2014-07-10 09:36:45 UTC (rev 420)
@@ -31,7 +31,7 @@
<a href="<c:url value="/wikitty/${key}/search"/>">${key}</a>
</li>
<li>
- <a class="btn btn-success btn-mini" href="<c:url value="/wikitty/${key}/edit/new"/>"><i class="icon-plus icon-white"></i> Add</a>
+ <a class="btn btn-success btn-xs" href="<c:url value="/wikitty/${key}/edit/new"/>"><i class="icon-plus icon-white"></i> Add</a>
</li>
<li>
<form class="form-search form-inline" action="<c:url value="/wikitty/${key}/search"/>">
Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/view.jsp
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/view.jsp 2014-07-10 09:34:48 UTC (rev 419)
+++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/view.jsp 2014-07-10 09:36:45 UTC (rev 420)
@@ -35,9 +35,9 @@
<c:forEach var="ext" items="${extensions}">
<dl><dt><a href="<c:url value="/wikitty/search?extension=${ext.name}"/>">${ext.name}</a>
- <a class="btn btn-success btn-mini" href="<c:url value="/wikitty/edit/${wikitty.id}?extension=${ext.name}"/>"><i class="icon-pencil icon-white"></i> Edit</a>
- <a class="btn btn-success btn-mini" href="<c:url value="/wikitty/editMulti/${wikitty.id}"/>"><i class="icon-pencil icon-white"></i> Edit Multi</a>
- <a class="btn btn-danger btn-mini" href="<c:url value="/wikitty/delete/${wikitty.id}?extension=${ext.name}&wmDecoratorNo=true"/>"><i class="icon-trash icon-white"></i> Delete</a></dt>
+ <a class="btn btn-success btn-xs" href="<c:url value="/wikitty/edit/${wikitty.id}?extension=${ext.name}"/>"><i class="icon-pencil icon-white"></i> Edit</a>
+ <a class="btn btn-success btn-xs" href="<c:url value="/wikitty/editMulti/${wikitty.id}"/>"><i class="icon-pencil icon-white"></i> Edit Multi</a>
+ <a class="btn btn-danger btn-xs" href="<c:url value="/wikitty/delete/${wikitty.id}?extension=${ext.name}&wmDecoratorNo=true"/>"><i class="icon-trash icon-white"></i> Delete</a></dt>
<c:forEach var="fieldName" items="${ext.fieldNames}">
<dd><w:display wikitty="${wikitty}" fqfield="${ext.name}.${fieldName}"/></dd>
</c:forEach>
1
0
r419 - in trunk: . chorem-webmotion/src/main/webapp/WEB-INF chorem-webmotion/src/main/webapp/WEB-INF/jsp chorem-webmotion/src/main/webapp/WEB-INF/jsp/salesReports chorem-webmotion/src/main/webapp/js
by ymartel@users.chorem.org 10 Jul '14
by ymartel@users.chorem.org 10 Jul '14
10 Jul '14
Author: ymartel
Date: 2014-07-10 11:34:48 +0200 (Thu, 10 Jul 2014)
New Revision: 419
Url: http://forge.chorem.org/projects/chorem/repository/revisions/419
Log:
some dependencies upgrade and bootstrap migration
Added:
trunk/chorem-webmotion/src/main/webapp/js/jquery.maskedinput-1.3-1.js
Removed:
trunk/chorem-webmotion/src/main/webapp/js/jquery.maskedinput-1.3.js
Modified:
trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/decorator.jsp
trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/salesReports/menu.jsp
trunk/chorem-webmotion/src/main/webapp/WEB-INF/wro.xml
trunk/chorem-webmotion/src/main/webapp/js/jquery.fn.gantt.js
trunk/pom.xml
Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/decorator.jsp
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/decorator.jsp 2014-07-07 11:56:49 UTC (rev 418)
+++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/decorator.jsp 2014-07-10 09:34:48 UTC (rev 419)
@@ -59,44 +59,44 @@
<script type="text/javascript" src="<c:url value='/js/ng-select2.js'/>"></script>
</head>
<body>
- <div class="navbar navbar-fixed-top">
+ <div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="navbar-inner">
<div class="container">
- <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
- <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
+ <span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
- </a>
+ </button>
- <a class="brand" href="<c:url value="/"/>">Chorem</a>
+ <a class="navbar-brand" href="<c:url value="/"/>">Chorem</a>
<!-- Everything you want hidden at 940px or less, place within here -->
- <div class="nav-collapse">
+ <div class="navbar-collapse collapse">
- <ul class="nav">
- <li class="dropdown nav-group">
+ <ul class="nav navbar-nav">
+ <li class="dropdown nav-group"">
<a href="<c:url value="/wikitty/search?extension=Company&extension=Person&extension=Employee&extension=Touch"/>">Contact</a>
<a href="#"
class="dropdown-toggle"
data-toggle="dropdown">
- <b class="caret"></b>
+ <span class="caret"></span>
</a>
- <ul class="dropdown-menu">
- <li><a href="<c:url value="/wikitty/Company/search"/>"><i class="icon-th-list icon-black"></i> All company</a></li>
- <li><a href="<c:url value="/wikitty/Company/edit/new"/>"><i class="icon-plus icon-black"></i> Add company</a></li>
+ <ul class="dropdown-menu" role="menu">
+ <li><a href="<c:url value="/wikitty/Company/search"/>"><span class="glyphicon glyphicon-th-list"></span> All company</a></li>
+ <li><a href="<c:url value="/wikitty/Company/edit/new"/>"><span class="glyphicon glyphicon-plus glyphicon-black"></span> Add company</a></li>
<li class="divider"></li>
- <li><a href="<c:url value="/wikitty/Person/search"/>"><i class="icon-th-list icon-black"></i> All person</a></li>
- <li><a href="<c:url value="/wikitty/Person/edit/new"/>"><i class="icon-plus icon-black"></i> Add person</a></li>
+ <li><a href="<c:url value="/wikitty/Person/search"/>"><span class="glyphicon glyphicon-th-list"></span> All person</a></li>
+ <li><a href="<c:url value="/wikitty/Person/edit/new"/>"><span class="glyphicon glyphicon-plus"></span> Add person</a></li>
<li class="divider"></li>
- <li><a href="<c:url value="/wikitty/Employee/search"/>"><i class="icon-th-list icon-black"></i> All employee</a></li>
- <li><a href="<c:url value="/wikitty/Employee/edit/new"/>"><i class="icon-plus icon-black"></i> Add employee</a></li>
+ <li><a href="<c:url value="/wikitty/Employee/search"/>"><span class="glyphicon glyphicon-th-list"></span> All employee</a></li>
+ <li><a href="<c:url value="/wikitty/Employee/edit/new"/>"><span class="glyphicon glyphicon-plus"></span> Add employee</a></li>
<li class="divider"></li>
- <li><a href="<c:url value="/wikitty/ContactDetails/search"/>"><i class="icon-th-list icon-black"></i> All contact details</a></li>
- <li><a href="<c:url value="/wikitty/ContactDetails/edit/new"/>"><i class="icon-plus icon-black"></i> Add contact details</a></li>
+ <li><a href="<c:url value="/wikitty/ContactDetails/search"/>"><span class="glyphicon glyphicon-th-list"></span> All contact details</a></li>
+ <li><a href="<c:url value="/wikitty/ContactDetails/edit/new"/>"><i class="glyphicon glyphicon-plus"></i> Add contact details</a></li>
<li class="divider"></li>
- <li><a href="<c:url value="/wikitty/Touch/search"/>"><i class="icon-th-list icon-black"></i> All touch</a></li>
- <li><a href="<c:url value="/wikitty/Touch/edit/new"/>"><i class="icon-plus icon-black"></i> Add touch</a></li>
+ <li><a href="<c:url value="/wikitty/Touch/search"/>"><span class="glyphicon glyphicon-th-list"></span> All touch</a></li>
+ <li><a href="<c:url value="/wikitty/Touch/edit/new"/>"><i class="glyphicon glyphicon-plus"></i> Add touch</a></li>
<li class="divider"></li>
<li><a href="<c:url value="/crm/export"/>"> Export</li>
</ul>
@@ -105,31 +105,31 @@
<!-- around projects -->
<a href="<c:url value="/report?report=quotation,projectOpen,projectClosed"/>">Project</a>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
- <b class="caret"></b>
+ <span class="caret"></span>
</a>
- <ul class="dropdown-menu">
+ <ul class="dropdown-menu" role="menu">
<li>Current project</li>
- <li><a href="<c:url value="/wikitty/Project/search"/>"><i class="icon-th-list icon-black"></i> All projects</a></li>
- <li><a href="<c:url value="/wikitty/Project/edit/new"/>"><i class="icon-plus icon-black"></i> Add project</a></li>
- <li><a href="<c:url value="/project"/>"><i class="icon-th-list icon-black"></i> Dashboard project</a></li>
- <li><a href="<c:url value="/project/multi"/>"><i class="icon-th-list icon-black"></i> Dashboard multi-project</a></li>
+ <li><a href="<c:url value="/wikitty/Project/search"/>"><span class="glyphicon glyphicon-th-list"></span> All projects</a></li>
+ <li><a href="<c:url value="/wikitty/Project/edit/new"/>"><span class="glyphicon glyphicon-plus"></span> Add project</a></li>
+ <li><a href="<c:url value="/project"/>"><span class="glyphicon glyphicon-th-list"></span> Dashboard project</a></li>
+ <li><a href="<c:url value="/project/multi"/>"><span class="glyphicon glyphicon-th-list"></span> Dashboard multi-project</a></li>
<li class="divider"></li>
<li>Propale</li>
- <li><a href="<c:url value="/wikitty/Quotation/search"/>"><i class="icon-th-list icon-black"></i> All quotations</a></li>
- <li><a href="<c:url value="/wikitty/Quotation/edit/new"/>"><i class="icon-plus icon-black"></i> Add quotation</a></li>
+ <li><a href="<c:url value="/wikitty/Quotation/search"/>"><span class="glyphicon glyphicon-th-list"></span> All quotations</a></li>
+ <li><a href="<c:url value="/wikitty/Quotation/edit/new"/>"><span class="glyphicon glyphicon-plus"></span> Add quotation</a></li>
<li class="divider"></li>
<li>Task</li>
- <li><a href="<c:url value="/wikitty/Task/search"/>"><i class="icon-th-list icon-black"></i> All tasks</a></li>
- <li><a href="<c:url value="/wikitty/Task/edit/new"/>"><i class="icon-plus icon-black"></i> Add task</a></li>
+ <li><a href="<c:url value="/wikitty/Task/search"/>"><span class="glyphicon glyphicon-th-list"></span> All tasks</a></li>
+ <li><a href="<c:url value="/wikitty/Task/edit/new"/>"><span class="glyphicon glyphicon-plus"></span> Add task</a></li>
<li class="divider"></li>
<li>Worker</li>
- <li><a href="<c:url value="/wikitty/Worker/search"/>"><i class="icon-th-list icon-black"></i> All workers</a></li>
- <li><a href="<c:url value="/wikitty/Worker/edit/new"/>"><i class="icon-plus icon-black"></i> Add worker</a></li>
- <li><a href="<c:url value="/project/employee"/>"><i class="icon-plus icon-black"></i> Employee dashboard</a></li>
+ <li><a href="<c:url value="/wikitty/Worker/search"/>"><span class="glyphicon glyphicon-th-list"></span> All workers</a></li>
+ <li><a href="<c:url value="/wikitty/Worker/edit/new"/>"><span class="glyphicon glyphicon-plus"></span> Add worker</a></li>
+ <li><a href="<c:url value="/project/employee"/>"><span class="glyphicon glyphicon-plus"></span> Employee dashboard</a></li>
<li class="divider"></li>
<li>Time</li>
- <li><a href="<c:url value="/wikitty/Time/search"/>"><i class="icon-th-list icon-black"></i> All times</a></li>
- <li><a href="<c:url value="/wikitty/Time/edit/new"/>"><i class="icon-plus icon-black"></i> Add time</a></li>
+ <li><a href="<c:url value="/wikitty/Time/search"/>"><span class="glyphicon glyphicon-th-list"></span> All times</a></li>
+ <li><a href="<c:url value="/wikitty/Time/edit/new"/>"><span class="glyphicon glyphicon-plus"></span> Add time</a></li>
<li class="divider"></li>
<li>Report</li>
<li><a href="<c:url value="/report?report=quotation"/>">Quotation</a></li>
@@ -141,43 +141,43 @@
<!-- around sales -->
<a>Commercial</a>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
- <b class="caret"></b>
+ <span class="caret"></span>
</a>
- <ul class="dropdown-menu">
- <li><a href="<c:url value="/sales/funnel"/>"><i class="icon-tasks icon-black"></i> Tunnel de commande</a></li>
- <li><a href="<c:url value="/sales/report/sales"/>"><i class="icon-th-list icon-black"></i> Rapports</a></li>
+ <ul class="dropdown-menu" role="menu">
+ <li><a href="<c:url value="/sales/funnel"/>"><span class="glyphicon glyphicon-tasks"></span> Tunnel de commande</a></li>
+ <li><a href="<c:url value="/sales/report/sales"/>"><span class="glyphicon glyphicon-th-list"></span> Rapports</a></li>
</ul>
</li>
<li class="dropdown nav-group">
<!-- around financial -->
<a href="<c:url value="/report?report=invoiceDebt,invoiceIncome,profitability,budget"/>">Financial</a>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
- <b class="caret"></b>
+ <span class="caret"></span>
</a>
- <ul class="dropdown-menu">
+ <ul class="dropdown-menu" role="menu">
<li>
- <a href="<c:url value="/wikitty/Quotation/search"/>"><i class="icon-th-list icon-black"></i>Quotations</a>
- <a href="<c:url value="/wikitty/Quotation/edit/new"/>"><i class="icon-plus icon-black"></i></a>
+ <a href="<c:url value="/wikitty/Quotation/search"/>"><span class="glyphicon glyphicon-th-list"></span>Quotations</a>
+ <a href="<c:url value="/wikitty/Quotation/edit/new"/>"><span class="glyphicon glyphicon-plus"></span></a>
</li>
<li>
- <a href="<c:url value="/wikitty/FinancialTransaction/search"/>"><i class="icon-th-list icon-black"></i>FinancialTransaction</a>
- <a href="<c:url value="/wikitty/FinancialTransaction/edit/new"/>"><i class="icon-plus icon-black"></i></a>
+ <a href="<c:url value="/wikitty/FinancialTransaction/search"/>"><span class="glyphicon glyphicon-th-list"></span>FinancialTransaction</a>
+ <a href="<c:url value="/wikitty/FinancialTransaction/edit/new"/>"><span class="glyphicon glyphicon-plus"></span></a>
</li>
<li>
- <a href="<c:url value="/wikitty/Invoice/search"/>"><i class="icon-th-list icon-black"></i>Invoices</a>
- <a href="<c:url value="/wikitty/Invoice/edit/new"/>"><i class="icon-plus icon-black"></i></a>
+ <a href="<c:url value="/wikitty/Invoice/search"/>"><span class="glyphicon glyphicon-th-list"></span>Invoices</a>
+ <a href="<c:url value="/wikitty/Invoice/edit/new"/>"><span class="glyphicon glyphicon-plus"></span></a>
</li>
<li>
- <a href="<c:url value="/wikitty/Invoice/search?query=FinancialTransaction.beneficiary%3D%22Code+Lutin%22"/>"><i class="icon-th-list icon-black"></i>Crédits-Ventes</a>
- <a href="<c:url value="/wikitty/Invoice/edit/new"/>"><i class="icon-plus icon-black"></i></a>
+ <a href="<c:url value="/wikitty/Invoice/search?query=FinancialTransaction.beneficiary%3D%22Code+Lutin%22"/>"><span class="glyphicon glyphicon-th-list"></span>Crédits-Ventes</a>
+ <a href="<c:url value="/wikitty/Invoice/edit/new"/>"><span class="glyphicon glyphicon-plus"></span></a>
</li>
<li>
- <a href="<c:url value="/wikitty/Invoice/search?query=FinancialTransaction.payer%3D%22Code+Lutin%22"/>"><i class="icon-th-list icon-black"></i>Débits-Achats</a>
- <a href="<c:url value="/wikitty/Invoice/edit/new"/>"><i class="icon-plus icon-black"></i></a>
+ <a href="<c:url value="/wikitty/Invoice/search?query=FinancialTransaction.payer%3D%22Code+Lutin%22"/>"><span class="glyphicon glyphicon-th-list"></span>Débits-Achats</a>
+ <a href="<c:url value="/wikitty/Invoice/edit/new"/>"><span class="glyphicon glyphicon-plus"></span></a>
</li>
<li>
- <a href="<c:url value="/wikitty/Category/search"/>"><i class="icon-th-list icon-black"></i>Categories</a>
- <a href="<c:url value="/wikitty/Category/edit/new"/>"><i class="icon-plus icon-black"></i></a>
+ <a href="<c:url value="/wikitty/Category/search"/>"><span class="glyphicon glyphicon-th-list"></span>Categories</a>
+ <a href="<c:url value="/wikitty/Category/edit/new"/>"><span class="glyphicon glyphicon-plus"></span></a>
</li>
<li class="divider"></li>
<li>Report</li>
@@ -194,25 +194,25 @@
<a href="#"
class="dropdown-toggle"
data-toggle="dropdown">
- <b class="caret"></b>
+ <span class="caret"></span>
</a>
- <ul class="dropdown-menu">
+ <ul class="dropdown-menu" role="menu">
<li>Reference Year</li>
- <li><a href="<c:url value="/wikitty/ReferenceYear/search"/>"><i class="icon-th-list icon-black"></i> All years</a></li>
- <li><a href="<c:url value="/wikitty/ReferenceYear/edit/new"/>"><i class="icon-plus icon-black"></i> Add year</a></li>
+ <li><a href="<c:url value="/wikitty/ReferenceYear/search"/>"><span class="glyphicon glyphicon-th-list"></span> All years</a></li>
+ <li><a href="<c:url value="/wikitty/ReferenceYear/edit/new"/>"><span class="glyphicon glyphicon-plus"></span> Add year</a></li>
<li>Employee HR</li>
- <li><a href="<c:url value="/wikitty/EmployeeHR/search"/>"><i class="icon-th-list icon-black"></i> All employees HR</a></li>
- <li><a href="<c:url value="/wikitty/EmployeeHR/edit/new"/>"><i class="icon-plus icon-black"></i> Add employee HR</a>
+ <li><a href="<c:url value="/wikitty/EmployeeHR/search"/>"><span class="glyphicon glyphicon-th-list"></span> All employees HR</a></li>
+ <li><a href="<c:url value="/wikitty/EmployeeHR/edit/new"/>"><span class="glyphicon glyphicon-plus"></span> Add employee HR</a>
<li><a href="<c:url value="/hr/employeeEdit"/>">Employee edit</a></li>
<li><a href="<c:url value="/hr/dashboardAdc"/>">Adc Dashboard</a></li>
<li>Vacation</li>
- <li><a href="<c:url value="/wikitty/Vacation/search"/>"><i class="icon-th-list icon-black"></i> All vacations</a></li>
- <li><a href="<c:url value="/wikitty/Vacation/edit/new"/>"><i class="icon-plus icon-black"></i> Add vacation</a></li>
+ <li><a href="<c:url value="/wikitty/Vacation/search"/>"><span class="glyphicon glyphicon-th-list"></span> All vacations</a></li>
+ <li><a href="<c:url value="/wikitty/Vacation/edit/new"/>"><span class="glyphicon glyphicon-plus"></span> Add vacation</a></li>
<li>Vacation Request</li>
- <li><a href="<c:url value="/wikitty/VacationRequest/search"/>"><i class="icon-th-list icon-black"></i> All requests</a></li>
- <li><a href="<c:url value="/wikitty/VacationRequest/edit/new"/>"><i class="icon-plus icon-black"></i> Add request</a></li>
- <li><a href="<c:url value="/report?report=requestVacation"/>"><i class="icon-th-list icon-black"></i> Dashboard vacations</a></li>
- <li><a href="<c:url value="/hr/vacationRequest/edit/new"/>"><i class="icon-plus icon-black"></i> Add Leave Request</a></li>
+ <li><a href="<c:url value="/wikitty/VacationRequest/search"/>"><span class="glyphicon glyphicon-th-list"></span> All requests</a></li>
+ <li><a href="<c:url value="/wikitty/VacationRequest/edit/new"/>"><span class="glyphicon glyphicon-plus"></span> Add request</a></li>
+ <li><a href="<c:url value="/report?report=requestVacation"/>"><span class="glyphicon glyphicon-th-list"></span> Dashboard vacations</a></li>
+ <li><a href="<c:url value="/hr/vacationRequest/edit/new"/>"><span class="glyphicon glyphicon-plus"></span> Add Leave Request</a></li>
</ul>
</li>
<li class="dropdown nav-group">
@@ -220,12 +220,12 @@
<a href="#"
class="dropdown-toggle"
data-toggle="dropdown">
- <b class="caret"></b>
+ <span class="caret"></span>
</a>
- <ul class="dropdown-menu">
+ <ul class="dropdown-menu" role="menu">
<li>User</li>
- <li><a href="<c:url value="/wikitty/WikittyUser/search"/>"><i class="icon-th-list icon-black"></i> All users</a></li>
- <li><a href="<c:url value="/wikitty/WikittyUser/edit/new"/>"><i class="icon-plus icon-black"></i> Add user</a></li>
+ <li><a href="<c:url value="/wikitty/WikittyUser/search"/>"><span class="glyphicon glyphicon-th-list"></span> All users</a></li>
+ <li><a href="<c:url value="/wikitty/WikittyUser/edit/new"/>"><span class="glyphicon glyphicon-plus"></span> Add user</a></li>
<li class="divider"></li>
<li><a href="<c:url value="/admin/variables"/>">Variables</a></li>
<li class="divider"></li>
@@ -233,12 +233,12 @@
<li class="divider"></li>
<li><a href="<c:url value="/admin/reindex"/>">Reindex</a></li>
<li class="divider"></li>
-
+
</ul>
</li>
</ul>
-
- <form class="navbar-search pull-left" action="<c:url value="/wikitty/search"/>">
+
+ <form class="navbar-form navbar-right" action="<c:url value="/wikitty/search"/>">
<input type="text" class="search-query" placeholder="Search" name="query" value="${fn:escapeXml(param.query)}"/>
</form>
</div>
Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/salesReports/menu.jsp
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/salesReports/menu.jsp 2014-07-07 11:56:49 UTC (rev 418)
+++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/salesReports/menu.jsp 2014-07-10 09:34:48 UTC (rev 419)
@@ -20,10 +20,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
#L%
--%>
-<ul class="nav nav-list">
- <li><a href="sales"><i class="icon-chevron-right"></i> Ventes</a></li>
- <li><a href="#"><i class="icon-chevron-right"></i> Ventes par client</a></li>
- <li><a href="salesPerProject"><i class="icon-chevron-right"></i> Ventes par projet</a></li>
- <li><a href="sentQuotation"><i class="icon-chevron-right"></i> Devis envoy�s</a></li>
- <li><a href="acceptedQuotation"><i class="icon-chevron-right"></i> Devis accept�s</a></li>
+<ul class="list-group">
+ <li class="list-group-item"><a href="sales"><i class="icon-chevron-right"></i> Ventes</a></li>
+ <li class="list-group-item"><a href="#"><i class="icon-chevron-right"></i> Ventes par client</a></li>
+ <li class="list-group-item"><a href="salesPerProject"><i class="icon-chevron-right"></i> Ventes par projet</a></li>
+ <li class="list-group-item"><a href="sentQuotation"><i class="icon-chevron-right"></i> Devis envoy�s</a></li>
+ <li class="list-group-item"><a href="acceptedQuotation"><i class="icon-chevron-right"></i> Devis accept�s</a></li>
</ul>
\ No newline at end of file
Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/wro.xml
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/WEB-INF/wro.xml 2014-07-07 11:56:49 UTC (rev 418)
+++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/wro.xml 2014-07-10 09:34:48 UTC (rev 419)
@@ -24,7 +24,8 @@
<group name='chorem-lib'>
<group-ref>jquery</group-ref>
- <group-ref>bootstrap-responsive</group-ref>
+ <group-ref>bootstrap</group-ref>
+ <group-ref>bootstrap-theme</group-ref>
<group-ref>jquery-ui</group-ref>
<group-ref>jquery-ui-cupertino</group-ref>
<group-ref>jquery-ui-fr</group-ref>
Modified: trunk/chorem-webmotion/src/main/webapp/js/jquery.fn.gantt.js
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/js/jquery.fn.gantt.js 2014-07-07 11:56:49 UTC (rev 418)
+++ trunk/chorem-webmotion/src/main/webapp/js/jquery.fn.gantt.js 2014-07-10 09:34:48 UTC (rev 419)
@@ -213,13 +213,14 @@
// Normalizes for IE
elementFromPoint: function (x, y) {
- if ($.browser.msie) {
- x -= $(document).scrollLeft();
- y -= $(document).scrollTop();
- } else {
- x -= window.pageXOffset;
- y -= window.pageYOffset;
- }
+ //XXX ymartel - 2014/07/07 : $.browser has been removed from jquery, do we still need it ?
+// if ($.browser.msie) {
+// x -= $(document).scrollLeft();
+// y -= $(document).scrollTop();
+// } else {
+ x -= window.pageXOffset;
+ y -= window.pageYOffset;
+// }
return document.elementFromPoint(x, y);
},
Copied: trunk/chorem-webmotion/src/main/webapp/js/jquery.maskedinput-1.3-1.js (from rev 416, trunk/chorem-webmotion/src/main/webapp/js/jquery.maskedinput-1.3.js)
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/js/jquery.maskedinput-1.3-1.js (rev 0)
+++ trunk/chorem-webmotion/src/main/webapp/js/jquery.maskedinput-1.3-1.js 2014-07-10 09:34:48 UTC (rev 419)
@@ -0,0 +1,381 @@
+/*
+ * %%Ignore-License
+ *
+ Masked Input plugin for jQuery
+ Copyright (c) 2007-2013 Josh Bush (digitalbush.com)
+ Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)
+ Version: 1.3.1
+
+<script src="jquery.js" type="text/javascript"></script>
+<script src="jquery.maskedinput.js" type="text/javascript"></script>
+
+jQuery(function($){
+ $("#date").mask("99/99/9999");
+ $("#phone").mask("(999) 999-9999");
+ $("#tin").mask("99-9999999");
+ $("#ssn").mask("999-99-9999");
+});
+
+Optionally, if you are not satisfied with the underscore ('_') character as a
+placeholder, you may pass an optional argument to the maskedinput method.
+
+jQuery(function($){
+ $("#product").mask("99/99/9999",{placeholder:" "});
+});
+
+Optionally, if you would like to execute a function once the mask has been
+completed, you can specify that function as an optional argument to the
+maskedinput method.
+
+jQuery(function($){
+ $("#product").mask("99/99/9999",
+ {completed:function(){alert("You typed thefollowing: "+this.val());}});
+});
+
+You can now supply your own mask definitions.
+
+jQuery(function($){
+ $.mask.definitions['~']='[+-]';
+ $("#eyescript").mask("~9.99 ~9.99 999");
+});
+
+You can have part of your mask be optional. Anything listed after '?' within the
+mask is considered optional user input. The common example for this is phone
+number + optional extension.
+
+jQuery(function($){
+ $("#phone").mask("(999) 999-9999? x99999");
+});
+*/
+(function($) {
+ function getPasteEvent() {
+ var el = document.createElement('input'),
+ name = 'onpaste';
+ el.setAttribute(name, '');
+ return (typeof el[name] === 'function')?'paste':'input';
+}
+
+var pasteEventName = getPasteEvent() + ".mask",
+ ua = navigator.userAgent,
+ iPhone = /iphone/i.test(ua),
+ android=/android/i.test(ua),
+ caretTimeoutId;
+
+$.mask = {
+ //Predefined character definitions
+ definitions: {
+ '9': "[0-9]",
+ 'a': "[A-Za-z]",
+ '*': "[A-Za-z0-9]"
+ },
+ dataName: "rawMaskFn",
+ placeholder: '_',
+};
+
+$.fn.extend({
+ //Helper Function for Caret positioning
+ caret: function(begin, end) {
+ var range;
+
+ if (this.length === 0 || this.is(":hidden")) {
+ return;
+ }
+
+ if (typeof begin == 'number') {
+ end = (typeof end === 'number') ? end : begin;
+ return this.each(function() {
+ if (this.setSelectionRange) {
+ this.setSelectionRange(begin, end);
+ } else if (this.createTextRange) {
+ range = this.createTextRange();
+ range.collapse(true);
+ range.moveEnd('character', end);
+ range.moveStart('character', begin);
+ range.select();
+ }
+ });
+ } else {
+ if (this[0].setSelectionRange) {
+ begin = this[0].selectionStart;
+ end = this[0].selectionEnd;
+ } else if (document.selection && document.selection.createRange) {
+ range = document.selection.createRange();
+ begin = 0 - range.duplicate().moveStart('character', -100000);
+ end = begin + range.text.length;
+ }
+ return { begin: begin, end: end };
+ }
+ },
+ unmask: function() {
+ return this.trigger("unmask");
+ },
+ mask: function(mask, settings) {
+ var input,
+ defs,
+ tests,
+ partialPosition,
+ firstNonMaskPos,
+ len;
+
+ if (!mask && this.length > 0) {
+ input = $(this[0]);
+ return input.data($.mask.dataName)();
+ }
+ settings = $.extend({
+ placeholder: $.mask.placeholder, // Load default placeholder
+ completed: null
+ }, settings);
+
+
+ defs = $.mask.definitions;
+ tests = [];
+ partialPosition = len = mask.length;
+ firstNonMaskPos = null;
+
+ $.each(mask.split(""), function(i, c) {
+ if (c == '?') {
+ len--;
+ partialPosition = i;
+ } else if (defs[c]) {
+ tests.push(new RegExp(defs[c]));
+ if (firstNonMaskPos === null) {
+ firstNonMaskPos = tests.length - 1;
+ }
+ } else {
+ tests.push(null);
+ }
+ });
+
+ return this.trigger("unmask").each(function() {
+ var input = $(this),
+ buffer = $.map(
+ mask.split(""),
+ function(c, i) {
+ if (c != '?') {
+ return defs[c] ? settings.placeholder : c;
+ }
+ }),
+ focusText = input.val();
+
+ function seekNext(pos) {
+ while (++pos < len && !tests[pos]);
+ return pos;
+ }
+
+ function seekPrev(pos) {
+ while (--pos >= 0 && !tests[pos]);
+ return pos;
+ }
+
+ function shiftL(begin,end) {
+ var i,
+ j;
+
+ if (begin<0) {
+ return;
+ }
+
+ for (i = begin, j = seekNext(end); i < len; i++) {
+ if (tests[i]) {
+ if (j < len && tests[i].test(buffer[j])) {
+ buffer[i] = buffer[j];
+ buffer[j] = settings.placeholder;
+ } else {
+ break;
+ }
+
+ j = seekNext(j);
+ }
+ }
+ writeBuffer();
+ input.caret(Math.max(firstNonMaskPos, begin));
+ }
+
+ function shiftR(pos) {
+ var i,
+ c,
+ j,
+ t;
+
+ for (i = pos, c = settings.placeholder; i < len; i++) {
+ if (tests[i]) {
+ j = seekNext(i);
+ t = buffer[i];
+ buffer[i] = c;
+ if (j < len && tests[j].test(t)) {
+ c = t;
+ } else {
+ break;
+ }
+ }
+ }
+ }
+
+ function keydownEvent(e) {
+ var k = e.which,
+ pos,
+ begin,
+ end;
+
+ //backspace, delete, and escape get special treatment
+ if (k === 8 || k === 46 || (iPhone && k === 127)) {
+ pos = input.caret();
+ begin = pos.begin;
+ end = pos.end;
+
+ if (end - begin === 0) {
+ begin=k!==46?seekPrev(begin):(end=seekNext(begin-1));
+ end=k===46?seekNext(end):end;
+ }
+ clearBuffer(begin, end);
+ shiftL(begin, end - 1);
+
+ e.preventDefault();
+ } else if (k == 27) {//escape
+ input.val(focusText);
+ input.caret(0, checkVal());
+ e.preventDefault();
+ }
+ }
+
+ function keypressEvent(e) {
+ var k = e.which,
+ pos = input.caret(),
+ p,
+ c,
+ next;
+
+ if (e.ctrlKey || e.altKey || e.metaKey || k < 32) {//Ignore
+ return;
+ } else if (k) {
+ if (pos.end - pos.begin !== 0){
+ clearBuffer(pos.begin, pos.end);
+ shiftL(pos.begin, pos.end-1);
+ }
+
+ p = seekNext(pos.begin - 1);
+ if (p < len) {
+ c = String.fromCharCode(k);
+ if (tests[p].test(c)) {
+ shiftR(p);
+
+ buffer[p] = c;
+ writeBuffer();
+ next = seekNext(p);
+
+ if(android){
+ setTimeout($.proxy($.fn.caret,input,next),0);
+ }else{
+ input.caret(next);
+ }
+
+ if (settings.completed && next >= len) {
+ settings.completed.call(input);
+ }
+ }
+ }
+ e.preventDefault();
+ }
+ }
+
+ function clearBuffer(start, end) {
+ var i;
+ for (i = start; i < end && i < len; i++) {
+ if (tests[i]) {
+ buffer[i] = settings.placeholder;
+ }
+ }
+ }
+
+ function writeBuffer() { input.val(buffer.join('')); }
+
+ function checkVal(allow) {
+ //try to place characters where they belong
+ var test = input.val(),
+ lastMatch = -1,
+ i,
+ c;
+
+ for (i = 0, pos = 0; i < len; i++) {
+ if (tests[i]) {
+ buffer[i] = settings.placeholder;
+ while (pos++ < test.length) {
+ c = test.charAt(pos - 1);
+ if (tests[i].test(c)) {
+ buffer[i] = c;
+ lastMatch = i;
+ break;
+ }
+ }
+ if (pos > test.length) {
+ break;
+ }
+ } else if (buffer[i] === test.charAt(pos) && i !== partialPosition) {
+ pos++;
+ lastMatch = i;
+ }
+ }
+ if (allow) {
+ writeBuffer();
+ } else if (lastMatch + 1 < partialPosition) {
+ input.val("");
+ clearBuffer(0, len);
+ } else {
+ writeBuffer();
+ input.val(input.val().substring(0, lastMatch + 1));
+ }
+ return (partialPosition ? i : firstNonMaskPos);
+ }
+
+ input.data($.mask.dataName,function(){
+ return $.map(buffer, function(c, i) {
+ return tests[i]&&c!=settings.placeholder ? c : null;
+ }).join('');
+ });
+
+ if (!input.attr("readonly"))
+ input
+ .one("unmask", function() {
+ input
+ .unbind(".mask")
+ .removeData($.mask.dataName);
+ })
+ .bind("focus.mask", function() {
+ clearTimeout(caretTimeoutId);
+ var pos,
+ moveCaret;
+
+ focusText = input.val();
+ pos = checkVal();
+
+ caretTimeoutId = setTimeout(function(){
+ writeBuffer();
+ if (pos == mask.length) {
+ input.caret(0, pos);
+ } else {
+ input.caret(pos);
+ }
+ }, 10);
+ })
+ .bind("blur.mask", function() {
+ checkVal();
+ if (input.val() != focusText)
+ input.change();
+ })
+ .bind("keydown.mask", keydownEvent)
+ .bind("keypress.mask", keypressEvent)
+ .bind(pasteEventName, function() {
+ setTimeout(function() {
+ var pos=checkVal(true);
+ input.caret(pos);
+ if (settings.completed && pos == input.val().length)
+ settings.completed.call(input);
+ }, 0);
+ });
+ checkVal(); //Perform initial check for existing values
+ });
+ }
+});
+
+
+})(jQuery);
Deleted: trunk/chorem-webmotion/src/main/webapp/js/jquery.maskedinput-1.3.js
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/js/jquery.maskedinput-1.3.js 2014-07-07 11:56:49 UTC (rev 418)
+++ trunk/chorem-webmotion/src/main/webapp/js/jquery.maskedinput-1.3.js 2014-07-10 09:34:48 UTC (rev 419)
@@ -1,301 +0,0 @@
-/*
- * %%Ignore-License
- *
- Masked Input plugin for jQuery
- Copyright (c) 2007-2011 Josh Bush (digitalbush.com)
- Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)
- Version: 1.3
-
-<script src="jquery.js" type="text/javascript"></script>
-<script src="jquery.maskedinput.js" type="text/javascript"></script>
-
-jQuery(function($){
- $("#date").mask("99/99/9999");
- $("#phone").mask("(999) 999-9999");
- $("#tin").mask("99-9999999");
- $("#ssn").mask("999-99-9999");
-});
-
-Optionally, if you are not satisfied with the underscore ('_') character as a
-placeholder, you may pass an optional argument to the maskedinput method.
-
-jQuery(function($){
- $("#product").mask("99/99/9999",{placeholder:" "});
-});
-
-Optionally, if you would like to execute a function once the mask has been
-completed, you can specify that function as an optional argument to the
-maskedinput method.
-
-jQuery(function($){
- $("#product").mask("99/99/9999",
- {completed:function(){alert("You typed thefollowing: "+this.val());}});
-});
-
-You can now supply your own mask definitions.
-
-jQuery(function($){
- $.mask.definitions['~']='[+-]';
- $("#eyescript").mask("~9.99 ~9.99 999");
-});
-
-You can have part of your mask be optional. Anything listed after '?' within the
-mask is considered optional user input. The common example for this is phone
-number + optional extension.
-
-jQuery(function($){
- $("#phone").mask("(999) 999-9999? x99999");
-});
-*/
-(function($) {
- var pasteEventName = ($.browser.msie ? 'paste' : 'input') + ".mask";
- var iPhone = (window.orientation != undefined);
-
- $.mask = {
- //Predefined character definitions
- definitions: {
- '9': "[0-9]",
- 'a': "[A-Za-z]",
- '*': "[A-Za-z0-9]"
- },
- dataName:"rawMaskFn"
- };
-
- $.fn.extend({
- //Helper Function for Caret positioning
- caret: function(begin, end) {
- if (this.length == 0) return;
- if (typeof begin == 'number') {
- end = (typeof end == 'number') ? end : begin;
- return this.each(function() {
- if (this.setSelectionRange) {
- this.setSelectionRange(begin, end);
- } else if (this.createTextRange) {
- var range = this.createTextRange();
- range.collapse(true);
- range.moveEnd('character', end);
- range.moveStart('character', begin);
- range.select();
- }
- });
- } else {
- if (this[0].setSelectionRange) {
- begin = this[0].selectionStart;
- end = this[0].selectionEnd;
- } else if (document.selection && document.selection.createRange) {
- var range = document.selection.createRange();
- begin = 0 - range.duplicate().moveStart('character', -100000);
- end = begin + range.text.length;
- }
- return { begin: begin, end: end };
- }
- },
- unmask: function() { return this.trigger("unmask"); },
- mask: function(mask, settings) {
- if (!mask && this.length > 0) {
- var input = $(this[0]);
- return input.data($.mask.dataName)();
- }
- settings = $.extend({
- placeholder: "_",
- completed: null
- }, settings);
-
- var defs = $.mask.definitions;
- var tests = [];
- var partialPosition = mask.length;
- var firstNonMaskPos = null;
- var len = mask.length;
-
- $.each(mask.split(""), function(i, c) {
- if (c == '?') {
- len--;
- partialPosition = i;
- } else if (defs[c]) {
- tests.push(new RegExp(defs[c]));
- if(firstNonMaskPos==null)
- firstNonMaskPos = tests.length - 1;
- } else {
- tests.push(null);
- }
- });
-
- return this.trigger("unmask").each(function() {
- var input = $(this);
- var buffer = $.map(mask.split(""), function(c, i) { if (c != '?') return defs[c] ? settings.placeholder : c });
- var focusText = input.val();
-
- function seekNext(pos) {
- while (++pos <= len && !tests[pos]);
- return pos;
- };
- function seekPrev(pos) {
- while (--pos >= 0 && !tests[pos]);
- return pos;
- };
-
- function shiftL(begin,end) {
- if(begin<0)
- return;
- for (var i = begin,j = seekNext(end); i < len; i++) {
- if (tests[i]) {
- if (j < len && tests[i].test(buffer[j])) {
- buffer[i] = buffer[j];
- buffer[j] = settings.placeholder;
- } else
- break;
- j = seekNext(j);
- }
- }
- writeBuffer();
- input.caret(Math.max(firstNonMaskPos, begin));
- };
-
- function shiftR(pos) {
- for (var i = pos, c = settings.placeholder; i < len; i++) {
- if (tests[i]) {
- var j = seekNext(i);
- var t = buffer[i];
- buffer[i] = c;
- if (j < len && tests[j].test(t))
- c = t;
- else
- break;
- }
- }
- };
-
- function keydownEvent(e) {
- var k=e.which;
-
- //backspace, delete, and escape get special treatment
- if(k == 8 || k == 46 || (iPhone && k == 127)){
- var pos = input.caret(),
- begin = pos.begin,
- end = pos.end;
-
- if(end-begin==0){
- begin=k!=46?seekPrev(begin):(end=seekNext(begin-1));
- end=k==46?seekNext(end):end;
- }
- clearBuffer(begin, end);
- shiftL(begin,end-1);
-
- return false;
- } else if (k == 27) {//escape
- input.val(focusText);
- input.caret(0, checkVal());
- return false;
- }
- };
-
- function keypressEvent(e) {
- var k = e.which,
- pos = input.caret();
- if (e.ctrlKey || e.altKey || e.metaKey || k<32) {//Ignore
- return true;
- } else if (k) {
- if(pos.end-pos.begin!=0){
- clearBuffer(pos.begin, pos.end);
- shiftL(pos.begin, pos.end-1);
- }
-
- var p = seekNext(pos.begin - 1);
- if (p < len) {
- var c = String.fromCharCode(k);
- if (tests[p].test(c)) {
- shiftR(p);
- buffer[p] = c;
- writeBuffer();
- var next = seekNext(p);
- input.caret(next);
- if (settings.completed && next >= len)
- settings.completed.call(input);
- }
- }
- return false;
- }
- };
-
- function clearBuffer(start, end) {
- for (var i = start; i < end && i < len; i++) {
- if (tests[i])
- buffer[i] = settings.placeholder;
- }
- };
-
- function writeBuffer() { return input.val(buffer.join('')).val(); };
-
- function checkVal(allow) {
- //try to place characters where they belong
- var test = input.val();
- var lastMatch = -1;
- for (var i = 0, pos = 0; i < len; i++) {
- if (tests[i]) {
- buffer[i] = settings.placeholder;
- while (pos++ < test.length) {
- var c = test.charAt(pos - 1);
- if (tests[i].test(c)) {
- buffer[i] = c;
- lastMatch = i;
- break;
- }
- }
- if (pos > test.length)
- break;
- } else if (buffer[i] == test.charAt(pos) && i!=partialPosition) {
- pos++;
- lastMatch = i;
- }
- }
- if (!allow && lastMatch + 1 < partialPosition) {
- input.val("");
- clearBuffer(0, len);
- } else if (allow || lastMatch + 1 >= partialPosition) {
- writeBuffer();
- if (!allow) input.val(input.val().substring(0, lastMatch + 1));
- }
- return (partialPosition ? i : firstNonMaskPos);
- };
-
- input.data($.mask.dataName,function(){
- return $.map(buffer, function(c, i) {
- return tests[i]&&c!=settings.placeholder ? c : null;
- }).join('');
- })
-
- if (!input.attr("readonly"))
- input
- .one("unmask", function() {
- input
- .unbind(".mask")
- .removeData($.mask.dataName);
- })
- .bind("focus.mask", function() {
- focusText = input.val();
- var pos = checkVal();
- writeBuffer();
- var moveCaret=function(){
- if (pos == mask.length)
- input.caret(0, pos);
- else
- input.caret(pos);
- };
- ($.browser.msie ? moveCaret:function(){setTimeout(moveCaret,0)})();
- })
- .bind("blur.mask", function() {
- checkVal();
- if (input.val() != focusText)
- input.change();
- })
- .bind("keydown.mask", keydownEvent)
- .bind("keypress.mask", keypressEvent)
- .bind(pasteEventName, function() {
- setTimeout(function() { input.caret(checkVal(true)); }, 0);
- });
-
- checkVal(); //Perform initial check for existing values
- });
- }
- });
-})(jQuery);
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-07-07 11:56:49 UTC (rev 418)
+++ trunk/pom.xml 2014-07-10 09:34:48 UTC (rev 419)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmine</artifactId>
- <version>4.6</version>
+ <version>5.0.5</version>
</parent>
<groupId>org.chorem</groupId>
@@ -75,7 +75,7 @@
</scm>
<distributionManagement>
<site>
- <id>${platform}</id>
+ <id>doc.${platform}</id>
<url>${our.site.repository}/${projectId}</url>
</site>
</distributionManagement>
@@ -106,10 +106,10 @@
<nuitonjsWro.version>1.0.2</nuitonjsWro.version>
<nuitonjsAngularjs.version>1.2.12-1</nuitonjsAngularjs.version>
- <nuitonjsJquery.version>1.8.3-1</nuitonjsJquery.version>
+ <nuitonjsJquery.version>2.1.1-1</nuitonjsJquery.version>
<nuitonjsJqueryui.version>1.10.4-1</nuitonjsJqueryui.version>
- <nuitonjsJqplot.version>1.0.4r1121-1</nuitonjsJqplot.version>
- <nuitonjsBootstrap.version>3.2.0-1</nuitonjsBootstrap.version>
+ <nuitonjsJqplot.version>1.0.8r1250-1-SNAPSHOT</nuitonjsJqplot.version>
+ <nuitonjsBootstrap.version>3.2.0-2-SNAPSHOT</nuitonjsBootstrap.version>
<!-- license to use -->
<license.licenseName>agpl_v3</license.licenseName>
1
0
Author: ymartel
Date: 2014-07-07 13:56:49 +0200 (Mon, 07 Jul 2014)
New Revision: 418
Url: http://forge.chorem.org/projects/chorem/repository/revisions/418
Log:
some upgrades
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-07-07 09:00:39 UTC (rev 417)
+++ trunk/pom.xml 2014-07-07 11:56:49 UTC (rev 418)
@@ -84,30 +84,33 @@
<platform>chorem.org</platform>
<projectId>chorem</projectId>
+ <guavaVersion>17.0</guavaVersion>
+ <gsonVersion>2.2.4</gsonVersion>
<opencsvVersion>2.3</opencsvVersion>
+ <slf4jVersion>1.7.7</slf4jVersion>
+ <javaxMailVersion>1.5.0-b01</javaxMailVersion>
+ <servletApiVersion>3.0-alpha-1</servletApiVersion>
+ <jspApiVersion>2.0</jspApiVersion>
+ <h2Version>1.4.179</h2Version>
+ <jstlVersion>1.2</jstlVersion>
+ <webmotionVersion>2.4</webmotionVersion>
<processPluginVersion>1.1</processPluginVersion>
<eugenePluginVersion>2.7.4</eugenePluginVersion>
- <nuitonUtilsVersion>3.0-rc-2</nuitonUtilsVersion>
+
+ <nuitonCsvVersion>3.0-rc-2</nuitonCsvVersion>
+ <nuitonUtilsVersion>3.0-rc-3</nuitonUtilsVersion>
+ <nuitonI18nVersion>3.1</nuitonI18nVersion>
<nuitonConfigVersion>3.0-alpha-2</nuitonConfigVersion>
- <nuitonWebVersion>1.7</nuitonWebVersion>
- <nuitonI18nVersion>3.0</nuitonI18nVersion>
- <nuitonCsvVersion>3.0-alpha-3</nuitonCsvVersion>
+ <nuitonWebVersion>1.16</nuitonWebVersion>
<wikittyVersion>3.11-SNAPSHOT</wikittyVersion>
- <slf4jVersion>1.7.6</slf4jVersion>
- <javaxMailVersion>1.5.0-b01</javaxMailVersion>
- <servletApiVersion>3.0-alpha-1</servletApiVersion>
- <jspApiVersion>2.0</jspApiVersion>
- <h2Version>1.3.175</h2Version>
- <webmotionVersion>2.4</webmotionVersion>
- <jstlVersion>1.2</jstlVersion>
+
+ <nuitonjsWro.version>1.0.2</nuitonjsWro.version>
<nuitonjsAngularjs.version>1.2.12-1</nuitonjsAngularjs.version>
<nuitonjsJquery.version>1.8.3-1</nuitonjsJquery.version>
- <nuitonjsJqueryui.version>1.9.2-1</nuitonjsJqueryui.version>
+ <nuitonjsJqueryui.version>1.10.4-1</nuitonjsJqueryui.version>
<nuitonjsJqplot.version>1.0.4r1121-1</nuitonjsJqplot.version>
- <nuitonjsBootstrap.version>2.3.2-1</nuitonjsBootstrap.version>
+ <nuitonjsBootstrap.version>3.2.0-1</nuitonjsBootstrap.version>
- <gsonVersion>2.2.4</gsonVersion>
-
<!-- license to use -->
<license.licenseName>agpl_v3</license.licenseName>
@@ -254,7 +257,7 @@
<dependency>
<groupId>org.nuiton.js</groupId>
<artifactId>nuiton-js-wro</artifactId>
- <version>1.0.2</version>
+ <version>${nuitonjsWro.version}</version>
</dependency>
<dependency>
<groupId>org.nuiton.js</groupId>
1
0
r417 - in trunk/chorem-webmotion/src/main: java/org/chorem/webmotion/actions/financial java/org/chorem/webmotion/bean/financial webapp/WEB-INF/jsp/financial webapp/js/financial
by ymartel@users.chorem.org 07 Jul '14
by ymartel@users.chorem.org 07 Jul '14
07 Jul '14
Author: ymartel
Date: 2014-07-07 11:00:39 +0200 (Mon, 07 Jul 2014)
New Revision: 417
Url: http://forge.chorem.org/projects/chorem/repository/revisions/417
Log:
UI is ready to create expense accounts
Modified:
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/financial/ExpenseAccountAction.java
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/bean/financial/ExpenseAccountEntryBean.java
trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountEntryEdit.html
trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp
trunk/chorem-webmotion/src/main/webapp/js/financial/expenseAccount.js
Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/financial/ExpenseAccountAction.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/financial/ExpenseAccountAction.java 2014-07-04 09:47:25 UTC (rev 416)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/financial/ExpenseAccountAction.java 2014-07-07 09:00:39 UTC (rev 417)
@@ -33,19 +33,25 @@
import com.google.common.base.Function;
import com.google.common.collect.Collections2;
import com.google.common.collect.Lists;
+import com.google.gson.Gson;
+import org.apache.commons.lang3.StringUtils;
import org.chorem.ChoremClient;
+import org.chorem.entities.Category;
import org.chorem.entities.CategoryImpl;
import org.chorem.entities.Employee;
import org.chorem.entities.EmployeeImpl;
import org.chorem.entities.ExpenseAccount;
+import org.chorem.entities.ExpenseAccountEntry;
import org.chorem.entities.ExpenseAccountEntryImpl;
import org.chorem.entities.ExpenseAccountImpl;
+import org.chorem.entities.Project;
import org.chorem.webmotion.PaginatedResult;
import org.chorem.webmotion.bean.financial.ExpenseAccountBean;
import org.chorem.webmotion.bean.financial.ExpenseAccountEntryBean;
import org.debux.webmotion.server.WebMotionController;
import org.debux.webmotion.server.render.Render;
import org.nuiton.util.DateUtil;
+import org.nuiton.wikitty.entities.Wikitty;
import org.nuiton.wikitty.query.WikittyQuery;
import org.nuiton.wikitty.query.WikittyQueryMaker;
import org.nuiton.wikitty.query.WikittyQueryResult;
@@ -124,8 +130,34 @@
Employee employee = client.restore(Employee.class, employeeId);
if (expenseAccountWikitty == null) {
expenseAccountWikitty = new ExpenseAccountImpl();
+ expenseAccountWikitty.setEmployee(employee);
}
- //TODO ymartel 2014/04/11 just do it
+ expenseAccountWikitty.setBeginDate(expenseAccount.getStartDate());
+ expenseAccountWikitty.setEndDate(expenseAccount.getEndDate());
+ Set<ExpenseAccountEntryBean> expenseAccountEntries = expenseAccount.getExpenseAccountEntries();
+ if (expenseAccountEntries != null) {
+ for (ExpenseAccountEntryBean expenseAccountEntryBean : expenseAccountEntries) {
+ ExpenseAccountEntry expenseAccountEntry = new ExpenseAccountEntryImpl();
+ expenseAccountEntry.setReference(expenseAccountEntryBean.getJustificationNumber());
+ expenseAccountEntry.setEmittedDate(new Date(expenseAccountEntryBean.getEmittedDate()));
+ expenseAccountEntry.setDescription(expenseAccountEntryBean.getDescription());
+ expenseAccountEntry.setAmount(expenseAccountEntryBean.getAmount());
+ expenseAccountEntry.setVAT(expenseAccountEntryBean.getVAT());
+ String projectId = expenseAccountEntryBean.getProjectId();
+ if (StringUtils.isNotBlank(projectId)) {
+ Wikitty project = client.restore(projectId);
+ expenseAccountEntry.setTarget(project);
+ }
+ String categoryId = expenseAccountEntryBean.getCategoryId();
+ if (StringUtils.isNotBlank(categoryId)) {
+ Category category = client.restore(Category.class, categoryId);
+ expenseAccountEntry.setCategory(category);
+ }
+
+ expenseAccountWikitty.addExpenseAccountEntry(expenseAccountEntry);
+ }
+ }
+ client.store(expenseAccountWikitty);
}
public Render findExpenseAccount(ChoremClient client, String expenseAccountId) {
@@ -137,39 +169,6 @@
if (expenseAccount == null) {
expenseAccount = new ExpenseAccountImpl();
-// expenseAccountBean.setId("new");n
-//
-// //XXX ymartel 2014/04/08 Some Fake datas, just for test
-// employee = client.findAllByExample(new EmployeeImpl(), 0, 1).get(0);
-// expenseAccountBean.setEmployeeName(employee.toString());
-// expenseAccountBean.setEmployeeId(employee.getWikittyId());
-//
-// expenseAccountBean.setMonth(3);
-// expenseAccountBean.setYear(2014);
-//
-// int capacity = categories.size();
-// expenseAccountEntries = new HashSet<>(capacity);
-// Random random = new Random();
-// for (CategoryImpl category : categories) {
-// ExpenseAccountEntryBean expenseAccountEntry = new ExpenseAccountEntryBean();
-// int randomInt = random.nextInt(capacity);
-// expenseAccountEntry.setEmittedDate(DateUtil.createDate(01, 03, 2014).getTime());
-// expenseAccountEntry.setDescription("blabla" + randomInt);
-// expenseAccountEntry.setJustificationNumber(String.valueOf(randomInt));
-// double amount = random.nextDouble();
-// expenseAccountEntry.setAmount(amount);
-// double vat = random.nextDouble();
-// expenseAccountEntry.setVAT(vat);
-// expenseAccountEntry.setTotal(amount + vat);
-// expenseAccountEntry.setCategoryName(category.toString());
-// expenseAccountEntry.setProjectName("aucun");
-// if (random.nextBoolean()) {
-// expenseAccountEntry.setPaymentDate(DateUtil.createDate(31, 03, 2014).getTime());
-// }
-// expenseAccountEntries.add(expenseAccountEntry);
-// }
-// expenseAccountBean.setExpenseAccountEntries(expenseAccountEntries);
-
}
ExpenseAccountBean expenseAccountBean = TRANSFORM_EXPENSE_ACCOUNT_TO_BEAN.apply(expenseAccount);
Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/bean/financial/ExpenseAccountEntryBean.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/bean/financial/ExpenseAccountEntryBean.java 2014-07-04 09:47:25 UTC (rev 416)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/bean/financial/ExpenseAccountEntryBean.java 2014-07-07 09:00:39 UTC (rev 417)
@@ -31,6 +31,7 @@
public class ExpenseAccountEntryBean implements Serializable {
protected String categoryName;
+ protected String categoryId;
protected long emittedDate;
protected long paymentDate;
protected String description;
@@ -49,6 +50,14 @@
this.categoryName = categoryName;
}
+ public String getCategoryId() {
+ return categoryId;
+ }
+
+ public void setCategoryId(String categoryId) {
+ this.categoryId = categoryId;
+ }
+
public long getEmittedDate() {
return emittedDate;
}
Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountEntryEdit.html
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountEntryEdit.html 2014-07-04 09:47:25 UTC (rev 416)
+++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountEntryEdit.html 2014-07-07 09:00:39 UTC (rev 417)
@@ -1,8 +1,15 @@
+
<td><input type="text" ng-model="newExpenseAccountEntry.justificationNumber" name="newExpenseAccountEntry.justificationNumber" size="10" style='width:100%'></td>
<td><input type="date" ng-model="newExpenseAccountEntry.emittedDate" name="newExpenseAccountEntry.emittedDate" size="10" maxlength="10" style='width:90%'></td>
- <td><input type="text" ng-model="newExpenseAccountEntry.project" name="newExpenseAccountEntry.project" size="4" style='width:100%'></td>
+ <td>
+ <input type="text" ng-model="newExpenseAccountEntry.projectName" name="newExpenseAccountEntry.project" size="4" style='width:100%' id="text-newExpenseAccountEntry-project" auto-complete data-source="Project" data-model="newExpenseAccountEntry" data-base-field="project">
+ <input type="hidden" ng-model="newExpenseAccountEntry.projectId" id="hidden-newExpenseAccountEntry-project"/>
+ </td>
<td><input type="text" ng-model="newExpenseAccountEntry.description" name="newExpenseAccountEntry.description" style='width:100%'></td>
- <td><input type="text" ng-model="newExpenseAccountEntry.category" name="newExpenseAccountEntry.category" style='width:100%'></td>
+ <td>
+ <input type="text" ng-model="newExpenseAccountEntry.categoryName" name="newExpenseAccountEntry.category" style='width:100%' id="text-newExpenseAccountEntry-category" auto-complete data-source="Category" data-model="newExpenseAccountEntry" data-base-field="category">
+ <input type="hidden" ng-model="newExpenseAccountEntry.categoryId" id="hidden-newExpenseAccountEntry-category"/>
+ </td>
<td><input type="number" ng-model="newExpenseAccountEntry.amount" name="newExpenseAccountEntry.amount" min="0" style='width:100%'></td>
<td><input type="number" ng-model="newExpenseAccountEntry.VAT" name="newExpenseAccountEntry.VAT" min="0" style='width:100%'></td>
<td>{{(newExpenseAccountEntry.amount * 1) + (newExpenseAccountEntry.VAT * 1)}}</td>
Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp 2014-07-04 09:47:25 UTC (rev 416)
+++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp 2014-07-07 09:00:39 UTC (rev 417)
@@ -44,27 +44,13 @@
<dl>
<dd ng-if="expenseAccount && expenseAccount.employeeId"><a href="<c:url value="/wikitty/view/{{expenseAccount.employeeId}}"/>">{{expenseAccount.employeeName}}</a></dd>
<dd ng-if="!expenseAccount || !expenseAccount.employeeId">
- <input type="text" ng-model="expenseAccount.employeeName" id="text-expenseAccount-employee" auto-complete auto-complete-source=<c:url value="/wikitty-json/search?extension=Employee"/> />
+ <input type="text" ng-model="expenseAccount.employeeName" id="text-expenseAccount-employee" auto-complete data-source="Employee" data-model="expenseAccount" data-base-field="employee" />
<input type="hidden" ng-model="expenseAccount.employeeId" id="hidden-expenseAccount-employee"/>
- <!-- script>
- $(function() {
- $( "#text-expenseAccount-employee" ).autocompleteByExtension({
- source: "<c:url value="/wikitty-json/search?extension=Employee"/>",
- minLength: 2,
- select: function( event, ui ) {
- $( "#text-expenseAccount-employee" ).val( ui.item.label );
- $( "#hidden-expenseAccount-employee" ).val( ui.item.id );
- return false;
- }
- });
- });
- </script -->
-
</dd>
<dd ng-if="editPeriod == false">Period from {{expenseAccount.startDate |date}} to {{expenseAccount.endDate |date}}</dd>
- <dd ng-if="editPeriod == true">StartDate : <input type="date" ng-model="newExpenseAccount.startDate" name="newExpenseAccount.startDate"></dd>
- <dd ng-if="editPeriod == true">EndDate : <input type="date" ng-model="newExpenseAccount.endDate" name="newExpenseAccount.endDate"></dd>
+ <dd ng-if="editPeriod == true">StartDate : <input type="date" ng-model="expenseAccount.startDate" name="expenseAccount.startDate"></dd>
+ <dd ng-if="editPeriod == true">EndDate : <input type="date" ng-model="expenseAccount.endDate" name="expenseAccount.endDate"></dd>
</dl>
</div>
Modified: trunk/chorem-webmotion/src/main/webapp/js/financial/expenseAccount.js
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/js/financial/expenseAccount.js 2014-07-04 09:47:25 UTC (rev 416)
+++ trunk/chorem-webmotion/src/main/webapp/js/financial/expenseAccount.js 2014-07-07 09:00:39 UTC (rev 417)
@@ -60,22 +60,21 @@
app.directive("autoComplete", function() {
return {
- restrict : "A" ,
- require : '^ngModel',
- link : function (scope, element, attrs) {
+ require : 'ngModel',
+ link : function ($scope, element, attrs) {
// prevent html5/browser auto completion
attrs.$set('autocomplete','off');
- scope.autocomplete = $(element).autocompleteByExtension({
- source: scope.baseURL + "wikitty-json/search?extension=Employee",
- minLength: 2,
- select: function(event, ui) {
- scope.expenseAccount.employeeName = ui.item.label;
- scope.expenseAccount.employeeId = ui.item.id;
- return true;
- }
- });
+ $scope.autocomplete = $(element).autocompleteByExtension({
+ source: $scope.baseURL + "wikitty-json/search?extension=" + $(element).data("source"),
+ minLength: 2,
+ select: function(event, ui) {
+ $scope[$(element).data("model")][$(element).data("baseField") + "Name"] = ui.item.label;
+ $scope[$(element).data("model")][$(element).data("baseField") + "Id"] = ui.item.id;
+ return true;
+ }
+ });
}
}
});
\ No newline at end of file
1
0
r416 - in trunk/chorem-webmotion/src/main/webapp: WEB-INF/jsp/financial js/financial
by ymartel@users.chorem.org 04 Jul '14
by ymartel@users.chorem.org 04 Jul '14
04 Jul '14
Author: ymartel
Date: 2014-07-04 11:47:25 +0200 (Fri, 04 Jul 2014)
New Revision: 416
Url: http://forge.chorem.org/projects/chorem/repository/revisions/416
Log:
bind the employee with ExpenseAccount in scope
Modified:
trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp
trunk/chorem-webmotion/src/main/webapp/js/financial/expenseAccount.js
Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp 2014-07-03 15:58:51 UTC (rev 415)
+++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp 2014-07-04 09:47:25 UTC (rev 416)
@@ -33,7 +33,8 @@
<script>
angular.module('expenseAccountPage').value('expenseAccountInit', {
expenseAccount: ${expenseAccount.toJson()},
- saveURL: "<c:url value="/financial/expenseAccounts"/>"
+ saveURL: "<c:url value="/financial/expenseAccounts"/>",
+ baseURL: "<c:url value="/"/>"
});
</script>
</head>
@@ -43,9 +44,9 @@
<dl>
<dd ng-if="expenseAccount && expenseAccount.employeeId"><a href="<c:url value="/wikitty/view/{{expenseAccount.employeeId}}"/>">{{expenseAccount.employeeName}}</a></dd>
<dd ng-if="!expenseAccount || !expenseAccount.employeeId">
- <input type="text" ng-model="expenseAccount.employeeName" id="text-expenseAccount-employee" />
+ <input type="text" ng-model="expenseAccount.employeeName" id="text-expenseAccount-employee" auto-complete auto-complete-source=<c:url value="/wikitty-json/search?extension=Employee"/> />
<input type="hidden" ng-model="expenseAccount.employeeId" id="hidden-expenseAccount-employee"/>
- <script>
+ <!-- script>
$(function() {
$( "#text-expenseAccount-employee" ).autocompleteByExtension({
source: "<c:url value="/wikitty-json/search?extension=Employee"/>",
@@ -58,7 +59,7 @@
}
});
});
- </script>
+ </script -->
</dd>
<dd ng-if="editPeriod == false">Period from {{expenseAccount.startDate |date}} to {{expenseAccount.endDate |date}}</dd>
Modified: trunk/chorem-webmotion/src/main/webapp/js/financial/expenseAccount.js
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/js/financial/expenseAccount.js 2014-07-03 15:58:51 UTC (rev 415)
+++ trunk/chorem-webmotion/src/main/webapp/js/financial/expenseAccount.js 2014-07-04 09:47:25 UTC (rev 416)
@@ -6,7 +6,7 @@
$scope.expenseAccount = expenseAccountInit.expenseAccount;
$scope.editPeriod = expenseAccountInit && expenseAccountInit.id ? false : true;
- $scope.saveURL = expenseAccountInit.saveURL;
+ $scope.baseURL = expenseAccountInit.baseURL;
$scope.newLine = function() {
if ($scope.showNewLine === true) {
@@ -27,6 +27,10 @@
}
}
+ $scope.ac_options = {
+ baseURL : $scope.baseURL,
+ };
+
$scope.addLine = function() {
if(!$scope.expenseAccount.expenseAccountEntries) {
@@ -44,13 +48,34 @@
console.log($scope.expenseAccount)
- url = $scope.saveURL + "/" + $scope.expenseAccount.id;
+ url = $scope.baseURL + "financial/expenseAccounts/" + $scope.expenseAccount.id;
$resource('url', $scope.expenseAccount, {'update' : {method:'PUT'}}).update(function(result) {
console.log("saved!");
});
}
+});
-});
+app.directive("autoComplete", function() {
+ return {
+ restrict : "A" ,
+ require : '^ngModel',
+ link : function (scope, element, attrs) {
+
+ // prevent html5/browser auto completion
+ attrs.$set('autocomplete','off');
+
+ scope.autocomplete = $(element).autocompleteByExtension({
+ source: scope.baseURL + "wikitty-json/search?extension=Employee",
+ minLength: 2,
+ select: function(event, ui) {
+ scope.expenseAccount.employeeName = ui.item.label;
+ scope.expenseAccount.employeeId = ui.item.id;
+ return true;
+ }
+ });
+ }
+ }
+});
\ No newline at end of file
1
0
r415 - in trunk: chorem-entities/src/main/xmi chorem-webmotion/src/main/java/org/chorem/webmotion/actions/financial chorem-webmotion/src/main/java/org/chorem/webmotion/bean/financial chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial chorem-webmotion/src/main/webapp/js/financial
by ymartel@users.chorem.org 03 Jul '14
by ymartel@users.chorem.org 03 Jul '14
03 Jul '14
Author: ymartel
Date: 2014-07-03 17:58:51 +0200 (Thu, 03 Jul 2014)
New Revision: 415
Url: http://forge.chorem.org/projects/chorem/repository/revisions/415
Log:
prepare Expense Account edition
Modified:
trunk/chorem-entities/src/main/xmi/chorem-model.properties
trunk/chorem-entities/src/main/xmi/chorem-model.zargo
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/financial/ExpenseAccountAction.java
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/bean/financial/ExpenseAccountBean.java
trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountEntryEdit.html
trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp
trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccounts.jsp
trunk/chorem-webmotion/src/main/webapp/js/financial/expenseAccount.js
Modified: trunk/chorem-entities/src/main/xmi/chorem-model.properties
===================================================================
--- trunk/chorem-entities/src/main/xmi/chorem-model.properties 2014-04-11 16:19:46 UTC (rev 414)
+++ trunk/chorem-entities/src/main/xmi/chorem-model.properties 2014-07-03 15:58:51 UTC (rev 415)
@@ -193,8 +193,8 @@
#
org.chorem.entities.ExpenseAccount.class.tagvalue.version=1.0
org.chorem.entities.ExpenseAccount.class.tagvalue.preload=ExpenseAccount.employee
-org.chorem.entities.ExpenseAccount.class.tagvalue.toString=%ExpenseAccount.employee$s - %ExpenseAccount.month$s/%ExpenseAccount.year$s
-org.chorem.entities.ExpenseAccount.class.tagvalue.sortOrder=ExpenseAccount.year,ExpenseAccount.month
+org.chorem.entities.ExpenseAccount.class.tagvalue.toString=%ExpenseAccount.employee$s - %Interval.beginDate$s/%Interval.endDate$s
+org.chorem.entities.ExpenseAccount.class.tagvalue.sortOrder=Interval.beginDate,Interval.endDate
#
# ExpenseAccountEntry
Modified: trunk/chorem-entities/src/main/xmi/chorem-model.zargo
===================================================================
(Binary files differ)
Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/financial/ExpenseAccountAction.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/financial/ExpenseAccountAction.java 2014-04-11 16:19:46 UTC (rev 414)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/financial/ExpenseAccountAction.java 2014-07-03 15:58:51 UTC (rev 415)
@@ -27,27 +27,23 @@
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
-import java.util.HashSet;
import java.util.List;
-import java.util.Map;
-import java.util.Random;
import java.util.Set;
import com.google.common.base.Function;
import com.google.common.collect.Collections2;
import com.google.common.collect.Lists;
-import com.google.gson.Gson;
import org.chorem.ChoremClient;
import org.chorem.entities.CategoryImpl;
import org.chorem.entities.Employee;
import org.chorem.entities.EmployeeImpl;
import org.chorem.entities.ExpenseAccount;
+import org.chorem.entities.ExpenseAccountEntryImpl;
import org.chorem.entities.ExpenseAccountImpl;
import org.chorem.webmotion.PaginatedResult;
import org.chorem.webmotion.bean.financial.ExpenseAccountBean;
import org.chorem.webmotion.bean.financial.ExpenseAccountEntryBean;
import org.debux.webmotion.server.WebMotionController;
-import org.debux.webmotion.server.call.Call;
import org.debux.webmotion.server.render.Render;
import org.nuiton.util.DateUtil;
import org.nuiton.wikitty.query.WikittyQuery;
@@ -59,21 +55,22 @@
*/
public class ExpenseAccountAction extends WebMotionController {
- public PaginatedResult<ExpenseAccountBean> findAllExpenseAccounts(ChoremClient client, Integer year, Integer mounth, int page, int count) {
+ public PaginatedResult<ExpenseAccountBean> findAllExpenseAccounts(ChoremClient client, Integer year, Integer month, int page, int count) {
- if (mounth == null) {
- mounth = DateUtil.getMonth(new Date());
+ if (month == null) {
+ month = DateUtil.getMonth(new Date());
}
if (year == null) {
Calendar calendar = Calendar.getInstance();
year = calendar.get(Calendar.YEAR);
}
+ Date refDate = DateUtil.createDate(1, month, year);
WikittyQuery totalQuery = new WikittyQueryMaker()
- .select().count(ExpenseAccount.ELEMENT_FIELD_EXPENSEACCOUNT_MONTH).where().and()
+ .select().count(ExpenseAccount.ELEMENT_FIELD_INTERVAL_BEGINDATE).where().and()
.exteq(ExpenseAccount.EXT_EXPENSEACCOUNT)
- .eq(ExpenseAccount.ELEMENT_FIELD_EXPENSEACCOUNT_MONTH, mounth)
- .eq(ExpenseAccount.ELEMENT_FIELD_EXPENSEACCOUNT_YEAR, year)
+ .le(ExpenseAccount.ELEMENT_FIELD_INTERVAL_BEGINDATE, refDate)
+ .ge(ExpenseAccount.ELEMENT_FIELD_INTERVAL_ENDDATE, refDate)
.end();
Integer nbExpenseAccounts = client.findByQuery(Integer.class, totalQuery);
@@ -84,8 +81,8 @@
WikittyQuery expAccountsQuery = new WikittyQueryMaker()
.where().and()
.exteq(ExpenseAccount.EXT_EXPENSEACCOUNT)
- .eq(ExpenseAccount.ELEMENT_FIELD_EXPENSEACCOUNT_MONTH, mounth)
- .eq(ExpenseAccount.ELEMENT_FIELD_EXPENSEACCOUNT_YEAR, year)
+ .le(ExpenseAccount.ELEMENT_FIELD_INTERVAL_BEGINDATE, refDate)
+ .ge(ExpenseAccount.ELEMENT_FIELD_INTERVAL_ENDDATE, refDate)
.end()
.setOffset((page - 1) * count)
.setLimit(page * count);
@@ -102,14 +99,14 @@
Employee employee = client.findAllByExample(new EmployeeImpl(), 0, 1).get(0);
ExpenseAccountBean fakeOne = new ExpenseAccountBean();
fakeOne.setId("fake");
- fakeOne.setMonth(03);
- fakeOne.setYear(2014);
+ fakeOne.setStartDate(DateUtil.createDate(1, 3, 2014));
+ fakeOne.setEndDate(DateUtil.createDate(31, 3, 2014));
fakeOne.setEmployeeName(employee.toString());
fakeOne.setEmployeeId(employee.getWikittyId());
ExpenseAccountBean fakeTwo = new ExpenseAccountBean();
fakeTwo.setId("fake");
- fakeTwo.setMonth(mounth);
- fakeTwo.setYear(year);
+ fakeTwo.setStartDate(DateUtil.createDate(1, 4, 2014));
+ fakeTwo.setEndDate(DateUtil.createDate(30, 4, 2014));
fakeTwo.setEmployeeName(employee.toString());
fakeTwo.setEmployeeId(employee.getWikittyId());
ArrayList<ExpenseAccountBean> expenseAccounts = new ArrayList<>();
@@ -122,12 +119,12 @@
}
public void saveExpenseAccount(ChoremClient client, String expenseAccountId, ExpenseAccountBean expenseAccount) {
- ExpenseAccount expenseAccountWikitty = client.restore(ExpenseAccount.class, expenseAccountId);
+ ExpenseAccountImpl expenseAccountWikitty = client.restore(ExpenseAccountImpl.class, expenseAccountId);
+ String employeeId = expenseAccount.getEmployeeId();
+ Employee employee = client.restore(Employee.class, employeeId);
if (expenseAccountWikitty == null) {
expenseAccountWikitty = new ExpenseAccountImpl();
}
- String json = expenseAccount.toJson();
- expenseAccount.toString();
//TODO ymartel 2014/04/11 just do it
}
@@ -137,45 +134,46 @@
WikittyQueryResult<CategoryImpl> categoriesResult = client.findAllByExample(new CategoryImpl(), 0, 10);
List<CategoryImpl> categories = categoriesResult.getAll();
- ExpenseAccountBean expenseAccountBean = null;
-
if (expenseAccount == null) {
- expenseAccountBean = new ExpenseAccountBean();
- expenseAccountBean.setId("new");
- //XXX ymartel 2014/04/08 Some Fake datas, just for test
- Employee employee = client.findAllByExample(new EmployeeImpl(), 0, 1).get(0);
- expenseAccountBean.setEmployeeName(employee.toString());
- expenseAccountBean.setEmployeeId(employee.getWikittyId());
+ expenseAccount = new ExpenseAccountImpl();
+// expenseAccountBean.setId("new");n
+//
+// //XXX ymartel 2014/04/08 Some Fake datas, just for test
+// employee = client.findAllByExample(new EmployeeImpl(), 0, 1).get(0);
+// expenseAccountBean.setEmployeeName(employee.toString());
+// expenseAccountBean.setEmployeeId(employee.getWikittyId());
+//
+// expenseAccountBean.setMonth(3);
+// expenseAccountBean.setYear(2014);
+//
+// int capacity = categories.size();
+// expenseAccountEntries = new HashSet<>(capacity);
+// Random random = new Random();
+// for (CategoryImpl category : categories) {
+// ExpenseAccountEntryBean expenseAccountEntry = new ExpenseAccountEntryBean();
+// int randomInt = random.nextInt(capacity);
+// expenseAccountEntry.setEmittedDate(DateUtil.createDate(01, 03, 2014).getTime());
+// expenseAccountEntry.setDescription("blabla" + randomInt);
+// expenseAccountEntry.setJustificationNumber(String.valueOf(randomInt));
+// double amount = random.nextDouble();
+// expenseAccountEntry.setAmount(amount);
+// double vat = random.nextDouble();
+// expenseAccountEntry.setVAT(vat);
+// expenseAccountEntry.setTotal(amount + vat);
+// expenseAccountEntry.setCategoryName(category.toString());
+// expenseAccountEntry.setProjectName("aucun");
+// if (random.nextBoolean()) {
+// expenseAccountEntry.setPaymentDate(DateUtil.createDate(31, 03, 2014).getTime());
+// }
+// expenseAccountEntries.add(expenseAccountEntry);
+// }
+// expenseAccountBean.setExpenseAccountEntries(expenseAccountEntries);
- expenseAccountBean.setMonth(3);
- expenseAccountBean.setYear(2014);
-
- int capacity = categories.size();
- expenseAccountEntries = new HashSet<>(capacity);
- Random random = new Random();
- for (CategoryImpl category : categories) {
- ExpenseAccountEntryBean expenseAccountEntry = new ExpenseAccountEntryBean();
- int randomInt = random.nextInt(capacity);
- expenseAccountEntry.setEmittedDate(DateUtil.createDate(01, 03, 2014).getTime());
- expenseAccountEntry.setDescription("blabla" + randomInt);
- expenseAccountEntry.setJustificationNumber(String.valueOf(randomInt));
- double amount = random.nextDouble();
- expenseAccountEntry.setAmount(amount);
- double vat = random.nextDouble();
- expenseAccountEntry.setVAT(vat);
- expenseAccountEntry.setTotal(amount + vat);
- expenseAccountEntry.setCategoryName(category.toString());
- expenseAccountEntry.setProjectName("aucun");
- if (random.nextBoolean()) {
- expenseAccountEntry.setPaymentDate(DateUtil.createDate(31, 03, 2014).getTime());
- }
- expenseAccountEntries.add(expenseAccountEntry);
- }
- expenseAccountBean.setExpenseAccountEntries(expenseAccountEntries);
-
}
+ ExpenseAccountBean expenseAccountBean = TRANSFORM_EXPENSE_ACCOUNT_TO_BEAN.apply(expenseAccount);
+
return renderView("financial/expenseAccountView.jsp", "expenseAccount", expenseAccountBean);
}
@@ -188,8 +186,9 @@
Employee employee = expenseAccount.getEmployee(false);
expenseAccountBean.setEmployeeName(employee != null ? employee.toString() : null);
expenseAccountBean.setEmployeeId(employee != null ? employee.getWikittyId() : null);
- expenseAccountBean.setMonth(expenseAccount.getMonth());
- expenseAccountBean.setYear(expenseAccount.getYear());
+ expenseAccountBean.setStartDate(expenseAccount.getBeginDate());
+ expenseAccountBean.setEndDate(expenseAccount.getEndDate());
+ expenseAccountBean.setEndDate(expenseAccount.getEndDate());
return expenseAccountBean;
}
};
Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/bean/financial/ExpenseAccountBean.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/bean/financial/ExpenseAccountBean.java 2014-04-11 16:19:46 UTC (rev 414)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/bean/financial/ExpenseAccountBean.java 2014-07-03 15:58:51 UTC (rev 415)
@@ -24,6 +24,7 @@
*/
import java.io.Serializable;
+import java.util.Date;
import java.util.Set;
import com.google.gson.Gson;
@@ -36,8 +37,8 @@
protected String id;
protected String employeeName;
protected String employeeId;
- protected int month;
- protected int year;
+ protected Date startDate;
+ protected Date endDate;
protected Set<ExpenseAccountEntryBean> expenseAccountEntries;
public String getId() {
@@ -64,20 +65,20 @@
this.employeeId = employeeId;
}
- public int getMonth() {
- return month;
+ public Date getStartDate() {
+ return startDate;
}
- public void setMonth(int month) {
- this.month = month;
+ public void setStartDate(Date startDate) {
+ this.startDate = startDate;
}
- public int getYear() {
- return year;
+ public Date getEndDate() {
+ return endDate;
}
- public void setYear(int year) {
- this.year = year;
+ public void setEndDate(Date endDate) {
+ this.endDate = endDate;
}
public Set<ExpenseAccountEntryBean> getExpenseAccountEntries() {
Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountEntryEdit.html
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountEntryEdit.html 2014-04-11 16:19:46 UTC (rev 414)
+++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountEntryEdit.html 2014-07-03 15:58:51 UTC (rev 415)
@@ -1,9 +1,9 @@
- <td><input type="text" ng-model="newExpenseAccountEntry.justificationNumber" name="newExpenseAccountEntry.justificationNumber" size="10"></td>
- <td><input type="date" ng-model="newExpenseAccountEntry.emittedDate" name="newExpenseAccountEntry.emittedDate" size="10" maxlength="10"></td>
- <td><input type="text" ng-model="newExpenseAccountEntry.project" name="newExpenseAccountEntry.project" size="4"></td>
- <td><input type="text" ng-model="newExpenseAccountEntry.description" name="newExpenseAccountEntry.description" class="w100"></td>
- <td><input type="text" ng-model="newExpenseAccountEntry.category" name="newExpenseAccountEntry.category" class="w100"></td>
- <td><input type="number" ng-model="newExpenseAccountEntry.amount" name="newExpenseAccountEntry.amount" class="w100"></td>
- <td><input type="number" ng-model="newExpenseAccountEntry.VAT" name="newExpenseAccountEntry.VAT" class="w100"></td>
- <td><input type="number" ng-model="newExpenseAccountEntry.total" name="newExpenseAccountEntry.total"></td>
+ <td><input type="text" ng-model="newExpenseAccountEntry.justificationNumber" name="newExpenseAccountEntry.justificationNumber" size="10" style='width:100%'></td>
+ <td><input type="date" ng-model="newExpenseAccountEntry.emittedDate" name="newExpenseAccountEntry.emittedDate" size="10" maxlength="10" style='width:90%'></td>
+ <td><input type="text" ng-model="newExpenseAccountEntry.project" name="newExpenseAccountEntry.project" size="4" style='width:100%'></td>
+ <td><input type="text" ng-model="newExpenseAccountEntry.description" name="newExpenseAccountEntry.description" style='width:100%'></td>
+ <td><input type="text" ng-model="newExpenseAccountEntry.category" name="newExpenseAccountEntry.category" style='width:100%'></td>
+ <td><input type="number" ng-model="newExpenseAccountEntry.amount" name="newExpenseAccountEntry.amount" min="0" style='width:100%'></td>
+ <td><input type="number" ng-model="newExpenseAccountEntry.VAT" name="newExpenseAccountEntry.VAT" min="0" style='width:100%'></td>
+ <td>{{(newExpenseAccountEntry.amount * 1) + (newExpenseAccountEntry.VAT * 1)}}</td>
<td><a class="btn btn-success" ng-click="addLine()"><i class="icon-pencil icon-white"></i>Validate</a></td>
Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp 2014-04-11 16:19:46 UTC (rev 414)
+++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp 2014-07-03 15:58:51 UTC (rev 415)
@@ -25,8 +25,10 @@
<%@ taglib uri="/WEB-INF/wikitty.tld" prefix="w"%>
<head>
- <script data-require="angular-resource(a)1.2.0-rc.3" data-semver="1.2.0-rc.3" src="<c:url value='http://code.angularjs.org/1.2.0-rc.3/angular-resource.js'/>"></script>
- <link data-require="bootstrap-css@*" data-semver="3.0.0" rel="stylesheet" href="<c:url value='http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css'/>" />
+ <script data-require="angular-resource(a)1.2.10" data-semver="1.2.10" src="<c:url value='http://code.angularjs.org/1.2.10/angular-resource.js'/>"></script>
+ <link data-require="bootstrap-css@*" data-semver="3.1.1" rel="stylesheet" href="<c:url value='http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css'/>" />
+ <script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.11.0.js"></script>
+
<script type="text/javascript" src="<c:url value='/js/financial/expenseAccount.js'/>"></script>
<script>
angular.module('expenseAccountPage').value('expenseAccountInit', {
@@ -39,23 +41,44 @@
<div ng-app='expenseAccountPage' ng-controller="expenseAccountView">
<div >
<dl>
- <dd><a href="<c:url value="/wikitty/view/{{expenseAccount.employeeId}}"/>">{{expenseAccount.employeeName}}</a></dd>
- <dd>Period : {{expenseAccount.month}} / {{expenseAccount.year}}</dd>
+ <dd ng-if="expenseAccount && expenseAccount.employeeId"><a href="<c:url value="/wikitty/view/{{expenseAccount.employeeId}}"/>">{{expenseAccount.employeeName}}</a></dd>
+ <dd ng-if="!expenseAccount || !expenseAccount.employeeId">
+ <input type="text" ng-model="expenseAccount.employeeName" id="text-expenseAccount-employee" />
+ <input type="hidden" ng-model="expenseAccount.employeeId" id="hidden-expenseAccount-employee"/>
+ <script>
+ $(function() {
+ $( "#text-expenseAccount-employee" ).autocompleteByExtension({
+ source: "<c:url value="/wikitty-json/search?extension=Employee"/>",
+ minLength: 2,
+ select: function( event, ui ) {
+ $( "#text-expenseAccount-employee" ).val( ui.item.label );
+ $( "#hidden-expenseAccount-employee" ).val( ui.item.id );
+
+ return false;
+ }
+ });
+ });
+ </script>
+
+ </dd>
+ <dd ng-if="editPeriod == false">Period from {{expenseAccount.startDate |date}} to {{expenseAccount.endDate |date}}</dd>
+ <dd ng-if="editPeriod == true">StartDate : <input type="date" ng-model="newExpenseAccount.startDate" name="newExpenseAccount.startDate"></dd>
+ <dd ng-if="editPeriod == true">EndDate : <input type="date" ng-model="newExpenseAccount.endDate" name="newExpenseAccount.endDate"></dd>
</dl>
</div>
<div>
<table>
<tr>
- <th>Justif. Nb</th>
- <th>Emitted Date</th>
- <th>Project</th>
- <th>Description</th>
- <th>Category</th>
- <th>Amount</th>
- <th>VAT</th>
- <th>total</th>
- <th>Payment Date</th>
+ <th style='width:15%'>Justif. Nb</th>
+ <th style='width:15%'>Emitted Date</th>
+ <th style='width:10%'>Project</th>
+ <th style='width:15%'>Description</th>
+ <th style='width:15%%'>Category</th>
+ <th style='width:7%'>Amount</th>
+ <th style='width:7%'>VAT</th>
+ <th style='width:6%'>total</th>
+ <th style='width:10%'>Payment Date</th>
</tr>
<tr ng-repeat="expenseEntry in expenseAccount.expenseAccountEntries">
<td>{{expenseEntry.justificationNumber}}</td>
@@ -73,8 +96,9 @@
</div>
<a class="btn btn-success" ng-click="newLine()"><i class="icon-list icon-white"></i> New entry</a>
<div ng-if="hasChanged == true">
- <a class="btn btn-success" ng-click="saveExpenseAccount()"><i class="icon-od icon-white"></i>Save</a>
+ <a class="btn btn-success" ng-click="saveExpenseAccount()"><i class="icon-od icon-white"></i>Save</a>
</div>
+
</div>
</div>
Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccounts.jsp
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccounts.jsp 2014-04-11 16:19:46 UTC (rev 414)
+++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccounts.jsp 2014-07-03 15:58:51 UTC (rev 415)
@@ -47,11 +47,11 @@
<td data-title="'Employee'">
<a href="<c:url value="/wikitty/view/{{expenseAccount.employeeId}}"/>">{{expenseAccount.employeeName}}</a>
</td>
- <td data-title="'Month'">
- {{expenseAccount.month}}
+ <td data-title="'Start Date'">
+ {{expenseAccount.startDate |date}}
</td>
- <td data-title="'Year'">
- {{expenseAccount.year}}
+ <td data-title="'End Date'">
+ {{expenseAccount.endDate |date}}
</td>
<td>
<a class="btn btn-success" href="<c:url value="/financial/expenseAccounts/{{expenseAccount.id}}"/>">See it</a>
Modified: trunk/chorem-webmotion/src/main/webapp/js/financial/expenseAccount.js
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/js/financial/expenseAccount.js 2014-04-11 16:19:46 UTC (rev 414)
+++ trunk/chorem-webmotion/src/main/webapp/js/financial/expenseAccount.js 2014-07-03 15:58:51 UTC (rev 415)
@@ -1,9 +1,11 @@
-var app = angular.module('expenseAccountPage', ['ngResource']);
+var app = angular.module('expenseAccountPage', ['ngResource', 'ui.bootstrap']);
-app.controller("expenseAccountView", function($scope, $resource, expenseAccountInit) {
+app.controller("expenseAccountView", function($scope, $resource, $modal, $log, expenseAccountInit) {
$scope.showNewLine = false;
$scope.expenseAccount = expenseAccountInit.expenseAccount;
+ $scope.editPeriod = expenseAccountInit && expenseAccountInit.id ? false : true;
+
$scope.saveURL = expenseAccountInit.saveURL;
$scope.newLine = function() {
@@ -27,6 +29,10 @@
$scope.addLine = function() {
+ if(!$scope.expenseAccount.expenseAccountEntries) {
+ $scope.expenseAccount.expenseAccountEntries = [];
+ }
+ $scope.newExpenseAccountEntry.total = $scope.newExpenseAccountEntry.amount + $scope.newExpenseAccountEntry.VAT;
$scope.expenseAccount.expenseAccountEntries.push($scope.newExpenseAccountEntry);
$scope.hasChanged = true;
1
0