X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/12bf7588649908f298043dccf17219297807b2b5..8862bb1eb24c616d45d556c6022dff6e3afbf69c:/SL/Controller/CustomerVendor.pm diff --git a/SL/Controller/CustomerVendor.pm b/SL/Controller/CustomerVendor.pm index 3e6ad8217..ada9d0d15 100644 --- a/SL/Controller/CustomerVendor.pm +++ b/SL/Controller/CustomerVendor.pm @@ -637,7 +637,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'; @@ -652,6 +652,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 = ?';