Auftrags-Controller: Abteilungen
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Fri, 6 Nov 2015 11:22:29 +0000 (12:22 +0100)
committerG. Richardson <information@kivitendo-premium.de>
Mon, 16 Nov 2015 15:15:59 +0000 (16:15 +0100)
SL/Controller/Order.pm
templates/webpages/order/tabs/basic_data.html

index ed84673..aaa31cc 100644 (file)
@@ -642,6 +642,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 c44e646..d66c910 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>