Author: bpoussin Date: 2012-08-21 01:28:09 +0200 (Tue, 21 Aug 2012) New Revision: 244 Url: http://chorem.org/repositories/revision/chorem/244 Log: - changement pour les rapports, ils sont tous gere par report.jsp - ajout des rapports individuels dans les menus - finalisation de budget Added: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/report.jsp Removed: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial.jsp trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/project.jsp Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/DashboardAction.java trunk/chorem-webmotion/src/main/resources/mapping trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardBudget.jsp trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/decorator.jsp trunk/chorem-webmotion/src/main/webapp/js/chorem.js 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 2012-08-20 23:26:27 UTC (rev 243) +++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/DashboardAction.java 2012-08-20 23:28:09 UTC (rev 244) @@ -58,6 +58,7 @@ import java.util.Date; import java.util.EnumSet; import java.util.HashMap; +import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; @@ -81,6 +82,8 @@ /** to use log facility, just put in your code: log.info(\"...\"); */ static private Log log = LogFactory.getLog(DashboardAction.class); + static final public String budgetDateFormat = "MM/yyyy"; + /** * Permet de decore une map dont toutes les valeurs manquant lorsqu'on les * demandent sont initialise avec l'objet passe dans le constructeur. @@ -99,6 +102,8 @@ @Override public Object clone() throws CloneNotSupportedException { MapWithDefault result = (MapWithDefault)super.clone(); + // class cast exception if map is not cloneable + result.map = (Map)ObjectUtil.clone((Cloneable)map); return result; } @@ -638,11 +643,11 @@ /** * Prévisionnel entre deux dates en fonction des factures */ - public Render budget(ChoremClient client, Date start, Date end, String filter) { + public Render budget(ChoremClient client, Date start, Date end, String query) { if (log.isDebugEnabled()) { log.debug(String.format( "budget for period '%s' to '%s' with filter '%s'", - start, end, filter)); + start, end, query)); } String companyId = client.getConfiguration().getDefaultCompany(); @@ -687,7 +692,7 @@ // La liste des factures entre les deux dates que l'on doit payer WikittyQuery invoiceDebt = new WikittyQueryMaker().and() - .parse(filter) + .parse(query) .containsOne(Invoice.FQ_FIELD_INVOICE_CUSTOMER) .select(Element.ID).eq(Employee.FQ_FIELD_EMPLOYEE_COMPANY, companyId) .close() @@ -697,7 +702,7 @@ // La liste des factures entre les deux dates que l'on doit payer WikittyQuery invoiceIncome = new WikittyQueryMaker().and() - .parse(filter) + .parse(query) .containsOne(Invoice.FQ_FIELD_INVOICE_SUPPLIER) .select(Element.ID).eq(Employee.FQ_FIELD_EMPLOYEE_COMPANY, companyId) .close() @@ -705,145 +710,207 @@ .end() .setLimit(WikittyQuery.MAX); + // total des factures avant les dates selectionnes Double[] amounts = client.findByQuery(Double.class, debt, income); - if (log.isDebugEnabled()) { - WikittyQuery debugDebt = new WikittyQueryMaker() - .select(Invoice.FQ_FIELD_INVOICE_AMOUNT) - .and() - .containsOne(Invoice.FQ_FIELD_INVOICE_CUSTOMER) - .select(Element.ID).eq(Employee.FQ_FIELD_EMPLOYEE_COMPANY, companyId) - .close() - .lt(Invoice.FQ_FIELD_INVOICE_EXPECTEDDATE, start) - .end() - .setLimit(WikittyQuery.MAX); - // La somme des factures que la company doit percevoir jusqu'a la date demandee - WikittyQuery debugIncome = new WikittyQueryMaker() - .select(Invoice.FQ_FIELD_INVOICE_AMOUNT) - .and() - .containsOne(Invoice.FQ_FIELD_INVOICE_SUPPLIER) - .select(Element.ID).eq(Employee.FQ_FIELD_EMPLOYEE_COMPANY, companyId) - .close() - .lt(Invoice.FQ_FIELD_INVOICE_EXPECTEDDATE, start) - .end() - .setLimit(WikittyQuery.MAX); - - WikittyQueryResult[] debugResult = client.findAllByQuery(debugDebt, debugIncome); - log.debug(String.format("\n\tDebt: %s [%s]\n\t\t(%s)\n\tIncome: %s [%s]\n\t\t(%s)", - amounts[0], debugResult[0].getAll(), debugResult[0].getQueryString(), - amounts[1], debugResult[1].getAll(), debugResult[1].getQueryString())); - } - + // toutes les factures des mois selectionnes WikittyQueryResult<Invoice>[] invoices = client.findAllByQuery(Invoice.class, invoiceDebt, invoiceIncome); - WikittyQuery categoriesQuery = new WikittyQueryMaker() - .exteq(Category.EXT_CATEGORY) - .end(); + // recuperation des noeuds root des categories WikittyQuery rootCategoriesQuery = new WikittyQueryMaker().and() .exteq(Category.EXT_CATEGORY) .isNull(Category.FQ_FIELD_WIKITTYTREENODE_PARENT) .end() .addSortAscending(new ElementField(Category.FQ_FIELD_CATEGORY_INDEX)); - WikittyQueryResult<Category>[] categories = - client.findAllByQuery(Category.class, categoriesQuery, rootCategoriesQuery); + WikittyQueryResult<Category> rootCategory = + client.findAllByQuery(Category.class, rootCategoriesQuery); + // les arbres de toutes les categories + List<WikittyQueryResultTreeNode<Category>> categoriesTree = + new LinkedList<WikittyQueryResultTreeNode<Category>>(); + for (Category c : rootCategory) { + WikittyQueryResultTreeNode<Category> treeResults = + client.findTreeNode(Category.class, c.getWikittyId(), Integer.MAX_VALUE, false, null); + if (treeResults != null) { + CollectionUtils.addAll(categoriesTree, treeResults.preorderEnumeration()); + } + } - String dateFormat = "MM/yyyy"; + // beginningFinances contient l'etat du compte, au depart beginningFinances vaut "recette passee" - "depense passee" + double finances = amounts[1] - amounts[0]; - List<String> dates = new LinkedList<String>(); - do { - dates.add(DateFormatUtils.format(start, dateFormat)); - start = DateUtils.addMonths(start, 1); - } while (!start.after(end)); + BudgetData data = new BudgetData(start, end, categoriesTree, finances); + // Debt + for (Invoice i : invoices[0]) { + data.add(true, i); + } - // key: date as MM/yyyy - Map<String, Map<Object, Double>> values = new HashMap<String, Map<Object, Double>>(); + // Income + for (Invoice i : invoices[1]) { + data.add(false, i); + } - String DEBT_KEY = "debt"; // cle pour les depenses sur le mois - String INCOME_KEY = "income"; // cle pour les revenus sur le mois - String TOTAL_KEY = "total"; // cle pour la diffence entre revenus et depenses sur le mois - String FINANCES_KEY = "finances"; // cle pour la tréso disponible + if (log.isDebugEnabled()) { + log.debug("budget data\n\t dates: " + data.getDates() + "\n\t rootTree: " + rootCategory + "\n\t categoriesTree: " + categoriesTree); + } + return renderView("dashboardBudget.jsp", + "data", data); + } - for (String d : dates) { - Map<Object, Double> catMap = new HashMap<Object, Double>(); - values.put(d, catMap); - for (Category c: categories[0]) { - catMap.put(c, 0.0); - } - catMap.put(DEBT_KEY, 0.0); - catMap.put(INCOME_KEY, 0.0); - catMap.put(TOTAL_KEY, 0.0); - catMap.put(FINANCES_KEY, 0.0); + /** + * Permet de collecter et representer les donnees pour le budget + */ + public static class BudgetData { + final static private String DEBT_KEY = "debt"; // cle pour les depenses sur le mois + final static private String INCOME_KEY = "income"; // cle pour les revenus sur le mois + final static private String TOTAL_KEY = "total"; // cle pour la diffence entre revenus et depenses sur le mois + + protected List<String> dates; + protected List<WikittyQueryResultTreeNode<Category>> categoriesTree; + protected double beginningFinances; + protected Map<String, Double> finances; + protected Map<String, Map<Object, Double>> values; + protected Map<String, Map<Category, List<Invoice>>> invoices; + + /** + * + * @param start la date de debut du budget + * @param end la date de fin du budget + * @param categoriesTree toutes les categories + * @param beginningFinances l'etat des beginningFinances avant la periode a afficher + */ + public BudgetData(Date start, Date end, + List<WikittyQueryResultTreeNode<Category>> categoriesTree, + double beginningFinances) { + this.categoriesTree = categoriesTree; + this.beginningFinances = beginningFinances; + + finances = new HashMap<String, Double>(); + + // La liste de toutes les dates que l'on souhaite + dates = new LinkedList<String>(); + do { + dates.add(DateFormatUtils.format(start, budgetDateFormat)); + start = DateUtils.addMonths(start, 1); + } while (!start.after(end)); + + + Map<Object, Double> capMap = new MapWithDefault<Object, Double>( + new HashMap<Object, Double>(), 0.0); + values = new MapWithDefault<String, Map<Object, Double>>( + new HashMap<String, Map<Object, Double>>(), capMap); + + Map<Category, List<Invoice>> capMapInvoice = new MapWithDefault<Category, List<Invoice>>( + new HashMap<Category, List<Invoice>>(), new LinkedList<Invoice>()); + invoices = new MapWithDefault<String, Map<Category, List<Invoice>>>( + new HashMap<String, Map<Category, List<Invoice>>>(), capMapInvoice); + } - // Debt - for (Invoice i : invoices[0]) { - String date = DateFormatUtils.format(i.getExpectedDate(), dateFormat); - Map<Object, Double> catMap = values.get(date); - Category c = i.getCategory(true); - if (catMap.containsKey(c)) { - double v = catMap.get(c); - v += i.getAmount(); - catMap.put(c, v); + public List<String> getDates() { + return dates; + } - v = catMap.get(DEBT_KEY); - v += i.getAmount(); - catMap.put(DEBT_KEY, v); + public List<WikittyQueryResultTreeNode<Category>> getCategoriesTree() { + return categoriesTree; + } + + public void add(boolean debt, Invoice invoice) { + // on modifie les invoices, donc on vide le cache de finances + finances.clear(); - v = catMap.get(TOTAL_KEY); - v -= i.getAmount(); - catMap.put(TOTAL_KEY, v); + Date d = getDate(invoice); + String date = DateFormatUtils.format(d, budgetDateFormat); + Category c = invoice.getCategory(true); + double amount = invoice.getAmount(); + + addAmount(date, c, amount); + addInvoice(date, c, invoice); + + if (debt) { + addDebt(date, amount); + addTotal(date, -amount); + } else { + addIncome(date, amount); + addTotal(date, amount); } + } - // Income - for (Invoice i : invoices[1]) { - String date = DateFormatUtils.format(i.getExpectedDate(), dateFormat); - Map<Object, Double> catMap = values.get(date); - Category c = i.getCategory(true); - if (catMap.containsKey(c)) { - double v = catMap.get(c); - v += i.getAmount(); - catMap.put(c, v); + protected Date getDate(Invoice invoice) { + Date result; + if (invoice.getPaymentDate() != null) { + result = invoice.getPaymentDate(); + } else { + result = invoice.getExpectedDate(); + } + return result; + } - v = catMap.get(INCOME_KEY); - v += i.getAmount(); - catMap.put(INCOME_KEY, v); + protected void addAmount(String month, Category c, double amount) { + double v = getAmount(month, c); + v += amount; + values.get(month).put(c, v); + } - v = catMap.get(TOTAL_KEY); - v += i.getAmount(); - catMap.put(TOTAL_KEY, v); - } + protected void addInvoice(String month, Category c, Invoice invoice) { + invoices.get(month).get(c).add(invoice); } - // finances contient l'etat du compte, au depart finances vaut "recette passee" - "depense passee" - double finances = amounts[1] - amounts[0]; - for (String date : dates) { - double v = values.get(date).get(TOTAL_KEY); - finances += v; - values.get(date).put(FINANCES_KEY, finances); + public void addDebt(String month, double amount) { + double v = values.get(month).get(DEBT_KEY); + v += amount; + values.get(month).put(DEBT_KEY, v); } + public void addIncome(String month, double amount) { + double v = values.get(month).get(INCOME_KEY); + v += amount; + values.get(month).put(INCOME_KEY, v); + } + public void addTotal(String month, double amount) { + double v = values.get(month).get(TOTAL_KEY); + v += amount; + values.get(month).put(TOTAL_KEY, v); + } - List<WikittyQueryResultTreeNode<Category>> categoriesTree = - new LinkedList<WikittyQueryResultTreeNode<Category>>(); - for (Category c : categories[1]) { - WikittyQueryResultTreeNode<Category> treeResults = - client.findTreeNode(Category.class, c.getWikittyId(), Integer.MAX_VALUE, false, null); - if (treeResults != null) { - CollectionUtils.addAll(categoriesTree, treeResults.preorderEnumeration()); - } + public double getAmount(String month, Category c) { + double result = values.get(month).get(c); + return result; } - if (log.isDebugEnabled()) { - log.debug("budget data\n\t dates: " + dates + "\n\t rootTree: " + categories[1] + "\n\t categoriesTree: " + categoriesTree + "\n\t values: " + values); + public List<Invoice> getInvoices(String month, Category c) { + List<Invoice> result = invoices.get(month).get(c); + return result; } - return renderView("dashboardBudget.jsp", - "dates", dates, - "categoriesTree", categoriesTree, - "values", values); + + public double getDebt(String month) { + double result = values.get(month).get(DEBT_KEY); + return result; + } + public double getIncome(String month) { + double result = values.get(month).get(INCOME_KEY); + return result; + } + public double getTotal(String month) { + double result = values.get(month).get(TOTAL_KEY); + return result; + } + public double getFinances(String month) { + Double result = finances.get(month); + if (result == null) { + double value = beginningFinances; + for (String d : getDates()) { + double total = getTotal(d); + value += total; + finances.put(d, value); + } + result = finances.get(month); + } + return result; + } } //////////////////////////////////////////////////////////////////////////// Modified: trunk/chorem-webmotion/src/main/resources/mapping =================================================================== --- trunk/chorem-webmotion/src/main/resources/mapping 2012-08-20 23:26:27 UTC (rev 243) +++ trunk/chorem-webmotion/src/main/resources/mapping 2012-08-20 23:28:09 UTC (rev 244) @@ -32,6 +32,5 @@ * /admin view:contact.jsp * /admin/{method} action:AdminAction.{method} * /contact view:contact.jsp -* /project view:project.jsp -* /financial view:financial.jsp +* /report view:report.jsp * /hr view:hr.jsp Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardBudget.jsp =================================================================== --- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardBudget.jsp 2012-08-20 23:26:27 UTC (rev 243) +++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardBudget.jsp 2012-08-20 23:28:09 UTC (rev 244) @@ -31,42 +31,42 @@ <thead> <tr> <th>Category</th> - <c:forEach var="d" items="${dates}"> + <c:forEach var="d" items="${data.dates}"> <th>${d}</th> </c:forEach> </tr> </thead> <tbody> - <c:forEach var="c" items="${categoriesTree}"> + <c:forEach var="c" items="${data.categoriesTree}"> <tr> <td><span class="level level${c.level}" level="${c.level}">${c.userObject}</span></td> - <c:forEach var="d" items="${dates}"> - <td class="currency"><span><f:formatNumber type="currency" value="${values.get(d).get(c.userObject)}"/></span></td> + <c:forEach var="d" items="${data.dates}"> + <td class="currency"><span class="withTooltip" title='<w:display wikitties="${data.getInvoices(d, c.userObject)}" toString="%Invoice.reference|noref$s: %Invoice.amount|0.0$,.2f"/>'><f:formatNumber type="currency" value="${data.getAmount(d, c.userObject)}"/></span></td> </c:forEach> </tr> </c:forEach> <tr> <th><span>Sorties</span></th> - <c:forEach var="d" items="${dates}"> - <td class="currency"><span><f:formatNumber type="currency" value='${values.get(d).get("debt")}'/></span></td> + <c:forEach var="d" items="${data.dates}"> + <td class="currency"><span><f:formatNumber type="currency" value='${data.getDebt(d)}'/></span></td> </c:forEach> </tr> <tr> <th><span>Entrées</span></th> - <c:forEach var="d" items="${dates}"> - <td class="currency"><span><f:formatNumber type="currency" value='${values.get(d).get("income")}'/></span></td> + <c:forEach var="d" items="${data.dates}"> + <td class="currency"><span><f:formatNumber type="currency" value='${data.getIncome(d)}'/></span></td> </c:forEach> </tr> <tr> <th><span>Total</span></th> - <c:forEach var="d" items="${dates}"> - <td class="currency"><span><f:formatNumber type="currency" value='${values.get(d).get("total")}'/></span></td> + <c:forEach var="d" items="${data.dates}"> + <td class="currency"><span><f:formatNumber type="currency" value='${data.getTotal(d)}'/></span></td> </c:forEach> </tr> <tr> <th><span>Total cumulé</span></th> - <c:forEach var="d" items="${dates}"> - <td class="currency"><span><f:formatNumber type="currency" value='${values.get(d).get("finances")}'/></span></td> + <c:forEach var="d" items="${data.dates}"> + <td class="currency"><span><f:formatNumber type="currency" value='${data.getFinances(d)}'/></span></td> </c:forEach> </tr> </tbody> Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/decorator.jsp =================================================================== --- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/decorator.jsp 2012-08-20 23:26:27 UTC (rev 243) +++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/decorator.jsp 2012-08-20 23:28:09 UTC (rev 244) @@ -96,7 +96,7 @@ </li> <li class="dropdown nav-group"> <!-- around projects --> - <a href="<c:url value="/project"/>">Project</a> + <a href="<c:url value="/report?report=quotation,projectOpen,projectClosed"/>">Project</a> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <b class="caret"></b> </a> @@ -120,11 +120,16 @@ <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 class="divider"></li> + <li>Report</li> + <li><a href="<c:url value="/report?report=quotation"/>">Quotation</a></li> + <li><a href="<c:url value="/report?report=projectOpen"/>">Project Open</a></li> + <li><a href="<c:url value="/report?report=projectClosed"/>">Project Closed</a></li> </ul> </li> <li class="dropdown nav-group"> <!-- around financial --> - <a href="<c:url value="/financial"/>">Financial</a> + <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> </a> @@ -141,8 +146,11 @@ <li><a href="<c:url value="/wikitty/Category/search"/>"><i class="icon-th-list icon-black"></i> All categories</a></li> <li><a href="<c:url value="/wikitty/Category/edit/new"/>"><i class="icon-plus icon-black"></i> Add category</a></li> <li class="divider"></li> - <li>Other</li> - <li><a href="<c:url value="wikitty/search?query=extension=Accounting"/>">Accounting</a></li> + <li>Report</li> + <li><a href="<c:url value="/report?report=invoiceDebt"/>">Debt</a></li> + <li><a href="<c:url value="/report?report=invoiceIncome"/>">Income</a></li> + <li><a href="<c:url value="/report?report=profitability"/>">Profitability</a></li> + <li><a href="<c:url value="/report?report=budget"/>">Budget</a></li> </ul> </li> <li class="dropdown nav-group"> Deleted: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial.jsp =================================================================== --- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial.jsp 2012-08-20 23:26:27 UTC (rev 243) +++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial.jsp 2012-08-20 23:28:09 UTC (rev 244) @@ -1,37 +0,0 @@ -<%-- - #%L - Chorem webmotion - $Id:$ - $HeadURL:$ - %% - 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% - --%> -<%@page contentType="text/html" pageEncoding="UTF-8"%> - -<h1>Financial</h1> - -<form> - date start: <input class="datepicker" type="text" name="start" value="${start}"/> - end: <input class="datepicker" type="text" name="end" value="${end}"/> - filtre: <input type="text" name="query"/> - <input type="submit"/> -</form> - -<jsp:include page="/fragment/dashboard/invoiceDebt"/> -<jsp:include page="/fragment/dashboard/invoiceIncome"/> -<jsp:include page="/fragment/dashboard/profitability"/> -<jsp:include page="/fragment/dashboard/budget"/> Deleted: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/project.jsp =================================================================== --- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/project.jsp 2012-08-20 23:26:27 UTC (rev 243) +++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/project.jsp 2012-08-20 23:28:09 UTC (rev 244) @@ -1,34 +0,0 @@ -<%-- - #%L - Chorem webmotion - $Id:$ - $HeadURL:$ - %% - 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% - --%> -<%@page contentType="text/html" pageEncoding="UTF-8"%> - -<h1>Project</h1> - -<form> - <input type="text" name="query"/> - <input type="submit"/> -</form> - -<jsp:include page="/fragment/dashboard/quotation?query=${query}"/> -<jsp:include page="/fragment/dashboard/projectOpen?query=${query}"/> -<jsp:include page="/fragment/dashboard/projectClosed?query=${query}"/> Added: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/report.jsp =================================================================== --- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/report.jsp (rev 0) +++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/report.jsp 2012-08-20 23:28:09 UTC (rev 244) @@ -0,0 +1,59 @@ +<%-- + #%L + Chorem webmotion + $Id:$ + $HeadURL:$ + %% + 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% + --%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> + +<h1>Financial</h1> + +<form class="well form-inline"> + <input type="hidden" name="report" value="${report}"/> + <input class="datepicker input-small" type="text" name="start" value="${start}" placeholder="date from"/> + <input class="datepicker input-small" type="text" name="end" value="${end}" placeholder="date to"/> + <input class="input-xxlarge" type="text" name="query" value="${query}" placeholder="filter query"/> + <input type="submit" class="btn"/> +</form> + + <%-- Rapport de projet --%> + <c:if test="${report == null || report == '' || report.contains('quotation')}"> + <jsp:include page="/fragment/dashboard/quotation"/> + </c:if> + <c:if test="${report == null || report == '' || report.contains('projectOpen')}"> + <jsp:include page="/fragment/dashboard/projectOpen"/> + </c:if> + <c:if test="${report == null || report == '' || report.contains('projectClosed')}"> + <jsp:include page="/fragment/dashboard/projectClosed"/> + </c:if> + + <%-- Rapport financier --%> + <c:if test="${report == null || report == '' || report.contains('invoiceDebt')}"> + <jsp:include page="/fragment/dashboard/invoiceDebt"/> + </c:if> + <c:if test="${report == null || report == '' || report.contains('invoiceIncome')}"> + <jsp:include page="/fragment/dashboard/invoiceIncome"/> + </c:if> + <c:if test="${report == null || report == '' || report.contains('profitability')}"> + <jsp:include page="/fragment/dashboard/profitability"/> + </c:if> + <c:if test="${report == null || report == '' || report.contains('budget')}"> + <jsp:include page="/fragment/dashboard/budget"/> + </c:if> Modified: trunk/chorem-webmotion/src/main/webapp/js/chorem.js =================================================================== --- trunk/chorem-webmotion/src/main/webapp/js/chorem.js 2012-08-20 23:26:27 UTC (rev 243) +++ trunk/chorem-webmotion/src/main/webapp/js/chorem.js 2012-08-20 23:28:09 UTC (rev 244) @@ -20,6 +20,11 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * #L% */ + +$(function() { + $('.withTooltip').tooltip({trigger: 'hover', delay: { show: 0, hide: 1000 }}); +}); + // tout ce qui aura la classe datepicker servira a editer une date $(function() { $( ".datepicker" ).datepicker($.datepicker.regional['fr']); @@ -67,3 +72,4 @@ }); } }); +