add invoicedata functions
This commit is contained in:
		@@ -10,7 +10,7 @@ use CRM_Tbusainvoicegen_ExtensionUtil as E;
 | 
			
		||||
 * @see http://wiki.civicrm.org/confluence/display/CRMDOC/API+Architecture+Standards
 | 
			
		||||
 */
 | 
			
		||||
function _civicrm_api3_invoicegen_Generate_spec(&$spec) {
 | 
			
		||||
  $spec['contact_id']['api.required'] = 0;
 | 
			
		||||
  $spec['contact_id']['api.required'] = 1;
 | 
			
		||||
  $spec['billing_period']['api.required'] = 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										29
									
								
								api/v3/Invoicegen/Invoicedata.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								api/v3/Invoicegen/Invoicedata.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,29 @@
 | 
			
		||||
<?php
 | 
			
		||||
use CRM_Tbusainvoicegen_ExtensionUtil as E;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Invoicegen.Generate API specification (optional)
 | 
			
		||||
 * This is used for documentation and validation.
 | 
			
		||||
 *
 | 
			
		||||
 * @param array $spec description of fields supported by this API call
 | 
			
		||||
 * @return void
 | 
			
		||||
 * @see http://wiki.civicrm.org/confluence/display/CRMDOC/API+Architecture+Standards
 | 
			
		||||
 */
 | 
			
		||||
function _civicrm_api3_invoicegen_Invoicedata_spec(&$spec) {
 | 
			
		||||
  $spec['contact_id']['api.required'] = 1;
 | 
			
		||||
  $spec['billing_period']['api.required'] = 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Invoicegen.Generate API
 | 
			
		||||
 *
 | 
			
		||||
 * @param array $params
 | 
			
		||||
 * @return array API result descriptor
 | 
			
		||||
 * @see civicrm_api3_create_success
 | 
			
		||||
 * @see civicrm_api3_create_error
 | 
			
		||||
 * @throws API_Exception
 | 
			
		||||
 */
 | 
			
		||||
function civicrm_api3_invoicegen_Invoicedata($params) {
 | 
			
		||||
  $returnValues = CRM_Tbusainvoicegen_Timebank::invoiceData($params['contact_id'], $params['billing_period']);
 | 
			
		||||
  return civicrm_api3_create_success($returnValues, $params, 'Invoicegen', 'invoicedata');
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user