finish the calculation in closeVotingPeriod.php