Revision 3d7017ef
Von Tamino Steinert vor etwa 1 Jahr hinzugefügt
SL/Controller/DeliveryOrder.pm | ||
---|---|---|
1268 | 1268 |
sub init_type { |
1269 | 1269 |
my ($self) = @_; |
1270 | 1270 |
|
1271 |
if (none { $::form->{type} eq $_ } @{$self->valid_types}) { |
|
1271 |
my $type = $self->order->record_type; |
|
1272 |
if (none { $type eq $_ } @{$self->valid_types}) { |
|
1272 | 1273 |
die "Not a valid type for delivery order"; |
1273 | 1274 |
} |
1274 | 1275 |
|
1275 |
$self->type($::form->{type});
|
|
1276 |
$self->type($type);
|
|
1276 | 1277 |
} |
1277 | 1278 |
|
1278 | 1279 |
sub init_cv { |
... | ... | |
1422 | 1423 |
$order = SL::DB::DeliveryOrder->new( |
1423 | 1424 |
orderitems => [], |
1424 | 1425 |
currency_id => $::instance_conf->get_currency_id(), |
1425 |
record_type => $self->type
|
|
1426 |
record_type => $::form->{type}
|
|
1426 | 1427 |
); |
1427 | 1428 |
} |
1428 | 1429 |
|
1429 |
my $cv_id_method = $self->cv . '_id';
|
|
1430 |
my $cv_id_method = $order->type_data->properties('customervendor'). '_id';
|
|
1430 | 1431 |
if (!$::form->{id} && $::form->{$cv_id_method}) { |
1431 | 1432 |
$order->$cv_id_method($::form->{$cv_id_method}); |
1432 | 1433 |
$order = SL::Model::Record->update_after_customer_vendor_change($order); |
... | ... | |
2220 | 2221 |
} |
2221 | 2222 |
|
2222 | 2223 |
sub init_type_data { |
2223 |
SL::DB::Helper::TypeDataProxy->new('SL::DB::DeliveryOrder', $::form->{type}); |
|
2224 |
my ($self) = @_; |
|
2225 |
SL::DB::Helper::TypeDataProxy->new('SL::DB::DeliveryOrder', $self->order->record_type); |
|
2224 | 2226 |
} |
2225 | 2227 |
|
2226 | 2228 |
sub init_valid_types { |
Auch abrufbar als: Unified diff
S:C:Record: Hole Typen aus Datenbankobjekt wenn ID gegeben