Revision 4d823692
Von Bernd Bleßmann vor etwa 1 Jahr hinzugefügt
SL/Controller/CustomerVendor.pm | ||
---|---|---|
867 | 867 |
} |
868 | 868 |
|
869 | 869 |
my $arap = $self->is_vendor ? 'ap' : 'ar'; |
870 |
my $num_args = 3;
|
|
870 |
my $num_args = 4;
|
|
871 | 871 |
|
872 | 872 |
my $cv = $self->is_vendor ? 'vendor' : 'customer'; |
873 | 873 |
|
... | ... | |
889 | 889 |
SELECT a.id |
890 | 890 |
FROM delivery_orders a |
891 | 891 |
JOIN '. $cv .' ct ON (a.'. $cv .'_id = ct.id) |
892 |
WHERE ct.id = ?'; |
|
892 |
WHERE ct.id = ? |
|
893 |
|
|
894 |
UNION |
|
895 |
|
|
896 |
SELECT id |
|
897 |
FROM price_rule_items |
|
898 |
WHERE type LIKE \''. $cv .'\' AND value_int = ?'; |
|
893 | 899 |
|
894 | 900 |
|
895 | 901 |
if ( $self->is_vendor ) { |
SL/DB/Business.pm | ||
---|---|---|
39 | 39 |
return join ' ', grep $_, $self->id, $self->description; |
40 | 40 |
} |
41 | 41 |
|
42 |
sub orphaned { |
|
43 |
my ($self) = @_; |
|
44 |
die 'not an accessor' if @_ > 1; |
|
45 |
|
|
46 |
return 1 unless $self->id; |
|
47 |
|
|
48 |
my @relations = qw( |
|
49 |
SL::DB::Customer |
|
50 |
SL::DB::Vendor |
|
51 |
SL::DB::BusinessModel |
|
52 |
); |
|
53 |
|
|
54 |
for my $class (@relations) { |
|
55 |
eval "require $class"; |
|
56 |
return 0 if $class->_get_manager_class->get_all_count(query => [ business_id => $self->id ]); |
|
57 |
} |
|
58 |
|
|
59 |
eval "require SL::DB::PriceRuleItem"; |
|
60 |
return 0 if SL::DB::Manager::PriceRuleItem->get_all_count(query => [ type => 'business', value_int => $self->id ]); |
|
61 |
|
|
62 |
return 1; |
|
63 |
} |
|
64 |
|
|
42 | 65 |
1; |
SL/DB/PartsGroup.pm | ||
---|---|---|
56 | 56 |
return 0 if $class->_get_manager_class->get_all_count(query => [ partsgroup_id => $self->id ]); |
57 | 57 |
} |
58 | 58 |
|
59 |
eval "require SL::DB::PriceRuleItem"; |
|
60 |
return 0 if SL::DB::Manager::PriceRuleItem->get_all_count(query => [ type => 'partsgroup', value_int => $self->id ]); |
|
61 |
|
|
59 | 62 |
return 1; |
60 | 63 |
} |
61 | 64 |
|
SL/DB/Pricegroup.pm | ||
---|---|---|
77 | 77 |
return 0 if $class->_get_manager_class->get_all_count(query => [ active_price_source => 'pricegroup/' . $self->id ]); |
78 | 78 |
} |
79 | 79 |
|
80 |
eval "require SL::DB::PriceRuleItem"; |
|
81 |
return 0 if SL::DB::Manager::PriceRuleItem->get_all_count(query => [ type => 'pricegroup', value_int => $self->id ]); |
|
82 |
|
|
80 | 83 |
return 1; |
81 | 84 |
} |
82 | 85 |
|
Auch abrufbar als: Unified diff
In Preisregeln benutze Objekte nicht löschen können.
Behebt #114 (redmine) bzw. die Reste davon.
Artikel löschen können wurde schon gelöst.