How Admin fees are calculated

From OpenPetra Wiki
Jump to navigation Jump to search

Types of Admin fees

There are two types of admin fees:

Calculating the fees during posting a gift batch

Analysis of Progress code

When posting a gift batch (gr1210.p), the fees are processed for each gift and gift detail.

  1. "Process each part of the gift.": this goes through all gift details, and the call to Find_Account_Info is important to us.
    • this returns the list of admin fees that apply to this gift detail, based on the recipient and the motivation detail
    • see "Return a list of the fee codes to be charged." which goes through table a_motivation_detail_fee
  2. "Calculate any fees on the gift.": this loop goes through all the fees that apply to this gift detail, and calculate the admin fee depending on the gift detail amount. the calculation is done in gl4391.p.
    • Add_To_Fee_Totals is called to add up the fees in table a_processed_fee
      • for each gift detail, the amount for each fee is stored in this table. a_processed_date_d is not set yet. Processing is done during ICH stewardship.

How to write in OpenPetra

  • We already have the screens for maintaining the fees receivable and fees payable.
  • TODO: We are still missing the options in the maintain motivation detail screen, to assign fees to a motivation detail
  • During posting of the Gift Batch, in csharp\ICT\Petra\Server\lib\MFinance\Gift\Gift.Transactions.cs, in method PostGiftBatch, we need to calculate the fees to be processed.
    • LoadGiftBatchForPosting should load the tables a_fees_payable and a_fees_receivable similar to motivation details.
      • also load all the processed fees for this gift batch
    • This means adding the tables to the typed dataset GiftBatchTDS

Generating a admin fee batch during ICH Stewardship processing

  • all records from a_processed_fee are processed, summed up, and posted in the Admin Fee GLBatch.