Author: bpoussin Date: 2013-02-20 12:38:15 +0100 (Wed, 20 Feb 2013) New Revision: 307 Url: http://chorem.org/projects/chorem/repository/revisions/307 Log: Integration nouvelle API du select de Wikitty Correction des erreurs dans le rapport Budget (provenant des select de wikitty) Modified: trunk/chorem-webmotion/pom.xml trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/DashboardAction.java trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/AccountSalesReportAction.java trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/ProjectSalesReportAction.java trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/SalesPerAccountReportAction.java trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/SalesPerProjectReportAction.java trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/SalesReportAction.java trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/SalesReportHelper.java trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardBudget.jsp trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardInvoice.jsp trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardSummary.jsp trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/salesReports/menu.jsp trunk/chorem-webmotion/src/main/webapp/js/chorem.js Modified: trunk/chorem-webmotion/pom.xml =================================================================== --- trunk/chorem-webmotion/pom.xml 2013-02-14 13:19:54 UTC (rev 306) +++ trunk/chorem-webmotion/pom.xml 2013-02-20 11:38:15 UTC (rev 307) @@ -174,12 +174,12 @@ <groupId>org.debux.webmotion</groupId> <artifactId>webmotion</artifactId> </dependency> - +<!-- <dependency> <groupId>org.debux.webmotion</groupId> <artifactId>webmotion-extra-sitemesh</artifactId> </dependency> - +--> </dependencies> <build> 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 2013-02-14 13:19:54 UTC (rev 306) +++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/DashboardAction.java 2013-02-20 11:38:15 UTC (rev 307) @@ -23,6 +23,14 @@ package org.chorem.webmotion.actions; +import java.util.Calendar; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateFormatUtils; @@ -37,10 +45,11 @@ import org.chorem.entities.Category; import org.chorem.entities.Configuration; import org.chorem.entities.Employee; +import org.chorem.entities.FinancialTransaction; import org.chorem.entities.Interval; import org.chorem.entities.Invoice; +import org.chorem.entities.InvoiceStatus; import org.chorem.entities.Quotation; -import org.chorem.entities.QuotationStatus; import org.chorem.entities.Sent; import org.chorem.entities.Started; import org.chorem.entities.Task; @@ -60,16 +69,6 @@ import org.nuiton.wikitty.query.WikittyQueryResultTreeNode; import org.nuiton.wikitty.query.conditions.Aggregate; -import java.util.Calendar; -import java.util.Collection; -import java.util.Date; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; - /** * * @author poussin @@ -153,21 +152,23 @@ protected WikittyQuery[] getDebtIncomeQuery(Date first, Date last, String companyId) { // toutes les depenses depuis le debut de l'annee WikittyQuery debtQuery = new ChoremQueryMaker() - .select(Invoice.FQ_FIELD_INVOICE_AMOUNT, Aggregate.SUM) + .select().sum(Invoice.FQ_FIELD_FINANCIALTRANSACTION_AMOUNT) .and() - .exteq(Invoice.EXT_INVOICE) - .bw(Invoice.FQ_FIELD_INVOICE_POSTEDDATE, first, last) - .containsOne(Invoice.FQ_FIELD_INVOICE_CUSTOMER) + .exteq(Invoice.EXT_FINANCIALTRANSACTION) + .not().eq(Invoice.FQ_FIELD_INVOICE_STATUS, InvoiceStatus.CANCELED.name()) + .bw(Invoice.FQ_FIELD_FINANCIALTRANSACTION_EMITTEDDATE, first, last) + .containsOne(Invoice.FQ_FIELD_FINANCIALTRANSACTION_PAYER) .select(Element.ID).filterOnCompanyOrEmployee(companyId) .end().setLimit(WikittyQuery.MAX); // toutes les factures emises depuis le debut de l'annee WikittyQuery incomeQuery = new ChoremQueryMaker() - .select(Invoice.FQ_FIELD_INVOICE_AMOUNT, Aggregate.SUM) + .select().sum(Invoice.FQ_FIELD_FINANCIALTRANSACTION_AMOUNT) .and() - .exteq(Invoice.EXT_INVOICE) - .bw(Invoice.FQ_FIELD_INVOICE_POSTEDDATE, first, last) - .containsOne(Invoice.FQ_FIELD_INVOICE_SUPPLIER) + .exteq(Invoice.EXT_FINANCIALTRANSACTION) + .not().eq(Invoice.FQ_FIELD_INVOICE_STATUS, InvoiceStatus.CANCELED.name()) + .bw(Invoice.FQ_FIELD_FINANCIALTRANSACTION_EMITTEDDATE, first, last) + .containsOne(Invoice.FQ_FIELD_FINANCIALTRANSACTION_BENEFICIARY) .select(Element.ID).filterOnCompanyOrEmployee(companyId) .end().setLimit(WikittyQuery.MAX); @@ -189,12 +190,12 @@ // La premiere annee WikittyQuery firstDateQuery = new WikittyQueryMaker() - .select(Invoice.FQ_FIELD_INVOICE_POSTEDDATE, Aggregate.MIN) + .select().min(Invoice.FQ_FIELD_FINANCIALTRANSACTION_EMITTEDDATE) .exteq(Invoice.EXT_INVOICE) .end().setLimit(WikittyQuery.MAX); // La derniere annee WikittyQuery lastDateQuery = new WikittyQueryMaker() - .select(Invoice.FQ_FIELD_INVOICE_POSTEDDATE, Aggregate.MAX) + .select().max(Invoice.FQ_FIELD_FINANCIALTRANSACTION_EMITTEDDATE) .exteq(Invoice.EXT_INVOICE) .end().setLimit(WikittyQuery.MAX); Date[] dates = client.findByQuery(Date.class, firstDateQuery, lastDateQuery); @@ -238,23 +239,23 @@ // les factures que notre societe doit payer au plus tard dans 7 jours WikittyQuery invoiceDebtQuery = new ChoremQueryMaker() - .select(Invoice.FQ_FIELD_INVOICE_AMOUNT, Aggregate.SUM) + .select().sum(Invoice.FQ_FIELD_FINANCIALTRANSACTION_AMOUNT) .and() .exteq(Invoice.EXT_INVOICE) - .lt(Invoice.FQ_FIELD_INVOICE_EXPECTEDDATE, inOneWeek) - .isNull(Invoice.FQ_FIELD_INVOICE_PAYMENTDATE) - .containsOne(Invoice.FQ_FIELD_INVOICE_CUSTOMER) + .lt(Invoice.FQ_FIELD_FINANCIALTRANSACTION_EXPECTEDDATE, inOneWeek) + .isNull(Invoice.FQ_FIELD_FINANCIALTRANSACTION_PAYMENTDATE) + .containsOne(Invoice.FQ_FIELD_FINANCIALTRANSACTION_PAYER) .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() - .select(Invoice.FQ_FIELD_INVOICE_AMOUNT, Aggregate.SUM) + .select().sum(Invoice.FQ_FIELD_FINANCIALTRANSACTION_AMOUNT) .and() .exteq(Invoice.EXT_INVOICE) - .lt(Invoice.FQ_FIELD_INVOICE_EXPECTEDDATE, now) - .isNull(Invoice.FQ_FIELD_INVOICE_PAYMENTDATE) - .containsOne(Invoice.FQ_FIELD_INVOICE_SUPPLIER) + .lt(Invoice.FQ_FIELD_FINANCIALTRANSACTION_EXPECTEDDATE, now) + .isNull(Invoice.FQ_FIELD_FINANCIALTRANSACTION_PAYMENTDATE) + .containsOne(Invoice.FQ_FIELD_FINANCIALTRANSACTION_BENEFICIARY) .select(Element.ID).filterOnCompanyOrEmployee(companyId) .end().setLimit(WikittyQuery.MAX); @@ -587,10 +588,10 @@ .parse(query) .exteq(Invoice.EXT_INVOICE) .or() - .bw(Invoice.FQ_FIELD_INVOICE_POSTEDDATE, start, end) - .isNull(Invoice.FQ_FIELD_INVOICE_POSTEDDATE) - .bw(Invoice.FQ_FIELD_INVOICE_EXPECTEDDATE, start, end) - .bw(Invoice.FQ_FIELD_INVOICE_PAYMENTDATE, start, end) + .bw(Invoice.FQ_FIELD_FINANCIALTRANSACTION_EMITTEDDATE, start, end) + .isNull(Invoice.FQ_FIELD_FINANCIALTRANSACTION_EMITTEDDATE) + .bw(Invoice.FQ_FIELD_FINANCIALTRANSACTION_EXPECTEDDATE, start, end) + .bw(Invoice.FQ_FIELD_FINANCIALTRANSACTION_PAYMENTDATE, start, end) .end().setLimit(WikittyQuery.MAX); ChoremQueryHelper.addSort(client, invoiceQuery, Invoice.EXT_INVOICE); @@ -630,7 +631,7 @@ Date start, Date end, String query) { String title = "Factures à payer par la société"; String companyId = client.getConfiguration().getDefaultCompany(); - String filter = Invoice.FQ_FIELD_INVOICE_CUSTOMER + "={SELECT id WHERE (" + + String filter = Invoice.FQ_FIELD_FINANCIALTRANSACTION_PAYER + "={SELECT id WHERE (" + Employee.FQ_FIELD_EMPLOYEE_COMPANY + "=" + companyId+" OR id=" + companyId + ")}"; return invoiceFilter(client, title, filter, start, end, query); } @@ -639,7 +640,7 @@ Date start, Date end, String query) { String title = "Factures émises par la société"; String companyId = client.getConfiguration().getDefaultCompany(); - String filter = Invoice.FQ_FIELD_INVOICE_SUPPLIER + "={SELECT id WHERE (" + + String filter = Invoice.FQ_FIELD_FINANCIALTRANSACTION_BENEFICIARY + "={SELECT id WHERE (" + Employee.FQ_FIELD_EMPLOYEE_COMPANY + "=" + companyId+" OR id=" + companyId + ")}"; return invoiceFilter(client, title, filter, start, end, query); } @@ -681,43 +682,75 @@ // La somme des factures que la company doit payer jusqu'a la date demandee WikittyQuery debt = new ChoremQueryMaker() - .select(Invoice.FQ_FIELD_INVOICE_AMOUNT, Aggregate.SUM) + .select().sum(Invoice.FQ_FIELD_FINANCIALTRANSACTION_AMOUNT) .and() - .containsOne(Invoice.FQ_FIELD_INVOICE_CUSTOMER) + .containsOne(Invoice.FQ_FIELD_FINANCIALTRANSACTION_PAYER) .select(Element.ID).filterOnCompanyOrEmployee(companyId) .close() - .lt(Invoice.FQ_FIELD_INVOICE_EXPECTEDDATE, start) + .not().eq(Invoice.FQ_FIELD_INVOICE_STATUS, InvoiceStatus.CANCELED) + .or() + .and() + .isNotNull(Invoice.FQ_FIELD_FINANCIALTRANSACTION_PAYMENTDATE) + .lt(Invoice.FQ_FIELD_FINANCIALTRANSACTION_PAYMENTDATE, start) + .close() + .and() + .isNull(Invoice.FQ_FIELD_FINANCIALTRANSACTION_PAYMENTDATE) + .lt(Invoice.FQ_FIELD_FINANCIALTRANSACTION_EXPECTEDDATE, start) .end() .setLimit(WikittyQuery.MAX); // La somme des factures que la company doit percevoir jusqu'a la date demandee WikittyQuery income = new ChoremQueryMaker() - .select(Invoice.FQ_FIELD_INVOICE_AMOUNT, Aggregate.SUM) + .select().sum(Invoice.FQ_FIELD_FINANCIALTRANSACTION_AMOUNT) .and() - .containsOne(Invoice.FQ_FIELD_INVOICE_SUPPLIER) + .containsOne(Invoice.FQ_FIELD_FINANCIALTRANSACTION_BENEFICIARY) .select(Element.ID).filterOnCompanyOrEmployee(companyId) .close() - .lt(Invoice.FQ_FIELD_INVOICE_EXPECTEDDATE, start) + .not().eq(Invoice.FQ_FIELD_INVOICE_STATUS, InvoiceStatus.CANCELED) + .or() + .and() + .isNotNull(Invoice.FQ_FIELD_FINANCIALTRANSACTION_PAYMENTDATE) + .lt(Invoice.FQ_FIELD_FINANCIALTRANSACTION_PAYMENTDATE, start) + .close() + .and() + .isNull(Invoice.FQ_FIELD_FINANCIALTRANSACTION_PAYMENTDATE) + .lt(Invoice.FQ_FIELD_FINANCIALTRANSACTION_EXPECTEDDATE, start) .end() .setLimit(WikittyQuery.MAX); // La liste des factures entre les deux dates que l'on doit payer WikittyQuery invoiceDebt = new ChoremQueryMaker().and() .parse(query) - .containsOne(Invoice.FQ_FIELD_INVOICE_CUSTOMER) + .containsOne(Invoice.FQ_FIELD_FINANCIALTRANSACTION_PAYER) .select(Element.ID).filterOnCompanyOrEmployee(companyId) .close() - .bw(Invoice.FQ_FIELD_INVOICE_EXPECTEDDATE, start, end) + .not().eq(Invoice.FQ_FIELD_INVOICE_STATUS, InvoiceStatus.CANCELED) + .or() + .and() + .isNotNull(Invoice.FQ_FIELD_FINANCIALTRANSACTION_PAYMENTDATE) + .bw(Invoice.FQ_FIELD_FINANCIALTRANSACTION_PAYMENTDATE, start, end) + .close() + .and() + .isNull(Invoice.FQ_FIELD_FINANCIALTRANSACTION_PAYMENTDATE) + .bw(Invoice.FQ_FIELD_FINANCIALTRANSACTION_EXPECTEDDATE, start, end) .end() .setLimit(WikittyQuery.MAX); // La liste des factures entre les deux dates que l'on doit payer WikittyQuery invoiceIncome = new ChoremQueryMaker().and() .parse(query) - .containsOne(Invoice.FQ_FIELD_INVOICE_SUPPLIER) + .containsOne(Invoice.FQ_FIELD_FINANCIALTRANSACTION_BENEFICIARY) .select(Element.ID).filterOnCompanyOrEmployee(companyId) .close() - .bw(Invoice.FQ_FIELD_INVOICE_EXPECTEDDATE, start, end) + .not().eq(Invoice.FQ_FIELD_INVOICE_STATUS, InvoiceStatus.CANCELED) + .or() + .and() + .isNotNull(Invoice.FQ_FIELD_FINANCIALTRANSACTION_PAYMENTDATE) + .bw(Invoice.FQ_FIELD_FINANCIALTRANSACTION_PAYMENTDATE, start, end) + .close() + .and() + .isNull(Invoice.FQ_FIELD_FINANCIALTRANSACTION_PAYMENTDATE) + .bw(Invoice.FQ_FIELD_FINANCIALTRANSACTION_EXPECTEDDATE, start, end) .end() .setLimit(WikittyQuery.MAX); @@ -725,8 +758,8 @@ Double[] amounts = client.findByQuery(Double.class, debt, income); // toutes les factures des mois selectionnes - WikittyQueryResult<Invoice>[] invoices = - client.findAllByQuery(Invoice.class, invoiceDebt, invoiceIncome); + WikittyQueryResult<FinancialTransaction>[] invoices = + client.findAllByQuery(FinancialTransaction.class, invoiceDebt, invoiceIncome); // recuperation des noeuds root des categories WikittyQuery rootCategoriesQuery = new WikittyQueryMaker().and() @@ -755,12 +788,12 @@ BudgetData data = new BudgetData(start, end, categoriesTree, finances); // Debt - for (Invoice i : invoices[0]) { + for (FinancialTransaction i : invoices[0]) { data.add(true, i); } // Income - for (Invoice i : invoices[1]) { + for (FinancialTransaction i : invoices[1]) { data.add(false, i); } @@ -784,7 +817,7 @@ protected double beginningFinances; protected Map<String, Double> finances; protected Map<String, Map<Object, Double>> values; - protected Map<String, Map<Category, List<Invoice>>> invoices; + protected Map<String, Map<Category, List<FinancialTransaction>>> invoices; /** * @@ -814,10 +847,10 @@ 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); + Map<Category, List<FinancialTransaction>> capMapInvoice = new MapWithDefault<Category, List<FinancialTransaction>>( + new HashMap<Category, List<FinancialTransaction>>(), new LinkedList<FinancialTransaction>()); + invoices = new MapWithDefault<String, Map<Category, List<FinancialTransaction>>>( + new HashMap<String, Map<Category, List<FinancialTransaction>>>(), capMapInvoice); } @@ -829,7 +862,7 @@ return categoriesTree; } - public void add(boolean debt, Invoice invoice) { + public void add(boolean debt, FinancialTransaction invoice) { // on modifie les invoices, donc on vide le cache de finances finances.clear(); @@ -851,7 +884,7 @@ } - protected Date getDate(Invoice invoice) { + protected Date getDate(FinancialTransaction invoice) { Date result; if (invoice.getPaymentDate() != null) { result = invoice.getPaymentDate(); @@ -867,7 +900,7 @@ values.get(month).put(c, v); } - protected void addInvoice(String month, Category c, Invoice invoice) { + protected void addInvoice(String month, Category c, FinancialTransaction invoice) { invoices.get(month).get(c).add(invoice); } @@ -892,8 +925,8 @@ return result; } - public List<Invoice> getInvoices(String month, Category c) { - List<Invoice> result = invoices.get(month).get(c); + public List<FinancialTransaction> getInvoices(String month, Category c) { + List<FinancialTransaction> result = invoices.get(month).get(c); return result; } Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/AccountSalesReportAction.java =================================================================== --- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/AccountSalesReportAction.java 2013-02-14 13:19:54 UTC (rev 306) +++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/AccountSalesReportAction.java 2013-02-20 11:38:15 UTC (rev 307) @@ -51,7 +51,7 @@ SalesData yearData = new SalesData(); WikittyQuery projectQuery = new WikittyQueryMaker() - .select("Quotation.amount", Aggregate.SUM).and() + .select().sum("Quotation.amount").where().and() .eq(Quotation.FQ_FIELD_QUOTATION_CUSTOMER, account) .bw(Accepted.FQ_FIELD_ACCEPTED_ACCEPTEDDATE, yearFirstDay, yearLastDay) Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/ProjectSalesReportAction.java =================================================================== --- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/ProjectSalesReportAction.java 2013-02-14 13:19:54 UTC (rev 306) +++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/ProjectSalesReportAction.java 2013-02-20 11:38:15 UTC (rev 307) @@ -51,7 +51,7 @@ SalesData yearData = new SalesData(); WikittyQuery projectQuery = new WikittyQueryMaker() - .select("Quotation.amount", Aggregate.SUM).and() + .select().sum("Quotation.amount").where().and() .eq(Quotation.FQ_FIELD_QUOTATION_PROJECT, project) .bw(Accepted.FQ_FIELD_ACCEPTED_ACCEPTEDDATE, yearFirstDay, yearLastDay) Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/SalesPerAccountReportAction.java =================================================================== --- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/SalesPerAccountReportAction.java 2013-02-14 13:19:54 UTC (rev 306) +++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/SalesPerAccountReportAction.java 2013-02-20 11:38:15 UTC (rev 307) @@ -70,7 +70,7 @@ SalesData projectData = new SalesData(); WikittyQuery accountQuery = new WikittyQueryMaker() - .select("Quotation.amount", Aggregate.SUM).and() + .select().sum("Quotation.amount").where().and() .eq(Quotation.FQ_FIELD_QUOTATION_CUSTOMER, account) .bw(Accepted.FQ_FIELD_ACCEPTED_ACCEPTEDDATE, first, last) .end(); Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/SalesPerProjectReportAction.java =================================================================== --- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/SalesPerProjectReportAction.java 2013-02-14 13:19:54 UTC (rev 306) +++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/SalesPerProjectReportAction.java 2013-02-20 11:38:15 UTC (rev 307) @@ -69,7 +69,7 @@ SalesData projectData = new SalesData(); WikittyQuery projectQuery = new WikittyQueryMaker() - .select("Quotation.amount", Aggregate.SUM).and() + .select().sum("Quotation.amount").where().and() .eq(Quotation.FQ_FIELD_QUOTATION_PROJECT, project) .bw(Accepted.FQ_FIELD_ACCEPTED_ACCEPTEDDATE, first, last) .end(); Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/SalesReportAction.java =================================================================== --- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/SalesReportAction.java 2013-02-14 13:19:54 UTC (rev 306) +++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/SalesReportAction.java 2013-02-20 11:38:15 UTC (rev 307) @@ -53,7 +53,7 @@ //Ventes de l'année WikittyQuery salesQuery = new WikittyQueryMaker() - .select("Quotation.amount", Aggregate.SUM).and() + .select().sum("Quotation.amount").where().and() .exteq(Accepted.EXT_ACCEPTED) .bw(Accepted.FQ_FIELD_ACCEPTED_ACCEPTEDDATE, yearFirstDay, yearLastDay) .end(); @@ -99,7 +99,7 @@ baseValue= DateUtils.addDays(lastDayOfMonth, 1); WikittyQuery monthQuery = new WikittyQueryMaker() - .select("Quotation.amount", Aggregate.SUM).and() + .select().sum("Quotation.amount").where().and() .bw(Accepted.FQ_FIELD_ACCEPTED_ACCEPTEDDATE, firstDayOfMonth, lastDayOfMonth) .end(); Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/SalesReportHelper.java =================================================================== --- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/SalesReportHelper.java 2013-02-14 13:19:54 UTC (rev 306) +++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/sales/SalesReportHelper.java 2013-02-20 11:38:15 UTC (rev 307) @@ -82,14 +82,16 @@ //Ventes de l'année WikittyQuery firstYearQuery = new WikittyQueryMaker() - .select("Draft.sendingDate", Aggregate.MIN).and() + .select().min("Draft.sendingDate").where().and() .exteq(Draft.EXT_DRAFT) .end(); Date firstYear = client.findByQuery(Date.class, firstYearQuery); Calendar c = Calendar.getInstance(); - c.setTime(firstYear); + if (firstYear != null) { // if no DRAFT available + c.setTime(firstYear); + } return c.get(Calendar.YEAR); } Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardBudget.jsp =================================================================== --- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardBudget.jsp 2013-02-14 13:19:54 UTC (rev 306) +++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardBudget.jsp 2013-02-20 11:38:15 UTC (rev 307) @@ -49,8 +49,9 @@ </span> </c:when> <c:otherwise> - <span class="withTooltip" - title='<w:display wikitties="${data.getInvoices(d, c.userObject)}" toString="%Invoice.reference|noref$s: %Invoice.amount|0.0$,.2f"/>'> + <span class="withPopover" + title='Detail pour <f:formatNumber type="currency" value="${data.getAmount(d, c.userObject)}"/>' + data-content='<w:display wikitties="${data.getInvoices(d, c.userObject)}" toString="<span class=\"withTooltip\" title=\"%FinancialTransaction.category$s: %FinancialTransaction.payer$s -> %FinancialTransaction.beneficiary$s\">%FinancialTransaction.reference|noref$s: %FinancialTransaction.amount|0.0$,.2f</span>"/>'> <f:formatNumber type="currency" value="${data.getAmount(d, c.userObject)}"/> </span> </c:otherwise> Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardInvoice.jsp =================================================================== --- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardInvoice.jsp 2013-02-14 13:19:54 UTC (rev 306) +++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardInvoice.jsp 2013-02-20 11:38:15 UTC (rev 307) @@ -45,15 +45,15 @@ <c:forEach var="q" items="${invoices}"> <tbody> <tr> - <td><w:display wikitty="${q.wikitty}" fqfield="Invoiceable.target" label=""/></td> - <td><w:display wikitty="${q.wikitty}" toString="%Invoice.reference|no reference$s" label=""/></td> - <td><w:display wikitty="${q.wikitty}" toString="%Invoice.description|Invoiceable.name$s" label=""/></td> - <td><w:display wikitty="${q.wikitty}" fqfield="Invoice.customer" label=""/></td> - <td><w:display wikitty="${q.wikitty}" fqfield="Invoice.supplier" label=""/></td> - <td class="currency"><w:display wikitty="${q.wikitty}" fqfield="Invoice.amount" label=""/></td> - <td class="date"><w:display wikitty="${q.wikitty}" fqfield="Invoice.postedDate" label=""/></td> - <td class="date"><w:display wikitty="${q.wikitty}" fqfield="Invoice.expectedDate" label=""/></td> - <td class="date"><w:display wikitty="${q.wikitty}" fqfield="Invoice.paymentDate" label=""/></td> + <td><w:display wikitty="${q.wikitty}" fqfield="FinancialTransaction.target" label=""/></td> + <td><w:display wikitty="${q.wikitty}" toString="%FinancialTransaction.reference|no reference$s" label=""/></td> + <td><w:display wikitty="${q.wikitty}" toString="%FinancialTransaction.description$s" label=""/></td> + <td><w:display wikitty="${q.wikitty}" fqfield="FinancialTransaction.payer" label=""/></td> + <td><w:display wikitty="${q.wikitty}" fqfield="FinancialTransaction.beneficiary" label=""/></td> + <td class="currency"><w:display wikitty="${q.wikitty}" fqfield="FinancialTransaction.amount" label=""/></td> + <td class="date"><w:display wikitty="${q.wikitty}" fqfield="FinancialTransaction.emittedDate" label=""/></td> + <td class="date"><w:display wikitty="${q.wikitty}" fqfield="FinancialTransaction.expectedDate" label=""/></td> + <td class="date"><w:display wikitty="${q.wikitty}" fqfield="FinancialTransaction.paymentDate" label=""/></td> <td><w:display wikitties="${attachments.get(q.wikittyId)}" toString="%Attachment.name|noname$s"/></td> </tr> </tbody> Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardSummary.jsp =================================================================== --- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardSummary.jsp 2013-02-14 13:19:54 UTC (rev 306) +++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardSummary.jsp 2013-02-20 11:38:15 UTC (rev 307) @@ -37,11 +37,11 @@ <div class="span24"> <ul> <li>Il y a ${invoiceDebtNb} - <a href='<c:url value="/report?report=invoiceDebt&end=${inOneWeek}&query=Invoice.paymentDate=null"/>'> + <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&query=Invoice.paymentDate=null and Invoice.expectedDate<${now}"/>'> + <a href='<c:url value="/report?report=invoiceIncome&query=FinancialTransaction.paymentDate=null and FinancialTransaction.expectedDate<${now}"/>'> factures impayées</a> pour un montant de <f:formatNumber type="currency" value="${invoiceIncome}"/></li> <li>Il y a ${touchNb} <a href='<c:url value="/wikitty/search?query=${touchQueryString}"/>'> 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 2013-02-14 13:19:54 UTC (rev 306) +++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/salesReports/menu.jsp 2013-02-20 11:38:15 UTC (rev 307) @@ -2,6 +2,6 @@ <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> + <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> \ No newline at end of file Modified: trunk/chorem-webmotion/src/main/webapp/js/chorem.js =================================================================== --- trunk/chorem-webmotion/src/main/webapp/js/chorem.js 2013-02-14 13:19:54 UTC (rev 306) +++ trunk/chorem-webmotion/src/main/webapp/js/chorem.js 2013-02-20 11:38:15 UTC (rev 307) @@ -21,13 +21,14 @@ * #L% */ -// tooltips utiliser pour le tableau budget, mais pas tres bien, car oblige -// de mettre hide a 1000. Le mieux serait d'avoir un tooltips (html) qui reste -// visible (et donc permet de cliquer sur les liens) si on va dessus' $(function() { - $('.withTooltip').tooltip({trigger: 'hover', delay: { show: 0, hide: 1000 }}); + $('.withTooltip').tooltip({html:true}); }); +$(function() { + $('.withPopover').popover({trigger: 'click', html:true}); +}); + $(function () { $.datepicker.setDefaults($.datepicker.regional['fr']); $.timepicker.setDefaults($.timepicker.regional['fr']);