Calculated membership fees

From MyMemberSoftware wiki
Jump to: navigation, search

Manually entering membership fees

In the amount field, you can enter the membership fee that individual members need to pay. In the amount description you can enter the description which can be printed on the bill.

The maximum amount you can enter is 999.99. When a larger amount is entered, it will be saved as 999.99.

Automatically calculating membership fees

We have developped a method to automatically calculate fields, based on the values of other membership fields. The amount and the amount description can be automatically filled in after every update on that member record. For example: in a membership administration of an orchestra, members can have two membertypes: adult-member or child-member. They can subscribe to lessons for 30 or 60 minutes. The membership fee is calculated with this formula:

amount = (IF membershiptype = adult-member; fee = 50, ELSEIF membershiptype = child-member; fee = 25) + (IF membershiptype = adult-member ; (IF lesson = 30 minutes; fee = 10) (IF lesson = 60 minutes; fee = 20), ELSEIF membershiptype = child-member; (IF lesson = 30 minutes; fee = 10) (IF lesson = 60 minutes; fee = 20))

The moment the lesson selection changes, the amount and the amount-description will be adjusted.

This functionality is not in the application, but available with the help of mysql triggers.

The technical name for this is "Triggers". For further information, see the mysql documentation.