CRM-14066: fix zero amount for discounted option
authoryashodha <yashodha.chaku@webaccess.co.in>
Tue, 14 Jan 2014 09:46:46 +0000 (15:16 +0530)
committeryashodha <yashodha.chaku@webaccess.co.in>
Tue, 14 Jan 2014 09:46:46 +0000 (15:16 +0530)
CRM/Event/Form/ManageEvent/Fee.php

index 8c7792ef9828207fa3d041858590d9303bb24460..9cc631cf766b465d6a28efb39d005eabbe737ba0 100644 (file)
@@ -685,9 +685,10 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
               $discountOptions = array();
               for ($i = 1; $i < self::NUM_OPTION; $i++) {
                 if (!empty($labels[$i]) &&
-                    !empty($values[$i][$j])
-                    ) {
-                  $discountOptions[] = array('label' => trim($labels[$i]),
+                  !CRM_Utils_System::isNull(CRM_Utils_Array::value($j, $values[$i]))
+                ) {
+                  $discountOptions[] = array(
+                    'label' => trim($labels[$i]),
                     'value' => CRM_Utils_Rule::cleanMoney(trim($values[$i][$j])),
                     'weight' => $i,
                     'is_active' => 1,