<<

NAME

C4::Stats - Update Koha statistics (log)

SYNOPSIS

  use C4::Stats;

DESCRIPTION

The functions of this module deals with statistics table of Koha database.

FUNCTIONS

UpdateStats

  &UpdateStats($params);

Adds an entry to the statistics table in the Koha database, which acts as an activity log.

$params is an hashref whose expected keys are: branch : the branch where the transaction occurred type : the type of transaction (renew, issue, localuse, return, writeoff, payment itemnumber : the itemnumber of the item borrowernumber : the borrowernumber of the patron amount : the amount of the transaction other : sipmode itemtype : the type of the item accountno : the count ccode : the collection code of the item

type key is mandatory. For types used in C4::Circulation (renew,issue,localuse,return), the following other keys are mandatory: branch, borrowernumber, itemnumber, ccode, itemtype For types used in C4::Accounts (writeoff, payment), the following other keys are mandatory: branch, borrowernumber, itemnumber, ccode, itemtype If an optional key is not provided, the value '' is used for this key.

Returns undef if no $param is given

TotalPaid

  @total = &TotalPaid ( $time, [$time2], [$spreadsheet ]);

Returns an array containing the payments and writeoffs made between two dates $time and $time2, or on a specific one, or from $time onwards.

$time param is mandatory. If $time eq 'today', returns are limited to the current day If $time2 eq '', results are returned from $time onwards. If $time2 is undef, returns are limited to $time $spreadsheet param is optional and controls the sorting of the results.

Returns undef if no param is given

AUTHOR

Koha Development Team <http://koha-community.org/>

<<