Auftrags-Controller: Abteilungen
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Fri, 6 Nov 2015 11:22:29 +0000 (12:22 +0100)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Fri, 11 Mar 2016 11:45:30 +0000 (12:45 +0100)
SL/Controller/Order.pm
templates/webpages/order/tabs/basic_data.html

index b795d14..6c71422 100644 (file)
@@ -629,6 +629,7 @@ sub _pre_render {
   my ($self) = @_;
 
   $self->{all_taxzones}        = SL::DB::Manager::TaxZone->get_all_sorted();
+  $self->{all_departments}     = SL::DB::Manager::Department->get_all_sorted();
   $self->{all_employees}       = SL::DB::Manager::Employee->get_all(where => [ or => [ id => $self->order->employee_id,
                                                                                        deleted => 0 ] ],
                                                                     sort_by => 'name');
index 32880cf..0fd301d 100644 (file)
             <td>[% L.select_tag('order.taxzone_id', SELF.all_taxzones, default=SELF.order.taxzone_id, title_key='description', style='width: 300px', class='recalc') %]</td>
           </tr>
 
+[%- IF SELF.all_departments.size %]
+          <tr>
+            <th align="right">[% 'Department' | $T8 %]</th>
+            <td>
+              [% L.select_tag('order.department_id', SELF.all_departments, default=SELF.order.department_id, title_key='description', with_empty=1, style='width:300px') %]
+            </td>
+          </tr>
+[%- END %]
+
           <tr>
             <th align="right">[% 'Shipping Point' | $T8 %]</th>
             <td>[% L.input_tag('order.shippingpoint', SELF.order.shippingpoint, style='width: 300px') %]</td>