commit b4a3746b017854dd2eb6ada5614ad08942f4d1bf
Author: Hans P. Schlaepfer <hanspeter.schlaepfer@revamp-it.ch>
Date:   Mon Jul 22 14:24:07 2019 +0200

    Neues Design 2019 Standard-Code templates/webpages/is/

diff --git a/templates/webpages/is/_payments.html b/templates/webpages/is/_payments.html
index 36b1181dd..26ababfc2 100644
--- a/templates/webpages/is/_payments.html
+++ b/templates/webpages/is/_payments.html
@@ -1,144 +1,134 @@
-  <tr>
-   <td>
-    <table width="100%">
-     <tr class="listheading">
-[% IF is_type_credit_note %]
-      <th colspan="6" class="listheading">[%- 'Payments' | $T8 %]</th>
-[% ELSE %]
-      <th colspan="6" class="listheading">[%- 'Incoming Payments' | $T8 %]</th>
-[%- END %]
-     </tr>
-
-
-     <tr>
-      <th>[%- 'Date' | $T8 %]</th>
-      <th>[%- 'Source' | $T8 %]</th>
-      <th>[%- 'Memo' | $T8 %]</th>
-      <th>[%- 'Amount' | $T8 %]</th>
-      <th></th>
-[% IF show_exchangerate %]
-      <th>[%- 'Exch' | $T8 %]</th>
-[% END %]
-      <th>[%- 'Account' | $T8 %]</th>
-     </tr>
-
-
-[% FOREACH i = paid_indices %]
-  [% SET changeable    = 'changeable_'    _ i %]
-  [% SET acc_trans_id  = 'acc_trans_id_'  _ i %]
-  [% SET p_gldate      = 'gldate_'        _ i %]
-  [% SET datepaid      = 'datepaid_'      _ i %]
-  [% SET source        = 'source_'        _ i %]
-  [% SET memo          = 'memo_'          _ i %]
-  [% SET paid          = 'paid_'          _ i %]
-  [% SET AR_paid       = 'AR_paid_'       _ i %]
-  [% SET selectAR_paid_ref = 'selectAR_paid_' _ i %]
-     <tr style='display:none'>
-       <td>
-         <input type=hidden name="acc_trans_id_[% i %]" value="[% $acc_trans_id %]">
-         <input type=hidden name="gldate_[% i %]" value="[% $p_gldate %]">
-       </td>
-     </tr>
-
-     <tr>
-     <td align="center">
-     [% IF $changeable %]
-       [% IF $datepaid %]
-         [% L.date_tag('datepaid_'_ i, $datepaid) %]
-       [% ELSE %]
-         [% L.date_tag('datepaid_'_ i, today) %]
-       [% END %]
-     [% ELSE %]
-       <input type="hidden" name="datepaid_[% i %]" value="[% $datepaid %]"> [% $datepaid %]
-     [% END %]
-     </td>
-
-     <td align=center>
-     [% IF $changeable %]
-       <input name="source_[% i %]" size="11" value="[% $source %]">
-     [% ELSE %]
-       <input type="hidden" name="source_[% i %]" value="[% $source %]">[% $source %]
-     [% END %]
-     </td>
-     <td align="center">
-     [% IF $changeable %]
-       <input name="memo_[% i %]" size="11" value="[% $memo %]">
-     [% ELSE %]
-       <input type="hidden" name="memo_[% i %]" value="[% $memo %]">[% $memo %]
-     [% END %]
-     </td>
-     <td align="center">
-     [% IF $changeable %]
-       <input name="paid_[% i %]" size="11" data-validate="number" class="numeric" value="[% LxERP.format_amount($paid, 2, 1) %]">
-     [% ELSE %]
-       <input type="hidden" name="paid_[% i %]" value="[% LxERP.format_amount($paid, 2, 1) %]">
-       [% LxERP.format_amount($paid, 2, 1) %]
-     [% END %]
-     </td>
-     <td>
-       [% IF $changeable && loop.last && paid_missing > 0 %]
-         <input type='button' id='is_set_to_paid_missing' value='[% 'Set to paid missing' | $T8 %]'>
-       [% END %]
-     </td>
-
-[% IF show_exchangerate %]
-     <td align="center">
-  [% SET forex        = 'forex_'        _ i %]
-  [% SET exchangerate = 'exchangerate_' _ i %]
-  [% IF $forex %]
-        <input type="hidden" name="exchangerate_[% i %]" value="[% LxERP.format_amount($exchangerate, 5) %]">
-        [% LxERP.format_amount($forex, 5) %]
-  [% ELSE %]
-     [% IF $changeable %]
-        <input name="exchangerate_[% i %]" size="10" value="[% LxERP.format_amount($exchangerate, 5, 1) %]">
-     [% ELSE %]
-        <input type="hidden" name="exchangerate_[% i %]" value="[% LxERP.format_amount($exchangerate, 5, 1) %]">
-        [% LxERP.format_amount($exchangerate, 5, 1) %]
-     [% END %]
-  [% END %]
-        <input type="hidden" name="forex_[% i %]" value="[% $forex %]">
-     </td>
-[% END %]
-
-     <td align="center">
-     [% IF $changeable %]
-       <select name="AR_paid_[% i %]">[% $selectAR_paid_ref %]</select>
-     [% ELSE %]
-       <input type="hidden" name="AR_paid_[% i %]" value="[% $AR_paid %]">[% $AR_paid %]
-     [% END %]
-     </td>
-
-    </tr>
-[% END # foreach %]
 [% USE LxERP %]
 [% USE T8 %]
 [% USE L %]
 
+<table class="tbl-list">
+  <caption>
+    [% IF is_type_credit_note %]
+      [% 'Payments' | $T8 %]
+    [% ELSE %]
+      [% 'Incoming Payments' | $T8 %]
+    [% END %]
+  </caption>
+  <thead>
+  <tr>
+    <th>[% 'Date' | $T8 %]</th>
+    <th>[% 'Source' | $T8 %]</th>
+    <th>[% 'Memo' | $T8 %]</th>
+    <th>[% 'Amount' | $T8 %]</th>
+    <th></th>
+    [% IF show_exchangerate %]
+    <th>[% 'Exch' | $T8 %]</th>
+    [% END %]
+    <th>[% 'Account' | $T8 %]</th>
+  </tr>
+  </thead>
+  <tbody>
+    [% FOREACH i = paid_indices %]
+      [% SET changeable    = 'changeable_'    _ i %]
+      [% SET acc_trans_id  = 'acc_trans_id_'  _ i %]
+      [% SET p_gldate      = 'gldate_'        _ i %]
+      [% SET datepaid      = 'datepaid_'      _ i %]
+      [% SET source        = 'source_'        _ i %]
+      [% SET memo          = 'memo_'          _ i %]
+      [% SET paid          = 'paid_'          _ i %]
+      [% SET AR_paid       = 'AR_paid_'       _ i %]
+      [% SET selectAR_paid_ref = 'selectAR_paid_' _ i %]
+      <!-- PENDENT: anders lösen -->
+      <tr style='display:none'>
+        <td>
+          <input type=hidden name="acc_trans_id_[% i %]" value="[% $acc_trans_id %]">
+          <input type=hidden name="gldate_[% i %]" value="[% $p_gldate %]">
+        </td>
+      </tr>
+      <tr>
+        <td>
+          [% IF $changeable %]
+            [% IF $datepaid %]
+              [% L.date_tag('datepaid_'_ i, $datepaid) %]
+            [% ELSE %]
+              [% L.date_tag('datepaid_'_ i, today) %]
+            [% END %]
+          [% ELSE %]
+             <input type="hidden" name="datepaid_[% i %]" value="[% $datepaid %]"> [% $datepaid %]
+          [% END %]
+        </td>
+        <td>
+          [% IF $changeable %]
+            <input type="text" name="source_[% i %]" size="11" value="[% $source %]">
+          [% ELSE %]
+            <input type="hidden" name="source_[% i %]" value="[% $source %]">[% $source %]
+          [% END %]
+        </td>
+        <td>
+          [% IF $changeable %]
+            <input type="text" name="memo_[% i %]" size="11" value="[% $memo %]">
+          [% ELSE %]
+            <input type="hidden" name="memo_[% i %]" value="[% $memo %]">[% $memo %]
+          [% END %]
+        </td>
+        <td>
+        [% IF $changeable %]
+          <input name="paid_[% i %]" size="11" data-validate="number" class="numeric" value="[% LxERP.format_amount($paid, 2, 1) %]">
+        [% ELSE %]
+          <input type="hidden" name="paid_[% i %]" value="[% LxERP.format_amount($paid, 2, 1) %]">
+          [% LxERP.format_amount($paid, 2, 1) %]
+        [% END %]
+        </td>
+        <td>
+          [% IF $changeable && loop.last && paid_missing > 0 %]
+            <input type="button" id="is_set_to_paid_missing" value="[% 'Set to paid missing' | $T8 %]">
+          [% END %]
+        </td>
+        [% IF show_exchangerate %]
+          <td>
+           [% SET forex        = 'forex_'        _ i %]
+           [% SET exchangerate = 'exchangerate_' _ i %]
+           [% IF $forex %]
+             <input type="hidden" name="exchangerate_[% i %]" value="[% LxERP.format_amount($exchangerate, 5) %]">
+             [% LxERP.format_amount($forex, 5) %]
+           [% ELSE %]
+             [% IF $changeable %]
+               <input type="text" name="exchangerate_[% i %]" size="10" value="[% LxERP.format_amount($exchangerate, 5, 1) %]">
+             [% ELSE %]
+               <input type="hidden" name="exchangerate_[% i %]" value="[% LxERP.format_amount($exchangerate, 5, 1) %]">
+               [% LxERP.format_amount($exchangerate, 5, 1) %]
+             [% END %]
+           [% END %]
+         <input type="hidden" name="forex_[% i %]" value="[% $forex %]">
+        </td>
+        [% END %]
+        <td>
+          [% IF $changeable %]
+            <select name="AR_paid_[% i %]">[% $selectAR_paid_ref %]</select>
+          [% ELSE %]
+            <input type="hidden" name="AR_paid_[% i %]" value="[% $AR_paid %]">[% $AR_paid %]
+          [% END %]
+        </td>
+      </tr>
+    [% END # foreach %]
+  </tbody>
+  <tfoot>
     <tr>
-      <td></td>
-      <td></td>
-      <td align="center">[%- 'Total' | $T8 %]</td>
-      <td align="center">[% LxERP.format_amount(totalpaid, 2) | html %]</td>
+      <td colspan="2"></td>
+      <td class="right">[% 'Total' | $T8 %]</td>
+      <td class="numeric">[% LxERP.format_amount(totalpaid, 2) | html %]</td>
+      <td colspan="2"></td>
     </tr>
     <tr>
-      <td></td>
-      <td></td>
-      <td align="center">[%- 'Missing amount' | $T8 %]</td>
-      <td align="center">[% LxERP.format_amount(paid_missing, 2) | html %]</td>
-    </tr>
-    <tr style='display:none'>
-     <td>
-     <input type="hidden" name="paidaccounts" value="[% paidaccounts %]">
-     <input type="hidden" name="selectAR_paid" value="[% selectAR_paid %]">
-     <input type="hidden" name="oldinvtotal" value="[% oldinvtotal %]">
-
-     <input type="hidden" name="oldtotalpaid" value="[% totalpaid %]">
-    </td>
+      <td colspan="2"></td>
+      <td class="right">[% 'Missing amount' | $T8 %]</td>
+      <td class="numeric">[% LxERP.format_amount(paid_missing, 2) | html %]</td>
+      <td colspan="2">
+        <input type="hidden" name="paidaccounts" value="[% paidaccounts %]">
+        <input type="hidden" name="selectAR_paid" value="[% selectAR_paid %]">
+        <input type="hidden" name="oldinvtotal" value="[% oldinvtotal %]">
+        <input type="hidden" name="oldtotalpaid" value="[% totalpaid %]">
+      </td>
    </tr>
-    </table>
+  </tfoot>
+</table>
 
-    </td>
-  </tr>
-    <script type='text/javascript'>
-     $('#is_set_to_paid_missing').click(function(){ $('input[name^="paid_"]:last').val('[% LxERP.format_amount(paid_missing, 2) %]') });
-    </script>
+<script type='text/javascript'>
+  $('#is_set_to_paid_missing').click(function(){ $('input[name^="paid_"]:last').val('[% LxERP.format_amount(paid_missing, 2) %]') });
+</script>
diff --git a/templates/webpages/is/form_footer.html b/templates/webpages/is/form_footer.html
index ecff7941a..a4efcca25 100644
--- a/templates/webpages/is/form_footer.html
+++ b/templates/webpages/is/form_footer.html
@@ -4,146 +4,100 @@
 [% USE L %]
 [% USE P %]
 
+<!--
+  Total-Lines of Invoice Items
+  Within the big colspan/rowspan cell there are weight information
+-->
+<table class="tbl-list footer-only full-width">
+  <colgroup>
+    <col style="width: 75%;">
+    <col style="width: 15%;">
+    <col style="width: 10%;">
+  </colgroup>
+  <tfoot>
+  [% UNLESS taxincluded %]
   <tr>
-   <td>
-    <table width="100%">
-     <tr valign="bottom">
-      <td>
-       <table>
-        <tr>
-         <th align="left">[% 'Notes (will appear on hard copy)' | $T8 %]</th>
-         <th align="left">[% 'Internal Notes' | $T8 %]</th>
-         <th align="right">[% 'Payment / Delivery Options' | $T8 %]</th>
-        </tr>
-        <tr valign="top">
-         <td>
-          [% L.textarea_tag("notes", notes, wrap="soft", style="width: 350px; height: 150px", class="texteditor") %]
-         </td>
-         <td>
-          [% L.textarea_tag("intnotes", intnotes, wrap="soft", style="width: 350px; height: 150px") %]
-         </td>
-         <td>
-           <table>
-             <tr>
-               <th align="right">[% 'Payment Terms' | $T8 %]</th>
-               <td>[% L.select_tag('payment_id', payment_terms, default = payment_id, title_key = 'description', with_empty = 1, style="width: 250px") %]
-                 <script type='text/javascript'>$('#payment_id').change(function(){ kivi.SalesPurchase.set_duedate_on_reference_date_change("invdate"); })</script>
-               </td>
-             </tr>
-             <tr>
-               <th align="right">[% 'Delivery Terms' | $T8 %] </th>
-               <td>
-                 [% L.select_tag('delivery_term_id', ALL_DELIVERY_TERMS, default = delivery_term_id, with_empty = 1, title_key = 'description', style = 'width: 250px') %]
-               </td>
-             </tr>
-             <tr>
-               <th align="right">[% 'direct debit' | $T8 %]</th>
-               <td>
-                 [%- L.checkbox_tag('direct_debit', 'checked', direct_debit) %]
-               </td>
-             </tr>
-           </table>
-         </td>
-        </tr>
-[%- IF id && follow_ups.size %]
-        <tr>
-          <td colspan="2">
-            [%- LxERP.t8('There are #1 unfinished follow-ups of which #2 are due.', follow_ups.size, follow_ups_unfinished) | html %]
-          <td>
-        </tr>
-[%- END %]
-       </table>
-      </td>
-[%- IF show_weight %]
-      <td>
-       <table>
-        <tr>
-         <th  align=left>[% 'Total weight' | $T8 %]</th>
-         <td>
-          [% LxERP.format_amount(totalweight) %] [% HTML.escape(weightunit) %]
-         </td>
-        </tr>
-       </table>
-      </td>
-[%- END %]
-      <td>
-       <table>
-        <tr>
-         <th  align=left>[% 'Ertrag' | $T8 %]</th>
-         <td>
-          [% LxERP.format_amount(marge_total, 2, 0) %]
-          <input type=hidden name="marge_total" value="[% marge_total %]">
-         </td>
-        </tr>
-        <tr>
-         <th  align=left>[% 'Ertrag prozentual' | $T8 %]</th>
-         <td>
-          [% LxERP.format_amount(marge_percent, 2, 0) %] %
-          <input type=hidden name="marge_percent" value="[% marge_percent %]">
-         </td>
-        </tr>
-       </table>
-      </td>
-      <td align="right">
-  [%- IF taxaccounts %]
-       <input type="hidden" name="taxincluded_changed_by_user" id="taxincluded_changed_by_user" value="[% taxincluded_changed_by_user ? '1' : '0' %]">
-       <input name="taxincluded" onclick="document.getElementById('taxincluded_changed_by_user').value = '1';" class="checkbox" type="checkbox" [% IF taxincluded %]checked[% END %]>
-       <b>[% 'Tax Included' | $T8 %]</b>
-       <br>
-       <br>
-  [%- END %]
-       <table>
+    <td>
+      [% IF show_weight %]
+        <div class="info-block"><!-- PENDENT: vereinheitlichen -->
+          <span class="info-label">[% 'Total weight' | $T8 %]</span>
+          <span class="info-value">[% LxERP.format_amount(totalweight) %] [% HTML.escape(weightunit) %]</span>
+        </div>
+      [% END %]
+    </td><!-- <td></td><td></td><td></td><td></td><td></td><td></td><td></td> -->
+    <th>[% 'Subtotal' | $T8 %]</th>
+    <td class="numeric">[% LxERP.format_amount(invsubtotal, 2) %]</td>
+  </tr>
+  [% END %]
 
-[%- UNLESS taxincluded %]
-        <tr>
-         <th align="right">[% 'Subtotal' | $T8 %]</th>
-         <td align="right">[% LxERP.format_amount(invsubtotal, 2) %]</td>
-       </tr>
-[%- END %]
+  [%# tax %]
+  [% FOREACH item = taxaccounts_array %]
+    [% SET description_ref = item _ '_description' %]
+    [% SET rate_ref        = item _ '_rate' %]
+    [% SET total_ref       = item _ '_total' %]
+    [% SET netto_ref       = item _ '_netto' %]
+    <tr>
+      <td></td>
+      <th>[% 'Including' | $T8 %] [% $description_ref | html %]&nbsp;[% $rate_ref * 100 %]%</th>
+      <td class="numeric">[% LxERP.format_amount($total_ref, 2) %]</td>
+    </tr>
+    [% IF taxincluded %]
+      <tr>
+        <td></td>
+        <th>[% 'Net amount' | $T8 %]</th>
+        <td class="numeric">[% LxERP.format_amount($netto_ref, 2) %]</td>
+      </tr>
+    [% END %]
+  [% END %]
+  [% IF rounding %]
+    <tr>
+    <td></td>
+      <th>[% 'Rounding' | $T8 %]</th>
+      <td class="numeric">[% LxERP.format_amount(rounding, 2) %]</td>
+    </tr>
+  [% END %]
+  <tr>
+    <td></td>
+    <th>[% 'Total' | $T8 %]</th>
+    <td class="numeric">[% LxERP.format_amount(invtotal, 2) %]</td>
+  </tr>
+  <tr>
+    <td></td>
+    <th>[% 'Ertrag' | $T8 %]</th>
+    <td class="numeric">
+      [% LxERP.format_amount(marge_total, 2, 0) %]
+      <input type=hidden name="marge_total" value="[% marge_total %]" class="numeric">
+    </td>
+  </tr>
+  <tr>
+    <td></td>
+    <th>[% 'Ertrag prozentual' | $T8 %]</th>
+    <td class="numeric">
+      [% LxERP.format_amount(marge_percent, 2, 0) %] %
+      <input type=hidden name="marge_percent" value="[% marge_percent %]" class="numeric">
+    </td>
+  </tr>
+  </tfoot>
+</table>
 
-[%# tax %]
-[% FOREACH item = taxaccounts_array %]
-[% SET description_ref = item _ '_description' %]
-[% SET rate_ref        = item _ '_rate' %]
-[% SET total_ref       = item _ '_total' %]
-[% SET netto_ref       = item _ '_netto' %]
-       <tr>
-        <th align="right">[% 'Including' | $T8 %] [% $description_ref | html %]&nbsp;[% $rate_ref * 100 %]%</th>
-        <td align="right">[% LxERP.format_amount($total_ref, 2) %]</td>
-       </tr>
-  [%- IF taxincluded %]
-       <tr>
-        <th align="right">[% 'Net amount' | $T8 %]</th>
-        <td align="right">[% LxERP.format_amount($netto_ref, 2) %]</td>
-       </tr>
-  [%- END %]
-[%- END %]
+[% IF id && follow_ups.size %]
+  <div class="message message_hint">
+      [% LxERP.t8('There are #1 unfinished follow-ups of which #2 are due.', follow_ups.size, follow_ups_unfinished) | html %]
+  </div>
+[% END %]
 
-[%- IF rounding %]
-        <tr>
-          <th align='right'>[% 'Rounding' | $T8 %]</th>
-          <td align='right'>[% LxERP.format_amount(rounding, 2) %]</td>
-        </tr>
-[%- END %]
+[% PROCESS 'is/_payments.html' %]
 
-        <tr>
-         <th align="right">[% 'Total' | $T8 %]</th>
-         <td align="right">[% LxERP.format_amount(invtotal, 2) %]</td>
-        </tr>
-       </table>
-      </td>
-     </tr>
-    </table>
-   </td>
-  </tr>
+</div><!--  /.ui-tabs-panel /#ui-tabs-basic-data -->
 
-[% PROCESS 'is/_payments.html' %]
- </table>
-</div>
 [% PROCESS 'webdav/_list.html' %]
-<div id="ui-tabs-1">
- [% LxERP.t8('Loading...') %]
-</div>
+
+<div id="ui-tabs-1" class="ui-tabs-panel" style="display:none">
+  <div class="wrapper">
+    [% LxERP.t8('Loading...') %]
+  </div>
+</div><!-- /#ui-tabs-1 -->
+
 </div>
 
 <input type="hidden" name="rowcount" value="[% rowcount %]">
@@ -153,21 +107,14 @@
 <input type="hidden" name="customer_discount" value="[% customer_discount %]">
 <input type="hidden" name="gldate" value="[% gldate %]">
 
-<div id="shipto_inputs" class="hidden">
- [%- PROCESS 'common/_ship_to_dialog.html' cvars=shipto_cvars %]
-</div>
-
+<div id="shipto_inputs" class="hidden">[% PROCESS 'common/_ship_to_dialog.html' cvars=shipto_cvars %]</div>
 <div id="email_inputs" style="display: none"></div>
+<div id="print_options" style="display: none">[% print_options %]</div>
 
-<div id="print_options" style="display: none">
- [% print_options %]
-</div>
 </form>
 <script type='text/javascript'>
- $(kivi.SalesPurchase.init_on_submit_checks);
+  $(kivi.SalesPurchase.init_on_submit_checks);
 </script>
 
 <div id="shipto_dialog" class="hidden"></div>
-<div id="print_dialog" class="hidden">
- [%- PROCESS 'common/_print_dialog.html' %]
-</div>
+<div id="print_dialog" class="hidden"><form action="#" name="fake-print-dialog" id="fake-print-dialog">[% PROCESS 'common/_print_dialog.html' %]</form></div>
diff --git a/templates/webpages/is/form_header.html b/templates/webpages/is/form_header.html
index dfe46b6b6..68c745202 100644
--- a/templates/webpages/is/form_header.html
+++ b/templates/webpages/is/form_header.html
@@ -9,292 +9,345 @@
 <script type="text/javascript" src="js/calculate_qty.js"></script>
 <script type="text/javascript" src="js/follow_up.js"></script>
 
+<h1>[% title %]</h1>
+
 <form method="post" id='form' name="invoice" action="[% script %]">
 
-[%- FOREACH key = HIDDENS %]
-<input type="hidden" name="[% HTML.escape(key) %]" id="[% HTML.escape(key) %]" value="[% HTML.escape($key)  %]">
-[%- END %]
+[% FOREACH key = HIDDENS %]
+  <input type="hidden" name="[% HTML.escape(key) %]" id="[% HTML.escape(key) %]" value="[% HTML.escape($key)  %]">
+[% END %]
 <input type="hidden" name="follow_up_trans_id_1" id="follow_up_trans_id_1" value="[% id %]">
 <input type="hidden" name="follow_up_trans_type_1" id="follow_up_trans_type_1" value="sales_invoice">
 <input type="hidden" name="follow_up_trans_info_1" id="follow_up_trans_info_1" value="[% HTML.escape(follow_up_trans_info) %]">
 <input type="hidden" name="follow_up_rowcount" id="follow_up_rowcount" value="1">
 <input type="hidden" name="lastmtime" id="lastmtime" value="[% HTML.escape(lastmtime) %]">
 
-<h1>[% title %]</h1>
 
-<p>[% saved_message %]</p>
+[% IF saved_message != '' %]<p>[% saved_message %]</p>[% END %]
 
-[%- INCLUDE 'common/flash.html' %]
-[%- INCLUDE 'generic/set_longdescription.html' %]
+[% INCLUDE 'common/flash.html' %]
+[% INCLUDE 'generic/set_longdescription.html' %]
 
 <div id="is_tabs" class="tabwidget">
- <ul>
-  <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
-[%- IF INSTANCE_CONF.get_webdav %]
-  <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
-[%- END %]
-[%- IF id %]
-  [%- IF INSTANCE_CONF.get_doc_storage %]
-  <li><a href="controller.pl?action=File/list&file_type=document&object_type=invoice&object_id=[% HTML.url(id) %]">[% 'Documents' | $T8 %]</a></li>
-  <li><a href="controller.pl?action=File/list&file_type=attachment&object_type=invoice&object_id=[% HTML.url(id) %]">[% 'Attachments' | $T8 %]</a></li>
-  [%- END %]
-  [%- IF AUTH.assert('record_links', 1) %]
-  <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Invoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
-  [%- END %]
-  [%- IF AUTH.assert('invoice_edit', 1) %]
-  <li><a href="[% 'controller.pl?action=AccTrans/list_transactions&trans_id=' _ HTML.url(id) | html %]">[% LxERP.t8('Transactions') %]</a></li>
-  [%- END %]
-[%- END %]
- </ul>
+  <ul class="ui-tabs-nav">
+    <li><a href="#ui-tabs-basic-data" class="ui-tabs">[% 'Basic Data' | $T8 %]</a></li>
+    [% IF INSTANCE_CONF.get_webdav %]
+      <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
+    [% END %]
+    [% IF id %]
+      [% IF INSTANCE_CONF.get_doc_storage %]
+        <li><a href="controller.pl?action=File/list&file_type=document&object_type=invoice&object_id=[% HTML.url(id) %]">[% 'Documents' | $T8 %]</a></li>
+        <li><a href="controller.pl?action=File/list&file_type=attachment&object_type=invoice&object_id=[% HTML.url(id) %]">[% 'Attachments' | $T8 %]</a></li>
+      [% END %]
+      [% IF AUTH.assert('record_links', 1) %]
+        <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Invoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
+      [% END %]
+      [% IF AUTH.assert('invoice_edit', 1) %]
+        <li><a href="[% 'controller.pl?action=AccTrans/list_transactions&trans_id=' _ HTML.url(id) | html %]">[% LxERP.t8('Transactions') %]</a></li>
+      [% END %]
+    [% END %]
+  </ul>
+
+
+<div id="ui-tabs-basic-data" class="ui-tabs-panel">
 
-<div id="ui-tabs-basic-data">
-<table width="100%">
-  <tr>
-    <td valign="top">
-      <table>
-        <tr>
-          <th align="right">[% 'Customer' | $T8 %]</th>
-          <td>
-           [% P.customer_vendor.picker("customer_id", customer_id, type="customer", style="width: 250px", class="initial_focus", onchange="\$('#update_button').click()") %]
-           [% L.button_tag("show_vc_details('customer')", LxERP.t8('Details (one letter abbreviation)')) %]
-           [% L.hidden_tag("previous_customer_id", customer_id) %]
-           [% L.hidden_tag("customer_pricegroup_id", customer_pricegroup_id) %]
-          </td>
-        </tr>
-[%- IF ALL_CONTACTS.size %]
-        <tr>
-          <th align="right">[% 'Contact Person' | $T8 %]</th>
-          <td>
-            [% L.select_tag('cp_id', ALL_CONTACTS, default = cp_id, value_key = 'cp_id', title_key = 'full_name_dep', with_empty = 1, style = 'width: 250px') %]
-          </td>
-        </tr>
-[%- END %]
-        <tr>
-          <th align="right">[% 'Shipping Address' | $T8 %]</th>
-          <td>
-           [%- IF ALL_SHIPTO.size %]
-            [% shiptos = [ [ "", LxERP.t8("No/individual shipping address") ] ] ;
-               L.select_tag('shipto_id', shiptos.import(ALL_SHIPTO), default=shipto_id, value_key='shipto_id', title_key='displayable_id', style='width: 250px') %]
-           [%- END %]
-           [% L.button_tag("kivi.SalesPurchase.edit_custom_shipto()", LxERP.t8("Custom shipto")) %]
-          </td>
-        </tr>
-        <tr>
-          <td align="right">[% 'Credit Limit' | $T8 %]</td>
-          <td>
-            [% LxERP.format_amount(creditlimit, 0, '0') %]; [% 'Remaining' | $T8 %]
-            <span class="plus[% IF is_credit_remaining_negativ %]0[% ELSE %]1[% END %]">[% LxERP.format_amount(creditremaining,0 ,'0') %]</span>
-          </td>
-        </tr>
-[%- IF max_dunning_level || dunning_description  %]
-        <tr>
-          <th align="right" valign="top">[% LxERP.t8("Dunning status") %]</th>
-          <td valign="top">
-           [% IF dunning_description %]
-            <span class="dunned_invoice">[% LxERP.t8("This invoice's dunning level: #1", dunning_description) %]</span>
-            [% IF max_dunning_level %]<br>[% END %]
-           [% END %]
-           [% IF max_dunning_level %]
-            <span class="customer_dunning_level">
-             [% LxERP.t8("Customer's current maximum dunning level: #1", max_dunning_level) %]
-             <br>
+<div class="wrapper" id="wrapper-1">
+  [% INCLUDE 'generic/toggle_wrapper.html' %]
+  <table class="tbl-horizontal">
+    <caption>[% 'Customer &amp; Order' | $T8 %]</caption>
+    <colgroup><col class="wi-mediumsmall"><col class="wi-wide"></colgroup>
+    <tbody>
+    <tr>
+      <th>[% 'Customer' | $T8 %]</th>
+      <td><!-- PENDENT: Type sollte text und nicht customer sein. Ueberall bei customer_vendor.picker aendern, auf allen Seiten -->
+        [% P.customer_vendor.picker("customer_id", customer_id, type="customer", class="wi-wide initial_focus", size=36, onchange="\$('#update_button').click()") %]
+        [% #L.button_tag("show_vc_details('customer')", LxERP.t8('Details (one letter abbreviation)'), class='wi-tiny neutral') %]
+        <a href="javascript:show_vc_details('customer')" class="button-image info tooltipster-html" title="[% 'Detail information about this customer' | $T8 %]"><img src="image/detail.png"></a>
+        [% L.hidden_tag("previous_customer_id", customer_id) %]
+        [% L.hidden_tag("customer_pricegroup_id", customer_pricegroup_id) %]
+      </td>
+    </tr>
+    [% IF ALL_CONTACTS.size %]
+      <tr>
+        <th>[% 'Contact Person' | $T8 %]</th>
+        <td>
+          [% L.select_tag('cp_id', ALL_CONTACTS, default = cp_id, value_key = 'cp_id', title_key = 'full_name_dep', with_empty = 1, class="wi-wide") %]
+        </td>
+      </tr>
+    [% END %]
+    <tr>
+      <th>[% 'Shipping Address' | $T8 %]</th>
+      <td>
+       [% IF ALL_SHIPTO.size %]
+        [% shiptos = [ [ "", LxERP.t8("No/individual shipping address") ] ] ;
+           L.select_tag('shipto_id', shiptos.import(ALL_SHIPTO), default=shipto_id, value_key='shipto_id', title_key='displayable_id', class="wi-wide") %]
+       [% END %]
+       [% L.button_tag("kivi.SalesPurchase.edit_custom_shipto()", LxERP.t8("Custom shipto"), class="wi-wide neutral below") %]
+      </td>
+    </tr>
+    <tr>
+      <th>[% 'Credit Limit' | $T8 %]</th>
+      <td>
+        <span class="data wi-wide">[% LxERP.format_amount(creditlimit, 0, '0') %], [% 'Remaining' | $T8 %] <span class="plus[% IF is_credit_remaining_negativ %]0[% ELSE %]1[% END %]">[% LxERP.format_amount(creditremaining,0 ,'0') %]</span> </span>
+      </td>
+    </tr>
+    [% IF max_dunning_level || dunning_description  %]
+      <tr>
+        <th>[% LxERP.t8("Dunning status") %]</th>
+        <td>
+         [% IF dunning_description %]
+           <span class="dunned_invoice data wi-wide">[% LxERP.t8("This invoice's dunning level: #1", dunning_description) %]</span>
+           [% IF max_dunning_level %]<br>[% END %]
+         [% END %]
+         [% IF max_dunning_level %]
+           <span class="customer_dunning_level data wi-wide">
+             [% LxERP.t8("Customer's current maximum dunning level: #1", max_dunning_level) %]<br>
              [% LxERP.t8("Dunned open amount: #1", LxERP.format_amount(dunning_amount, 2)) %]
-            </span>
-           [% END %]
-          </td>
-        </tr>
-[%- END %]
-[%- IF invoice_obj.sepa_exports.as_list.size %]
-        <tr>
-          <th align="right">[% LxERP.t8("SEPA exports") %]</th>
-          <td>
-           [% FOREACH export = invoice_obj.sepa_exports.as_list %]
-            <a href="sepa.pl?action=bank_transfer_edit&vc=customer&id=[% HTML.url(export.id) %]">[% HTML.escape(export.id) %]</a>
-            [% UNLESS loop.last %], [% END %]
-           [% END %]
-          </td>
-        </tr>
-[%- END %]
-[%- IF business %]
-        <tr>
-          <th align="right">[% 'Customer type' | $T8 %]</th>
-          <td>[% business %]; [% 'Trade Discount' | $T8 %] [% LxERP.format_amount(tradediscount * 100) %] %</td>
-        </tr>
-[%- END %]
-        <tr>
-          <th align="right" nowrap>[% 'Record in' | $T8 %]</th>
-          <td colspan="3">
-            <select name="AR" style="width:250px;">[% selectAR %]</select>
-            <input type="hidden" name="selectAR" value="[% selectAR | html %]">
-          </td>
-        </tr>
-        <tr>
-          <th align="right">[% 'Steuersatz' | $T8 %]</th>
-          <td>
-            [% L.select_tag('taxzone_id', ( id ? ALL_TAXZONES : ALL_ACTIVE_TAXZONES) , default = taxzone_id, title_key = 'description', disabled = (id ? 1 : 0), style='width: 250px', onchange = "document.getElementById('update_button').click();") %]
-  [%- IF id %]
+          </span>
+         [% END %]
+        </td>
+      </tr>
+    [% END %]
+    [% IF invoice_obj.sepa_exports.as_list.size %]
+      <tr>
+        <th>[% LxERP.t8("SEPA exports") %]</th>
+        <td>
+         [% FOREACH export = invoice_obj.sepa_exports.as_list %]
+           <a href="sepa.pl?action=bank_transfer_edit&vc=customer&id=[% HTML.url(export.id) %]">[% HTML.escape(export.id) %]</a>
+           [% UNLESS loop.last %], [% END %]
+         [% END %]
+        </td>
+      </tr>
+    [% END %]
+    [% IF business %]
+      <tr>
+        <th>[% 'Customer type' | $T8 %]</th>
+        <td><span class="data wi-wide">[% business %] ([% 'Trade Discount' | $T8 %] [% LxERP.format_amount(tradediscount * 100) %]%)</span></td>
+      </tr>
+    [% END %]
+    <tr>
+      <th>[% 'Record in' | $T8 %]</th>
+      <td>
+        <select name="AR" class="wi-wide">[% selectAR %]</select>
+        <input type="hidden" name="selectAR" value="[% selectAR | html %]">
+      </td>
+    </tr>
+  [% IF currencies %]
+    <tr>
+      <th>[% 'Currency' | $T8 %]</th>
+      <td>[% currencies %]</td>
+    </tr>
+  [% END %]
+  <!--PENDENT: Hardcoded! Ist das korrekt? hps-->
+    <tr>
+      <th>[% 'Steuersatz' | $T8 %]</th>
+      <td>
+        [% L.select_tag('taxzone_id', ( id ? ALL_TAXZONES : ALL_ACTIVE_TAXZONES) , default = taxzone_id, title_key = 'description', disabled = (id ? 1 : 0), class='wi-wide', onchange = "document.getElementById('update_button').click();") %]
+        [% IF id %]
           <input type='hidden' name='taxzone_id' value='[% taxzone_id %]'>
-  [%- END %]
-          </td>
-        </tr>
-[%- IF ALL_DEPARTMENTS %]
-        <tr>
-          <th align="right" nowrap>[% 'Department' | $T8 %]</th>
-          <td colspan="3">
-            [% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1, style = 'width:250px') %]
-          </td>
-        </tr>
-[%- END %]
-[%- IF currencies %]
-        <tr>
-          <th align="right">[% 'Currency' | $T8 %]</th>
-          <td>[% currencies %]</td>
-        </tr>
-[%- END %]
-        <tr style='display:none'>
-          <td>
-            <input type="hidden" name="fxgain_accno" value="[% fxgain_accno %]">
-            <input type="hidden" name="fxloss_accno" value="[% fxloss_accno %]">
-            <input type="hidden" name="rndgain_accno" value="[% rndgain_accno %]">
-            <input type="hidden" name="rndloss_accno" value="[% rndloss_accno %]">
-          </td>
-        </tr>
-[%- IF show_exchangerate %]
-        <tr>
-          <th align="right">[% 'Exchangerate' | $T8 %]</th>
-          <td>
-           [%- IF forex %]
+        [% END %]
+      </td>
+    </tr>
+    [% IF taxaccounts %]
+      <tr>
+        <th>[% 'Tax Included' | $T8 %]</th>
+        <td>
+          <input type="hidden" name="taxincluded_changed_by_user" id="taxincluded_changed_by_user" value="[% taxincluded_changed_by_user ? '1' : '0' %]">
+          <input name="taxincluded" onclick="document.getElementById('taxincluded_changed_by_user').value = '1';" type="checkbox" [% IF taxincluded %]checked[% END %]>
+        </td>
+      </tr>
+    [% END %]
+    [% IF ALL_DEPARTMENTS %]
+      <tr>
+        <th>[% 'Department' | $T8 %]</th>
+        <td>[% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1, class='wi-wide') %]</td>
+      </tr>
+    [% END %]
+    <tr style='display:none'>
+      <td>
+        <input type="hidden" name="fxgain_accno" value="[% fxgain_accno %]">
+        <input type="hidden" name="fxloss_accno" value="[% fxloss_accno %]">
+        <input type="hidden" name="rndgain_accno" value="[% rndgain_accno %]">
+        <input type="hidden" name="rndloss_accno" value="[% rndloss_accno %]">
+      </td>
+    </tr>
+    [% IF show_exchangerate %]
+      <tr>
+        <th>[% 'Exchangerate' | $T8 %]</th>
+        <td>
+          [% IF forex %]
             [% LxERP.format_amount(exchangerate, 5) %]
-           [%- ELSE %]
-            <input name="exchangerate" size="10" value="[% HTML.escape(LxERP.format_amount(exchangerate)) %]">
-           [%- END %]
-          </td>
-        </tr>
-[%- END %]
-        <tr>
-          <th align="right" nowrap>[% 'Shipping Point' | $T8 %]</th>
-          <td colspan="3"><input size='35' name="shippingpoint" value="[% HTML.escape(shippingpoint) %]"></td>
-        </tr>
-        <tr>
-          <th align="right" nowrap>[% 'Ship via' | $T8 %]</th>
-          <td colspan="3"><input size='35' name="shipvia" value="[% HTML.escape(shipvia) %]"></td>
-        </tr>
-        <tr>
-          <th align="right">[% 'Transaction description' | $T8 %]</th>
-          <td colspan="3">[% L.input_tag("transaction_description", transaction_description, size=35, "data-validate"=INSTANCE_CONF.get_require_transaction_description_ps ? 'required' : '') %]</td>
-        </tr>
-      </table>
-    </td>
-    <td align="right" valign="top">
-      <table>
-        <tr>
-          <th align="right">[% 'Employee' | $T8 %]</th>
-          <td>
-            [% L.select_tag('employee_id', ALL_EMPLOYEES, default = employee_id, title_key = 'safe_name') %]
-          </td>
-        </tr>
-[%- IF ALL_SALESMEN.size %]
-        <tr>
-          <th align="right">[% 'Salesman' | $T8 %]</th>
-          <td>
-            [% L.select_tag('salesman_id', ALL_SALESMEN, default = (salesman_id ? salesman_id : employee_id), title_key = 'safe_name') %]
-          </td>
-        </tr>
-[%- END %]
+          [% ELSE %]
+            <input type="text" name="exchangerate" size="10" value="[% HTML.escape(LxERP.format_amount(exchangerate)) %]">
+          [% END %]
+        </td>
+      </tr>
+    [% END %]
+    <tr>
+      <th>[% 'Shipping Point' | $T8 %]</th>
+      <td><input type="text" class="wi-wide" name="shippingpoint" value="[% HTML.escape(shippingpoint) %]"></td>
+    </tr>
+    <tr>
+      <th>[% 'Ship via' | $T8 %]</th>
+      <td><input type="text" class="wi-wide" name="shipvia" value="[% HTML.escape(shipvia) %]"></td>
+    </tr>
+    <tr>
+      <th>[% 'Transaction description' | $T8 %]</th>
+      <td>[% L.input_tag("transaction_description", transaction_description, class="wi-wide", "data-validate"=INSTANCE_CONF.get_require_transaction_description_ps ? 'required' : '') %]</td>
+    </tr>
+    </tbody>
+  </table>
 
-[%- IF is_type_credit_note %]
-        <tr>
-          <th align="right" nowrap>[% 'Credit Note Number' | $T8 %]</th>
-          <td colspan="3"><input size='11' name="invnumber" id="invnumber" value="[% HTML.escape(invnumber) %]"></td>
-        </tr>
-        <tr>
-          <th align="right" nowrap>[% 'Invoice Number' | $T8 %]</th>
-          <td colspan="3"><input size='11' name="invnumber_for_credit_note" id="invnumber_for_credit_note" value="[% HTML.escape(invnumber_for_credit_note) %]"></td>
-        </tr>
-        <tr>
-          <th align="right">[% 'Credit Note Date' | $T8 %]</th>
-          <td>[% L.date_tag('invdate', invdate, onchange='kivi.SalesPurchase.set_duedate_on_reference_date_change("invdate")') %]</td>
-        </tr>
-[%- ELSE %]
-        <tr>
-          <th align="right" nowrap>[% 'Invoice Number' | $T8 %]</th>
-          <td colspan="3"><input size='11' name="invnumber" id="invnumber" value="[% HTML.escape(invnumber) %]"></td>
-        </tr>
-        <tr>
-          <th align="right">[% 'Invoice Date' | $T8 %]</th>
-          <td>[% L.date_tag('invdate', invdate, onchange='kivi.SalesPurchase.set_duedate_on_reference_date_change("invdate")') %]</td>
-        </tr>
-        <tr>
-          <th align="right">[% 'Due Date' | $T8 %]</th>
-          <td>
-           <span id="duedate_container"[% IF payment_terms_obj.auto_calculation %] style="display:none"[% END %]>[% L.date_tag('duedate', duedate) %]</span>
-           <span id="duedate_fixed"[% IF !payment_terms_obj.auto_calculation %] style="display:none"[% END %]>[% HTML.escape(duedate) %]</span>
-          </td>
-        </tr>
-        <tr>
-        <th align="right" nowrap>[% 'Delivery Order Number' | $T8 %]</th>
-          <td colspan="3"><input size='11' name="donumber" id="donumber" value="[% HTML.escape(donumber) %]"></td>
-        </tr>
-[%- END %]
-        <tr>
-          <th align="right">[% 'Delivery Date' | $T8 %]</th>
-          <td>[% L.date_tag('deliverydate', deliverydate) %]</td>
-        </tr>
-        <tr>
-          <th align="right" nowrap>[% 'Order Number' | $T8 %]</th>
-          <td colspan="3"><input size='11' name="ordnumber" id="ordnumber" value="[% HTML.escape(ordnumber) %]"></td>
-        </tr>
-        <tr>
-          <th align="right" nowrap>[% 'Order Date' | $T8 %]</th>
-          <td>[% L.date_tag('orddate', orddate) %]</td>
-        </tr>
-        <tr>
-          <th align="right" nowrap>[% 'Quotation Number' | $T8 %]</th>
-          <td colspan="3"><input size='11' name="quonumber" id="quonumber" value="[% HTML.escape(quonumber) %]"></td>
-        </tr>
-        <tr>
-          <th align="right" nowrap>[% 'Quotation Date' | $T8 %]</th>
-          <td>[% L.date_tag('quodate', quodate) %]</td>
-        </tr>
-        <tr>
-          <th align="right" nowrap>[% 'Customer Order Number' | $T8 %]</th>
-          <td colspan="3"><input size='11' name="cusordnumber" id="cusordnumber" value="[% HTML.escape(cusordnumber) %]"></td>
-        </tr>
-        <tr>
-          <th align="right" nowrap>[% 'Project Number' | $T8 %]</th>
-          <td>
-            [%- L.select_tag('globalproject_id', ALL_PROJECTS, title_key = 'projectnumber', default = globalproject_id, with_empty = '1', onChange = "document.getElementById('update_button').click();") %]
-          </td>
-        </tr>
-      </table>
-    </td>
-  </tr>
-  <tr style='display:none'>
-    <td>
-      <input type="hidden" name="webdav" value="[% webdav %]">
-    </td>
-  </tr>
-</table>
+  <table class="tbl-horizontal">
+    <caption>[% 'Payment / Delivery Options' | $T8 %]</caption>
+    <colgroup> <col class="wi-wide"> </colgroup>
+    <tbody>
+    <tr>
+      <th class="single-col">
+        <span class="label above">[% 'Payment Terms' | $T8 %]</span>
+        [% L.select_tag('payment_id', payment_terms, default = payment_id, title_key = 'description', with_empty = 1, class="wi-wide") %]
+        <script type='text/javascript'>$('#payment_id').change(function(){ kivi.SalesPurchase.set_duedate_on_reference_date_change("invdate"); })</script>
+      </th>
+    </tr>
+    <tr>
+      <th class="single-col">
+        <span class="label above">[% 'Delivery Terms' | $T8 %]</span>
+        [% L.select_tag('delivery_term_id', ALL_DELIVERY_TERMS, default = delivery_term_id, with_empty = 1, title_key = 'description', class="wi-wide") %]
+      </th>
+    </tr>
+    <tr>
+      <th>[% 'direct debit' | $T8 %] [% L.checkbox_tag('direct_debit', 'checked', direct_debit) %]</th>
+    </tr>
+    <tr>
+      <th class="caption">[% 'Notes (will appear on hard copy)' | $T8 %]</th>
+    </tr>
+    <tr>
+      <td class="wi-wide">
+        [% L.textarea_tag("notes", notes, wrap="soft", class="wi-wide texteditor", style="height:84px;") %]
+      </td>
+    </tr>
+     <tr>
+      <th>
+        <span class="label above">[% 'Internal Notes' | $T8 %]</span>
+        [% L.textarea_tag("intnotes", intnotes, wrap="soft", class="wi-wide") %]
+      </th>
+    </tr>
+  </tbody>
+  </table>
 
-  <script type="text/javascript" src="js/show_form_details.js"></script>
-  <script type="text/javascript" src="js/show_vc_details.js"></script>
-  <script type="text/javascript" src="js/show_history.js"></script>
-  <script type="text/javascript">
-   <!--
-     $('document').ready(function(){
-[% IF resubmit && is_format_html %]
-       window.open('about:blank','Beleg');
-       document.invoice.target = 'Beleg';
-       kivi.SalesPurchase.show_print_dialog();
-       kivi.SalesPurchase.print_record();
-[% ELSIF resubmit %]
-       kivi.SalesPurchase.show_print_dialog();
-       kivi.SalesPurchase.print_record();
-[% ELSIF creditwarning != '' %]
-       alert('[% 'Credit Limit exceeded!!!' | $T8 %]');
-[% ELSE %]
-[% END %]
+  <table class="tbl-horizontal">
+    <caption>[% 'Dates &amp; Numbers' | $T8 %]</caption>
+    <colgroup> <col class="wi-small"><col class="wi-small"><col class="wi-small"> </colgroup>
+    <tbody>
+    <tr>
+      <th>[% 'Employee' | $T8 %]</th>
+      <td colspan="2">
+        [% L.select_tag('employee_id', ALL_EMPLOYEES, default = employee_id, title_key = 'safe_name', class="wi-lightwide") %]
+      </td>
+    </tr>
+    [% IF ALL_SALESMEN.size %]
+      <tr>
+        <th>[% 'Salesman' | $T8 %]</th>
+        <td colspan="2">
+          [% L.select_tag('salesman_id', ALL_SALESMEN, default = (salesman_id ? salesman_id : employee_id), title_key = 'safe_name', class="wi-lightwide") %]
+        </td>
+      </tr>
+    [% END %]
+    <tr>
+      <th>&nbsp;</th>
+      <th>[% 'Date' | $T8 %]</th>
+      <th>[% 'Number' | $T8 %]</th>
+    </tr>
+    [% IF is_type_credit_note %]
+      <tr>
+        <th>[% 'Credit Note' | $T8 %]</th>
+        <!-- <th>[% 'Credit Note Number' | $T8 %]</th> -->
+        <td>[% L.date_tag('invdate', invdate, onchange='kivi.SalesPurchase.set_duedate_on_reference_date_change("invdate")', class='wi-date') %]</td>
+        <td><input type="text" name="invnumber" id="invnumber" value="[% HTML.escape(invnumber) %]" class="wi-small"></td>
+      </tr>
+      <tr>
+        <th>[% 'Invoice' | $T8 %]</th>
+        <td>&nbsp;</td>
+        <td><input type="text" name="invnumber_for_credit_note" id="invnumber_for_credit_note" value="[% HTML.escape(invnumber_for_credit_note) %]"  class="wi-small"></td>
+      </tr>
+      <tr>
+      </tr>
+    [% ELSE %]
+    <tr>
+      <th>[% 'Invoice' | $T8 %]</th>
+      <!-- <th>[% 'Invoice Date' | $T8 %]</th> -->
+      <td>[% L.date_tag('invdate', invdate, onchange='kivi.SalesPurchase.set_duedate_on_reference_date_change("invdate")', class='wi-date') %]</td>
+      <td><input type="text" name="invnumber" id="invnumber" value="[% HTML.escape(invnumber) %]" class="wi-small"></td>
+    </tr>
+    <tr>
+      <th>[% 'Due Date' | $T8 %]</th>
+      <td>
+       <span class="condensed" id="duedate_container"[% IF payment_terms_obj.auto_calculation %] style="display:none"[% END %]>[% L.date_tag('duedate', duedate, class='wi-date') %]</span>
+       <span class="condensed" id="duedate_fixed"[% IF !payment_terms_obj.auto_calculation %] style="display:none"[% END %]>[% HTML.escape(duedate, class='wi-date') %]</span>
+      </td>
+      <td></td>
+    </tr>
+    <tr>
+      <th>[% 'Delivery Order Number' | $T8 %]</th>
+      <td></td>
+      <td><input type="text" name="donumber" id="donumber" value="[% HTML.escape(donumber) %]" class="wi-small"></td>
+    </tr>
+  [% END %]
+    <tr>
+      <th>[% 'Delivery Date' | $T8 %]</th>
+      <td>[% L.date_tag('deliverydate', deliverydate, class='wi-date') %]</td>
+      <td></td>
+   </tr>
+    <tr>
+      <th>[% 'Order' | $T8 %]</th>
+      <!-- <th>[% 'Order Date' | $T8 %]</th> -->
+      <td>[% L.date_tag('orddate', orddate, class='wi-date') %]</td>
+      <td><input type="text" name="ordnumber" id="ordnumber" value="[% HTML.escape(ordnumber) %]" class="wi-small"></td>
+    </tr>
+    <tr>
+    </tr>
+    <tr>
+      <th>[% 'Quotation' | $T8 %]</th>
+      <!-- <th>[% 'Quotation Date' | $T8 %]</th> -->
+      <td>[% L.date_tag('quodate', quodate, class='wi-date') %]</td>
+      <td><input type="text" name="quonumber" id="quonumber" value="[% HTML.escape(quonumber) %]" class="wi-small"></td>
+    </tr>
+    <tr>
+    </tr>
+    <tr>
+      <th>[% 'Customer Order Number' | $T8 %]</th>
+      <td>&nbsp;</td>
+      <td><input type="text" name="cusordnumber" id="cusordnumber" value="[% HTML.escape(cusordnumber) %]" class="wi-small"></td>
+    </tr>
+    <tr>
+      <th>[% 'Project' | $T8 %]</th>
+      <td colspan="2">[% L.select_tag('globalproject_id', ALL_PROJECTS, title_key = 'projectnumber', default = globalproject_id, with_empty = '1', onChange = "document.getElementById('update_button').click();", class="wi-lightwide") %]</td>
+    </tr>
+    </tbody>
+  </table>
+
+  </div> <!-- /.wrapper -->
+
+<input type="hidden" name="webdav" value="[% webdav %]">
+
+<script type="text/javascript" src="js/show_form_details.js"></script>
+<script type="text/javascript" src="js/show_vc_details.js"></script>
+<script type="text/javascript" src="js/show_history.js"></script>
+[% IF (resubmit && is_format_html) || resubmit || creditwarning != '' %]
+  <script type="text/javascript"><!--
+    $('document').ready(function(){
+      [% IF resubmit && is_format_html %]
+        window.open('about:blank','Beleg');
+        document.invoice.target = 'Beleg';
+        kivi.SalesPurchase.show_print_dialog();
+        kivi.SalesPurchase.print_record();
+      [% ELSIF resubmit %]
+        kivi.SalesPurchase.show_print_dialog();
+        kivi.SalesPurchase.print_record();
+      [% ELSIF creditwarning != '' %]
+        alert('[% 'Credit Limit exceeded!!!' | $T8 %]');
+      [% ELSE %]
+      [% END %]
      });
-   //-->
-  </script>
-<table width="100%">
+  //--></script>
+[% END %]
