From 109f336b80b950ebbcd4e33aafb5029937272b3c Mon Sep 17 00:00:00 2001 From: daovietanh99 Date: Fri, 16 Feb 2024 09:59:13 +0700 Subject: [PATCH] UPDATE: update logic for subtotal rows --- cope2n-api/fwd_api/utils/file.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/cope2n-api/fwd_api/utils/file.py b/cope2n-api/fwd_api/utils/file.py index a256097..024461e 100644 --- a/cope2n-api/fwd_api/utils/file.py +++ b/cope2n-api/fwd_api/utils/file.py @@ -505,13 +505,12 @@ def dict2xlsx(input: json, _type='report'): ws[key + str(start_index)].fill = fill_green elif key in ['C', 'D', 'E', 'F', 'G', 'H']: ws[key + str(start_index)].fill = fill_yellow - else: - if 'average_accuracy_rate' in mapping[key] and type(value) in [int, float] and value < 98: - ws[key + str(start_index)].font = font_red - elif 'average_processing_time' in mapping[key] and type(value) in [int, float] and value > 2.0: - ws[key + str(start_index)].font = font_red - elif 'bad_percent' in mapping[key] and type(value) in [int, float] and value > 10: - ws[key + str(start_index)].font = font_red + if 'average_accuracy_rate' in mapping[key] and type(value) in [int, float] and value < 98: + ws[key + str(start_index)].font = font_red + elif 'average_processing_time' in mapping[key] and type(value) in [int, float] and value > 2.0: + ws[key + str(start_index)].font = font_red + elif 'bad_percent' in mapping[key] and type(value) in [int, float] and value > 10: + ws[key + str(start_index)].font = font_red elif _type == 'report_detail': if 'accuracy' in mapping[key] and type(value) in [int, float] and value < 75: ws[key + str(start_index)].font = font_red