diff --git a/app/work_report.py b/app/work_report.py index 1f915eb..430261e 100644 --- a/app/work_report.py +++ b/app/work_report.py @@ -218,11 +218,13 @@ def _finance_table(data: dict) -> str: _esc(item.get("sign_count", 0)), _wan(item.get("sign_amount")), target, rate_text, ], cls)) - body.append(row([ - "未分季", _esc(unscheduled.get("acc_count", 0)), _wan(unscheduled.get("acc_amount")), - _esc(unscheduled.get("sign_count", 0)), _wan(unscheduled.get("sign_amount")), - "—", "—", - ])) + if (int(unscheduled.get("acc_count") or 0) > 0 + or int(unscheduled.get("sign_count") or 0) > 0): + body.append(row([ + "未分季", _esc(unscheduled.get("acc_count", 0)), _wan(unscheduled.get("acc_amount")), + _esc(unscheduled.get("sign_count", 0)), _wan(unscheduled.get("sign_amount")), + "—", "—", + ])) body.append(row([ "合计", f"{_esc(total.get('acc_count', 0))}", f"{_wan(total.get('acc_amount'))}", diff --git a/tests/test_work_report.py b/tests/test_work_report.py index f2e413a..c235dec 100644 --- a/tests/test_work_report.py +++ b/tests/test_work_report.py @@ -51,6 +51,7 @@ def test_看板导出完整工作汇报页(h): assert "高风险戊" not in body assert "本期没有重点工作" not in body assert "2028 Q1" in body + assert "未分季" not in body assert "35.00" in body and "225.00" in body and "160.00" in body and "260.00" in body assert "历史遗留任务" not in body assert body.index("自研乙") < body.index("方案评审通过") < body.index("自研甲") < body.index("联调完成")