Answers.Body: <p>This is fixed in 4.7.12.  See the conversation on Github (<a href="https://github.com/iATSPayments/com.iatspayments.civicrm/issues/134#issuecomment-248059104" rel="nofollow">https://github.com/iATSPayments/com.iatspayments.civicrm/issues/134#issuecomment-248059104</a>) and the issue on JIRA (<a href="https://issues.civicrm.org/jira/browse/CRM-19309" rel="nofollow">https://issues.civicrm.org/jira/browse/CRM-19309</a>)</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-16T05:58:54.833Z
Answers.LastActivityDate: 2016-10-16T05:58:54.833Z
Answers.UserDisplayName: Allen Hutchison
Answers.Body: <p>Unfortunately, the issue here is that the api for this stuff is/was a bit sketchy (Eileen's been gradually migrating and cleaning up the old IPN callback code into a better place). We've been hoping that the most recent versions of 4.7 will work and have optimistically included the code here:
  <a href="https://github.com/iATSPayments/com.iatspayments.civicrm/commit/3d7db087a45024d613e2475b94e6467aa7ab873a" rel="nofollow">https://github.com/iATSPayments/com.iatspayments.civicrm/commit/3d7db087a45024d613e2475b94e6467aa7ab873a</a></p>
  
  <p>You're welcome to try a modification of that patch and see if your version of 4.6 creates the accounting records you want.</p>
  
  <p>Failing this - I do have a lot of iATS clients that care about bookkeeping, so it's possible what you need is available, but it's beyond my understanding.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-08-18T22:38:38.890Z
Answers.LastActivityDate: 2016-08-18T22:38:38.890Z
Answers.UserDisplayName: Alan Dixon
Answers.Body: <p>I was wondering why I was the only complainer given that this issue was probably always there, but it only impacts accounting batches that apparently are still not used in frequent conjunction with iATS recurring. </p>
  
  <p>Karin made some headway a few weeks ago but after testing Civi master branch regurgitated - Karin - any progress since? Not sure it's worth handling this conversation in tandem with <a href="https://github.com/iATSPayments/com.iatspayments.civicrm/issues/134" rel="nofollow">https://github.com/iATSPayments/com.iatspayments.civicrm/issues/134</a>?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-08-19T00:13:53.357Z
Answers.LastActivityDate: 2016-08-19T00:13:53.357Z
Answers.UserDisplayName: Tamar Meir - Cividesk
Body: <p>We are ramping up for online donations and use the Accounting Batches CSV export to get our Civi contribution data into our 3rd party accounting software.  A key piece of data from that report is the 'Credit Account' column since that tells our accounting software which fund the donation should go to.</p>
  
  <p>We've recently started testing Recurring Contributions.  The contributions themselves are being processed correctly via iATS (we've done credit cards only thus far).  However, <strong>we did our first accounting batch export with recurring contributions yesterday, and the Credit Account column is blank for all subsequent recurring contributions.</strong>  The one-time donations and the initial recurring contribution for a contact show the Credit Account correctly.</p>
  
  <p>After looking through the database to see where the disconnect might be, it appears that recurring contributions are not creating records in the <code>civicrm_financial_item</code> table.  I can track/match a completed recurring contribution through the <code>civicrm_contribution</code>, <code>civicrm_entity_financial_trxn</code>, <code>civicrm_financial_trxn</code>, and <code>civicrm_line_item</code> tables.  The <code>civicrm_entity_financial_trxn</code> table has the recurring transaction records with <code>civicrm_contribution</code> in the <code>entity_table</code> column, but that table does not have a corresponding record for the transaction with <code>civicrm_financial_item</code> in the <code>entity_table</code> column.</p>
  
  <p>I found <a href="https://github.com/iATSPayments/com.iatspayments.civicrm/issues/134" rel="nofollow noreferrer">iATS Github Issue 134</a>, but that was specifically asking about Civi 4.7, so I don't know if the same issue would apply (I'm going to cross post there as well).  I also don't know if I might have setup things incorrectly in the backend for accounting, so that's a possibility as well (and I'm not sure what to look for there).</p>
  
  <p>According to <a href="https://wiki.civicrm.org/confluence/display/CRM/CiviAccounts+Data+Flow#CiviAccountsDataFlow-Onlinecontribution-Pending(incompletetransaction)orFailed" rel="nofollow noreferrer">CiviAccounts Data Flow</a>:</p>
  
  <blockquote>
    <p>IPN payment processors processing a contribution do NOT create
    civicrm_financial_item, civicrm_financial_trxn, or
    civicrm_entity_financial_trxn records at the time the transaction is
    posted to the payment processor. They are only created at the time of
    the IPN call back.</p>
  </blockquote>
  
  <p>Since <a href="https://civicrm.stackexchange.com/a/2132/105">iATS doesn't use IPN</a>, I didn't know if that might be the reason for the lack of records in the <code>civicrm_financial_item</code> table.  The other tables in the above quote have records for subsequent recurring contributions, so I'm not sure if this applies to iATS.</p>
  
  <p>For the sake of our Accounting Export, I don't see a way in the database to get the Credit Account for a contribution (<code>civicrm_financial_account.accounting_code</code>) for a recurring contribution without a record in the <code>civicrm_financial_item</code> table.</p>
  
  <p>Does anyone knows how to either a) correct the recurring contributions not ending up in <code>civicrm_financial_item</code> table or b) how to query the database to get the Credit Account without the financial item record?  I'd sure appreciate the help!</p>
  
  <p>Civi 4.6.14 (will be updating to 4.6.20 before go-live); Drupal 7.44; iATS Payments extension 1.5.3</p>
  
