From 7e67f9d4222b52414557b3b51402d2dc233afbd5 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 1 Feb 2026 21:09:51 +0900 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/payroll/vouchers/service.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/app/payroll/vouchers/service.py b/backend/app/payroll/vouchers/service.py index f403e9b..00225f5 100644 --- a/backend/app/payroll/vouchers/service.py +++ b/backend/app/payroll/vouchers/service.py @@ -318,14 +318,14 @@ def build_voucher_summary( salary_months = [] if salary_list: salary_months = [ - f"{s.payroll_year:04d}-{s.payroll_month:02d}" + f"{s.payroll_year if s.payroll_year else 0:04d}-{s.payroll_month if s.payroll_month else 0:02d}" for s in salary_list ] bonus_months = [] if bonus_list: bonus_months = [ - f"{b.bonus_year:04d}-{b.bonus_month:02d}" + f"{b.bonus_year if b.bonus_year else 0:04d}-{b.bonus_month if b.bonus_month else 0:02d}" for b in bonus_list ] @@ -349,8 +349,9 @@ def export_vouchers(request: VoucherExportRequest) -> VoucherExportResponse: """账票エクスポート処理(メイン)""" try: # リクエストログ - end_label = f"{request.end_year:04d}-{request.end_month:02d}" if request.end_year else "None" - logger.info(f"エクスポート要求: start={request.start_year:04d}-{request.start_month:02d}, " + end_label = f"{request.end_year:04d}-{request.end_month:02d}" if request.end_year and request.end_month else "None" + start_label = f"{request.start_year:04d}-{request.start_month:02d}" if request.start_year and request.start_month else "None" + logger.info(f"エクスポート要求: start={start_label}, " f"end={end_label}, " f"type={request.voucher_type}, employees={request.employee_ids}")