Auftrags-Controller: Anzeige mit Infos über den Kunden-/Lieferantentyp
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Mon, 12 Mar 2018 16:03:01 +0000 (17:03 +0100)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Mon, 12 Mar 2018 16:03:01 +0000 (17:03 +0100)
SL/Controller/Order.pm
templates/webpages/order/tabs/_business_info_row.html [new file with mode: 0644]
templates/webpages/order/tabs/basic_data.html

index b87049a..b3477b2 100644 (file)
@@ -594,6 +594,7 @@ sub action_customer_vendor_changed {
   $self->js
     ->replaceWith('#order_cp_id',            $self->build_contact_select)
     ->replaceWith('#order_shipto_id',        $self->build_shipto_select)
+    ->replaceWith('#business_info_row',      $self->build_business_info_row)
     ->val(        '#order_taxzone_id',       $self->order->taxzone_id)
     ->val(        '#order_taxincluded',      $self->order->taxincluded)
     ->val(        '#order_payment_id',       $self->order->payment_id)
@@ -1016,6 +1017,14 @@ sub build_shipto_select {
   );
 }
 
+# render the info line for business
+#
+# Needed, if customer/vendor changed.
+sub build_business_info_row
+{
+  $_[0]->p->render('order/tabs/_business_info_row', SELF => $_[0]);
+}
+
 # build the rows for displaying taxes
 #
 # Called if amounts where recalculated and redisplayed.
@@ -1695,6 +1704,10 @@ reused from generic code.
 
 =over 4
 
+=item * C<template/webpages/order/tabs/_business_info_row.html>
+
+For displaying information on business type
+
 =item * C<template/webpages/order/tabs/_item_input.html>
 
 The input line for items
diff --git a/templates/webpages/order/tabs/_business_info_row.html b/templates/webpages/order/tabs/_business_info_row.html
new file mode 100644 (file)
index 0000000..cdd61a6
--- /dev/null
@@ -0,0 +1,10 @@
+[%- USE T8 %][%- USE HTML %]
+
+<tr id='business_info_row' [%- IF !SELF.order.customervendor.business_id %]style='display:none'[%- END %]>
+  <th align="right">[%- IF SELF.cv == 'customer' -%]
+                      [%- 'Customer type' | $T8 -%]
+                    [%- ELSE -%]
+                      [%- 'Vendor type' | $T8 -%]
+                    [%- END -%]</th>
+  <td>[% HTML.escape(SELF.order.customervendor.business.description) %]; [% 'Trade Discount' | $T8 %] [% SELF.order.customervendor.business.discount_as_percent %] %</td>
+</tr>
index b686842..c74019a 100644 (file)
@@ -39,6 +39,8 @@
                                 style='width: 300px') %]</td>
           </tr>
 
+          [%- PROCESS order/tabs/_business_info_row.html SELF=SELF %]
+
           <tr>
             <th align="right">[% 'Steuersatz' | $T8 %]</th>
             <td>[% L.select_tag('order.taxzone_id', SELF.all_taxzones, default=SELF.order.taxzone_id, title_key='description', style='width: 300px', class='recalc') %]</td>