Revision ff5279ed
Von Bernd Bleßmann vor mehr als 4 Jahren hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
1015 | 1015 |
$self->js->render(); |
1016 | 1016 |
} |
1017 | 1017 |
|
1018 |
# update description, notes and sellprice from master data |
|
1019 |
sub action_update_row_from_master_data { |
|
1020 |
my ($self) = @_; |
|
1021 |
|
|
1022 |
foreach my $item_id (@{ $::form->{item_ids} }) { |
|
1023 |
my $idx = first_index { $_ eq $item_id } @{ $::form->{orderitem_ids} }; |
|
1024 |
my $item = $self->order->items_sorted->[$idx]; |
|
1025 |
|
|
1026 |
$item->description($item->part->description); |
|
1027 |
$item->longdescription($item->part->notes); |
|
1028 |
|
|
1029 |
my $price_source = SL::PriceSource->new(record_item => $item, record => $self->order); |
|
1030 |
|
|
1031 |
my $price_src; |
|
1032 |
if ($item->part->is_assortment) { |
|
1033 |
# add assortment items with price 0, as the components carry the price |
|
1034 |
$price_src = $price_source->price_from_source(""); |
|
1035 |
$price_src->price(0); |
|
1036 |
} else { |
|
1037 |
$price_src = $price_source->best_price |
|
1038 |
? $price_source->best_price |
|
1039 |
: $price_source->price_from_source(""); |
|
1040 |
$price_src->price(0) if !$price_source->best_price; |
|
1041 |
} |
|
1042 |
|
|
1043 |
$item->sellprice($price_src->price); |
|
1044 |
$item->active_price_source($price_src); |
|
1045 |
|
|
1046 |
$self->js |
|
1047 |
->run('kivi.Order.update_sellprice', $item_id, $item->sellprice_as_number) |
|
1048 |
->val('.row_entry:has(#item_' . $item_id . ') [name = "order.orderitems[].description"]', $item->description) |
|
1049 |
->val('.row_entry:has(#item_' . $item_id . ') [name = "order.orderitems[].longdescription"]', $item->longdescription); |
|
1050 |
} |
|
1051 |
|
|
1052 |
$self->recalc(); |
|
1053 |
$self->js_redisplay_line_values; |
|
1054 |
$self->js_redisplay_amounts_and_taxes; |
|
1055 |
|
|
1056 |
$self->js->render(); |
|
1057 |
} |
|
1058 |
|
|
1018 | 1059 |
sub js_load_second_row { |
1019 | 1060 |
my ($self, $item, $item_id, $do_parse) = @_; |
1020 | 1061 |
|
Auch abrufbar als: Unified diff
Auftrags-Controller: Positions-Update aus Artikel-Stamm