Browse Source

This closes #78 and closes #80.

What I thought was a desired equitable behavior for eab was actually a bug.  Now behavior is predictable. Only checks for 0.00 and 0, so 0.0 would create an issue, but unlikely to happen.
devel
Jonathan Rosenbaum 6 years ago
parent
commit
2380d6a6d4
  1. 5
      Connections/database_functions.php
  2. 12
      js/transaction.js

5
Connections/database_functions.php

@ -88,11 +88,6 @@ define("SPECIAL_VOLUNTEER_DISCOUNT",50); // PERCENTAGE
// 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.
// Keeping things equitable, if a patron decides to purchase a bike, rather than earning it,
// that counts to the EAB limit for the year.
define("EARN_A_BIKE_LIMIT",1);
// Determine if stand time behaviour will be based on the SWEAT_EQUITY_LIMIT with discounts applied,
// or 1 to 1 (1hr of volunteering === 1hr of free stand time) regardless of the SWEAT_EQUITY_LIMIT
define("REDEEM_ONE_TO_ONE", true);

12
js/transaction.js

@ -89,7 +89,6 @@ $(function() {
}
} );
// paid or not?
$(":checked").parent("td").prev().children().not("#payment_type_label").hide(); // need to watch that not introduction bugs
$(".paid").click(function() {
@ -1036,6 +1035,7 @@ $(function() {
sold_to.change(function() {
//sold_to.hide();
amount.prop("disabled","");
var membership_obj; //reuse this object
@ -1521,12 +1521,18 @@ $(function() {
} else {
vhr = parseFloat($("#redeemable_hours").val());
}
// Don't require paid to be selected, only amount >= 0
// Don't require paid to be selected, only amount >= 0
//
// Here is where equitable behaviour for earned bikes could be turned off/on
// However, it actually was a feature induced bug or undesired depending how you look at it,
// see #78 and #80,
// because vhr always became 0 when amount was added if spinner was not used
var max_bike_earned = 0, maximum_allowable_earned_bikes;
if ($("#transaction_type").val() === "Bicycles") {
// hours were redeemed and this is a Bicycle transaction
if (vhr !== "0.00") {
if (vhr !== "0.00" && vhr !== 0) {
max_bike_earned = 1;
}
}

Loading…
Cancel
Save