Fix zu Bug 1823.
Achtung, es gibt noch ein Szenario was nicht erkannt wird:
Wenn die Lieferadresse im originalen Kunden gelöscht wurde, und somit keinem
Kunden mehr zugewordnet ist, wird nicht erkannt dass diese Lieferadresse nicht
zum zweiten Kunden gehört (wie auch) und nicht gelöscht.
Gleiches Problem auch bei Ansprechpartnern.
$::form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{employee_id}, deleted => 0 ] ]);
$::form->{ALL_SALESMEN} = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{salesman_id}, deleted => 0 ] ]);
$::form->{ALL_SHIPTO} = SL::DB::Manager::Shipto->get_all(query => [
- or => [ trans_id => $::form->{"$::form->{vc}_id"} * 1, shipto_id => $::form->{shipto_id} * 1 ]
+ or => [ trans_id => $::form->{"$::form->{vc}_id"} * 1, and => [ shipto_id => $::form->{shipto_id} * 1, trans_id => undef ] ]
]);
$::form->{ALL_CONTACTS} = SL::DB::Manager::Contact->get_all(query => [
or => [
$TMPL_VAR{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{employee_id}, deleted => 0 ] ]);
$TMPL_VAR{ALL_SALESMEN} = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{salesman_id}, deleted => 0 ] ]);
$TMPL_VAR{ALL_SHIPTO} = SL::DB::Manager::Shipto->get_all(query => [
- or => [ trans_id => $::form->{"$::form->{vc}_id"} * 1, shipto_id => $::form->{shipto_id} * 1 ]
+ or => [ trans_id => $::form->{"$::form->{vc}_id"} * 1, and => [ shipto_id => $::form->{shipto_id} * 1, trans_id => undef ] ]
]);
$TMPL_VAR{ALL_CONTACTS} = SL::DB::Manager::Contact->get_all(query => [
or => [
$TMPL_VAR{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{employee_id}, deleted => 0 ] ]);
$TMPL_VAR{ALL_SALESMEN} = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{salesman_id}, deleted => 0 ] ]);
$TMPL_VAR{ALL_SHIPTO} = SL::DB::Manager::Shipto->get_all(query => [
- or => [ trans_id => $::form->{"$::form->{vc}_id"} * 1, shipto_id => $::form->{shipto_id} * 1 ]
+ or => [ trans_id => $::form->{"$::form->{vc}_id"} * 1, and => [ shipto_id => $::form->{shipto_id} * 1, trans_id => undef ] ]
]);
$TMPL_VAR{ALL_CONTACTS} = SL::DB::Manager::Contact->get_all(query => [
or => [