branch develop updated (7508a6b -> 794e95a)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository chorem. See http://git.chorem.org/chorem.git from 7508a6b fixes #1129: Migrates to git new e7845dd fixes #1135 : Took the same query than dashboard new 69fc48d fixes #1134 : remove list style replace wikitty ids with real values (async) new 794e95a fixes #1136 : change request to get invoice that target project and quotations on the project The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 794e95a775a49f54516f5f2e976d5ce0879d4280 Author: kootox <jean.couteau@gmail.com> Date: Sun Nov 9 15:53:34 2014 +0100 fixes #1136 : change request to get invoice that target project and quotations on the project commit 69fc48df5517f7cc0814eb5153ae59a92f7f8d43 Author: kootox <jean.couteau@gmail.com> Date: Sun Nov 9 15:24:21 2014 +0100 fixes #1134 : remove list style replace wikitty ids with real values (async) commit e7845ddc9cc277e5053a95111b9c40c44b01e741 Author: kootox <jean.couteau@gmail.com> Date: Fri Nov 7 13:56:51 2014 +0100 fixes #1135 : Took the same query than dashboard Summary of changes: .../financial/BillingPerProjectReportAction.java | 12 ++++---- .../actions/financial/BillingReportAction.java | 31 +++++++++++++++------ .../WEB-INF/jsp/salesReports/salesFunnel.jsp | 24 ++++++++-------- .../src/main/webapp/css/chorem-sales.css | 2 +- chorem-webmotion/src/main/webapp/js/salesFunnel.js | 32 ++++++++++++++++++++++ 5 files changed, 74 insertions(+), 27 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository chorem. See http://git.chorem.org/chorem.git commit e7845ddc9cc277e5053a95111b9c40c44b01e741 Author: kootox <jean.couteau@gmail.com> Date: Fri Nov 7 13:56:51 2014 +0100 fixes #1135 : Took the same query than dashboard --- .../actions/financial/BillingReportAction.java | 31 ++++++++++++++++------ 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/financial/BillingReportAction.java b/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/financial/BillingReportAction.java index af9faaa..3ec97fb 100644 --- a/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/financial/BillingReportAction.java +++ b/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/financial/BillingReportAction.java @@ -23,14 +23,18 @@ package org.chorem.webmotion.actions.financial; import org.apache.commons.lang3.time.DateUtils; import org.chorem.ChoremClient; +import org.chorem.ChoremQueryMaker; import org.chorem.entities.Accepted; import org.chorem.entities.FinancialTransaction; +import org.chorem.entities.Invoice; +import org.chorem.entities.InvoiceStatus; import org.chorem.webmotion.actions.sales.QuotationYearData; import org.chorem.webmotion.actions.sales.SalesReportHelper; import org.debux.webmotion.server.WebMotionController; import org.debux.webmotion.server.render.Render; import org.nuiton.util.DateUtil; import org.nuiton.wikitty.WikittyClient; +import org.nuiton.wikitty.entities.Element; import org.nuiton.wikitty.query.WikittyQuery; import org.nuiton.wikitty.query.WikittyQueryMaker; @@ -52,6 +56,8 @@ public class BillingReportAction extends WebMotionController { */ public Render billing(ChoremClient client, String from, String to) { + String companyId = client.getConfiguration().getDefaultCompany(); + if (null == from) { from = String.valueOf(BillingReportHelper.getFirstYear(client)); } @@ -75,11 +81,14 @@ public class BillingReportAction extends WebMotionController { QuotationYearData yearData = new QuotationYearData(); //factures de l'année - WikittyQuery billingQuery = new WikittyQueryMaker() - .select().sum("FinancialTransaction.amount").where().and() - .exteq(FinancialTransaction.EXT_FINANCIALTRANSACTION) + WikittyQuery billingQuery = new ChoremQueryMaker() + .select().sum(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_AMOUNT).where().and() + .exteq(Invoice.EXT_INVOICE) + .not().eq(Invoice.FQ_FIELD_INVOICE_STATUS, InvoiceStatus.CANCELED.name()) .bw(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_EMITTEDDATE, yearFirstDay, yearLastDay) - .end(); + .containsOne(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_BENEFICIARY) + .select(Element.ID).filterOnCompanyOrEmployee(companyId) + .end().setLimit(WikittyQuery.MAX); Integer billing = client.findByQuery(Integer.class, billingQuery); @@ -108,7 +117,9 @@ public class BillingReportAction extends WebMotionController { "toYear", to); } - protected Map<String,Integer> getBillingData(Integer year, WikittyClient client){ + protected Map<String,Integer> getBillingData(Integer year, ChoremClient client){ + + String companyId = client.getConfiguration().getDefaultCompany(); Date first = BillingReportHelper.getFirstDayOfYear(year); @@ -121,10 +132,14 @@ public class BillingReportAction extends WebMotionController { Date firstDayOfMonth = DateUtil.setFirstDayOfMonth(baseValue); baseValue= DateUtils.addDays(lastDayOfMonth, 1); - WikittyQuery monthQuery = new WikittyQueryMaker() - .select().sum("FinancialTransaction.amount").where().and() + WikittyQuery monthQuery = new ChoremQueryMaker() + .select().sum(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_AMOUNT).where().and() + .exteq(Invoice.EXT_INVOICE) + .not().eq(Invoice.FQ_FIELD_INVOICE_STATUS, InvoiceStatus.CANCELED.name()) .bw(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_EMITTEDDATE, firstDayOfMonth, lastDayOfMonth) - .end(); + .containsOne(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_BENEFICIARY) + .select(Element.ID).filterOnCompanyOrEmployee(companyId) + .end().setLimit(WikittyQuery.MAX); Integer billing = client.findByQuery(Integer.class, monthQuery); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository chorem. See http://git.chorem.org/chorem.git commit 69fc48df5517f7cc0814eb5153ae59a92f7f8d43 Author: kootox <jean.couteau@gmail.com> Date: Sun Nov 9 15:24:21 2014 +0100 fixes #1134 : remove list style replace wikitty ids with real values (async) --- .../WEB-INF/jsp/salesReports/salesFunnel.jsp | 24 ++++++++-------- .../src/main/webapp/css/chorem-sales.css | 2 +- chorem-webmotion/src/main/webapp/js/salesFunnel.js | 32 ++++++++++++++++++++++ 3 files changed, 45 insertions(+), 13 deletions(-) diff --git a/chorem-webmotion/src/main/webapp/WEB-INF/jsp/salesReports/salesFunnel.jsp b/chorem-webmotion/src/main/webapp/WEB-INF/jsp/salesReports/salesFunnel.jsp index 2614a76..811ecb7 100644 --- a/chorem-webmotion/src/main/webapp/WEB-INF/jsp/salesReports/salesFunnel.jsp +++ b/chorem-webmotion/src/main/webapp/WEB-INF/jsp/salesReports/salesFunnel.jsp @@ -55,14 +55,14 @@ <li ng-repeat="lead in leads" class="salesFunnelItem"> <div class="pull-left"> <a href="../wikitty/edit/{{lead.meta.id}}"/> - <i class="icon-edit"></i> + <i class="glyphicon glyphicon-edit"></i> </a> <small> - <a href="/wikitty/Employee/view/{{lead.getField('Quotation', 'customer')}}">{{lead.getField('Quotation','customer')}}</a> + <a href="../wikitty/Employee/view/{{lead.getField('Quotation', 'customer')}}">{{dependencies[dependencies[lead.getField('Quotation','customer')].getField('Employee','company')].getField('Company','name')}}</a> </small> <p> <span class="salesFunnelItemTitle"> - <a class="name-link" href="/wikitty/Project/view/{{lead.getField('Quotation','project')}}"/>{{lead.getField('Quotation','projet')}}</a> + <a class="name-link" href="../wikitty/Project/view/{{lead.getField('Quotation','project')}}"/>{{dependencies[lead.getField('Quotation','project')].getField('Project','name')}}</a> </span> - <small>{{lead.getField('Quotation','description')}}</small> </p> </div> @@ -70,7 +70,7 @@ <a class="btn btn-warning pull-right" ng-click="cancel(lead)">Annuler</a> <div class="pull-right"> <p class="salesFunnelItemTitle">{{lead.getField('Quotation','amount')}} €</p> - <small>{{lead.getField('Quotation','category')}} - {{lead.getField('Quotation','estimatedDays')}}j - {{lead.getField('Quotation','conversionHope')}} %</small> + <small>{{dependencies[lead.getField('Quotation','category')].getField('WikittyTreeNode','name')}} - {{lead.getField('Quotation','estimatedDays')}}j - {{lead.getField('Quotation','conversionHope')}} %</small> </div> <div style="clear:both;"/> </li> @@ -83,11 +83,11 @@ <ul class="unstyled drafts"> <li ng-repeat="draft in drafts" class="salesFunnelItem"> <div class="pull-left"> - <a href="../wikitty/edit/{{draft.meta.id}}"/><i class="icon-edit"></i></a> - <small><a href="/wikitty/Employee/view/{{draft.getField('Quotation', 'customer')}}">{{draft.getField('Quotation','customer')}}</a><span ng-hide="!draft.getField('Draft','sendingDate')"> - Deadline:{{draft.getField('Draft','sendingDate') | date:'dd/MM/yyyy'}}</span></small> + <a href="../wikitty/edit/{{draft.meta.id}}"/><i class="glyphicon glyphicon-edit"></i></a> + <small><a href="../wikitty/Employee/view/{{draft.getField('Quotation', 'customer')}}">{{dependencies[dependencies[draft.getField('Quotation','customer')].getField('Employee','company')].getField('Company','name')}}</a><span ng-hide="!draft.getField('Draft','sendingDate')"> - Deadline:{{draft.getField('Draft','sendingDate') | date:'dd/MM/yyyy'}}</span></small> <p> <span class="salesFunnelItemTitle"> - <a class="name-link" href="/wikitty/Project/view/{{draft.getField('Quotation','project')}}"/>{{draft.getField('Quotation','projet')}}</a> + <a class="name-link" href="../wikitty/Project/view/{{draft.getField('Quotation','project')}}"/>{{dependencies[draft.getField('Quotation','project')].getField('Project','name')}}</a> </span> - <small>{{draft.getField('Quotation','description')}}</small> </p> </div> @@ -95,7 +95,7 @@ <a class="btn btn-warning pull-right" ng-click="cancel(draft)">Annuler</a> <div class="pull-right"> <p class="salesFunnelItemTitle">{{draft.getField('Quotation','amount')}} €</p> - <small>{{draft.getField('Quotation','category')}} - {{draft.getField('Quotation','estimatedDays')}}j - {{draft.getField('Quotation','conversionHope')}} %</small> + <small>{{dependencies[draft.getField('Quotation','category')].getField('WikittyTreeNode','name')}} - {{draft.getField('Quotation','estimatedDays')}}j - {{draft.getField('Quotation','conversionHope')}} %</small> </div> <div style="clear:both;"/> </li> @@ -108,11 +108,11 @@ <ul class="unstyled sents"> <li ng-repeat="sent in sents" class="salesFunnelItem"> <div class="pull-left"> - <a href="../wikitty/edit/{{sent.meta.id}}"/><i class="icon-edit"></i></a> - <small><a href="/wikitty/Employee/view/{{sent.getField('Quotation', 'customer')}}">{{sent.getField('Quotation','customer')}}</a><span ng-hide="!sent.getField('Sent','postedDate')"> - Répondu le:{{sent.getField('Sent','postedDate') | date:'dd/MM/yyyy'}}</span></a></small> + <a href="../wikitty/edit/{{sent.meta.id}}"/><i class="glyphicon glyphicon-edit"></i></a> + <small><a href="../wikitty/Employee/view/{{sent.getField('Quotation', 'customer')}}">{{dependencies[dependencies[sent.getField('Quotation','customer')].getField('Employee','company')].getField('Company','name')}}</a><span ng-hide="!sent.getField('Sent','postedDate')"> - Répondu le:{{sent.getField('Sent','postedDate') | date:'dd/MM/yyyy'}}</span></a></small> <p> <span> - <a class="name-link" href="/wikitty/Project/view/{{sent.getField('Quotation','project')}}"/>{{sent.getField('Quotation','projet')}}</a> + <a class="name-link" href="../wikitty/Project/view/{{sent.getField('Quotation','project')}}"/>{{dependencies[sent.getField('Quotation','project')].getField('Project','name')}}</a> </span> - <small>{{sent.getField('Quotation','description')}}</small> </p> </div> @@ -121,7 +121,7 @@ <a class="btn btn-warning pull-right" ng-click="cancel(sent)">Annuler</a> <div class="pull-right"> <p class="salesFunnelItemTitle">{{sent.getField('Quotation','amount')}} €</p> - <small>{{sent.getField('Quotation','category')}} - {{sent.getField('Quotation','estimatedDays')}}j - {{sent.getField('Quotation','conversionHope')}} %</small> + <small>{{dependencies[sent.getField('Quotation','category')].getField('WikittyTreeNode','name')}} - {{sent.getField('Quotation','estimatedDays')}}j - {{sent.getField('Quotation','conversionHope')}} %</small> </div> <div style="clear:both;"/> </li> diff --git a/chorem-webmotion/src/main/webapp/css/chorem-sales.css b/chorem-webmotion/src/main/webapp/css/chorem-sales.css index c30cea0..f672ceb 100644 --- a/chorem-webmotion/src/main/webapp/css/chorem-sales.css +++ b/chorem-webmotion/src/main/webapp/css/chorem-sales.css @@ -26,7 +26,7 @@ margin-bottom: 10px; min-height: 20px; padding: 5px; - list-style-type:none; + list-style:none; } .salesFunnelItemTitle{ diff --git a/chorem-webmotion/src/main/webapp/js/salesFunnel.js b/chorem-webmotion/src/main/webapp/js/salesFunnel.js index fbd848e..6a2ae71 100644 --- a/chorem-webmotion/src/main/webapp/js/salesFunnel.js +++ b/chorem-webmotion/src/main/webapp/js/salesFunnel.js @@ -39,6 +39,7 @@ salesFunnel.directive('datepicker', function() { }); + var salesFunnelController = ['$scope', '$modal', 'Wikitty', function ($scope, $modal, Wikitty) { $scope.wikittyId = ''; $scope.wikitty = {}; @@ -52,17 +53,48 @@ var salesFunnelController = ['$scope', '$modal', 'Wikitty', function ($scope, $m $scope.sents={}; $scope.sentsAmount=0; $scope.sentsAmountHope=0; + $scope.dependencies={}; + $scope.customerCompanyId=0; + + var getDependencies = function(w){ + for (var i in w) + { + if (i != "$promise" && i != "$resolved" && i != "length") { + var categoryId = w[i].getField('Quotation','category'); + Wikitty.get(categoryId, function(cat){ + $scope.dependencies[categoryId]=cat; + }); + + var customerId = w[i].getField('Quotation','customer'); + Wikitty.get(customerId, function(cust){ + $scope.dependencies[customerId]=cust; + var customerCompanyId = cust.getField('Employee','company'); + Wikitty.get(customerCompanyId, function(comp){ + $scope.dependencies[customerCompanyId]=comp; + }); + }); + + var projectId = w[i].getField('Quotation','project'); + Wikitty.get(projectId, function(project){ + $scope.dependencies[projectId]=project; + }); + } + } + } Wikitty.query("extension = Quotation AND extension != Draft AND extension != Cancelled", function(w) { $scope.leads= w; + getDependencies(w); }); Wikitty.query("extension = Draft AND extension != Sent AND extension != Cancelled", function(w) { $scope.drafts= w; + getDependencies(w); }); Wikitty.query("extension = Sent AND extension != Accepted AND extension != Rejected AND extension != Cancelled", function(w) { $scope.sents= w; + getDependencies(w); }); $scope.leadToDraft = function(lead){ -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository chorem. See http://git.chorem.org/chorem.git commit 794e95a775a49f54516f5f2e976d5ce0879d4280 Author: kootox <jean.couteau@gmail.com> Date: Sun Nov 9 15:53:34 2014 +0100 fixes #1136 : change request to get invoice that target project and quotations on the project --- .../actions/financial/BillingPerProjectReportAction.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/financial/BillingPerProjectReportAction.java b/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/financial/BillingPerProjectReportAction.java index 39d35e2..49a0f78 100644 --- a/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/financial/BillingPerProjectReportAction.java +++ b/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/financial/BillingPerProjectReportAction.java @@ -22,15 +22,13 @@ package org.chorem.webmotion.actions.financial; */ import org.chorem.ChoremClient; -import org.chorem.entities.Accepted; -import org.chorem.entities.FinancialTransaction; -import org.chorem.entities.Project; -import org.chorem.entities.Quotation; +import org.chorem.entities.*; import org.chorem.webmotion.actions.sales.SalesData; import org.chorem.webmotion.actions.sales.SalesReportHelper; import org.debux.webmotion.server.WebMotionController; import org.debux.webmotion.server.render.Render; import org.nuiton.wikitty.WikittyClient; +import org.nuiton.wikitty.entities.Element; import org.nuiton.wikitty.query.WikittyQuery; import org.nuiton.wikitty.query.WikittyQueryMaker; @@ -93,16 +91,18 @@ public class BillingPerProjectReportAction extends WebMotionController { WikittyQuery projectQuery = new WikittyQueryMaker() .select().sum("FinancialTransaction.amount").where().and() - .eq(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_TARGET, project) .bw(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_EMITTEDDATE, first, last) + .containsOne(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_TARGET) + .select(Element.ID).or().ideq(project).eq(Quotation.ELEMENT_FIELD_QUOTATION_PROJECT, project).close() .end(); Integer sales = client.findByQuery(Integer.class, projectQuery); //TODO JC 2012-01-22 Find a way to replace two queries into one. WikittyQuery transactionsQuery = new WikittyQueryMaker().and() - .eq(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_TARGET, project) .bw(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_EMITTEDDATE, first, last) + .containsOne(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_TARGET) + .select(Element.ID).or().ideq(project).eq(Quotation.ELEMENT_FIELD_QUOTATION_PROJECT, project).close() .end(); List<FinancialTransaction> transactions = client.findAllByQuery(FinancialTransaction.class, -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm