Commit f4b71d8a authored by Monish Deb's avatar Monish Deb

additional changes

parent c5911f34
......@@ -91,9 +91,6 @@ class CRM_Syncintacct_API {
$journalLineEntry->setVendorId($entry['VENDORID']);
$journalLineEntry->setTransactionCurrency($entry['CURRENCY']);
$journalLineEntry->setTransactionAmount($entry['AMOUNT']);
// @TODO this is a dummy active location id passed
$journalLineEntry->setLocationId('Elim');
//$journalLineEntry->setLocationId($entry['LOCATION']);
$this->_setMetaData($journalLineEntry, $entry);
$journalLineEntry->setMemo($entry['DESCRIPTION']);
$customFields = new CustomAllocationSplit($entry['customfields']);
......@@ -130,8 +127,6 @@ class CRM_Syncintacct_API {
$billLineEntry = new BillLineCreate();
$billLineEntry->setGlAccountNumber($entry['ACCOUNTNO']);
$billLineEntry->setTransactionAmount($entry['AMOUNT']);
//$billLineEntry->setLocationId($entry['LOCATION']);
$billLineEntry->setLocationId('Elim');
$this->_setMetaData($billLineEntry, $entry);
// TODO: BillLineCreate does not support adding custom fields yet
// $customFields = new CustomAllocationSplit($entry['customfields']);
......@@ -144,6 +139,7 @@ class CRM_Syncintacct_API {
'DEPARTMENT' => 'setDepartmentId',
'PROJECTID' => 'setProjectId',
'CLASSID' => 'setClassId',
'LOCATION' => 'setLocationId',
];
foreach ($attributes as $attribute => $func) {
if (!empty($params[$attribute])) {
......
......@@ -37,7 +37,10 @@ function civicrm_api3_intacct_SyncFinancialAccount($params) {
* @throws API_Exception
*/
function civicrm_api3_intacct_processBatchSyncToIntacct($params) {
$dao = CRM_Core_DAO::executeQuery('SELECT * FROM civicrm_intacct_batches ORDER BY id ASC');
$dao = CRM_Core_DAO::executeQuery('SELECT cib.*
FROM civicrm_intacct_batches cib
INNER JOIN civicrm_batch cb ON cb.id = cib.batch_id
ORDER BY cib.id ASC');
while($dao->fetch()) {
$response = CRM_Syncintacct_Util::createEntriesByType(
CRM_Syncintacct_Util::fetchEntries($dao->batch_id, $dao->mode),
......
......@@ -97,7 +97,7 @@ function syncintacct_civicrm_buildForm($formName, &$form) {
$form->add('text', 'class_id', ts('Class'), [], TRUE);
$form->add('text', 'dept_id', ts('Department'), [], TRUE);
$form->add('text', 'location', ts('Location'), [], TRUE);
$form->add('text', 'project_id', ts('Project'), [], TRUE);
$form->add('text', 'project_id', ts('Project'));
CRM_Core_Region::instance('page-body')->add(array(
'template' => "CRM/Syncintacct/FinancialAccountExtra.tpl",
));
......@@ -112,6 +112,9 @@ function syncintacct_civicrm_post($op, $objectName, $objectId, &$objectRef) {
if ($objectName == 'FinancialAccount' && $op == 'del') {
CRM_Core_DAO::executeQuery("DLEETE FROM civicrm_intacct_financial_account_data WHERE financial_account_id = " . $objectId);
}
elseif ($objectName == 'Batch' && $op == 'delete') {
CRM_Core_DAO::executeQuery("DLEETE FROM civicrm_intacct_batches WHERE batch_id = " . $objectId);
}
}
function syncintacct_civicrm_postProcess($formName, &$form) {
......
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