Commit a65a8c33 authored by Monish Deb's avatar Monish Deb

minor fixes

parent cde857de
......@@ -11,7 +11,7 @@ return array (
'name' => 'Sync Batch to Intacct',
'description' => 'Create GL or AP entries in Intacct for respective contribution or grant payments.',
'run_frequency' => 'Daily',
'api_entity' => 'Intacct',
'api_entity' => 'Job',
'api_action' => 'processBatchSyncToIntacct',
'parameters' => '',
),
......
<?php
function civicrm_api3_intacct_processBatchSyncToIntacct($params) {
/**
* Job.ProcessBatchSyncToIntacct 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_job_ProcessBatchSyncToIntacct($params) {
$dao = CRM_Core_DAO::executeQuery('SELECT * FROM civicrm_intacct_batches ORDER BY id ASC');
while($dao->fetch()) {
$entityTable = ($dao->mode == 'GL') ? 'civicrm_contribution' : 'civicrm_grant';
$batchEntries = CRM_Syncintacct_Util::fetchTransactionrecords($dao->batch_id, $entityTable);
CRM_Syncintacct_Util::createGLEntries($batchEntries);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment