OK, i've commited a HUGE rewritte of circulation. WARNING : it's partially tested, so feel free to test & report problems. At least, I could do issues & returns. I haven't got a chance to check transfers & only partially tested reserves. I'll do on friday (tomorrow I can't) However : there ARE bugs, otherwise i'm not a human, and afaik, i'm one ;-) Note that NOTHING should change in Koha behaviour. It's purely internal improvements. Here are the notes I've written while doing my modifs. Some errors may occur & some modif may have been forgotten, I apologize if you find some diffs. * moved getpatroninformation to Members.pm, renamed to GetPatronDetails and fixed API (removed $env as 1st parameter) * canbookbeissued renamed to CanBookBeIssued * currenissued renamed to GetCurrentIssues * getissues dropped (use GetCurrentIssues instead) * renewstatus renamed to CanBookBeRenewed and API fixed (removed $dbh and $env) * issuebook renamed to AddIssue * renewbook renamed to AddRenewal and API fixed (removed $dbh) * calc_charge renamed to GetIssuingCharge & API fixed (removed $env as 1st parameter) * createcharge renamed to AddIssuingCharge and API fixed (removed $env & $dbh * removed find_reserve (useless) * removed fixaccountforlostandreturned : it was used just once, and I think/fear it was highly boggus. It was supposed to update fines when a book marked lost was returned, but it seems it supposed some HLT specific parameters. My opinion is that it's better just to point the fact (that a returned book was marked lost), and let the librarian deal manually with the fine part (the behaviour depending on the library) * getiteminformation update to contain current borrower * getcurrentborrower removed (it's now in getiteminformation) * checkreserve_to_delete removed (unused) * getcurrentissues renamed to GetBorrowerIssues and improve Perl * GetIssuesFromBiblio renamed to GetBiblioIssues * get_current_return_date_of removed * GetItemIssues added : returns the list of issues for a given item (Note : It's not called GetIssues, as it could be confusing with serial issues) * GetItemIssue added : returns the current issue information if a book is issued (Note : It's not called GetIssue, as it could be confusing with serial issues) * get_transfert_infos renamed to GetTransfers * GetTransfersFromBib renamed to GetTRansfersFromTo * GetReservesForBranch and GetReservesToBranch moved to Reserves.pm * CheckItemNotify GetOverduesForBranch RemoveNotifyLine and AddNotifyLine moved to Overdues.pm * checktransferts removed (duplicate of GetTransfers) * GetLostItems moved to Biblio.pm * decode : question for Chris : what is decode really doing ? It's called by circulation.pl/cuecatbarcodedecode, and I really don't see what those 2 subs does. If you can explain... * itemseen moved to Biblio.pm and renamed to ModDateLastSeen * removed itemborrowed (used only once, can be merged with another query 3 lines before) * created GetItem in Biblio.pm. Replaced many getiteminformation by GetItem (those who just need item details, and nothing about circulation) * replaced some getiteminformation by GetBiblioFromItem & * AddIssue deeply rewritten : to create an issue, we mainly get a borrowernumber and a barcode. We read item information with GetItem, we need some biblio-level informations, read with GetBiblioFromItemNumber, and we read previous issues with GetIssue TODO : - remove getnextacctno, and replace it by an auto_increment field (the code is dirty & dangerous) - some $env in API still to remove - AddReturn returns useless informations - Rename Reserves2.pm to Reserves.pm - debug Overdues.pm & Reserves.pm - change some sub name (...Detail for example) & checking for some subs being 2 for the same goal be happy or upset, depending on how many things i've broken ;-) -- Paul POULAIN et Henri Damien LAURENT Consultants indépendants en logiciels libres et bibliothéconomie (http://www.koha-fr.org) Tel : 04 91 31 45 19