@classmethod
def apply_up_to(cls, revisions, cost_price, date):
    """Apply revision to cost price up to date
        revisions list is modified"""
    try:
        while True:
            revision = revisions.pop(0)
            if revision.date <= date:
                cost_price = revision.get_cost_price(cost_price)
            else:
                revisions.insert(0, revision)
                break
    except IndexError:
        pass
    return cost_price
