diff options
author | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-11-02 23:24:28 +0000 |
---|---|---|
committer | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-11-02 23:24:28 +0000 |
commit | da36e0095ae8b05e124507abd70b7122a94c15f1 (patch) | |
tree | e2c0fe8d0bfbf6643af697877218453fa054d9cb /LedgerSMB/GL.pm | |
parent | 24fa7eca64770b4c2fe9690ba88d77d9ba1f1b75 (diff) |
Change defaults queries to using new table structure
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@469 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/GL.pm')
-rwxr-xr-x | LedgerSMB/GL.pm | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/LedgerSMB/GL.pm b/LedgerSMB/GL.pm index c6fe1037..8d31c453 100755 --- a/LedgerSMB/GL.pm +++ b/LedgerSMB/GL.pm @@ -500,13 +500,17 @@ sub transaction { if ($form->{id}) { - $query = "SELECT closedto, revtrans - FROM defaults"; + $query = "SELECT setting_key, value + FROM defaults + WHERE setting_key IN + ('closedto', 'revtrans')"; $sth = $dbh->prepare($query); $sth->execute || $form->dberror($query); - ($form->{closedto}, $form->{revtrans}) = $sth->fetchrow_array; + my $results = $sth->fetchall_hashref('setting_key'); + $form->{closedto} = $results->{'closedto'}->{'value'}; + $form->{revtrans} = $results->{'revtrans'}->{'value'}; $sth->finish; $query = qq|SELECT g.*, d.description AS department @@ -544,13 +548,19 @@ sub transaction { $form->get_recurring($dbh); } else { - $query = "SELECT current_date AS transdate, closedto, revtrans - FROM defaults"; + $query = "SELECT current_date AS transdate, setting_key, value + FROM defaults + WHERE setting_key IN + ('closedto', 'revtrans')"; + $sth = $dbh->prepare($query); $sth->execute || $form->dberror($query); - ($form->{transdate}, $form->{closedto}, $form->{revtrans}) = $sth->fetchrow_array; + my $results = $sth->fetchall_hashref('setting_key'); + $form->{closedto} = $results->{'closedto'}->{'value'}; + $form->{revtrans} = $results->{'revtrans'}->{'value'}; + $form->{transdate} = $results->{'revtrans'}->{'transdate'}; } $sth->finish; |