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

SF.net SVN: ledger-smb:[4094] branches/1.3



Revision: 4094
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4094&view=rev
Author:   einhverfr
Date:     2011-11-26 11:42:42 +0000 (Sat, 26 Nov 2011)
Log Message:
-----------
Correcting filtering fo customers/vendors on ar/ap screens

Modified Paths:
--------------
    branches/1.3/Changelog
    branches/1.3/LedgerSMB/Form.pm
    branches/1.3/bin/arap.pl

Modified: branches/1.3/Changelog
===================================================================
--- branches/1.3/Changelog	2011-11-26 11:24:54 UTC (rev 4093)
+++ branches/1.3/Changelog	2011-11-26 11:42:42 UTC (rev 4094)
@@ -28,6 +28,7 @@
 * Corrected missing translation call in contact template (Chris T)
 * Corrected UI glitch when processing recurring transactions (Chris T)
 * Corrected double escaping bug in balance sheet template (Erik H)
+* Corrected filtering of customers/vendors on AR/AP screens (Chris T)
 
 Changelog for LedgerSMB 1.3.6
 * Including xelatex templates under directory templates/xedemo (Chris T)

Modified: branches/1.3/LedgerSMB/Form.pm
===================================================================
--- branches/1.3/LedgerSMB/Form.pm	2011-11-26 11:24:54 UTC (rev 4093)
+++ branches/1.3/LedgerSMB/Form.pm	2011-11-26 11:42:42 UTC (rev 4094)
@@ -1815,7 +1815,7 @@
 # this sub gets the id and name from $table
 sub get_name {
 
-    my ( $self, $myconfig, $table, $transdate ) = @_;
+    my ( $self, $myconfig, $table, $transdate, $entity_class) = @_;
 
     my @queryargs;
     my $where;
@@ -1848,10 +1848,11 @@
              LEFT JOIN country_tax_form ctf ON (c.taxform_id = ctf.id)
 		 WHERE (lower(e.name) LIKE ?
 		       OR c.meta_number ILIKE ?)
+                       AND coalesce(?, c.entity_class) = c.entity_class
 		$where
 		ORDER BY e.name/;
 
-    unshift( @queryargs, $name, $self->{"${table}number"} );
+    unshift( @queryargs, $name, $self->{"${table}number"} , $entity_class);
     my $sth = $self->{dbh}->prepare($query);
     $sth->execute(@queryargs) || $self->dberror($query);
 

Modified: branches/1.3/bin/arap.pl
===================================================================
--- branches/1.3/bin/arap.pl	2011-11-26 11:24:54 UTC (rev 4093)
+++ branches/1.3/bin/arap.pl	2011-11-26 11:42:42 UTC (rev 4094)
@@ -101,12 +101,18 @@
             $form->{oldinvtotal}  = 0;
             $form->{oldtotalpaid} = 0;
             $form->{calctax}      = 1;
+            if ($form->{vc} eq 'customer'){
+                $form->{entity_class} = 2;
+            } elsif ($form->{vc} eq 'vendor'){
+                $form->{entity_class} = 1;
+            }
 
             # return one name or a list of names in $form->{name_list}
             if (
                 (
                     $rv =
-                    $form->get_name( \%myconfig, $name, $form->{transdate} )
+                    $form->get_name( \%myconfig, $name, $form->{transdate} ,
+                                     $form->{entity_class})
                 ) > 1
               )
             {

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.