| Line 1... |
Line -... |
| 1 |
|
- |
|
| 2 |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
1 |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
| 3 |
|
2 |
|
| 4 |
|
3 |
|
| 5 |
<!-- Chart.js Datalabels plugin for v2 -->
|
4 |
<!-- Chart.js Datalabels plugin for v2 -->
|
| 6 |
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@0.7.0"></script>
|
5 |
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@0.7.0"></script>
|
| Line 17... |
Line 16... |
| 17 |
<h4><strong>Investometer</strong></h4>
|
16 |
<h4><strong>Investometer</strong></h4>
|
| 18 |
<canvas id="investometerGauge"></canvas>
|
17 |
<canvas id="investometerGauge"></canvas>
|
| 19 |
</div>
|
18 |
</div>
|
| 20 |
|
19 |
|
| 21 |
|
20 |
|
| 22 |
|
- |
|
| 23 |
<div class="col-lg-5">
|
21 |
<div class="col-lg-5">
|
| 24 |
<h4 style="margin-bottom:24px " ><strong>Banner for Shopfront</strong></h4>
|
22 |
<h4 style="margin-bottom:24px "><strong>Banner for Shopfront</strong></h4>
|
| 25 |
<div class="form-group">
|
23 |
<div class="form-group">
|
| 26 |
#if(!$printResources.isEmpty())
|
24 |
#if(!$printResources.isEmpty())
|
| 27 |
<div id="myCarousel" class="carousel slide" data-ride="carousel" style="margin-top: 50px">
|
25 |
<div id="myCarousel" class="carousel slide" data-ride="carousel" style="margin-top: 50px">
|
| 28 |
<!-- Wrapper for slides -->
|
26 |
<!-- Wrapper for slides -->
|
| 29 |
<div class="carousel-inner text-center">
|
27 |
<div class="carousel-inner text-center">
|
| Line 75... |
Line 73... |
| 75 |
let cutOfPercent = $investments.get('cutOf');
|
73 |
let cutOfPercent = $investments.get('cutOf');
|
| 76 |
let minimumInvestmentParcent = $investments.get('minInvestment');
|
74 |
let minimumInvestmentParcent = $investments.get('minInvestment');
|
| 77 |
|
75 |
|
| 78 |
let agreedInvestment =$investments.get('minimumInvestment');
|
76 |
let agreedInvestment =$investments.get('minimumInvestment');
|
| 79 |
let currentInvestment =$investments.get('totalInvestment');
|
77 |
let currentInvestment =$investments.get('totalInvestment');
|
| 80 |
let billBlockPercentAmt = ((agreedInvestment*cutOfPercent)/100).toFixed(2);
|
78 |
let billBlockPercentAmt = ((agreedInvestment * cutOfPercent) / 100).toFixed(2);
|
| 81 |
let maintainPercentAmt= ((agreedInvestment*minimumInvestmentParcent)/100).toFixed(2);
|
79 |
let maintainPercentAmt = ((agreedInvestment * minimumInvestmentParcent) / 100).toFixed(2);
|
| 82 |
|
80 |
|
| 83 |
var percentForNeedle=0.00;
|
81 |
var percentForNeedle = 0.00;
|
| 84 |
|
82 |
|
| 85 |
if(currentInvestment>agreedInvestment){
|
83 |
if (currentInvestment > agreedInvestment) {
|
| 86 |
percentForNeedle = 98;
|
84 |
percentForNeedle = 98;
|
| 87 |
}else{
|
85 |
} else {
|
| 88 |
percentForNeedle = ((currentInvestment / agreedInvestment) * 100).toFixed(2)
|
86 |
percentForNeedle = ((currentInvestment / agreedInvestment) * 100).toFixed(2)
|
| 89 |
}
|
87 |
}
|
| 90 |
const percent = ((currentInvestment / agreedInvestment) * 100).toFixed(2);
|
88 |
const percent = ((currentInvestment / agreedInvestment) * 100).toFixed(2);
|
| 91 |
console.log("percentForNeedle - ",percentForNeedle)
|
89 |
console.log("percentForNeedle - ", percentForNeedle)
|
| 92 |
console.log("percent - ",percent)
|
90 |
console.log("percent - ", percent)
|
| 93 |
|
91 |
|
| 94 |
|
92 |
|
| 95 |
let billBlockPercentAmtFormmated=formatIndianNumber(billBlockPercentAmt);
|
93 |
let billBlockPercentAmtFormmated = formatIndianNumber(billBlockPercentAmt);
|
| 96 |
let agreedInvestmentFormmated=formatIndianNumber(agreedInvestment);
|
94 |
let agreedInvestmentFormmated = formatIndianNumber(agreedInvestment);
|
| 97 |
let currentInvestmentFormmated=formatIndianNumber(currentInvestment);
|
95 |
let currentInvestmentFormmated = formatIndianNumber(currentInvestment);
|
| 98 |
let maintainPercentAmtFormmated=formatIndianNumber(maintainPercentAmt);
|
96 |
let maintainPercentAmtFormmated = formatIndianNumber(maintainPercentAmt);
|
| 99 |
const ctx = document.getElementById("investometerGauge").getContext("2d");
|
97 |
const ctx = document.getElementById("investometerGauge").getContext("2d");
|
| 100 |
let labels = [];
|
98 |
let labels = [];
|
| 101 |
let data = [];
|
99 |
let data = [];
|
| 102 |
let colors = [];
|
100 |
let colors = [];
|
| 103 |
|
101 |
|
| 104 |
if (isInvestmentOk) {
|
102 |
if (isInvestmentOk) {
|
| 105 |
if(partnerType=="BRONZE"){
|
103 |
if (partnerType == "BRONZE") {
|
| 106 |
// One segments: Investment OK bcoz of Partner type BRONZE
|
104 |
// One segments: Investment OK bcoz of Partner type BRONZE
|
| 107 |
labels = [
|
105 |
labels = [
|
| 108 |
`Investment OK (${currentInvestmentFormmated})+`
|
106 |
`Investment OK (${currentInvestmentFormmated})+`
|
| 109 |
];
|
107 |
];
|
| 110 |
data = [100];
|
108 |
data = [100];
|
| 111 |
colors = ["green"];
|
109 |
colors = ["green"];
|
| 112 |
}else{
|
110 |
} else {
|
| 113 |
// Three segments: Billing Blocked, Increase Investment, Investment OK
|
111 |
// Three segments: Billing Blocked, Increase Investment, Investment OK
|
| 114 |
labels = [
|
112 |
labels = [
|
| 115 |
`70% of Agreed Investment(Billing Block) (${billBlockPercentAmtFormmated})`,
|
113 |
`70% of Agreed Investment(Billing Block) (${billBlockPercentAmtFormmated})`,
|
| 116 |
`75% of Agreed Investment(Increase Investment) (${maintainPercentAmtFormmated})`,
|
114 |
`75% of Agreed Investment(Increase Investment) (${maintainPercentAmtFormmated})`,
|
| 117 |
`Investment OK (${maintainPercentAmtFormmated})+`
|
115 |
`Investment OK (${maintainPercentAmtFormmated})+`
|
| Line 148... |
Line 146... |
| 148 |
circumference: Math.PI,
|
146 |
circumference: Math.PI,
|
| 149 |
title: {
|
147 |
title: {
|
| 150 |
display: true,
|
148 |
display: true,
|
| 151 |
text: `Current Invested Value: Rs.${currentInvestment.toLocaleString('en-IN')}(${percent}%)`
|
149 |
text: `Current Invested Value: Rs.${currentInvestment.toLocaleString('en-IN')}(${percent}%)`
|
| 152 |
},
|
150 |
},
|
| 153 |
tooltips: { enabled: true },
|
151 |
tooltips: {enabled: true},
|
| 154 |
animation: {
|
152 |
animation: {
|
| 155 |
animateRotate: true,
|
153 |
animateRotate: true,
|
| 156 |
animateScale: false
|
154 |
animateScale: false
|
| 157 |
},
|
155 |
},
|
| 158 |
plugins: {
|
156 |
plugins: {
|
| Line 195... |
Line 193... |
| 195 |
|
193 |
|
| 196 |
ctx.restore();
|
194 |
ctx.restore();
|
| 197 |
},
|
195 |
},
|
| 198 |
datalabels: {
|
196 |
datalabels: {
|
| 199 |
display: true,
|
197 |
display: true,
|
| 200 |
formatter: function(value, context) {
|
198 |
formatter: function (value, context) {
|
| 201 |
const label = context.chart.data.labels[context.dataIndex];
|
199 |
const label = context.chart.data.labels[context.dataIndex];
|
| 202 |
|
200 |
|
| 203 |
if (label.includes("Billing Block")) {
|
201 |
if (label.includes("Billing Block")) {
|
| 204 |
return `₹${currentInvestment.toLocaleString('en-IN')}`;
|
202 |
return `₹${currentInvestment.toLocaleString('en-IN')}`;
|
| 205 |
}
|
203 |
}
|