Bug 11492: Keep routing notes when receiving next serial
This patch ensures the routing notes are carried over when generating the next serial. To test: 1) Create a routing list for a subscription 2) Add a borrower and a note to the routing list 3) Generate the next serial (serials-collection.pl) 4) Edit the routing list to see the notes 5) Note that the notes have disappeared 6) Apply patch 7) Edit the routing list, add a note 8) Generate the next serial 9) Edit the routing list and confirm the note is still there 10) Confirm you are still able to edit serials (serials-edit.pl) and routing notes stay Sponsored-by: Plant and Food Research Limited Signed-off-by: Nazlı Çetin <nazli@devinim.com.tr> Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> (cherry picked from commit2c25016a8e) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> (cherry picked from commit93cc499ed7) Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
94b15df0d4
commit
f4e55bbfd7
|
|
@ -1085,13 +1085,13 @@ sub ModSerialStatus {
|
|||
#It is a usual serial
|
||||
# 1st, get previous status :
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $query = "SELECT serial.subscriptionid,serial.status,subscription.periodicity
|
||||
my $query = "SELECT serial.subscriptionid,serial.status,subscription.periodicity,serial.routingnotes
|
||||
FROM serial, subscription
|
||||
WHERE serial.subscriptionid=subscription.subscriptionid
|
||||
AND serialid=?";
|
||||
my $sth = $dbh->prepare($query);
|
||||
$sth->execute($serialid);
|
||||
my ( $subscriptionid, $oldstatus, $periodicity ) = $sth->fetchrow;
|
||||
my ( $subscriptionid, $oldstatus, $periodicity, $routingnotes ) = $sth->fetchrow;
|
||||
my $frequency = GetSubscriptionFrequency($periodicity);
|
||||
|
||||
# change status & update subscriptionhistory
|
||||
|
|
@ -1099,16 +1099,15 @@ sub ModSerialStatus {
|
|||
if ( $status == DELETED ) {
|
||||
DelIssue( { 'serialid' => $serialid, 'subscriptionid' => $subscriptionid, 'serialseq' => $serialseq } );
|
||||
} else {
|
||||
|
||||
my $query = '
|
||||
UPDATE serial
|
||||
SET serialseq = ?, publisheddate = ?, publisheddatetext = ?,
|
||||
planneddate = ?, status = ?, notes = ?
|
||||
planneddate = ?, status = ?, notes = ?, routingnotes = ?
|
||||
WHERE serialid = ?
|
||||
';
|
||||
$sth = $dbh->prepare($query);
|
||||
$sth->execute( $serialseq, $publisheddate, $publisheddatetext,
|
||||
$planneddate, $status, $notes, $serialid );
|
||||
$planneddate, $status, $notes, $routingnotes, $serialid );
|
||||
$query = "SELECT * FROM subscription WHERE subscriptionid = ?";
|
||||
$sth = $dbh->prepare($query);
|
||||
$sth->execute($subscriptionid);
|
||||
|
|
@ -1162,9 +1161,7 @@ sub ModSerialStatus {
|
|||
WHERE subscriptionid = ?";
|
||||
$sth = $dbh->prepare($query);
|
||||
$sth->execute( $newlastvalue1, $newlastvalue2, $newlastvalue3, $newinnerloop1, $newinnerloop2, $newinnerloop3, $subscriptionid );
|
||||
|
||||
NewIssue( $newserialseq, $subscriptionid, $subscription->{'biblionumber'}, 1, $nextpubdate, $nextpubdate );
|
||||
|
||||
NewIssue( $newserialseq, $subscriptionid, $subscription->{'biblionumber'}, 1, $nextpubdate, $nextpubdate, $publisheddatetext, $notes, $routingnotes );
|
||||
# check if an alert must be sent... (= a letter is defined & status became "arrived"
|
||||
if ( $subscription->{letter} && $status == ARRIVED && $oldstatus != ARRIVED ) {
|
||||
require C4::Letters;
|
||||
|
|
@ -1530,7 +1527,7 @@ sub ReNewSubscription {
|
|||
|
||||
=head2 NewIssue
|
||||
|
||||
NewIssue($serialseq,$subscriptionid,$biblionumber,$status, $planneddate, $publisheddate, $notes)
|
||||
NewIssue($serialseq,$subscriptionid,$biblionumber,$status, $planneddate, $publisheddate, $notes, $routingnotes)
|
||||
|
||||
Create a new issue stored on the database.
|
||||
Note : we have to update the recievedlist and missinglist on subscriptionhistory for this subscription.
|
||||
|
|
@ -1540,7 +1537,7 @@ returns the serial id
|
|||
|
||||
sub NewIssue {
|
||||
my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate,
|
||||
$publisheddate, $publisheddatetext, $notes ) = @_;
|
||||
$publisheddate, $publisheddatetext, $notes, $routingnotes ) = @_;
|
||||
### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ?
|
||||
|
||||
return unless ($subscriptionid);
|
||||
|
|
@ -1562,6 +1559,7 @@ sub NewIssue {
|
|||
publisheddate => $publisheddate,
|
||||
publisheddatetext => $publisheddatetext,
|
||||
notes => $notes,
|
||||
routingnotes => $routingnotes
|
||||
}
|
||||
)->store();
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ if($op eq 'gennext' && @subscriptionid){
|
|||
my $subscriptionid = $subscriptionid[0];
|
||||
my $sth = $dbh->prepare("
|
||||
SELECT publisheddate, publisheddatetext, serialid, serialseq,
|
||||
planneddate
|
||||
planneddate, notes, routingnotes
|
||||
FROM serial
|
||||
WHERE status = 1 AND subscriptionid = ?
|
||||
");
|
||||
|
|
@ -88,7 +88,8 @@ if($op eq 'gennext' && @subscriptionid){
|
|||
my $planneddate = $date_received_today ? dt_from_string : $nextpublisheddate;
|
||||
## Creating the new issue
|
||||
NewIssue( $newserialseq, $subscriptionid, $subscription->{'biblionumber'},
|
||||
1, $planneddate, $nextpublisheddate );
|
||||
1, $planneddate, $nextpublisheddate, $issue->{publisheddatetext},
|
||||
$issue->{notes}, $issue->{routingnotes} );
|
||||
|
||||
## Updating the subscription seq status
|
||||
my $squery = "UPDATE subscription SET lastvalue1=?, lastvalue2=?, lastvalue3=?, innerloop1=?, innerloop2=?, innerloop3=?
|
||||
|
|
|
|||
|
|
@ -238,7 +238,8 @@ if ( $op and $op eq 'serialchangestatus' ) {
|
|||
$plan_date,
|
||||
$pub_date,
|
||||
$publisheddatetexts[$i],
|
||||
$notes[$i]
|
||||
$notes[$i],
|
||||
$serialdatalist[0]->{'routingnotes'}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ subtest 'Values should not be erased on editing' => sub {
|
|||
);
|
||||
my ( undef, undef, $itemnumber ) = C4::Items::AddItemFromMarc( $item_record, $biblionumber );
|
||||
my $serialid = C4::Serials::NewIssue( "serialseq", $subscriptionid, $biblionumber,
|
||||
1, undef, undef, "publisheddatetext", "notes" );
|
||||
1, undef, undef, "publisheddatetext", "notes", "routingnotes" );
|
||||
C4::Serials::AddItem2Serial( $serialid, $itemnumber );
|
||||
my $serial_info = C4::Serials::GetSerialInformation($serialid);
|
||||
my ($itemcallnumber_info) = grep { $_->{kohafield} eq 'items.itemcallnumber' }
|
||||
|
|
|
|||
Loading…
Reference in New Issue