Bug 10481: FIX No enrollment fee when changing patron category.
authorJonathan Druart <jonathan.druart@biblibre.com>
Mon, 17 Jun 2013 12:56:22 +0000 (14:56 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 16 Aug 2013 15:07:50 +0000 (15:07 +0000)
commitf8eb19163bd4e59e99b6dae90a5712b6a7be52f6
tree55698b17c84e5d9d0c4297719ef08425cd286a99
parenta4d8144efdcbbf30d649264495f151e8b6fd7594
Bug 10481: FIX No enrollment fee when changing patron category.

When a patron changes to a category with enrollment fee, they
are not generated.

Test plan:
- Choose a category without fee (e.g. Kid)
- Add an enrollment fee for another category (e.g. Young adult)
- Choose a kid and change his category to "Young adult".
- Note the warning message "Fees & Charges: Patron has Outstanding fees
  & charges of XX" on the check out page.

This patch also moves all instances of adding the enrollment fee
to a new routine in C4::Members, AddEnrolmentFeeIfNeeded(), so
additional tests include:

- Register a new patron and give it a category that has
  an enrollment fee.  Verify that the fee is charged.
- Renew the patron.  Verify that the additional fee is charged.
- Register a new patron with a child patron category.
- Use the 'update child to adult' menu option to change the
  patron's category to one that is fee-bearing.  Verify that the
  enrollment fee was charged.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
C4/Members.pm