Revision e064ca5b
Von Sven Schöling vor fast 3 Jahren hinzugefügt
SL/Controller/DeliveryOrder.pm | ||
---|---|---|
46 | 46 |
use Rose::Object::MakeMethods::Generic |
47 | 47 |
( |
48 | 48 |
scalar => [ qw(item_ids_to_delete is_custom_shipto_to_delete) ], |
49 |
'scalar --get_set_init' => [ qw(order valid_types type cv p all_price_factors search_cvpartnumber show_update_button part_picker_classification_ids) ], |
|
49 |
'scalar --get_set_init' => [ qw(order valid_types type cv p all_price_factors search_cvpartnumber show_update_button part_picker_classification_ids type_data) ],
|
|
50 | 50 |
); |
51 | 51 |
|
52 | 52 |
|
... | ... | |
66 | 66 |
my ($self) = @_; |
67 | 67 |
|
68 | 68 |
$self->order->transdate(DateTime->now_local()); |
69 |
$self->set_reqdate_by_type; |
|
69 |
$self->type_data->set_reqdate_by_type;
|
|
70 | 70 |
|
71 | 71 |
|
72 | 72 |
$self->pre_render(); |
... | ... | |
1025 | 1025 |
my ($self) = @_; |
1026 | 1026 |
|
1027 | 1027 |
if (none { $::form->{type} eq $_ } @{$self->valid_types}) { |
1028 |
die "Not a valid type for order"; |
|
1028 |
die "Not a valid type for delivery order";
|
|
1029 | 1029 |
} |
1030 | 1030 |
|
1031 | 1031 |
$self->type($::form->{type}); |
... | ... | |
1069 | 1069 |
sub init_part_picker_classification_ids { |
1070 | 1070 |
my ($self) = @_; |
1071 | 1071 |
|
1072 |
return [ map { $_->id } @{ SL::DB::Manager::PartClassification->get_all(where => $self->type_date->part_classification_query) } ];
|
|
1072 |
return [ map { $_->id } @{ SL::DB::Manager::PartClassification->get_all(where => $self->type_data->part_classification_query) } ];
|
|
1073 | 1073 |
} |
1074 | 1074 |
|
1075 | 1075 |
sub check_auth { |
... | ... | |
1161 | 1161 |
# order here solves this problem. |
1162 | 1162 |
my $order; |
1163 | 1163 |
$order = SL::DB::DeliveryOrder->new(id => $::form->{id})->load(with => [ 'orderitems', 'orderitems.part' ]) if $::form->{id}; |
1164 |
$order ||= SL::DB::DeliveryOrder->new(orderitems => [], |
|
1165 |
quotation => $self->type_data->is_quotation, |
|
1166 |
currency_id => $::instance_conf->get_currency_id(),); |
|
1164 |
$order ||= SL::DB::DeliveryOrder->new(orderitems => [], currency_id => $::instance_conf->get_currency_id(),); |
|
1167 | 1165 |
|
1168 | 1166 |
my $cv_id_method = $self->cv . '_id'; |
1169 | 1167 |
if (!$::form->{id} && $::form->{$cv_id_method}) { |
... | ... | |
1572 | 1570 |
$item->active_discount_source($price_source->discount_from_source($item->active_discount_source)); |
1573 | 1571 |
} |
1574 | 1572 |
|
1575 |
if ($self->order->number && $::instance_conf->get_webdav) {
|
|
1573 |
if ($self->order->${\ $self->type_data->nr_key } && $::instance_conf->get_webdav) {
|
|
1576 | 1574 |
my $webdav = SL::Webdav->new( |
1577 | 1575 |
type => $self->type, |
1578 | 1576 |
number => $self->order->number, |
Auch abrufbar als: Unified diff
DeliveryOrder: neue typen für Lieferschein