[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb: [1179] trunk/LedgerSMB/Form.pm
- Subject: SF.net SVN: ledger-smb: [1179] trunk/LedgerSMB/Form.pm
- From: ..hidden..
- Date: Thu, 10 May 2007 16:53:09 -0700
Revision: 1179
http://svn.sourceforge.net/ledger-smb/?rev=1179&view=rev
Author: einhverfr
Date: 2007-05-10 16:53:09 -0700 (Thu, 10 May 2007)
Log Message:
-----------
Adding performance patch for larger datasets
Modified Paths:
--------------
trunk/LedgerSMB/Form.pm
Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm 2007-05-10 23:31:38 UTC (rev 1178)
+++ trunk/LedgerSMB/Form.pm 2007-05-10 23:53:09 UTC (rev 1179)
@@ -2403,29 +2403,15 @@
}
my $query = qq|
- SELECT id
- FROM $arap
- WHERE id IN
- (SELECT MAX(id)
- FROM $arap
- WHERE $where AND ${vc}_id > 0)|;
-
- my ($trans_id) = $dbh->selectrow_array($query);
-
- $trans_id *= 1;
-
- $query = qq|
- SELECT ct.name AS $vc, a.curr AS currency, a.${vc}_id,
+ SELECT ct.name AS $vc, ct.curr AS currency, ct.id AS ${vc}_id,
current_date + ct.terms AS duedate,
- a.department_id, d.description AS department, ct.notes,
+ ct.notes,
ct.curr AS currency
- FROM $arap a
- JOIN $vc ct ON (a.${vc}_id = ct.id)
- LEFT JOIN department d ON (a.department_id = d.id)
- WHERE a.id = ?|;
+ FROM $vc ct
+ WHERE ct.id = (select customer_id from $arap where $where AND ${vc}_id IS NOT NULL order by id DESC limit 1)|;
$sth = $dbh->prepare($query);
- $sth->execute($trans_id) || $self->dberror($query);
+ $sth->execute() || $self->dberror($query);
my $ref = $sth->fetchrow_hashref(NAME_lc);
for ( keys %$ref ) { $self->{$_} = $ref->{$_} }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.