<<

GetSuppliersWithLateIssues

NAME

C4::Serials - Give functions for serializing.

SYNOPSIS

  use C4::Serials;

DESCRIPTION

Give all XYZ functions

FUNCTIONS

%supplierlist = &GetSuppliersWithLateIssues

this function get all suppliers with late issues.

return : the supplierlist into a hash. this hash containts id & name of the supplier

GetLateIssues

@issuelist = &GetLateIssues($supplierid)

this function select late issues on database

return : the issuelist into an table. Each line of this table containts a ref to a hash which it containts name,title,planneddate,serialseq,serial.subscriptionid from tables : subscription, serial & biblio

GetSubscriptionHistoryFromSubscriptionId

$sth = GetSubscriptionHistoryFromSubscriptionId() this function just prepare the SQL request. After this function, don't forget to execute it by using $sth->execute($subscriptionid) return : $sth = $dbh->prepare($query).

GetSerialStatusFromSerialId

$sth = GetSerialStatusFromSerialId(); this function just prepare the SQL request. After this function, don't forget to execute it by using $sth->execute($serialid) return : $sth = $dbh->prepare($query).

GetSerialInformation

$data = GetSerialInformation($serialid); returns a hash containing : items : items marcrecord (can be an array) serial table field subscription table field + information about subscription expiration

AddItem2Serial

$data = AddItem2Serial($serialid,$itemnumber); Adds an itemnumber to Serial record

UpdateClaimdateIssues

UpdateClaimdateIssues($serialids,[$date]);

Update Claimdate for issues in @$serialids list with date $date (Take Today if none)

GetSubscription

$subs = GetSubscription($subscriptionid) this function get the subscription which has $subscriptionid as id. return : a hashref. This hash containts subscription, subscriptionhistory, aqbudget.bookfundid, biblio.title

GetFullSubscription

   \@res = GetFullSubscription($subscriptionid)
   this function read on serial table.

PrepareSerialsData

   \@res = PrepareSerialsData($serialinfomation)
   where serialinformation is a hashref array

GetSubscriptionsFromBiblionumber

\@res = GetSubscriptionsFromBiblionumber($biblionumber) this function get the subscription list. it reads on subscription table. return : table of subscription which has the biblionumber given on input arg. each line of this table is a hashref. All hashes containt startdate, histstartdate,opacnote,missinglist,recievedlist,periodicity,status & enddate

GetFullSubscriptionsFromBiblionumber

   \@res = GetFullSubscriptionsFromBiblionumber($biblionumber)
   this function read on serial table.

GetSubscriptions

@results = GetSubscriptions($title,$ISSN,$biblionumber); this function get all subscriptions which has title like $title,ISSN like $ISSN and biblionumber like $biblionumber. return: a table of hashref. Each hash containt the subscription.

GetSerials

($totalissues,@serials) = GetSerials($subscriptionid); this function get every serial not arrived for a given subscription as well as the number of issues registered in the database (all types) this number is used to see if a subscription can be deleted (=it must have only 1 issue)

FIXME: We should return \@serials.

GetSerials2

($totalissues,@serials) = GetSerials2($subscriptionid,$status); this function get every serial waited for a given subscription as well as the number of issues registered in the database (all types) this number is used to see if a subscription can be deleted (=it must have only 1 issue)

GetLatestSerials

\@serials = GetLatestSerials($subscriptionid,$limit) get the $limit's latest serials arrived or missing for a given subscription return : a ref to a table which it containts all of the latest serials stored into a hash.

GetDistributedTo

$distributedto=GetDistributedTo($subscriptionid) This function select the old previous value of distributedto in the database.

GetNextSeq

GetNextSeq($val) $val is a hashref containing all the attributes of the table 'subscription' This function get the next issue for the subscription given on input arg return: all the input params updated.

GetSeq

$calculated = GetSeq($val) $val is a hashref containing all the attributes of the table 'subscription' this function transforms {X},{Y},{Z} to 150,0,0 for example. return: the sequence in integer format

GetExpirationDate

$sensddate = GetExpirationDate($subscriptionid)

this function return the expiration date for a subscription given on input args.

return the enddate

CountSubscriptionFromBiblionumber

$subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber) this count the number of subscription for a biblionumber given. return : the number of subscriptions with biblionumber given on input arg.

