Clear raw gross values for the current-period lookup rows, edit both matching rows instead of a baseline row, and assert recalculated detail and unchanged baseline totals.
jianwel
merged commit 7be8854104 into main2026-11-01 02:20:08 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
毛利率编辑重算测试原本预期本期毛利 50,实际得到 60。原因有两处:测试只清空 Fact.gross,导出仍从原始行读取直接毛利 50/10;编辑固定第 2 行实际改到 2025-08 基期,断言却检查 2026-08 本期。
本次仅修正测试:模拟本期两条原始直接毛利缺失的记录,保持数据库毛利与原 30% 毛利率一致;导出后按期间、科室、产品定位两条记录,确认进入 lookup 计算后将毛利率改为 50%。保留本期合计 50 的原断言,并增加逐行 40/10、基期仍为 90 的断言。生产导出和重算逻辑不变。
验证:
分支从 main 创建;本次仅修改 tests/test_formula_workbook_docs.py,未运行前端测试。