diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-10-20 01:05:26 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-10-20 01:05:26 +0000 |
commit | 70c29cebc700cf9cd2f63b0a333b61aca85ac30d (patch) | |
tree | 81ad8b8abc6a572f80a073388298acb941db7696 /LedgerSMB | |
parent | f084ce511dbdda4fcb65c6f64746c201cc5f2caa (diff) |
Removing references to ca.pl's list_transactions function and moving these to a gl report.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2374 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rwxr-xr-x | LedgerSMB/Auth/DB.pm | 2 | ||||
-rw-r--r-- | LedgerSMB/GL.pm | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/LedgerSMB/Auth/DB.pm b/LedgerSMB/Auth/DB.pm index de9d23fe..4ffa5a0a 100755 --- a/LedgerSMB/Auth/DB.pm +++ b/LedgerSMB/Auth/DB.pm @@ -70,6 +70,7 @@ sub session_check { || $form->dberror( __FILE__ . ':' . __LINE__ . ': Looking for session: ' ); my $sessionValid = $checkQuery->rows; + $dbh->commit; if ($sessionValid) { @@ -112,7 +113,6 @@ sub session_check { print qq|Set-Cookie: ${LedgerSMB::Sysconfig::cookie_name}=; path=$path;\n|; return 0; } - $dbh->commit; } sub session_create { diff --git a/LedgerSMB/GL.pm b/LedgerSMB/GL.pm index 25b0206d..63201e69 100644 --- a/LedgerSMB/GL.pm +++ b/LedgerSMB/GL.pm @@ -234,6 +234,12 @@ sub all_transactions { my $sth; my $var; my $null; + if ($form->{accno} and !$form->{chart_id}){ + my $sth = $dbh->prepare('SELECT id FROM chart WHERE accno = ?'); + $sth->execute($form->{accno}); + ($form->{chart_id}) = $sth->fetchrow_array(); + delete $form->{accno}; + } my ( $glwhere, $arwhere, $apwhere ) = ( "1 = 1", "1 = 1", "1 = 1" ); @@ -304,13 +310,13 @@ sub all_transactions { $var = $dbh->quote( $form->like( lc $form->{description} ) ); $glwhere .= " AND lower(g.description) LIKE $var"; - $arwhere .= " AND (lower(ct.name) LIKE $var + $arwhere .= " AND (lower(e.name) LIKE $var OR lower(ac.memo) LIKE $var OR a.id IN (SELECT DISTINCT trans_id FROM invoice WHERE lower(description) LIKE $var))"; - $apwhere .= " AND (lower(ct.name) LIKE $var + $apwhere .= " AND (lower(e.name) LIKE $var OR lower(ac.memo) LIKE $var OR a.id IN (SELECT DISTINCT trans_id FROM invoice @@ -485,7 +491,6 @@ sub all_transactions { $approved = (ac.approved AND a.approved)) ORDER BY $sortorder|; - my $sth = $dbh->prepare($query); $sth->execute || $form->dberror($query); |