From c0e83f8de881755f3b5e9b624c1c17ae2d4649ab Mon Sep 17 00:00:00 2001 From: einhverfr Date: Tue, 31 Oct 2006 03:30:39 +0000 Subject: Defaults table revision. Most COA's and System->defaults are known to be broken. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@413 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/OE.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'LedgerSMB/OE.pm') diff --git a/LedgerSMB/OE.pm b/LedgerSMB/OE.pm index 1a51a6cf..0992b00e 100755 --- a/LedgerSMB/OE.pm +++ b/LedgerSMB/OE.pm @@ -776,7 +776,9 @@ sub retrieve { my $var; my $ref; - $query = qq|SELECT curr, current_date FROM defaults|; + $query = qq| + SELECT value, current_date FROM defaults + WHERE setting_key = 'curr'|; ($form->{currencies}, $form->{transdate}) = $dbh->selectrow_array($query); @@ -952,7 +954,9 @@ sub exchangerate_defaults { my $buysell = ($form->{vc} eq "customer") ? "buy" : "sell"; # get default currencies - my $query = qq|SELECT substr(curr,1,3), curr FROM defaults|; + my $query = qq| + SELECT substr(value,1,3), value FROM defaults + WHERE setting_key = 'curr'|; ($form->{defaultcurrency}, $form->{currencies}) = $dbh->selectrow_array($query); @@ -1568,7 +1572,9 @@ sub order_details { $form->format_string(qw(text_amount text_decimal)); - $query = qq|SELECT weightunit FROM defaults|; + $query = qq| + SELECT value FROM defaults + WHERE setting_key = 'weightunit'|; ($form->{weightunit}) = $dbh->selectrow_array($query); $dbh->commit; @@ -2193,7 +2199,7 @@ sub get_soparts { } - $query = qq|SELECT current_date FROM defaults|; + $query = qq|SELECT current_date|; ($form->{transdate}) = $dbh->selectrow_array($query); # foreign exchange rates -- cgit v1.2.3