Fix typo in Period.write to check invoice sequence changes

It was introduced in changeset 90edc4984c69.
Patch from Jordi Esteve.

issue3567
review2461003
merge