Revision 6eb84397
Von Moritz Bunkus vor etwa 2 Jahren hinzugefügt
- ID 6eb843977077aabdf5f9e488916ab3ad0c58fed9
- Vorgänger 46282860
SL/Controller/Part.pm | ||
---|---|---|
|
||
sub init_all_buchungsgruppen {
|
||
my ($self) = @_;
|
||
if ( $self->part->orphaned ) {
|
||
return SL::DB::Manager::Buchungsgruppe->get_all_sorted;
|
||
} else {
|
||
if (!$self->part->orphaned) {
|
||
return SL::DB::Manager::Buchungsgruppe->get_all_sorted(where => [ id => $self->part->buchungsgruppen_id ]);
|
||
}
|
||
|
||
return SL::DB::Manager::Buchungsgruppe->get_all_sorted(
|
||
where => [
|
||
or => [
|
||
id => $self->part->buchungsgruppen_id,
|
||
obsolete => 0,
|
||
],
|
||
]
|
||
);
|
||
}
|
||
|
||
sub init_shops_not_assigned {
|
||
... | ... | |
return 1;
|
||
}
|
||
|
||
sub form_check_buchungsgruppe {
|
||
my ($self) = @_;
|
||
|
||
return 1 if $::form->{part}->{obsolete};
|
||
|
||
my $buchungsgruppe = SL::DB::Buchungsgruppe->new(id => $::form->{part}->{buchungsgruppen_id})->load;
|
||
|
||
return 1 if !$buchungsgruppe->obsolete;
|
||
|
||
$self->js->flash('error', t8("The booking group '#1' is obsolete and cannot be used with active articles.", $buchungsgruppe->description))
|
||
->focus('#part_buchungsgruppen_id');
|
||
|
||
return 0;
|
||
}
|
||
|
||
# general checking functions
|
||
|
||
sub check_part_id {
|
||
... | ... | |
$self->form_check_assortment_items_unique || return 0;
|
||
$self->form_check_assembly_items_exist || return 0;
|
||
$self->form_check_partnumber_is_unique || return 0;
|
||
$self->form_check_buchungsgruppe || return 0;
|
||
|
||
return 1;
|
||
}
|
Auch abrufbar als: Unified diff
Buchungsgruppen ungültig setzen können