X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/7e8765c67a41ac4117a64c652a23cfac363a547f..201c9038c6c64d91b9be59991b6b6449c33a0d4f:/SL/Controller/Order.pm?ds=sidebyside diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index 9489c50f3..631ab16dd 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -93,7 +93,7 @@ sub action_delete { flash_later('info', $::locale->text('The order has been deleted')); my @redirect_params = ( - action => 'edit', + action => 'add', type => $self->type, ); @@ -783,6 +783,8 @@ sub _make_item { $item->assign_attributes(%$attr); $item->longdescription($item->part->notes) if $is_new && !defined $attr->{longdescription}; + # item fields that currently can't be set in in row but are needed: + $item->lastcost($item->part->lastcost) if $is_new; return $item; } @@ -891,9 +893,9 @@ sub _delete { my ($self) = @_; my $errors = []; - my $db = $self->order->db; + my $db = $self->order->db; - $db->do_transaction( + $db->with_transaction( sub { my @spoolfiles = grep { $_ } map { $_->spoolfile } @{ SL::DB::Manager::Status->get_all(where => [ trans_id => $self->order->id ]) }; $self->order->delete; @@ -913,12 +915,11 @@ sub _save { my ($self) = @_; my $errors = []; - my $db = $self->order->db; + my $db = $self->order->db; - $db->do_transaction( - sub { - SL::DB::OrderItem->new(id => $_)->delete for @{$self->item_ids_to_delete}; - $self->order->save(cascade => 1); + $db->with_transaction(sub { + SL::DB::OrderItem->new(id => $_)->delete for @{$self->item_ids_to_delete}; + $self->order->save(cascade => 1); }) || push(@{$errors}, $db->error); return $errors; @@ -1204,10 +1205,6 @@ java script functions =item * -C is not displayed until an order is saved - -=item * - Customer discount is not displayed as a valid discount in price source popup (this might be a bug in price sources) @@ -1236,9 +1233,12 @@ Table header is not sticky in the scrolling area. Sorting does not include C, neither does reordering. +This behavior was implemented intentionally. But we can discuss, which behavior +should be implemented. + =item * -C does not use the currently inserted string for +C does not use the currently inserted string for filtering. =item * Performance