diff options
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); |