Skip to content

Commit

Permalink
Removing a sql query with invalid syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
einhverfr committed Oct 23, 2014
1 parent f40522d commit 5f1ce9f
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions LedgerSMB/IC.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1953,47 +1953,6 @@ sub create_links {
( $form->{currencies} ) = $dbh->selectrow_array($query);

}
else {

# Dieter: FIXME left joins not working
$query = qq|
SELECT (SELECT value FROM defaults
WHERE setting_key = 'weightunit')
AS weightunit, current_date AS priceupdate,
(SELECT value FROM defaults
WHERE setting_key = 'curr') AS currencies,
a1.accno AS inventory_accno,
a1.description AS inventory_description,
a2.accno AS income_accno,
a2.description AS income_description,
a3.accno AS expense_accno,
a3.description AS expense_description
FROM account a1, account a2, account a3
WHERE a1.id IN (SELECT value::int FROM defaults
WHERE setting_key = 'inventory_accno_id')
AND a2.id IN (SELECT value::int FROM defaults
WHERE setting_key = 'income_accno_id')
AND a3.id IN (SELECT value::int FROM defaults
WHERE setting_key
= 'expense_accno_id')|;
$sth = $dbh->prepare($query);
$sth->execute || $form->dberror($query);

$ref = $sth->fetchrow_hashref(NAME_lc);
for (qw(weightunit priceupdate currencies)) {
$form->{$_} = $ref->{$_};
}

# setup accno hash, {amount} is used in create_links
for (qw(inventory income expense)) {
$form->{amount}{"IC_$_"} = {
accno => $ref->{"${_}_accno"},
description => $ref->{"${_}_description"}
};
}

$sth->finish;
}

$dbh->commit;

Expand Down

0 comments on commit 5f1ce9f

Please sign in to comment.