io/select_item um optional part.notes erweitert
[kivitendo-erp.git] / bin / mozilla / io.pl
index 4ad3cbf..3d3d94c 100644 (file)
@@ -345,7 +345,7 @@ sub display_row {
     if ($form->{"id_${i}"} && !$is_delivery_order) {
       my $price_source  = SL::PriceSource->new(record_item => $record_item, record => $record);
       my $price         = $price_source->price_from_source($::form->{"active_price_source_$i"});
-      my $discount      = $price_source->price_from_source($::form->{"active_discount_source_$i"});
+      my $discount      = $price_source->discount_from_source($::form->{"active_discount_source_$i"});
       my $best_price    = $price_source->best_price;
       my $best_discount = $price_source->best_discount;
       $column_data{price_source} .= $cgi->button(-value => $price->source_description, -onClick => "kivi.io.price_chooser($i)");
@@ -507,7 +507,8 @@ sub select_item {
   $::form->header;
 
   my @item_list = map {
-    $_->{display_sellprice} /= $_->{price_factor} if ($_->{price_factor});
+    # maybe there is a better backend function or way to calc
+    $_->{display_sellprice} = ($_->{price_factor}) ? $_->{sellprice} / $_->{price_factor} : $_->{sellprice};
     $_;
   } @{ $::form->{item_list} };
 
@@ -519,6 +520,7 @@ sub select_item {
                                                          ITEM_LIST       => \@item_list,
                                                          IS_ASSEMBLY     => $mode eq 'IC',
                                                          IS_PURCHASE     => $mode eq 'IS',
+                                                         SHOW_NOTES      => $::instance_conf->get_show_longdescription_select_item(),
                                                          PRE_ENTERED_QTY => $pre_entered_qty, });
 
   $main::lxdebug->leave_sub();