From 6bf279f80918f9d06c2fbb48950456ba51fd1f8c Mon Sep 17 00:00:00 2001 From: einhverfr Date: Sat, 12 Jan 2008 04:54:45 +0000 Subject: Correcting bug 1835463, cannot transfer to warehouses git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@2037 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/OE.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'LedgerSMB') diff --git a/LedgerSMB/OE.pm b/LedgerSMB/OE.pm index 295e736c..5383d808 100755 --- a/LedgerSMB/OE.pm +++ b/LedgerSMB/OE.pm @@ -2028,8 +2028,8 @@ sub get_inventory { my @a = ( partnumber, warehouse ); my $sortorder = $form->sort_order( \@a, \%ordinal ); - if ($fromwarehouse_id) { - if ($towarehouse_id) { + if ($fromwarehouse_id ne 'NULL') { + if ($towarehouse_id ne 'NULL') { $where .= " AND NOT i.warehouse_id = $towarehouse_id"; } @@ -2041,8 +2041,9 @@ sub get_inventory { FROM inventory i JOIN parts p ON (p.id = i.parts_id) LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id) - JOIN warehouse w ON (w.id = i.warehouse_id) - WHERE i.warehouse_id = $fromwarehouse_id + LEFT JOIN warehouse w ON (w.id = i.warehouse_id) + WHERE (i.warehouse_id = $fromwarehouse_id OR + i.warehouse_id IS NULL)) $where GROUP BY p.id, p.partnumber, p.description, pg.partsgroup, w.description, i.warehouse_id @@ -2074,7 +2075,7 @@ sub get_inventory { FROM inventory i JOIN parts p ON (p.id = i.parts_id) LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id) - JOIN warehouse w ON (w.id = i.warehouse_id) + LEFT JOIN warehouse w ON (w.id = i.warehouse_id) WHERE i.warehouse_id != $towarehouse_id $where GROUP BY p.id, p.partnumber, p.description, -- cgit v1.2.3