CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Negative Contribution
Pages: [1]

Author Topic: Negative Contribution  (Read 1018 times)

Interpolat

  • I post frequently
  • ***
  • Posts: 140
  • Karma: -1
    • Interpolat Solutions, LLC.
  • CiviCRM version: 4.4+
  • CMS version: Wordpress
  • MySQL version: 5.5+
  • PHP version: 5.4+
Negative Contribution
December 30, 2013, 10:28:44 pm
I am using CiviCRM on one of my sites to manage my contractors, as well as my clients.  For my clients, I record income as contributions, in the normal way that donations would be recorded.  I am however trying to record payments I make to my contractors (Remuneration) as well.  TO do this, I thought I would enter negative amounts for remunerations, to indicate outgoing payments (expenses), and this way, Civi would keep an accurate balance of my accounts.  Everything seems to work as expected, except after I enter a negative contribution (say, -10.25 for $10.25 paid out), against a contact, the transaction is not listed under the contact's contributions, like positive contributions would be.  Although the Civi Contribution menu does show that a transaction is in the records, the place where the transaction would normally be listed says no transaction has been recorded.  I can also go to my reports and see the transaction, so I know it is in the system.
Interpolat Solutions, LLC
Connecting the dots for you!
http://www.interpolat.com

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Negative Contribution
December 30, 2013, 10:48:59 pm
Not sure why negative contribution amounts are not showing in the contact tab. I just did quick test in 4.4 on the public demo and they are definitely showing (see screenshot).

That said, you might want to experiment w using the Grant component for this which is intended for outgoing payments.
Protect your investment in CiviCRM by  becoming a Member!

Interpolat

  • I post frequently
  • ***
  • Posts: 140
  • Karma: -1
    • Interpolat Solutions, LLC.
  • CiviCRM version: 4.4+
  • CMS version: Wordpress
  • MySQL version: 5.5+
  • PHP version: 5.4+
Re: Negative Contribution
December 31, 2013, 08:50:05 am
I have now spent an additional couple of hours or so on this.  I disabled all extensions I do have installed, cleared caches, etc.  Still, cannot get negative contributions to show like they do for you David.  Any ideas of whereas I should be looking?
Interpolat Solutions, LLC
Connecting the dots for you!
http://www.interpolat.com

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Negative Contribution
December 31, 2013, 09:16:04 am
No idea what's happening :-(. You could try and debug by checking the query being run for that contact's contribution tab. Add debugging starting on line 455 of CRM/Contribute/Form/Search.php (and then reload the contact's contribution tab using a URL like this - http://<your site>/civicrm/contact/view?reset=1&force=1&cid=5&selectedChild=contribute ):

Code: [Select]
    $query = &$selector->getQuery();
// add next 2 lines
crm_core_error::debug('$query', $query);
exit();

Part of the output will be the WHERE and FROM clauses of the query - which MIGHT give you clues. The example below is for contribution tab of contact id 5.

Code: [Select]
[_whereClause] =>  ( contact_a.id = 5 AND civicrm_contribution.is_test = 0 )
    [_permissionWhereClause] => (contact_a.is_deleted = 0)
    [_fromClause] =>  FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id  INNER JOIN civicrm_financial_type ON civicrm_contribution.financial_type_id = civicrm_financial_type.id  LEFT JOIN civicrm_entity_financial_account ON civicrm_entity_financial_account.entity_id = civicrm_contribution.financial_type_id AND civicrm_entity_financial_account.entity_table = 'civicrm_financial_type'  INNER JOIN civicrm_financial_account ON civicrm_financial_account.id = civicrm_entity_financial_account.financial_account_id  INNER JOIN civicrm_option_value cov ON cov.value = civicrm_entity_financial_account.account_relationship AND cov.name = 'Income Account is'  INNER JOIN civicrm_option_group cog ON cog.id = cov.option_group_id AND cog.name = 'account_relationship'  LEFT  JOIN civicrm_contribution_product ON civicrm_contribution_product.contribution_id = civicrm_contribution.id LEFT  JOIN civicrm_product ON civicrm_contribution_product.product_id =civicrm_product.id  LEFT JOIN civicrm_entity_financial_trxn ON (
        civicrm_entity_financial_trxn.entity_table = 'civicrm_contribution'
        AND civicrm_contribution.id = civicrm_entity_financial_trxn.entity_id ) LEFT JOIN civicrm_financial_trxn ON (
        civicrm_entity_financial_trxn.financial_trxn_id = civicrm_financial_trxn.id ) LEFT JOIN civicrm_entity_batch ON ( civicrm_entity_batch.entity_table = 'civicrm_financial_trxn'
        AND civicrm_financial_trxn.id = civicrm_entity_batch.entity_id ) LEFT JOIN civicrm_batch ON civicrm_entity_batch.batch_id = civicrm_batch.id LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_contribution' AND
                                                    civicrm_contribution.id = civicrm_note.entity_id ) LEFT JOIN civicrm_option_group option_group_payment_instrument ON ( option_group_payment_instrument.name = 'payment_instrument') LEFT JOIN civicrm_option_value payment_instrument ON (civicrm_contribution.payment_instrument_id = payment_instrument.value
                               AND option_group_payment_instrument.id = payment_instrument.option_group_id )  LEFT JOIN civicrm_option_group option_group_contribution_status ON (option_group_contribution_status.name = 'contribution_status') LEFT JOIN civicrm_option_value contribution_status ON (civicrm_contribution.contribution_status_id = contribution_status.value
                               AND option_group_contribution_status.id = contribution_status.option_group_id )
