Bug 5236 Followup: items table information being keyed by biblionumber instead!
authorIan Walls <ian.walls@bywatersolutions.com>
Mon, 3 Oct 2011 14:45:59 +0000 (10:45 -0400)
committerChris Cormack <chrisc@catalyst.net.nz>
Mon, 3 Oct 2011 19:54:40 +0000 (08:54 +1300)
This patch fixes an error with bugfix 5236; any item-table information in the PREDUE letter
was being parsed with biblionumber as the key, instead of itemnumber.  Unless itemnumber == biblionumber,
this will ALWAYS return the wrong information.

I've moved the item table parsing line to within the if ($itemnumber) conditional check, and replaced
the key to use the itemnumber instead of the biblionumber.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
misc/cronjobs/advance_notices.pl

index 3ca4835..1fa358f 100755 (executable)
@@ -349,11 +349,11 @@ sub parse_letter {
     }
     if ( $params->{'itemnumber'} ) {
         C4::Letters::parseletter( $params->{'letter'}, 'issues', $params->{'itemnumber'} );
+        C4::Letters::parseletter( $params->{'letter'}, 'items', $params->{'itemnumber'} );
     }
     if ( $params->{'biblionumber'} ) {
         C4::Letters::parseletter( $params->{'letter'}, 'biblio',      $params->{'biblionumber'} );
         C4::Letters::parseletter( $params->{'letter'}, 'biblioitems', $params->{'biblionumber'} );
-        C4::Letters::parseletter( $params->{'letter'}, 'items', $params->{'biblionumber'} );
     }
 
     return $params->{'letter'};