From 94903b12ecba837d8717bcf91b7bcc25556a996a Mon Sep 17 00:00:00 2001 From: aurynn_cmd Date: Thu, 5 Jul 2007 18:44:24 +0000 Subject: 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 --- LedgerSMB/Form.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'LedgerSMB/Form.pm') 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 -- cgit v1.2.3