include support for defining custom invoice date, due date, period begin and end
This commit is contained in:
@ -10,8 +10,13 @@ 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'] = 1;
|
||||
$spec['contact_id']['description'] = 'Specify a timebank\'s contact ID to generate the invoice for, or leave blank to select all active timebanks.';
|
||||
$spec['billing_period']['description'] = 'The year, a dash, and a 1 or 2 for the first or second half of the year. E.g. 2019-2 for 7/1/19-12/31/19.';
|
||||
$spec['billing_period']['api.required'] = 1;
|
||||
$spec['invoice_date']['description'] = 'Date of the invoice(s) to generate, or leave blank for today\'s date. Format as: 2019-7-25';
|
||||
$spec['due_date']['description'] = 'Due date of the invoice(s), or leave blank for March 31st/September 30th (based on billing period. Format as: 2019-7-25';
|
||||
$spec['period_begin_date']['description'] = 'Period begin date, or leave blank for January 1st/July 1st (based on billing period). Format as: 2019-7-25';
|
||||
$spec['period_end_date']['description'] = 'Period end date, or leave blank for June 30th/December 31st (based on billing period). Format as: 2019-7-25';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -24,6 +29,6 @@ function _civicrm_api3_invoicegen_Generate_spec(&$spec) {
|
||||
* @throws API_Exception
|
||||
*/
|
||||
function civicrm_api3_invoicegen_Generate($params) {
|
||||
$returnValues = CRM_Tbusainvoicegen_Timebank::generate($params['contact_id'], $params['billing_period']);
|
||||
$returnValues = CRM_Tbusainvoicegen_Timebank::generate($params);
|
||||
return civicrm_api3_create_success($returnValues, $params, 'Invoicegen', 'generate');
|
||||
}
|
||||
|
Reference in New Issue
Block a user