Browse Source

Closes #68

devel 2.0
Jonathan Rosenbaum 7 years ago
parent
commit
0b56dea180
  1. 4
      Connections/database_functions.php
  2. 2
      js/transaction.js
  3. 5
      json/transaction.php

4
Connections/database_functions.php

@ -87,6 +87,10 @@ define("VOLUNTEER_DISCOUNT",25); // PERCENTAGE
define("SPECIAL_VOLUNTEER_HOURS_QUALIFICATION",100); // IN HOURS define("SPECIAL_VOLUNTEER_HOURS_QUALIFICATION",100); // IN HOURS
define("SPECIAL_VOLUNTEER_DISCOUNT",50); // PERCENTAGE define("SPECIAL_VOLUNTEER_DISCOUNT",50); // PERCENTAGE
// Customized sweat equity limit per contact_id
// e.g. for sweat equity limit of $200 for contact_id 500: array(500 => 200)
$custom_sweat_equity_limit = array();
// Determines the behaviour of Bicycles (transaction_type_id) for volunteer to earn-a-bike purchases. // Determines the behaviour of Bicycles (transaction_type_id) for volunteer to earn-a-bike purchases.
// Keeping things equitable, if a patron decides to purchase a bike, rather than earning it, // Keeping things equitable, if a patron decides to purchase a bike, rather than earning it,
// that counts to the EAB limit for the year. // that counts to the EAB limit for the year.

2
js/transaction.js

@ -659,7 +659,7 @@ $(function() {
// volunteer hours magic // volunteer hours magic
function redeemable(obj, spinner_value, event, volunteer) { function redeemable(obj, spinner_value, event, volunteer) {
//var sweat_equity_hours = obj.sweat_equity_limit / (obj.volunteer_hours_redeemed * obj.volunteer_hour_value); //var sweat_equity_hours = obj.sweat_equity_limit / (obj.volunteer_hours_redeemed * obj.volunteer_hour_value);
var redeemable_value; var redeemable_value;
if ($("#transaction_type").val() !== "Stand Time") { if ($("#transaction_type").val() !== "Stand Time") {

5
json/transaction.php

@ -152,6 +152,11 @@ $membership_discount = MEMBERSHIP_DISCOUNT;
$result["max_bike_earned"] = $max_bike_earned; $result["max_bike_earned"] = $max_bike_earned;
$result["volunteer_hour_value"] = $volunteer_hour_value; $result["volunteer_hour_value"] = $volunteer_hour_value;
$result["sweat_equity_limit"] = $sweat_equity_limit; $result["sweat_equity_limit"] = $sweat_equity_limit;
foreach ( $custom_sweat_equity_limit as $key => $value ) {
if( $result["contact_id"] == $key ) {
$result["sweat_equity_limit"] = $value;
}
}
$result["volunteer_discount"] = $volunteer_discount; $result["volunteer_discount"] = $volunteer_discount;
$result["special_volunteer_hours_qualification"] = $special_volunteer_hours_qualification; $result["special_volunteer_hours_qualification"] = $special_volunteer_hours_qualification;
$result["special_volunteer_discount"] = $special_volunteer_discount; $result["special_volunteer_discount"] = $special_volunteer_discount;

Loading…
Cancel
Save