summaryrefslogtreecommitdiff
path: root/LedgerSMB/Form.pm
diff options
context:
space:
mode:
authoraurynn_cmd <aurynn_cmd@4979c152-3d1c-0410-bac9-87ea11338e46>2007-07-05 18:44:24 +0000
committeraurynn_cmd <aurynn_cmd@4979c152-3d1c-0410-bac9-87ea11338e46>2007-07-05 18:44:24 +0000
commit94903b12ecba837d8717bcf91b7bcc25556a996a (patch)
tree8e8185200c5a72e3cef0d7edf3391f38409a50ea /LedgerSMB/Form.pm
parent9aec614fb5c2470d3bb60e88bb6a71429d50b790 (diff)
Modifications to support toggling of the On-Hold field in the ar and ap tables;
An On-Hold toggle button was added to the Invoice Edit page, as well as a selector for All Invoices (default), Active Invoices, and Held Invoices to the AR and AP search pages. Modifications as needed to bring the code in line with linuxpoet's entity patches. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1350 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/Form.pm')
-rw-r--r--LedgerSMB/Form.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm
index 4a2d0a65..7d263fdd 100644
--- a/LedgerSMB/Form.pm
+++ b/LedgerSMB/Form.pm
@@ -1201,10 +1201,11 @@ sub get_name {
my $name = $self->like( lc $self->{$table} );
my $query = qq|
- SELECT * FROM $table
- WHERE (lower(name) LIKE ? OR ${table}number LIKE ?)
+ SELECT * FROM $table t
+ JOIN entity e ON t.entity_id = e.id
+ WHERE (lower(e.name) LIKE ? OR t.${table}number LIKE ?)
$where
- ORDER BY name|;
+ ORDER BY e.name|;
unshift( @queryargs, $name, $name );
my $sth = $self->{dbh}->prepare($query);
@@ -1726,7 +1727,7 @@ sub lastname_used {
$where = "AND $where " if $where;
$inv_notes = "ct.invoice_notes," if $vc eq 'customer';
my $query = qq|
- SELECT entity.name, ct.curr AS currency, ct.id AS ${vc}_id,
+ SELECT entity.name, ct.curr AS currency, entity_id AS ${vc}_id,
current_date + ct.terms AS duedate,
$inv_notes
ct.curr AS currency