r394 - in trunk/chorem-webmotion/src/main: java/org/chorem/webmotion/actions webapp/WEB-INF/jsp
Author: jcouteau Date: 2013-12-17 11:55:59 +0100 (Tue, 17 Dec 2013) New Revision: 394 Url: http://chorem.org/projects/chorem/repository/revisions/394 Log: Fixes #951 : Ajouter le CA TTC sur la page d'accueil Fixes #952 : Ajouter les ?\195?\169volutions sur la page d'accueil Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/DashboardAction.java trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardSummary.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 2013-09-20 17:25:15 UTC (rev 393) +++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/DashboardAction.java 2013-12-17 10:55:59 UTC (rev 394) @@ -403,40 +403,92 @@ .isNull(Interval.FQ_FIELD_INTERVAL_ENDDATE) .end().setLimit(0); - WikittyQueryResult<Double>[] invoices = - client.findAllByQuery(Double.class, - invoiceDebtQuery, invoiceIncomeQuery); + WikittyQueryResult<Double>[] invoices = + client.findAllByQuery(Double.class, + invoiceDebtQuery, invoiceIncomeQuery); - WikittyQueryResult<String> touchs = - client.findAllByQuery(touchQuery); + WikittyQueryResult<String> touchs = + client.findAllByQuery(touchQuery); - // nombre de facture - int invoiceDebtNb = invoices[0].getTotalResult(); - // montant total de toutes les factures - double invoiceDebt = invoices[0].peek(); + // nombre de facture + int invoiceDebtNb = invoices[0].getTotalResult(); + // montant total de toutes les factures + double invoiceDebt = invoices[0].peek(); - // nombre de facture - int invoiceIncomeNb = invoices[1].getTotalResult(); - // montant total de toutes les factures - double invoiceIncome = invoices[1].peek(); + // nombre de facture + int invoiceIncomeNb = invoices[1].getTotalResult(); + // montant total de toutes les factures + double invoiceIncome = invoices[1].peek(); - int touchNb = touchs.getTotalResult(); + int touchNb = touchs.getTotalResult(); - String touchQueryString = touchQuery.getCondition().toString(); + //CA HT + double income = Double.valueOf(annualDebtIncome.get("incomes").toString()) + + Double.valueOf(annualDebtIncome.get("extraIncomes").toString()); - return renderView("dashboardSummary.jsp", - "date", now, - "now", "\"" + WikittyUtil.toString(now) + "\"", //DateFormatUtils.format(now, solRDateFormat), - "inOneWeek", DateFormatUtils.format(inOneWeek, summaryDateFormat), - "invoiceDebtNb", invoiceDebtNb, - "invoiceDebt", invoiceDebt, - "invoiceIncomeNb", invoiceIncomeNb, - "invoiceIncome", invoiceIncome, - "annualDebtIncome", annualDebtIncome, - "pastAnnualDebtIncome", pastAnnualDebtIncome, - "touchNb", touchNb, - "touchQueryString", touchQueryString - ); + //CA HT année précédente + double pastIncome = Double.valueOf(pastAnnualDebtIncome.get("incomes").toString()) + + Double.valueOf(pastAnnualDebtIncome.get("extraIncomes").toString()); + + //Evolution du CA HT + double incomeEvolution = (income-pastIncome)/pastIncome; + + //CA TTC + double incomeTTC = Double.valueOf(annualDebtIncome.get("incomesTTC").toString()) + + Double.valueOf(annualDebtIncome.get("extraIncomesTTC").toString()); + + //CA TTC année précédente + double pastIncomeTTC = Double.valueOf(pastAnnualDebtIncome.get("incomesTTC").toString()) + + Double.valueOf(pastAnnualDebtIncome.get("extraIncomesTTC").toString()); + + //Evolution du CA TTC + double incomeTTCEvolution = (incomeTTC-pastIncomeTTC)/pastIncomeTTC; + + //dépenses TTC + double debtsTTC = Double.valueOf(annualDebtIncome.get("debtsTTC").toString()); + + //dépenses TTC année précédente + double pastDebtsTTC = Double.valueOf(pastAnnualDebtIncome.get("debtsTTC").toString()); + + //Evolution des dépenses TTC + double debtsTTCEvolution = (debtsTTC-pastDebtsTTC)/pastDebtsTTC; + + //profitTTC + double profitTTC = incomeTTC - debtsTTC; + + //profit TTC année précédente + double pastProfitTTC = pastIncomeTTC - pastDebtsTTC; + + //Evolution profit TTC + double profitTTCEvolution = (profitTTC - pastProfitTTC) / pastProfitTTC; + + String touchQueryString = touchQuery.getCondition().toString(); + + return renderView("dashboardSummary.jsp", + "date", now, + "now", "\"" + WikittyUtil.toString(now) + "\"", //DateFormatUtils.format(now, solRDateFormat), + "inOneWeek", DateFormatUtils.format(inOneWeek, summaryDateFormat), + "invoiceDebtNb", invoiceDebtNb, + "invoiceDebt", invoiceDebt, + "invoiceIncomeNb", invoiceIncomeNb, + "invoiceIncome", invoiceIncome, + "annualDebtIncome", annualDebtIncome, + "pastAnnualDebtIncome", pastAnnualDebtIncome, + "income", income, + "pastIncome", pastIncome, + "incomeEvolution", incomeEvolution, + "incomeTTC", incomeTTC, + "pastIncomeTTC", pastIncomeTTC, + "incomeTTCEvolution", incomeTTCEvolution, + "debtsTTC", debtsTTC, + "pastDebtsTTC", pastDebtsTTC, + "debtsTTCEvolution", debtsTTCEvolution, + "profitTTC", profitTTC, + "pastProfitTTC", pastProfitTTC, + "profitTTCEvolution", profitTTCEvolution, + "touchNb", touchNb, + "touchQueryString", touchQueryString + ); } //////////////////////////////////////////////////////////////////////////// Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardSummary.jsp =================================================================== --- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardSummary.jsp 2013-09-20 17:25:15 UTC (rev 393) +++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardSummary.jsp 2013-12-17 10:55:59 UTC (rev 394) @@ -52,28 +52,42 @@ <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="${annualDebtIncome.get('incomes') + annualDebtIncome.get('extraIncomes')}"/> + <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="${pastAnnualDebtIncome.get('incomes') + pastAnnualDebtIncome.get('extraIncomes')}"/> + <f:formatNumber type="currency" value="${pastIncome}"/> </a> - </strong>) + </strong> - Évolution : <f:formatNumber type="percent" value="${incomeEvolution}"/> + </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> <li>Dépenses TTC: <strong> <a href='<c:url value="/wikitty/search?query=${annualDebtIncome.get('debtsQuery')} %23limit=2147483647"/>'> - <f:formatNumber type="currency" value="${annualDebtIncome.get('debtsTTC')}"/> + <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="${pastAnnualDebtIncome.get('debtsTTC')}"/> + <f:formatNumber type="currency" value="${pastDebtsTTC}"/> </a> - </strong>) + </strong>) - Évolution : <f:formatNumber type="percent" value="${debtsTTCEvolution}"/> + </li> <li>Bénéfice/perte: - <strong><f:formatNumber type="currency" value="${annualDebtIncome.get('incomesTTC') + annualDebtIncome.get('extraIncomesTTC') - annualDebtIncome.get('debtsTTC')}"/></strong> - (N-1: <strong><f:formatNumber type="currency" value="${pastAnnualDebtIncome.get('incomesTTC') + pastAnnualDebtIncome.get('extraIncomesTTC') - pastAnnualDebtIncome.get('debtsTTC')}"/></strong>) + <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}"/> </ul> </div> </div>
participants (1)
-
jcouteau@users.chorem.org