[Koha-patches] [PATCH] kohabug 2390 Setting default fund for new orders

Galen Charlton galen.charlton at liblime.com
Fri Jul 25 17:37:49 CEST 2008


From: Chris Nighswonger <chris.nighswonger at liblime.com>

If a new order was created and no fund selected, a db error was thrown due to the
'bookfundid' field being set to NULL. This patch sets the first fund retrieved from
available funds as the default selection in the scrolling list.

A further enhancement might be to allow the library to choose which fund is the
default fund.

Signed-off-by: Galen Charlton <galen.charlton at liblime.com>
---
 acqui/neworderempty.pl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl
index 103f98d..1340543 100755
--- a/acqui/neworderempty.pl
+++ b/acqui/neworderempty.pl
@@ -186,7 +186,7 @@ my $CGIbookfund = CGI::scrolling_list(
     -name     => 'bookfund',
 	-id       => 'bookfund',
     -values   => \@select_bookfund,
-    -default  => $data->{'bookfundid'},
+    -default  => ($data->{'bookfundid'} ? $data->{'bookfundid'} : $select_bookfund[0]),
     -labels   => \%select_bookfunds,
 	#-size     => 1,
 	-tabindex =>'',
-- 
1.5.5.GIT




More information about the Koha-patches mailing list