--CRM-16187, Added create spec for financial trxn create
authorPradeep Nayak <pradpnayak@gmail.com>
Thu, 23 Jul 2015 19:57:13 +0000 (01:27 +0530)
committerPradeep Nayak <pradpnayak@gmail.com>
Sat, 25 Jul 2015 05:19:56 +0000 (10:49 +0530)
api/v3/FinancialTrxn.php

index 9375c812988bcb0f54d67329549f1cdd842eb338..18c680cce459f36f4896c112863d7d74c6e2706f 100644 (file)
@@ -65,3 +65,18 @@ function civicrm_api3_financial_trxn_get($params) {
 function civicrm_api3_financial_trxn_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
+
+/**
+ * Adjust Metadata for Create action.
+ *
+ * The metadata is used for setting defaults, documentation & validation.
+ *
+ * @param array $params
+ * Array of parameters determined by getfields.
+ */
+function _civicrm_api3_financial_trxn_create_spec(&$params) {
+  $params['to_financial_account_id']['api.required'] = 1;
+  $params['status_id']['api.required'] = 1;
+  $params['payment_instrument_id']['api.required'] = 1;
+  $params['total_amount']['api.required'] = 1;
+}
\ No newline at end of file