Exemple #1
0
def annual():
    """ Run annual actions (January 1st). """

    # -3 hours per family, except if on probation.
    for family in Family.query:
        if family.is_bank or family.on_probation or not family.active:
            continue

        Family.bank_transaction(3, "Yearly Dues", family=family)

    db.session.commit()
Exemple #2
0
def quarterly():
    """ Run quarterly actions. """

    # +10 hours to Chair
    # +4 hours to Co-Chair
    # +4 hours to Roster/Tech
    chair = Family.query.filter_by(type=FamilyType.chair).first()
    co_chair = Family.query.filter_by(type=FamilyType.co_chair).first()
    tech = Family.query.filter_by(type=FamilyType.tech).first()

    for hours, family in [(10, chair), (4, co_chair), (4, tech)]:
        Family.bank_transaction(hours, "Quarterly Hours", sitter=family)

    db.session.commit()