C4::Bookfund - Koha functions for dealing with bookfund, currency & money.
the functions in this modules deal with bookfund, currency and money. They allow to get and/or set some informations for a specific budget or currency.
$dataaqbookfund = &GetBookFund($bookfundid);
this function get the bookfundid,
the branchcode from aqbookfund table for bookfundid given on input arg.
$dataaqbookfund is a hashref full of bookfundid,
$sth = &GetBookFundsId Read on aqbookfund table and execute a simple SQL query.
return: $sth->execute. Don't forget to fetch row from the database after using this function by using, for example, $sth->fetchrow_hashref;
@results is an array of id existing on the database.
@results = &GetBookFunds;
Returns a list of all book funds.
@results is an array of references-to-hash,
whose keys are fields from the aqbookfund and aqbudget tables of the Koha database.
Results are ordered alphabetically by book fund name.
@currencies = &GetCurrencies;
Returns the list of all known currencies.
$currencies is a array; its elements are references-to-hash,
whose keys are the fields from the currency table in the Koha database.
( $spent, $comtd ) = &GetBookFundBreakdown( $id, $start, $end );
returns the total comtd & spent for a given bookfund, and a given year used in acqui-home.pl
&NewBookFund(bookfundid, bookfundname, branchcode);
this function create a new bookfund into the database.
This function updates the bookfundname and the branchcode in the aqbookfund table.
@results = SearchBookFund( $bookfundid,$filter,$filter_bookfundid, $filter_bookfundname,$filter_branchcode);
this function searchs among the bookfunds corresponding to our filtering rules.
Sets the exchange rate for
$currency to be
$number = Countbookfund($bookfundid);
this function count the number of bookfund with id given on input arg. return : the result of the SQL query as a number.
$foreignprice = &ConvertCurrency($currency, $localprice);
Converts the price
$localprice to foreign currency
$currency by dividing by the exchange rate,
and returns the result.
If no exchange rate is found,
&ConvertCurrency assumes the rate is one to one.
&DelBookFund($bookfundid); this function delete a bookfund which has $bokfundid as parameter on aqbookfund table and delete the approriate budget.
Koha Developement team <email@example.com>