[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

small Patch for 1.2.13 / show customer number in customer select



Hi,

we use Ledger SMB now for a while .. and have customers with a large number
of addresses.

So its important for us, to see the customer number, while selecting a
customer, and nice if its sorted after the customer number.

so here the small patch, mabye someone will find it useful:

--------------------------- CUT ---------------------------

diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm
index abc280e..b2296a2 100755
--- a/LedgerSMB/Form.pm
+++ b/LedgerSMB/Form.pm
@@ -1942,17 +1942,17 @@ sub all_vc {
 
         $self->{"${vc}_id"} *= 1;
 
-        $query = qq|SELECT id, name
+        $query = qq|SELECT id, name, customernumber
                                          FROM $vc
                                         WHERE 1=1
                                                   $where
 
                                         UNION 
 
-                                       SELECT id,name
+                                       SELECT id,name, customernumber
                                          FROM $vc
                                         WHERE id = ?
-                                 ORDER BY name|;
+                                 ORDER BY customernumber, name|;
 
         push( @queryargs, $self->{"${vc}_id"} );
 
diff --git a/bin/is.pl b/bin/is.pl
index f615a23..61741f2 100755
--- a/bin/is.pl
+++ b/bin/is.pl
@@ -138,7 +138,7 @@ qq|<option
value="$_->{projectnumber}--$_->{id}">$_->{projectnumber}\n|;
         $form->{customer} = "$form->{customer}--$form->{customer_id}";
         for ( @{ $form->{all_customer} } ) {
             $form->{selectcustomer} .=
-              qq|<option value="$_->{name}--$_->{id}">$_->{name}\n|;
+              qq|<option value="$_->{name}--$_->{id}">$_->{customernumber}
$_->{name}\n|;
         }
     }
--------------------------- CUT ---------------------------


-- 
Florian Reitmeir