fix calculation of unused time credit + advance billing, #36726