fix: 修正空白加班餐扣归属计算
This commit is contained in:
@@ -221,6 +221,23 @@ def test_night_allocation_uses_meal_deducted_minutes_with_previous_date_rules():
|
||||
]
|
||||
|
||||
|
||||
def test_blank_overtime_meal_deduction_is_clipped_like_metrics():
|
||||
start_at = datetime(2026, 7, 25, 6, 0)
|
||||
end_at = datetime(2026, 7, 25, 19, 0)
|
||||
item = _item(id=1, good_qty=680)
|
||||
report = _report(start_at, end_at, item)
|
||||
|
||||
metrics = calculate_report_metrics(start_at, end_at, [item])
|
||||
rows = build_report_allocation_drafts(report)
|
||||
|
||||
assert metrics["effective_minutes"] == 680
|
||||
assert metrics["shift_day_minutes"] == 500
|
||||
assert metrics["shift_overtime_minutes"] == 180
|
||||
assert [(row.effective_minutes, row.day_minutes, row.overtime_minutes, row.night_minutes) for row in rows] == [
|
||||
(680, 500, 180, 0),
|
||||
]
|
||||
|
||||
|
||||
def test_zero_effective_minutes_falls_back_to_original_report_date():
|
||||
item = _item(good_qty=5, defect_qty=1, scrap_qty=0.5, changeover_count=2, process_unit_price_yuan=3)
|
||||
report = _report(
|
||||
|
||||
Reference in New Issue
Block a user