Remainder not added on last deferral line
The test last_move.period.end_date >= deferral.end_date
to detect last move works only if the deferral end date is the end period date.
Instead it should test for the period start date.
Extracted from #12167