[$memType, 'Positive']]); $properties = ['financial_type_id', 'total_amount', 'name', 'auto_renew']; while ($dao->fetch()) { foreach ($properties as $property) { $details[$property] = $dao->$property; } } $details['total_amount_numeric'] = $details['total_amount']; // fix the display of the monetary value, CRM-4038 $details['total_amount'] = CRM_Utils_Money::formatLocaleNumericRoundedForDefaultCurrency($details['total_amount'] ?? 0); $options = CRM_Core_SelectValues::memberAutoRenew(); $details['auto_renew'] = $options[$details['auto_renew']] ?? NULL; CRM_Utils_JSON::output($details); } }