summaryrefslogtreecommitdiff
path: root/LedgerSMB/PE.pm
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-10-31 03:30:39 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-10-31 03:30:39 +0000
commitc0e83f8de881755f3b5e9b624c1c17ae2d4649ab (patch)
treeed788a6c04e35faf8a6b26e8afe16096efa61608 /LedgerSMB/PE.pm
parente2bbcb8d35f48c73d989c3d01bc5a028df8aac32 (diff)
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
Diffstat (limited to 'LedgerSMB/PE.pm')
-rwxr-xr-xLedgerSMB/PE.pm18
1 files changed, 9 insertions, 9 deletions
diff --git a/LedgerSMB/PE.pm b/LedgerSMB/PE.pm
index 604e62e7..02b7b59d 100755
--- a/LedgerSMB/PE.pm
+++ b/LedgerSMB/PE.pm
@@ -283,7 +283,7 @@ sub list_stock {
}
$sth->finish;
- $query = qq|SELECT current_date FROM defaults|;
+ $query = qq|SELECT current_date|;
($form->{stockingdate}) = $dbh->selectrow_array($query) if !$form->{stockingdate};
$dbh->disconnect;
@@ -378,8 +378,7 @@ sub get_job {
my $ref;
if ($form->{id}) {
- $query = qq|SELECT weightunit
- FROM defaults|;
+ $query = qq|SELECT value FROM defaults WHERE setting_key = 'weightunit'|;
($form->{weightunit}) = $dbh->selectrow_array($query);
$query = qq|SELECT pr.*,
@@ -396,7 +395,9 @@ sub get_job {
LEFT JOIN partsgroup pg ON (pg.id = p.partsgroup_id)
WHERE pr.id = $form->{id}|;
} else {
- $query = qq|SELECT weightunit, current_date AS startdate FROM defaults|;
+ $query = qq|
+ SELECT value, current_date AS startdate FROM defaults
+ WHERE setting_key = 'weightunit'|;
}
$sth = $dbh->prepare($query);
@@ -491,7 +492,7 @@ sub get_customer {
my $ref;
if (! $form->{startdate}) {
- $query = qq|SELECT current_date FROM defaults|;
+ $query = qq|SELECT current_date|;
($form->{startdate}) = $dbh->selectrow_array($query);
}
@@ -654,7 +655,7 @@ sub stock_assembly {
my $rvh = $dbh->prepare($query) || $form->dberror($query);
if (! $form->{stockingdate}) {
- $query = qq|SELECT current_date FROM defaults|;
+ $query = qq|SELECT current_date|;
($form->{stockingdate}) = $dbh->selectrow_array($query);
}
@@ -1375,7 +1376,7 @@ sub project_sales_order {
# connect to database
my $dbh = $form->dbconnect($myconfig);
- my $query = qq|SELECT current_date FROM defaults|;
+ my $query = qq|SELECT current_date|;
my ($transdate) = $dbh->selectrow_array($query);
$form->all_years($myconfig, $dbh);
@@ -1468,8 +1469,7 @@ sub get_jcitems {
$sth->finish;
- $query = qq|SELECT curr
- FROM defaults|;
+ $query = qq|SELECT value FROM defaults WHERE setting_key = 'curr'|;
($form->{currency}) = $dbh->selectrow_array($query);
$form->{currency} =~ s/:.*//;
$form->{defaultcurrency} = $form->{currency};