From: Bernd Bleßmann Date: Wed, 19 Aug 2015 12:38:00 +0000 (+0200) Subject: Auftrags-Controller: Artikel nicht hinzufügen, wenn keine part-id da ist. X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=f66bf46864b00cab02e07cf4407a8d1502642a36;p=kivitendo-erp.git Auftrags-Controller: Artikel nicht hinzufügen, wenn keine part-id da ist. --- diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index 166926987..c4624072a 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -127,6 +127,9 @@ sub action_add_item { my ($self) = @_; my $form_attr = $::form->{add_item}; + + return unless $form_attr->{parts_id}; + my $item = SL::DB::OrderItem->new; $item->assign_attributes(%$form_attr); diff --git a/templates/webpages/order/tabs/basic_data.html b/templates/webpages/order/tabs/basic_data.html index b5d3c3bb8..ea9710ba4 100644 --- a/templates/webpages/order/tabs/basic_data.html +++ b/templates/webpages/order/tabs/basic_data.html @@ -76,6 +76,16 @@ title_key='safe_name') %] + [% IF SELF.cv == 'customer' %] + + [% 'Salesman' | $T8 %] + [% L.select_tag('order.employee_id', + SELF.all_employees, + default=(SELF.order.salesman_id ? SELF.order.salesman_id : SELF.current_employee_id), + title_key='safe_name') %] + + [% END %] + [% 'Order Number' | $T8 %] [% L.input_tag('order.ordnumber', SELF.order.ordnumber, size = 11) %] @@ -184,6 +194,8 @@ function reload_cv_dependend_selections() { } function add_item() { + if ($('#add_item_parts_id').val() == '') return; + var data = $('#order_form').serialize(); data += '&action=Order/add_item'; data += '&type=' + $('#type').val();