Revision 5b4b0b71
Von Tamino Steinert vor etwa 1 Jahr hinzugefügt
SL/Controller/Reclamation.pm | ||
---|---|---|
1110 | 1110 |
sub init_type { |
1111 | 1111 |
my ($self) = @_; |
1112 | 1112 |
|
1113 |
if (none { $::form->{type} eq $_ } @{$self->valid_types}) { |
|
1113 |
my $type = $self->reclamation->record_type : $::form->{type}; |
|
1114 |
if (none { $type eq $_ } @{$self->valid_types}) { |
|
1114 | 1115 |
die "Not a valid type for reclamation"; |
1115 | 1116 |
} |
1116 | 1117 |
|
1117 |
$self->type($::form->{type});
|
|
1118 |
$self->type($type);
|
|
1118 | 1119 |
} |
1119 | 1120 |
|
1120 | 1121 |
sub init_cv { |
... | ... | |
1362 | 1363 |
$reclamation = SL::DB::Reclamation->new(id => $::form->{id})->load(); |
1363 | 1364 |
} else { |
1364 | 1365 |
$reclamation = SL::DB::Reclamation->new( |
1365 |
record_type => $self->type,
|
|
1366 |
record_type => $::form->{type},
|
|
1366 | 1367 |
reclamation_items => [], |
1367 | 1368 |
currency_id => $::instance_conf->get_currency_id(), |
1368 | 1369 |
); |
1369 | 1370 |
} |
1370 | 1371 |
|
1371 |
my $cv_id_method = $self->cv . '_id';
|
|
1372 |
my $cv_id_method = $reclamation->type_data->properties('customervendor'). '_id';
|
|
1372 | 1373 |
if (!$::form->{id} && $::form->{$cv_id_method}) { |
1373 | 1374 |
$reclamation->$cv_id_method($::form->{$cv_id_method}); |
1374 | 1375 |
$reclamation = SL::Model::Record->update_after_customer_vendor_change($reclamation); |
... | ... | |
2369 | 2370 |
} |
2370 | 2371 |
|
2371 | 2372 |
sub init_type_data { |
2372 |
SL::DB::Helper::TypeDataProxy->new('SL::DB::Reclamation', $::form->{type}); |
|
2373 |
my ($self) = @_; |
|
2374 |
SL::DB::Helper::TypeDataProxy->new('SL::DB::Reclamation', $self->reclamation->record_type); |
|
2373 | 2375 |
} |
2374 | 2376 |
|
2375 | 2377 |
1; |
Auch abrufbar als: Unified diff
S:C:Record: Hole Typen aus Datenbankobjekt wenn ID gegeben