* $financialAccountType array with key account relationship and value financial account type option groups
*
*/
- function jqFinancial($config) {
+ /**
+ * @param $config
+ */
+ static function jqFinancial($config) {
if (!isset($_GET['_value']) ||
empty($_GET['_value'])) {
CRM_Utils_System::civiExit();
'7' => 4, //cost of sales
'8' => 1, //premium inventory
'9' => 3, //discount account is
+ '10' => 2, //sales tax liability
);
$financialAccountType = CRM_Utils_Array::value($_GET['_value'], $financialAccountType);
$result = CRM_Contribute_PseudoConstant::financialAccount(NULL, $financialAccountType);
) + $selectedArray;
}
}
- echo json_encode($elements);
- CRM_Utils_System::civiExit();
+ CRM_Utils_JSON::output($elements);
}
- function jqFinancialRelation($config) {
+ /**
+ * @param $config
+ */
+ static function jqFinancialRelation($config) {
if (!isset($_GET['_value']) ||
empty($_GET['_value'])) {
CRM_Utils_System::civiExit();
}
}
}
- echo json_encode($elements);
- CRM_Utils_System::civiExit();
+ CRM_Utils_JSON::output($elements);
}
- function jqFinancialType($config) {
+ /**
+ * @param $config
+ */
+ static function jqFinancialType($config) {
if (! isset($_GET['_value']) ||
empty($_GET['_value'])) {
CRM_Utils_System::civiExit();
}
$elements = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Product', $_GET['_value'], 'financial_type_id');
- echo json_encode($elements);
- CRM_Utils_System::civiExit();
+ CRM_Utils_JSON::output($elements);
}
/**
}
}
}
- echo json_encode($response);
- CRM_Utils_System::civiExit();
+ CRM_Utils_JSON::output($response);
}
static function getFinancialTransactionsList() {
else {
$status = array('status' => ts("This batch is configured to include only transactions using %1 payment method. If you want to include other transactions, please edit the batch first and modify the Payment Method.", array( 1 => $paymentInstrument)));
}
- echo json_encode($status);
- CRM_Utils_System::civiExit();
+ CRM_Utils_JSON::output($status);
}
static function getBatchSummary() {
'opened_date' => CRM_Utils_Date::customFormat($batchInfo->created_date),
);
- echo json_encode($batchSummary);
- CRM_Utils_System::civiExit();
+ CRM_Utils_JSON::output($batchSummary);
}
}