Author: jcouteau Date: 2013-03-27 10:14:42 +0100 (Wed, 27 Mar 2013) New Revision: 335 Url: http://chorem.org/projects/chorem/repository/revisions/335 Log: refs #862 : Add pipeline value in funnel Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/salesReports/salesFunnel.jsp trunk/chorem-webmotion/src/main/webapp/js/chorem.js Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/salesReports/salesFunnel.jsp =================================================================== --- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/salesReports/salesFunnel.jsp 2013-03-23 00:23:19 UTC (rev 334) +++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/salesReports/salesFunnel.jsp 2013-03-27 09:14:42 UTC (rev 335) @@ -48,6 +48,7 @@ <!-- LEADS TAB --> <div class="tab-pane active" id="lead"> + <h4> Total : ${leadAmount}€ - Total espéré : ${leadAmountHope}€</h4> <ul class="unstyled leads"> <c:forEach var="q" items="${leads}"> <li class="salesFunnelItem"> @@ -88,6 +89,7 @@ <!-- DRAFT TAB --> <div class="tab-pane" id="draft"> + <h4>Total : <span id="draftAmount">${draftAmount}</span>€ - Total espéré : <span id="draftAmountHope">${draftAmountHope}</span>€</h4> <ul class="unstyled drafts"> <c:forEach var="q" items="${drafts}"> <li class="salesFunnelItem draft"> @@ -109,6 +111,7 @@ <!-- SENT TAB --> <div class="tab-pane" id="sent"> + <h4> Total : <span id="sentAmount">${sentAmount}</span>€ - Total espéré : <span id="sentAmountHope">${sentAmountHope}</span>€</h4> <ul class="unstyled sents"> <c:forEach var="q" items="${sents}"> <li class="salesFunnelItem sent"> Modified: trunk/chorem-webmotion/src/main/webapp/js/chorem.js =================================================================== --- trunk/chorem-webmotion/src/main/webapp/js/chorem.js 2013-03-23 00:23:19 UTC (rev 334) +++ trunk/chorem-webmotion/src/main/webapp/js/chorem.js 2013-03-27 09:14:42 UTC (rev 335) @@ -305,6 +305,19 @@ drafts.append(li); oldQuotation.slideUp(); + //update draftAmount and draftAmountHope + var draftAmount = parseInt($("#draftAmount").text()) + wikitty["Quotation.amount"]; + var amountHope = wikitty["Quotation.amount"]*wikitty["Quotation.conversionHope"]/100; + var draftAmountHope = parseInt($("#draftAmountHope").text()) + amountHope; + $("#draftAmount").text(draftAmount); + $("#draftAmountHope").text(draftAmountHope); + + //update leadAmount and leadAmountHope + var leadAmount = parseInt($("#leadAmount").text()) - wikitty["Quotation.amount"]; + var leadAmountHope = parseInt($("#leadAmountHope").text()) - amountHope; + $("#leadAmount").text(leadAmount); + $("#leadAmountHope").text(leadAmountHope); + }).fail(function(){ //fail //TODO JC20130212 retour utilisateur @@ -394,6 +407,19 @@ sents.append(li); oldQuotation.slideUp(); + //update draftAmount and draftAmountHope + var draftAmount = parseInt($("#draftAmount").text()) - wikitty["Quotation.amount"]; + var amountHope = wikitty["Quotation.amount"]*wikitty["Quotation.conversionHope"]/100; + var draftAmountHope = parseInt($("#draftAmountHope").text()) - amountHope; + $("#draftAmount").text(draftAmount); + $("#draftAmountHope").text(draftAmountHope); + + //update sentAmount and sentAmountHope + var sentAmount = parseInt($("#sentAmount").text()) + wikitty["Quotation.amount"]; + var sentAmountHope = parseInt($("#sentAmountHope").text()) + amountHope; + $("#sentAmount").text(sentAmount); + $("#sentAmountHope").text(sentAmountHope); + }).fail(function(){ //fail //TODO JC20130212 retour utilisateur @@ -404,9 +430,18 @@ var id = $(this).attr('wikittyId'); var oldQuotation = $(this).parent(); $.get(createUrl("/sales/funnel/json/reject/", id), - function(){ + function(data){ //success oldQuotation.slideUp(); + + var wikitty = data.data; + + //update sentAmount and sentAmountHope + var sentAmount = parseInt($("#sentAmount").text()) - wikitty["Quotation.amount"]; + var amountHope = wikitty["Quotation.amount"]*wikitty["Quotation.conversionHope"]/100; + var sentAmountHope = parseInt($("#sentAmountHope").text()) - amountHope; + $("#sentAmount").text(sentAmount); + $("#sentAmountHope").text(sentAmountHope); }).fail(function(){ //fail //TODO JC20130212 retour utilisateur @@ -417,9 +452,18 @@ var id = $(this).attr('wikittyId'); var oldQuotation = $(this).parent(); $.get(createUrl("/sales/funnel/json/accept/", id), - function(){ + function(data){ //success oldQuotation.slideUp(); + + var wikitty = data.data; + + //update sentAmount and sentAmountHope + var sentAmount = parseInt($("#sentAmount").text()) - wikitty["Quotation.amount"]; + var amountHope = wikitty["Quotation.amount"]*wikitty["Quotation.conversionHope"]/100; + var sentAmountHope = parseInt($("#sentAmountHope").text()) - amountHope; + $("#sentAmount").text(sentAmount); + $("#sentAmountHope").text(sentAmountHope); }).fail(function(){ //fail //TODO JC20130212 retour utilisateur
participants (1)
-
jcouteau@users.chorem.org