diff options
Diffstat (limited to 'LedgerSMB')
-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 |