From: Sven Schöling Date: Thu, 6 Aug 2015 09:29:20 +0000 (+0200) Subject: PriceSource: Vor Popup Einheit resetten X-Git-Tag: release-3.3.0~30 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=9716e08ebc2431c0aaf3410e016a06d25f7218ba;p=kivitendo-erp.git PriceSource: Vor Popup Einheit resetten Ansonsten gibt es beim nächsten Update Probleme mit doppelt formatierten Einheiten. --- 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); }