PaypalDonationExtension-Finance

From PeacockWiki

Jump to: navigation, search

Provides a treasurer with an interface to record financial details of the wiki.

Contents

Details

  • Version 0.1
  • Date 9 Apr 2007
  • Tested on MediaWiki 1.7.1, PHP 5.1.6 (apache2handler), MySQL 5.0.24a-Debian_9ubuntu0.1-log

Features

  • Facilitates grouping financial data by defined date periods
  • Allows recording of simple line items
  • Allows a line item to be included in another time period for reporting purposes.

Design

This extension requires PaypalDonationExtension to be installed.

This extension makes use of two additional tables: lineitems, containing incomes and expendatures, and periods, marking periods of time used for reporting.

An initial period should be created at a time before existing records. This will mark the beginning time for reporting, as each period extends from its defined end date, to the previos end found in the database.

It is intended for these periods to be roughly a month in length, allowing descrete reports of the status of lyricwikis finances, inline with major expences (hosting). Periods however may be any duration required.

lineitems represent a single income or expendature.

Each item has a date, a description, an amount, and an extra period field.

Items are assigned within a period based on the items date. The description is a short text field intended to summaries the item. The amount is a decimal number, positive for income, negative for expendature.

The extra period field allows the lineitem to be assigned to another time period for reporting purposes. For example, donations for January may be collected at the beginning of Febuary. The transaction occurs in Febuary, however the item is representative of Januarys activities, and therefore, may be included in Januarys report. Each item is only shown in one report.

A total of all paypal donations is automatically appended to the report for the current period. This total shows only donations falling within the current period.

Database

CREATE TABLE  `wiki`.`finance_period` (
  `id` int(11) NOT NULL auto_increment,
  `end_date` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;

CREATE TABLE  `wiki`.`finance_lineitem` (
  `id` int(11) NOT NULL auto_increment,
  `item` text NOT NULL,
  `date` datetime NOT NULL default '0000-00-00 00:00:00',
  `amount` double NOT NULL default '0',
  `period` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=27 DEFAULT CHARSET=latin1;

Files

  • pp_finance.php
    Allows Treasurer to edit financial information
  • pp_finance-api.php
    Functions allowing plugins access to financial information

API

  • class finance_api
    • static function getPeriods()
    • static function lastPeriod()
    • static function getPeriod($id=null)
    • static function getTransactions($period)
    • static function getReport($period)
    • static function getItem($id)
    • static function printItems($items)
    • static function printPeriods($periods)

Usage

Treasurers may access the Special:Finance page, where they are shown a list of periods.

Periods may be added via the form at the bottom of the screen.

Once added, periods may be selected for editing. Once selected, the periods details appear in the form, where they may be modified and update, deleted, or discarded, resulting in no change.

Once periods are defined, the treasurer may continue to edit items within defined periods, by clicking on the date of the period.

The procedure for adding/editing/deleting lineitems is much the same as for periods.

The items view shows two sections, transactions, and reports.

Transactions shows items dated within the period viewed. Reports shows lineitems assigned to that period (see Design).

Example

see Special:Finance

Installation

Use the sql code above to create a table in the wiki database.

Copy the two files into the same location as the paypal extension (extensions/paypal/). The file will be automatically detected and loaded

To check to see if it is installed properly, visit your Version page, eg Special:Version.

You should see the following items:

  • Extensions:
    • Extension functions:
      • paypalSetupFinance

Login to the wiki with an account with userrights rights (bureaucrat), and assign the treasurer role to those responsible for managing finances.

Releases

Todo

PaypalDonationExtension-Finance/Todo Full Todo

RoadMap

PaypalDonationExtension-Finance/RoadMap Full RoadMap

History

PaypalDonationExtension-Finance/History Full History

Source Code

Personal tools