Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-19803

View Payment popup of a participant does not show refunds

    Details

    • Versioning Impact:
      None (no code merged)
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code
    • Verified?:
      No

      Description

      Short description. When a participant cancels a component of an event, and a part of his payment is refunded it does not show in the <>

      To reproduce on http://dmaster.demo.civicrm.org/ .

      • Register a participant for the Fall Fundraising dinner, and opt for a couple table (100 dollars).
      • Record in the same screen the payment (default option, also 100 dollars).
      • Change the selection to a single table (just 50 dollars).
      • Use Record Refund to pay back 50 dollars.

      My expectation is that the view payments popup show the refund, but it does not.

      On my own system I made the following change that solves the issue:

      From a1eda08c83e4ee2aa47447fb67fc82067ee032b5 Mon Sep 17 00:00:00 2001
      From: Klaas Eikelboom <klaas@kainuk.nl>
      Date: Wed, 28 Dec 2016 09:29:02 +0100
      Subject: [PATCH] Solution for not showing refunds, using a left join now
      
      ---
       custom/php/CRM/Contribute/BAO/Contribution.php | 4 ++--
       1 file changed, 2 insertions(+), 2 deletions(-)
      
      diff --git a/custom/php/CRM/Contribute/BAO/Contribution.php b/custom/php/CRM/Contribute/BAO/Contribution.php
      index 6408b34..3f828dd 100644
      --- a/custom/php/CRM/Contribute/BAO/Contribution.php
      +++ b/custom/php/CRM/Contribute/BAO/Contribution.php
      @@ -4076,9 +4076,9 @@ WHERE eft.financial_trxn_id IN ({$trxnId}, {$baseTrxnId['financialTrxnId']})
                 LEFT JOIN civicrm_entity_financial_trxn eft ON (eft.entity_id = con.id AND eft.entity_table = 'civicrm_contribution')
                 INNER JOIN civicrm_financial_trxn ft ON ft.id = eft.financial_trxn_id
                   AND ft.to_financial_account_id != %2
      -          INNER JOIN civicrm_entity_financial_trxn ef ON (ef.financial_trxn_id = ft.id AND ef.entity_table = 'civicrm_financial_item')
      +          LEFT JOIN civicrm_entity_financial_trxn ef ON (ef.financial_trxn_id = ft.id AND ef.entity_table = 'civicrm_financial_item')
                 LEFT JOIN civicrm_financial_item fi ON fi.id = ef.entity_id
      -          INNER JOIN civicrm_financial_account fa ON fa.id = fi.financial_account_id
      +          LEFT JOIN civicrm_financial_account fa ON fa.id = fi.financial_account_id
       
               WHERE con.id = %1 AND ft.is_payment = 1
               GROUP BY ft.id";
      -- 
      

        Attachments

          Activity

            People

            • Assignee:
              jitendra.purohit Jitendra Purohit
              Reporter:
              keikelboom Klaas Eikelboom
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: