[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] CVS: koha/C4 Bull.pm,1.9,1.10
From: |
Henri-Damien LAURENT |
Subject: |
[Koha-cvs] CVS: koha/C4 Bull.pm,1.9,1.10 |
Date: |
Thu, 16 Jun 2005 12:10:15 -0700 |
Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11586/C4
Modified Files:
Bull.pm
Log Message:
Adding 2 status to serial issues :
- delete : to delete the current issue
- not issued : to distinguish missing from not issued serial number.
Index: Bull.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Bull.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** Bull.pm 4 May 2005 15:40:01 -0000 1.9
--- Bull.pm 16 Jun 2005 19:10:10 -0000 1.10
***************
*** 51,55 ****
&Find_Next_Date, &Get_Next_Seq
&hassubscriptionexpired &subscriptionexpirationdate
&subscriptionrenew
! &getSupplierListWithLateIssues &GetLateIssues);
sub getSupplierListWithLateIssues {
--- 51,55 ----
&Find_Next_Date, &Get_Next_Seq
&hassubscriptionexpired &subscriptionexpirationdate
&subscriptionrenew
! &getSupplierListWithLateIssues &GetLateIssues
&serialdelete);
sub getSupplierListWithLateIssues {
***************
*** 275,279 ****
my $dbh = C4::Context->dbh;
# status = 2 is "arrived"
! my $sth=$dbh->prepare("select serialid,serialseq, status, planneddate
from serial where subscriptionid = ? and status <>2 and status <>4");
$sth->execute($subscriptionid);
my @serials;
--- 275,279 ----
my $dbh = C4::Context->dbh;
# status = 2 is "arrived"
! my $sth=$dbh->prepare("select serialid,serialseq, status, planneddate
from serial where subscriptionid = ? and status <>2 and status <>4 and status
<>5");
$sth->execute($subscriptionid);
my @serials;
***************
*** 289,296 ****
}
! sub serialchangestatus {
! my ($serialid,$serialseq,$planneddate,$status)address@hidden;
! # warn "($serialid,$serialseq,$planneddate,$status)";
! # 1st, get previous status : if we change from "waited" to something
else, then we will have to create a new "waited" entry
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare("select subscriptionid,status from serial where
serialid=?");
--- 289,294 ----
}
! sub serialdelete {
! my ($serialid,$serialseq)address@hidden;
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare("select subscriptionid,status from serial where
serialid=?");
***************
*** 298,314 ****
my ($subscriptionid,$oldstatus) = $sth->fetchrow;
# change status & update subscriptionhistory
! $sth = $dbh->prepare("update serial set
serialseq=?,planneddate=?,status=? where serialid = ?");
! $sth->execute($serialseq,$planneddate,$status,$serialid);
$sth = $dbh->prepare("select missinglist,recievedlist from
subscriptionhistory where subscriptionid=?");
$sth->execute($subscriptionid);
my ($missinglist,$recievedlist) = $sth->fetchrow;
! if ($status eq 2) {
! $recievedlist .= ",$serialseq";
! }
! if ($status eq 4) {
! $missinglist .= ",$serialseq";
! }
$sth=$dbh->prepare("update subscriptionhistory set recievedlist=?,
missinglist=? where subscriptionid=?");
$sth->execute($recievedlist,$missinglist,$subscriptionid);
# create new waited entry if needed (ie : was a "waited" and has
changed)
if ($oldstatus eq 1 && $status ne 1) {
--- 296,336 ----
my ($subscriptionid,$oldstatus) = $sth->fetchrow;
# change status & update subscriptionhistory
! my $sth = $dbh->prepare("delete * from serial where serialid = ?");
! $sth->execute($serialid);
$sth = $dbh->prepare("select missinglist,recievedlist from
subscriptionhistory where subscriptionid=?");
$sth->execute($subscriptionid);
my ($missinglist,$recievedlist) = $sth->fetchrow;
! $recievedlist =~ s/",$serialseq"//;
! $missinglist =~ s/",$serialseq"//;
$sth=$dbh->prepare("update subscriptionhistory set recievedlist=?,
missinglist=? where subscriptionid=?");
$sth->execute($recievedlist,$missinglist,$subscriptionid);
+ }
+
+ sub serialchangestatus {
+ my ($serialid,$serialseq,$planneddate,$status)address@hidden;
+ # warn "($serialid,$serialseq,$planneddate,$status)";
+ # 1st, get previous status : if we change from "waited" to something
else, then we will have to create a new "waited" entry
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("select subscriptionid,status from serial where
serialid=?");
+ $sth->execute($serialid);
+ my ($subscriptionid,$oldstatus) = $sth->fetchrow;
+ # change status & update subscriptionhistory
+ if ($status eq 6){
+ delissue($serialseq, $subscriptionid)
+ }else{
+ $sth = $dbh->prepare("update serial set
serialseq=?,planneddate=?,status=? where serialid = ?");
+ $sth->execute($serialseq,$planneddate,$status,$serialid);
+ $sth = $dbh->prepare("select missinglist,recievedlist from
subscriptionhistory where subscriptionid=?");
+ $sth->execute($subscriptionid);
+ my ($missinglist,$recievedlist) = $sth->fetchrow;
+ if ($status eq 2) {
+ $recievedlist .= ",$serialseq";
+ }
+ $missinglist .= ",$serialseq" if ($status eq 4) ;
+ $missinglist .= ",not issued $serialseq" if ($status eq 5);
+ $sth=$dbh->prepare("update subscriptionhistory set
recievedlist=?, missinglist=? where subscriptionid=?");
+ $sth->execute($recievedlist,$missinglist,$subscriptionid);
+ }
+
# create new waited entry if needed (ie : was a "waited" and has
changed)
if ($oldstatus eq 1 && $status ne 1) {
***************
*** 335,338 ****
--- 357,367 ----
}
+ sub delissue {
+ my ($serialseq,$subscriptionid) = @_;
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("delete from serial where serialseq= ? and
subscriptionid= ? ");
+ $sth->execute($serialseq,$subscriptionid);
+ }
+
sub Get_Next_Date(@) {
my ($planneddate,$subscription) = @_;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] CVS: koha/C4 Bull.pm,1.9,1.10,
Henri-Damien LAURENT <=
- Prev by Date:
[Koha-cvs] CVS: koha/koha-tmpl/intranet-tmpl/default/en/bull statecollection.tmpl,1.5,1.6
- Next by Date:
[Koha-cvs] CVS: koha/koha-tmpl/opac-tmpl/css/en opac-auth.tmpl,1.3,1.3.2.1 opac-MARCdetail.tmpl,1.5.2.2,1.5.2.3 opac-user.tmpl,1.8.2.3,1.8.2.4
- Previous by thread:
[Koha-cvs] CVS: koha/koha-tmpl/intranet-tmpl/default/en/bull statecollection.tmpl,1.5,1.6
- Next by thread:
[Koha-cvs] CVS: koha/koha-tmpl/opac-tmpl/css/en opac-auth.tmpl,1.3,1.3.2.1 opac-MARCdetail.tmpl,1.5.2.2,1.5.2.3 opac-user.tmpl,1.8.2.3,1.8.2.4
- Index(es):