From bb7ed168f52948d0af5e8065b062b6440b804b3e Mon Sep 17 00:00:00 2001
From: Fridolyn SOMERS <fridolyn.somers@biblibre.com>
Date: Wed, 3 Jul 2013 14:24:23 +0200
Subject: [PATCH] Bug 10535 - by default sort funds by name

In parcels.pl, and other acquisition pages, the funds are not sorted by name in combo-box.
With a great number of founds, it is difficult to find one.

This patch adds a default value to $orderby arg of C4::Budgets::GetBudgets.

Test plan :
- Create a new fund with a name begining with 'z' and set you has owner.
- Create a new fund with a name begining with 'a' and set you has owner.
- Got to a vendor and click "Receive shipments"
- Look at fund combobox
=> Funds are sorted by name

Signed-off-by: Silvia Simonetti <s.simonetti@cineca.it>
---
 C4/Budgets.pm |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/C4/Budgets.pm b/C4/Budgets.pm
index 2c78284..a648773 100644
--- a/C4/Budgets.pm
+++ b/C4/Budgets.pm
@@ -709,7 +709,8 @@ gets all budgets
 
 # -------------------------------------------------------------------
 sub GetBudgets {
-    my ($filters,$orderby) = @_;
+    my $filters = shift;
+    my $orderby = shift || 'budget_name';
     return SearchInTable("aqbudgets",$filters, $orderby, undef,undef, undef, "wide");
 }
 
-- 
1.7.10.4