fspc / Yellow-Bike-Database

Yellow Bike Project Hours and Transaction Database for Community Bike Shops
GNU General Public License v3.0
7 stars 1 forks source link

Patron (member and volunteer) provide membership discount when volunteer redeemable hours run out during a transaction. #4

Closed fspc closed 7 years ago

fspc commented 7 years ago

There are two ways of approaching this bug:

  1. Provide membership discount when volunteer redeemable hours run out during a transaction.
  2. Apply either the membership discount or volunteer redeemable hours depending on which would provide greater savings.

If a patron just has a small amount of redeemable hours left and the membership savings are greater, that would make the best sense. Patron can always apply smaller amount at a later time for a small purchase.

Example: $1,000 purchase with 19 unused hours, 12.5 not used (conf: 8 x 12.5 = $100)

  1. both in sequence = ((1000 - 113) x .10) 88.70 + 113 = $201.70 savings
  2. membership savings = $100; volunteer hour savings = $113

Example: $1,000 purchase with 19 unused hours, 12.5 used (conf: 8 x 12.5 = $100)

  1. both in sequence = ((1000 - 38) x .10) 96.20 + 38 = $134.20 savings
  2. membership savings = $100; volunteer hour savings = $38

1 is the best choice because it encourages both membership purchase and volunteering!