From: Bernd Bleßmann Date: Tue, 25 Nov 2014 13:13:25 +0000 (+0100) Subject: Kunden/Lieferanten sind nicht verwaist, wenn es Lieferscheine gibt. X-Git-Tag: release-3.2.0beta~226^2^2 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=8862bb1eb24c616d45d556c6022dff6e3afbf69c;p=kivitendo-erp.git Kunden/Lieferanten sind nicht verwaist, wenn es Lieferscheine gibt. --- 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 = ?';