ModSubscriptionHistory

ModSubscriptionHistory($subscriptionid,$histstartdate,$enddate,$recievedlist,$missinglist,$opacnote,$librariannote);

this function modify the history of a subscription. Put your new values on input arg.

ModSerialStatus

ModSerialStatus($serialid,$serialseq, $planneddate,$publisheddate,$status,$notes)

This function modify the serial status. Serial status is a number.(eg 2 is "arrived") Note : if we change from "waited" to something else,then we will have to create a new "waited" entry

GetNextExpected

$nextexpected = GetNextExpected($subscriptionid)

Get the planneddate for the current expected issue of the subscription.

returns a hashref:

$nextexepected = { serialid => int planneddate => C4::Dates object }

ModNextExpected

ModNextExpected($subscriptionid,$date)

Update the planneddate for the current expected issue of the subscription. This will modify all future prediction results.

$date is a C4::Dates object.

ModSubscription

this function modify a subscription. Put all new values on input args.

NewSubscription

$subscriptionid = &NewSubscription($auser,branchcode,$aqbooksellerid,$cost,$aqbudgetid,$biblionumber, $startdate,$periodicity,$dow,$numberlength,$weeklength,$monthlength, $add1,$every1,$whenmorethan1,$setto1,$lastvalue1,$innerloop1, $add2,$every2,$whenmorethan2,$setto2,$lastvalue2,$innerloop2, $add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3, $numberingmethod, $status, $notes, $serialsadditems)

Create a new subscription with value given on input args.

return : the id of this new subscription

ReNewSubscription

ReNewSubscription($subscriptionid,$user,$startdate,$numberlength,$weeklength,$monthlength,$note)

this function renew a subscription with values given on input args.

NewIssue

NewIssue($serialseq,$subscriptionid,$biblionumber,$status, $planneddate, $publisheddate, $notes)

Create a new issue stored on the database. Note : we have to update the recievedlist and missinglist on subscriptionhistory for this subscription.

ItemizeSerials

ItemizeSerials($serialid, $info); $info is a hashref containing barcode branch, itemcallnumber, status, location $serialid the serialid return : 1 if the itemize is a succes. 0 and @error else. @error containts the list of errors found.

HasSubscriptionExpired

$has_expired = HasSubscriptionExpired($subscriptionid)

the subscription has expired when the next issue to arrive is out of subscription limit.

return : 0 if the subscription has not expired 1 if the subscription has expired 2 if has subscription does not have a valid expiration date set

SetDistributedto

SetDistributedto($distributedto,$subscriptionid); This function update the value of distributedto for a subscription given on input arg.

DelSubscription

DelSubscription($subscriptionid) this function delete the subscription which has $subscriptionid as id.

DelIssue

DelIssue($serialseq,$subscriptionid) this function delete an issue which has $serialseq and $subscriptionid given on input arg.

GetLateOrMissingIssues

($count,@issuelist) = &GetLateMissingIssues($supplierid,$serialid)

this function select missing issues on database - where serial.status = 4 or serial.status=3 or planneddate<now

return : a count of the number of missing issues the issuelist into a table. Each line of this table containts a ref to a hash which it containts name,title,planneddate,serialseq,serial.subscriptionid from tables : subscription, serial & biblio

removeMissingIssue

removeMissingIssue($subscriptionid)

this function removes an issue from being part of the missing string in subscriptionlist.missinglist column

called when a missing issue is found from the serials-recieve.pl file

updateClaim

&updateClaim($serialid)

this function updates the time when a claim is issued for late/missing items

called from claims.pl file

getsupplierbyserialid

($result) = &getsupplierbyserialid($serialid)

this function is used to find the supplier id given a serial id

return : hashref containing serialid, subscriptionid, and aqbooksellerid

check_routing

($result) = &check_routing($subscriptionid)

this function checks to see if a serial has a routing list and returns the count of routingid used to show either an 'add' or 'edit' link

addroutingmember

&addroutingmember($borrowernumber,$subscriptionid)

this function takes a borrowernumber and subscriptionid and add the member to the routing list for that serial subscription and gives them a rank on the list of either 1 or highest current rank + 1

reorder_members

&reorder_members($subscriptionid,$routingid,$rank)

