fixed detailed value missing issue in SpaceEfficiency report in Web UI
Merge branch 'develop'pull/41/head
commit
64eac25c46
|
@ -218,7 +218,7 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = round(reporting_period_data['cumulations'][i], 2) \
|
||||
if reporting_period_data['cumulations'][i] is not None else 0
|
||||
if reporting_period_data['cumulations'][i] is not None else None
|
||||
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
|
@ -336,7 +336,7 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = round(reporting_period_data['values'][j][i], 2) \
|
||||
if reporting_period_data['values'][j][i] is not None else 0.00
|
||||
if reporting_period_data['values'][j][i] is not None else None
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
current_row_number += 1
|
||||
|
@ -355,7 +355,7 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = round(reporting_period_data['cumulations'][i], 2) \
|
||||
if reporting_period_data['cumulations'][i] is not None else 0.00
|
||||
if reporting_period_data['cumulations'][i] is not None else None
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
current_row_number += 2
|
||||
|
|
|
@ -304,9 +304,9 @@ const SpaceEfficiency = ({ setRedirect, setRedirectUrl, t }) => {
|
|||
detailed_value['startdatetime'] = currentTimestamp;
|
||||
json['reporting_period_efficiency']['values'].forEach((currentValue, energyCategoryIndex) => {
|
||||
if (json['reporting_period_efficiency']['values'][energyCategoryIndex][timestampIndex] != null) {
|
||||
detailed_value['a' + 2 * energyCategoryIndex] = json['reporting_period_efficiency']['values'][energyCategoryIndex][timestampIndex].toFixed(2);
|
||||
detailed_value['a' + energyCategoryIndex] = json['reporting_period_efficiency']['values'][energyCategoryIndex][timestampIndex].toFixed(2);
|
||||
} else {
|
||||
detailed_value['a' + 2 * energyCategoryIndex] = '';
|
||||
detailed_value['a' + energyCategoryIndex] = '';
|
||||
};
|
||||
});
|
||||
|
||||
|
@ -318,7 +318,11 @@ const SpaceEfficiency = ({ setRedirect, setRedirectUrl, t }) => {
|
|||
detailed_value['id'] = detailed_value_list.length;
|
||||
detailed_value['startdatetime'] = t('Subtotal');
|
||||
json['reporting_period_efficiency']['cumulations'].forEach((currentValue, index) => {
|
||||
detailed_value['a' + index] = currentValue.toFixed(2);
|
||||
if (currentValue != null) {
|
||||
detailed_value['a' + index] = currentValue.toFixed(2);
|
||||
}else {
|
||||
detailed_value['a' + index] = '';
|
||||
}
|
||||
});
|
||||
detailed_value_list.push(detailed_value);
|
||||
setDetailedDataTableData(detailed_value_list);
|
||||
|
|
Loading…
Reference in New Issue