b374k
m1n1 1.01
Apache/2.4.41 (Ubuntu)
Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64
uid=33(www-data) gid=33(www-data) groups=33(www-data)
server ip : 62.171.164.128 | your ip : 127.0.0.1
safemode OFF
 >  / home / Mirasvit / Report / view / adminhtml / web / js / grid / columns /
Filename/home/Mirasvit/Report/view/adminhtml/web/js/grid/columns/number.js
Size1.03 kb
Permissionrw-r--r--
Ownerroot : root
Create time01-Jul-2024 20:52
Last modified06-Apr-2021 18:06
Last accessed23-Aug-2025 19:44
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
define([
'Mirasvit_Report/js/grid/columns/column'
], function (Column) {
'use strict';

return Column.extend({
defaults: {
bodyTmpl: 'report/grid/cells/number',

imports: {
totals: '${ $.provider }:data.totals'
}
},

getPercent: function (row) {
var total = 0;
if (this.totals.length) {
total = this.totals[0][this.index + '_orig'];
}

if (total === 0 || total === undefined || total === '' || total === null) {
return false;
}

var value = row[this.index + '_orig'];
var result = false;

if (this.valueType === 'percent') {
result = ((value / 100) * 100).toFixed(1);
} else if (this.valueType === 'money' || this.valueType === 'number') {
result = ((value / total) * 100).toFixed(1);
}

return result;
}
});
});