diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-09-09 07:48:09 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-09-09 07:48:09 +0000 |
commit | 6599a872c186b3be1b4e9c14200bf623f9f2c4a3 (patch) | |
tree | 945440a447798aac3dba762f9b4613948395975c | |
parent | 266c26a6ea04bb2ebd17b3c5daf4dbc5c3ab6ea9 (diff) |
Fixed every known issue with OID's.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@46 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-x | LedgerSMB/IC.pm | 4 | ||||
-rwxr-xr-x | LedgerSMB/IS.pm | 4 | ||||
-rwxr-xr-x | LedgerSMB/OE.pm | 8 |
3 files changed, 7 insertions, 9 deletions
diff --git a/LedgerSMB/IC.pm b/LedgerSMB/IC.pm index 276992fc..bcdf9254 100755 --- a/LedgerSMB/IC.pm +++ b/LedgerSMB/IC.pm @@ -63,7 +63,7 @@ sub get_part { JOIN assembly a ON (a.parts_id = p.id) LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id) WHERE a.id = $form->{id} - ORDER BY $oid{$myconfig->{dbdriver}}|; + |; $sth = $dbh->prepare($query); $sth->execute || $form->dberror($query); @@ -1390,7 +1390,7 @@ sub include_assembly { my @a = qw(partnumber description bin); if ($form->{sort} eq 'partnumber') { - $sortorder = "$oid{$myconfig->{dbdriver}}"; + $sortorder = "TRUE"; } else { @a = grep !/$form->{sort}/, @a; $sortorder = "$form->{sort} $form->{direction}, ". join ',', @a; diff --git a/LedgerSMB/IS.pm b/LedgerSMB/IS.pm index 2cb4d259..324675a6 100755 --- a/LedgerSMB/IS.pm +++ b/LedgerSMB/IS.pm @@ -451,9 +451,7 @@ sub assembly_details { my $sortorder = ""; if ($form->{grouppartsgroup}) { - $sortorder = qq|ORDER BY pg.partsgroup, a.$oid|; - } else { - $sortorder = qq|ORDER BY a.$oid|; + $sortorder = qq|ORDER BY pg.partsgroup|; } my $query = qq|SELECT p.partnumber, p.description, p.unit, a.qty, diff --git a/LedgerSMB/OE.pm b/LedgerSMB/OE.pm index 3e372e29..9e82afeb 100755 --- a/LedgerSMB/OE.pm +++ b/LedgerSMB/OE.pm @@ -626,7 +626,7 @@ sub retrieve { $sth->finish; for (qw(printed emailed queued)) { $form->{$_} =~ s/ +$//g } - my %oid = ( 'Pg' => 'TRUE', + my %oid = ( 'Pg' => 'id', 'Oracle' => 'rowid', 'DB2' => '1=1' ); @@ -1607,8 +1607,8 @@ sub adj_onhand { sub adj_inventory { my ($dbh, $myconfig, $form) = @_; - my %oid = ( 'Pg' => 'TRUE', - 'PgPP' => 'TRUE', + my %oid = ( 'Pg' => 'id', + 'PgPP' => 'id', 'Oracle' => 'rowid', 'DB2' => '1=1' ); @@ -1620,7 +1620,7 @@ sub adj_inventory { my $sth = $dbh->prepare($query); $sth->execute || $form->dberror($query); - $query = qq|SELECT $oid{$myconfig->{dbdriver}} AS oid, qty, + $query = qq|SELECT qty, (SELECT SUM(qty) FROM inventory WHERE trans_id = $form->{id} AND orderitems_id = ?) AS total |