ICH Stewardship calculation

From OpenPetra Wiki
Jump to navigation Jump to search

Intro

The stewardship calculation helps each office to calculate how much money they owe to other fields, and how much money they should be receiving from other fields.

Functionality involved

Generate and post the ICH stewardship batch

  • UI: gl2150-1.w to select the period for which the stewardship should be run.
  • Progress code: gl2160.p (called from accounts.w)


  • check that there are still open periods (a_ledger.a_provisional_year_end_flag_l)
  • Generate Admin Fee batch gl2150.p (read also: How Admin fees are calculated)
  • create a GL batch with name "ICH Stewardship"
  • for all foreign cost centres, find all gl transactions that have been posted but not been part of an ICH calculation
    • process income
    • process expense
    • process direct transfers
    • mark the gl transactions as processed
    • mark all gift details as processed (a_gift_detail.a_ich_number_i)
    • Balance the cost centre by entering an opposite transaction to ICH settlement
  • Update the balance of the ICH account (like a bank account).
  • Post the ICH Stewardship batch
  • print report if needed (not done for the moment)

after the calculation

UI

  • The user selects the output options.
  • Progress code: gi3000o.w

Print Admin Fee calculation

  • Progress code: gl2150p.p

DROP: Recalculate the balances of the ledger

This might not be necessary in OpenPetra anymore. For the moment we should assume all balances are correct all the time.

  • Progress code: gs5530.p


Calculate the report

  • Progress code: gl2161p.p (for the moment ignore gl2160p.p, since it is slower, and only needed for previous years)

Generate the HOSA file

Home office statement of accounts, is sent to all offices that this office has financial dealings with.

  • Progress code: gl2120-1.i, gl2120p.p, gi3200.p etc

Generate and Email the report

  • Generate ICH Stewardship FILE and send it via email to the ICH office
  • Progress code: gi3100.p
  • for creating CSV files: there is a class that allows you to create an XmlDocument, and then write it to CSV, and the names of the attributes are used as column headers. see csharp\ICT\Common\IO\Csv2Xml.cs, Ict.Common.IO TCsv2Xml, public static bool Xml2Csv(XmlDocument ADoc, string AOutCSVFile)
  • For sending emails with OpenPetra, please use the class at csharp\ICT\Common\IO\SmtpEmail.cs
    • A sample smtp email server is available from Timotheus on request, and you can add the Host, username and password to your config files.

DROP: Recipient gift statements

  • send a report of received gifts to the recipients.
  • not needed anymore, should be uploaded the Intranet solution
  • Progress code: gr1121p.p

Special treatment for branch processing

  • this is for departments within the current field.
  • for the moment we should ignore this.
  • Progress code: gi3400.p

Import all available stewardship reports

This is run only at the International Clearing House itself, eg on Ledger 4.

  • It imports all the stewardship Files that have been sent by all the offices via Email.
  • It also creates a stewardship batch on the ICH ledger
      File Name: giStewardshipImport.p
 Procedure Name: Import all available Stewardship Reports

NUnit tests for stewardship