Skip to content

Commit

Permalink
Fix javascript varible scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
martonmiklos committed May 8, 2024
1 parent a7e23c6 commit 4d112b7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/backend/InvenTree/templates/js/translated/stock.js
Original file line number Diff line number Diff line change
Expand Up @@ -3350,19 +3350,19 @@ function loadTestStatisticsTable(table, prefix, url, options, filters = {}) {
async: true,
success: function(data) {
const keys = ['passed', 'failed', 'total']
header = '';
rows = []
passed= '';
failed = '';
total = '';
let header = '';
let rows = []
let passed= '';
let failed = '';
let total = '';
$('.test-stat-result-cell').remove();
$.each(data[0], function(key, value){
if (key != "total") {
header += '<th class="test-stat-result-cell">' + key + '</th>';
keys.forEach(function(keyName) {
var tdText = '-';
if (value['total'] != '0' && value[keyName] != '0') {
percentage = ''
let percentage = ''
if (keyName != 'total' && value[total] != 0) {
percentage = ' (' + (100.0 * (parseFloat(value[keyName]) / parseFloat(value['total']))).toLocaleString(undefined, {minimumFractionDigits: 0, maximumFractionDigits: 2}) + '%)';
}
Expand Down

0 comments on commit 4d112b7

Please sign in to comment.