X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/958b82d600cebec78ff208257b1fd348ee0439bf..11aeaa07186197c61dfe610d2a5c981754fd2e9d:/SL/Controller/Order.pm diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index e5313124d..e67576c3b 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -1165,11 +1165,11 @@ sub action_create_part { flash_later('info', t8('You are adding a new part while you are editing another document. You will be redirected to your document when saving the new part or aborting this form.')); my @redirect_params = ( - controller => 'Part', - action => 'add', - part_type => $::form->{add_item}->{create_part_type}, - callback => $callback, - show_abort => 1, + controller => 'Part', + action => 'add', + part_type => $::form->{add_item}->{create_part_type}, + callback => $callback, + inline_create => 1, ); $self->redirect_to(@redirect_params); @@ -1704,6 +1704,7 @@ sub new_item { my $part = SL::DB::Part->new(id => $attr->{parts_id})->load; my $price_source = SL::PriceSource->new(record_item => $item, record => $record); + $item->qty(1.0) if !$item->qty; $item->unit($part->unit) if !$item->unit; my $price_src; @@ -1736,7 +1737,6 @@ sub new_item { my %new_attr; $new_attr{part} = $part; $new_attr{description} = $part->description if ! $item->description; - $new_attr{qty} = 1.0 if ! $item->qty; $new_attr{price_factor_id} = $part->price_factor_id if ! $item->price_factor_id; $new_attr{sellprice} = $price_src->price; $new_attr{discount} = $discount_src->discount;