Settings configured mid-week (e.g. Thursday) have an effective_from of that date. CloseWeek was looking up settings as-of Monday, which predates the new settings row and fell back to the old default. Now uses today's date for the settings lookup, so any settings change made before closing the week is correctly reflected in expected_ms.