From 73c02d6cdb3994cc303d6563618a6da68674bb99 Mon Sep 17 00:00:00 2001 From: PhanThanhTrung Date: Wed, 6 Mar 2024 16:32:50 +0700 Subject: [PATCH] update write file --- cope2n-api/billing_report.xlsx | Bin 6556 -> 6559 bytes cope2n-api/fwd_api/utils/file.py | 7 ++++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cope2n-api/billing_report.xlsx b/cope2n-api/billing_report.xlsx index 2723b16a92b84d02c271992fa2f9e4e29aaa066d..b55b44cf1bd88f42b9b455ff0d4a40adc328ad22 100644 GIT binary patch delta 2094 zcmZuy2{aUH8y*H@8Ozv)p|M4>WRQ#~Tgj4)7?BB?K|&ZzqMETLeln&jg(ezHmN5*H zxN$ANT*-1tTF_WyER!3u^v~S?oO|m(|98%Np6~t6^S$qRpYJ{IS71yv2BVyS0v#0T_^nbs!Z1E>ecYEQn!eO~q(2wGQ5X6PL(! zX((DQjg9nu(UBo*W|aPD)!#Q1k1Q~bN@Xd&p0GsgjmbPIpUgmH<{(rppm`j&`pzCB z&Qu&&0{M5E$Qk)5a{1~m=gyXO&ndKYF%Z!1ZGK~s*ucBN{IKAaK&kbTkHAVN$6m#f*J}&5DQjk>K*ZABaNOE(TmYWy0s&_&B-&wzquVuKzlA(0`XaHf ztAFT|i*rC&a_nJstf`?xovT7z2(Drv9wH=6i~rQ(736hpa#`rJN#=7|JoSfOkAJjS6olH$>$dilXH<-%DZ&$AmmJ0U} z0#y@n{+rMAaIm!YC4dB9`S#hSZG(8<9luDk9=uD z)>n(g6wo1nzgYgRB_qkVEzsfa1&Jf35h~8t-ug|^`4?{9?_;$(+Ur?ASdO=7TVLbW{s)`gD{ls%Y|)`s2#oV? z$RqSq>2Y=Qd9qP5WzABTgqI~1ixgE<5v4soXNTi82T zM_Zn!Q$|)-g5}-h8a2n*upFCgLiB~?hV1j|qWU*FPC9fz468+d_^PC?-pe<*Nr$h8T5e zdgdDb9)X>&Y=;!;86WqoC_HpN>0emwM*_j(5=m0j2K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 100755 --- a/cope2n-api/fwd_api/utils/file.py +++ b/cope2n-api/fwd_api/utils/file.py @@ -22,7 +22,7 @@ from ..celery_worker.client_connector import c_connector import imagesize import csv from openpyxl import load_workbook -from openpyxl.styles import Font, Border, Side, PatternFill, NamedStyle, numbers +from openpyxl.styles import Font, Border, Side, PatternFill, NamedStyle, numbers, Alignment s3_client = S3Util.MinioS3Client( endpoint=settings.S3_ENDPOINT, @@ -467,7 +467,7 @@ def dict2xlsx(input: json, _type='report'): fill_green = PatternFill(start_color=green, end_color=green, fill_type = "solid") fill_yellow = PatternFill(start_color=yellow, end_color=yellow, fill_type = "solid") fill_gray = PatternFill(start_color=gray, end_color=gray, fill_type = "solid") - + align_right = Alignment(horizontal='right') if _type == 'report': wb = load_workbook(filename = 'report.xlsx') ws = wb['Sheet1'] @@ -573,7 +573,8 @@ def dict2xlsx(input: json, _type='report'): ws[key + str(start_index)] = value ws[key + str(start_index)].border = border ws[key + str(start_index)].font = font_black - + if key in ['G', 'H']: + ws[key + str(start_index)].alignment = align_right start_index += 1 return wb