From ef272155e0eeab150b81098a4c2d1b8e554e2985 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adolfo=20Rodr=C3=ADguez?= <adolfo.rodriguez@xercode.es>
Date: Fri, 22 Nov 2024 10:47:29 +0100
Subject: [PATCH] Bug 38515: Keep serial notes when generating next serial.

This patch prevents the loss of notes in serials when generating next serial

Test plan:
1 Create a subscription, fill the notes field for the serial with Expected status and activate the system preference PreserveSerialNotes
2 Click Generate next
3 Check that the notes from the now Late serial are gone and that the new serial doesn't have notes.
4 Apply patch, restart services
5 Edit the serial with Expected status to fill the notes field.
6 Click Generate next
7 Check that the notes from the now Late serial are kepts and that they have been copied to the new serial.

Signed-off-by: David Nind <david@davidnind.com>
---
 serials/serials-collection.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/serials/serials-collection.pl b/serials/serials-collection.pl
index 025bde2179..c6651ecef1 100755
--- a/serials/serials-collection.pl
+++ b/serials/serials-collection.pl
@@ -71,7 +71,7 @@ if($op eq 'cud-gennext' && @subscriptionid){
             my $planneddate = $date_received_today ? dt_from_string : $issue->{planneddate};
             ModSerialStatus( $issue->{serialid}, $issue->{serialseq},
                     $planneddate, $issue->{publisheddate},
-                    $issue->{publisheddatetext}, $status, "", $count_forward );
+                    $issue->{publisheddatetext}, $status, $issue->{notes}, $count_forward );
         } else {
             require C4::Serials::Numberpattern;
             my $subscription = GetSubscription($subscriptionid);
-- 
2.39.5