X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/656902356dbfe87a8f1992c0119be3912cc59eed..a7177e631661ee3e6b74e24dc230571ab2b24837:/SL/Controller/CustomerVendor.pm diff --git a/SL/Controller/CustomerVendor.pm b/SL/Controller/CustomerVendor.pm index 60b26bb93..f57c4b8bd 100644 --- a/SL/Controller/CustomerVendor.pm +++ b/SL/Controller/CustomerVendor.pm @@ -645,7 +645,7 @@ sub is_orphaned { } my $arap = $self->is_vendor ? 'ap' : 'ar'; - my $num_args = 2; + my $num_args = 3; my $cv = $self->is_vendor ? 'vendor' : 'customer'; @@ -660,6 +660,13 @@ sub is_orphaned { SELECT a.id FROM oe a JOIN '. $cv .' ct ON (a.'. $cv .'_id = ct.id) + WHERE ct.id = ? + + UNION + + SELECT a.id + FROM delivery_orders a + JOIN '. $cv .' ct ON (a.'. $cv .'_id = ct.id) WHERE ct.id = ?';