this function is used to reorder the routing list

it takes the routingid of the member one wants to re-rank and the rank it is to move to - it gets all members on list puts their routingid's into an array - removes the one in the array that is $routingid - then reinjects $routingid at point indicated by $rank - then update the database with the routingids in the new order

delroutingmember

&delroutingmember($routingid,$subscriptionid)

this function either deletes one member from routing list if $routingid exists otherwise deletes all members from the routing list

getroutinglist

($count,@routinglist) = &getroutinglist($subscriptionid)

this gets the info from the subscriptionroutinglist for $subscriptionid

return : a count of the number of members on routinglist the routinglist into a table. Each line of this table containts a ref to a hash which containts routingid - a unique id, borrowernumber, ranking, and biblionumber of subscription

countissuesfrom

$result = &countissuesfrom($subscriptionid,$startdate)

abouttoexpire

$result = &abouttoexpire($subscriptionid)

this function alerts you to the penultimate issue for a serial subscription

returns 1 - if this is the penultimate issue returns 0 - if not

old_newsubscription

($subscriptionid) = &old_newsubscription($auser,$aqbooksellerid,$cost,$aqbudgetid,$biblionumber, $startdate,$periodicity,$firstacquidate,$dow,$irregularity,$numberpattern,$numberlength,$weeklength,$monthlength, $add1,$every1,$whenmorethan1,$setto1,$lastvalue1, $add2,$every2,$whenmorethan2,$setto2,$lastvalue2, $add3,$every3,$whenmorethan3,$setto3,$lastvalue3, $numberingmethod, $status, $callnumber, $notes, $hemisphere)

this function is similar to the NewSubscription subroutine but has a few different values passed in $firstacquidate - date of first serial issue to arrive $irregularity - the issues not expected separated by a '|' - eg. monthly issue but not expecting issue for june and july would have $irregularity of '6|7' $numberpattern - the number for an array of labels to reconstruct the javascript correctly in the subscription-add.tmpl file $callnumber - display the callnumber of the serial $hemisphere - either 2 = southern hemisphere or 1 = northern hemisphere - used for quarterly serials

return : the $subscriptionid number of the new subscription

old_modsubscription

($subscriptionid) = &old_modsubscription($auser,$aqbooksellerid,$cost,$aqbudgetid,$biblionumber, $startdate,$periodicity,$firstacquidate,$dow,$irregularity,$numberpattern,$numberlength,$weeklength,$monthlength, $add1,$every1,$whenmorethan1,$setto1,$lastvalue1, $add2,$every2,$whenmorethan2,$setto2,$lastvalue2, $add3,$every3,$whenmorethan3,$setto3,$lastvalue3, $numberingmethod, $status, $callnumber, $notes, $hemisphere, $subscriptionid)

this function is similar to the ModSubscription subroutine but has a few different values passed in $firstacquidate - date of first serial issue to arrive $irregularity - the issues not expected separated by a '|' - eg. monthly issue but not expecting issue for june and july would have $irregularity of '6|7' $numberpattern - the number for an array of labels to reconstruct the javascript correctly in the subscription-add.tmpl file $callnumber - display the callnumber of the serial $hemisphere - either 2 = southern hemisphere or 1 = northern hemisphere - used for quarterly serials

old_getserials

($totalissues,@serials) = &old_getserials($subscriptionid)

this function get a hashref of serials and the total count of them

return : $totalissues - number of serial lines the serials into a table. Each line of this table containts a ref to a hash which it containts serialid, serialseq, status,planneddate,notes,routingnotes from tables : serial where status is not 2, 4, or 5

GetNextDate

($resultdate) = &GetNextDate($planneddate,$subscription)

this function is an extension of GetNextDate which allows for checking for irregularity

it takes the planneddate and will return the next issue's date and will skip dates if there exists an irregularity - eg if periodicity is monthly and $planneddate is 2007-02-10 but if March and April is to be skipped then the returned date will be 2007-05-10

return : $resultdate - then next date in the sequence

Return 0 if periodicity==0

itemdata

  $item = &itemdata($barcode);

Looks up the item with the given barcode, and returns a reference-to-hash containing information about that item. The keys of the hash are the fields from the items and biblioitems tables in the Koha database.

AUTHOR

Koha Developement team <info@koha.org>

<<