Protect your investment in CiviCRM by  becoming a Member!

Interpolat

  • I post frequently
  • ***
  • Posts: 140
  • Karma: -1
    • Interpolat Solutions, LLC.
  • CiviCRM version: 4.4+
  • CMS version: Wordpress
  • MySQL version: 5.5+
  • PHP version: 5.4+
Re: Negative Contribution
December 31, 2013, 09:47:17 am
Getting a 404 error with contact-view link http://www.jmdezigns.com/civicrm/contact/view?reset=1&force=1&cid=38&selectedChild=contribute
Interpolat Solutions, LLC
Connecting the dots for you!
http://www.interpolat.com

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Negative Contribution
January 01, 2014, 01:13:06 pm
You'll need to go to the equivalent URL for your WordPress / Civi site. You can get there by going to contact's contribution tab, then viewing a contribution and then cancelling.
Protect your investment in CiviCRM by  becoming a Member!

Interpolat

  • I post frequently
  • ***
  • Posts: 140
  • Karma: -1
    • Interpolat Solutions, LLC.
  • CiviCRM version: 4.4+
  • CMS version: Wordpress
  • MySQL version: 5.5+
  • PHP version: 5.4+
Re: Negative Contribution
January 02, 2014, 07:15:50 pm
What table of the database controls DISPLAY of contribution data?
Interpolat Solutions, LLC
Connecting the dots for you!
http://www.interpolat.com

ChrisChinchilla

  • I post occasionally
  • **
  • Posts: 104
  • Karma: 3
  • CiviCRM version: 4.1.2
  • CMS version: Drupal 6 & 7
Re: Negative Contribution
January 02, 2014, 08:45:42 pm
it's the contribution table, probably 'civicrm_contribution'. We use negative contributions heavily, never had any issues either.
Melbourne CiviCRM meetup group - http://www.meetup.com/MelbourneCiviCRM/

Interpolat

  • I post frequently
  • ***
  • Posts: 140
  • Karma: -1
    • Interpolat Solutions, LLC.
  • CiviCRM version: 4.4+
  • CMS version: Wordpress
  • MySQL version: 5.5+
  • PHP version: 5.4+
Re: Negative Contribution
January 02, 2014, 10:31:29 pm
The contributions are being recorded in the database, but will not display under contact's contributions in admin panel.  So should I rule out any database issues here?  Is this the only place where DISPLAY of contributions is controlled within the database?  If so, I have some corrupt file somewhere, or potentially, interference from another Wordpress plugin.
Interpolat Solutions, LLC
Connecting the dots for you!
http://www.interpolat.com

ChrisChinchilla

  • I post occasionally
  • **
  • Posts: 104
  • Karma: 3
  • CiviCRM version: 4.1.2
  • CMS version: Drupal 6 & 7
Re: Negative Contribution
January 03, 2014, 10:04:39 pm
Are you using ACL at all? Can you see the contributions when logged in as super admin?
Melbourne CiviCRM meetup group - http://www.meetup.com/MelbourneCiviCRM/

Interpolat

  • I post frequently
  • ***
  • Posts: 140
  • Karma: -1
    • Interpolat Solutions, LLC.
  • CiviCRM version: 4.4+
  • CMS version: Wordpress
  • MySQL version: 5.5+
  • PHP version: 5.4+
Re: Negative Contribution
January 03, 2014, 11:12:29 pm
I figured out the problem.

So it turns out Civi does not like a financial type that I defined, and was using for these negative contributions, for a reason I still do not know.  So I switch financial type, and negative contributions show up just fine.
Interpolat Solutions, LLC
Connecting the dots for you!
http://www.interpolat.com

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Negative Contribution

This forum was archived on 2017-11-26.