Aller directement à la fin des métadonnées
Aller au début des métadonnées

Overview

There are two ways to refund from an accounting perspective:

  1. Just reverse out the payment (credit the revenue and debit the asset account like a bank account that received the deposit and is used to pay the refund), or 
  2. Create a Pending Refund, then Process the Refund. From an accounting perspective, this means 1) Move the monies to be refunded into accounts payable (ie credit accounts payable and debit the original revenue account or a related contra revenue account), then 2) at some later point when the refund is paid (via check, etc) clear the funds from the accounts payable account using the account used to pay (debit accounts payable and credit bank account). See eg http://accounting-simplified.com/accounting-for-sales-return.html

1 was implemented first in core. 2 is being implemented as an extension.

Assumptions

  1. Only a single Accounts Payable account is needed.

Schema Changes

  1. Add 'Refunded' option value in Financial Item Status option group on upgrade and in tarball. Check if this causes issues anywhere, eg reports.

Create

$result = civicrm_api3('refund', 'create', array(
  'contribution_id' => 1, /* required */
  'total_amount' => 50,  /* optional, if not present, will default to amount outstanding;
                                      if present and line_items present, must equal sum of amounts for specified line_items */
  'line_items' => array ( /* optional, if not present, will default to all line items for contribution; 
                                       if present, must be non-null, ie have at least one line_item array */
    array( 
      'line_item_id' => 1, /* required */
      'amount' => 20, /* optional, if not present, will default to amount outstanding;
                         if present, must be for same amount as outstanding in initial implementation */
      ),
    ),
    array( 
      'line_item_id' => 2, 
      'amount' => 30,
    ),
  ),
);

The Refund API uses the financial_type for line items to determine the appropriate financial account to debit by finding the 'Is Contra Revenue Account' 'Is Revenue Account' entity_financial_account relationship for the FT, same as for a contribution.

For each line item fully refunded, 

More to come re: how to specify item to be partially refunded when a line item is for qty>1 (eg multiple tickets), how to specify the refund instrument, how to determine whether to record accounts payable, storage of refund.

Étiquette
  • Aucun

Creative Commons License
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-Share Alike 3.0 United States Licence.