Skip to content

Commit a908de6

Browse files
committed
Remove costs for reports customized counters type 3
1 parent 12fa829 commit a908de6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

www/app/report/CounterReport.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<div ng-if="::$ctrl.isMonthView" style="margin-bottom: 12px">
88
<div>{{:: 'Total Usage' | translate }}: {{:: $ctrl.data.usage.toFixed(3) }} {{:: $ctrl.unit}}</div>
9-
<div>{{:: 'Monthly Cost' | translate }}: {{:: $ctrl.data.cost.toFixed(2) }}</div>
9+
<div ng-if="::($ctrl.device.SwitchTypeVal != 3)">{{:: 'Monthly Cost' | translate }}: {{:: $ctrl.data.cost.toFixed(2) }}</div>
1010
</div>
1111

1212
<div ng-if="::$ctrl.noDataAvailable" class="no-data">

www/app/report/CounterReport.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ define(['app', 'report/helpers'], function (app, reportHelpers) {
213213

214214
columns.push({ title: $.t('Usage'), data: 'usage', render: counterRenderer });
215215

216-
if (!['Counter Incremental'].includes(vm.device.SubType))
216+
if (!['Counter Incremental'].includes(vm.device.SubType) && (vm.device.SwitchTypeVal != 3))
217217
columns.push({ title: $.t('Costs'), data: 'cost', render: costRenderer });
218218

219219
columns.push({
@@ -240,9 +240,13 @@ define(['app', 'report/helpers'], function (app, reportHelpers) {
240240
function showUsageChart(data) {
241241
var chartElement = $element.find('#usagegraph');
242242
var series = [];
243+
var valueQuantity = "Count";
244+
if (typeof vm.device.ValueQuantity != 'undefined') {
245+
valueQuantity = vm.device.ValueQuantity;
246+
}
243247

244248
var chartName = vm.device.SwitchTypeVal === 4 ? 'Generated' : 'Usage';
245-
var yAxisName = ['Energy', 'Gas', 'Water', 'Water', 'Energy'][vm.device.SwitchTypeVal];
249+
var yAxisName = ['Energy', 'Gas', 'Water', valueQuantity, 'Energy'][vm.device.SwitchTypeVal];
246250

247251
series.push({
248252
name: $.t(chartName),

0 commit comments

Comments
 (0)