X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/2d975c005034c80400abd22cfd6cd737d172045a..9716e08ebc2431c0aaf3410e016a06d25f7218ba:/SL/Controller/PriceSource.pm diff --git a/SL/Controller/PriceSource.pm b/SL/Controller/PriceSource.pm index 0c3eb877a..10763ce55 100644 --- a/SL/Controller/PriceSource.pm +++ b/SL/Controller/PriceSource.pm @@ -25,6 +25,12 @@ sub action_price_popup { my ($self) = @_; my $record_item = _make_record_item($::form->{row}); + my $old_unit; + if (($old_unit = $record_item->{__additional_form_attributes}{unit_old}) && $old_unit ne $record_item->unit) { + # reset unit changes. the way these interact on update breaks stuff + $record_item->unit_obj(SL::DB::Manager::Unit->find_by(name => $old_unit)); + $self->js->val("select[name='unit_$::form->{row}']", $old_unit); + } $self->render_price_dialog($record_item); }