Tags: <civicontribute><database><recurring-contributions><iats>
Title: Recurring iATS contributions not creating civicrm_finanical_item records
ThreadText: # Recurring iATS contributions not creating civicrm_finanical_item records
  
  (Asked by: username_0 on 2016-08-18)
  
  We are ramping up for online donations and use the Accounting Batches CSV export to get our Civi contribution data into our 3rd party accounting software. A key piece of data from that report is the 'Credit Account' column since that tells our accounting software which fund the donation should go to.
  
  We've recently started testing Recurring Contributions. The contributions themselves are being processed correctly via iATS (we've done credit cards only thus far). However, **we did our first accounting batch export with recurring contributions yesterday, and the Credit Account column is blank for all subsequent recurring contributions.** The one-time donations and the initial recurring contribution for a contact show the Credit Account correctly.
  
  After looking through the database to see where the disconnect might be, it appears that recurring contributions are not creating records in the `civicrm_financial_item` table. I can track/match a completed recurring contribution through the `civicrm_contribution`, `civicrm_entity_financial_trxn`, `civicrm_financial_trxn`, and `civicrm_line_item` tables. The `civicrm_entity_financial_trxn` table has the recurring transaction records with `civicrm_contribution` in the `entity_table` column, but that table does not have a corresponding record for the transaction with `civicrm_financial_item` in the `entity_table` column.
  
  I found [iATS Github Issue 134](https://github.com/iATSPayments/com.iatspayments.civicrm/issues/134), but that was specifically asking about Civi 4.7, so I don't know if the same issue would apply (I'm going to cross post there as well). I also don't know if I might have setup things incorrectly in the backend for accounting, so that's a possibility as well (and I'm not sure what to look for there).
  
  According to [CiviAccounts Data Flow](https://wiki.civicrm.org/confluence/display/CRM/CiviAccounts+Data+Flow#CiviAccountsDataFlow-Onlinecontribution-Pending(incompletetransaction)orFailed):
  
  > IPN payment processors processing a contribution do NOT create
  > civicrm\_financial\_item, civicrm\_financial\_trxn, or
  > civicrm\_entity\_financial\_trxn records at the time the transaction is
  > posted to the payment processor. They are only created at the time of
  > the IPN call back.
  
  Since [iATS doesn't use IPN](https://civicrm.stackexchange.com/a/2132/105), I didn't know if that might be the reason for the lack of records in the `civicrm_financial_item` table. The other tables in the above quote have records for subsequent recurring contributions, so I'm not sure if this applies to iATS.
  
  For the sake of our Accounting Export, I don't see a way in the database to get the Credit Account for a contribution (`civicrm_financial_account.accounting_code`) for a recurring contribution without a record in the `civicrm_financial_item` table.
  
  Does anyone knows how to either a) correct the recurring contributions not ending up in `civicrm_financial_item` table or b) how to query the database to get the Credit Account without the financial item record? I'd sure appreciate the help!
  
  Civi 4.6.14 (will be updating to 4.6.20 before go-live); Drupal 7.44; iATS Payments extension 1.5.3
  
  **Tags:** civicontribute, database, recurring-contributions, iats
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_0 on 2016-10-16. Score: 1 | Accepted answer
  
  This is fixed in 4.7.12. See the conversation on Github (<https://github.com/iATSPayments/com.iatspayments.civicrm/issues/134#issuecomment-248059104>) and the issue on JIRA (<https://issues.civicrm.org/jira/browse/CRM-19309>)
  
  
  ---
  
  ### Answer by username_1 on 2016-08-18. Score: 1
  
  Unfortunately, the issue here is that the api for this stuff is/was a bit sketchy (Eileen's been gradually migrating and cleaning up the old IPN callback code into a better place). We've been hoping that the most recent versions of 4.7 will work and have optimistically included the code here:
  <https://github.com/iATSPayments/com.iatspayments.civicrm/commit/3d7db087a45024d613e2475b94e6467aa7ab873a>
  
  You're welcome to try a modification of that patch and see if your version of 4.6 creates the accounting records you want.
  
  Failing this - I do have a lot of iATS clients that care about bookkeeping, so it's possible what you need is available, but it's beyond my understanding.
  
  
  ---
  
  ### Answer by username_2 on 2016-08-19. Score: 0
  
  I was wondering why I was the only complainer given that this issue was probably always there, but it only impacts accounting batches that apparently are still not used in frequent conjunction with iATS recurring.
  
  Karin made some headway a few weeks ago but after testing Civi master branch regurgitated - Karin - any progress since? Not sure it's worth handling this conversation in tandem with <https://github.com/iATSPayments/com.iatspayments.civicrm/issues/134>?
  
  
  ---
  
  