Vergessene locals
[kivitendo-erp.git] / templates / webpages / ar / form_header.html
index 363bb9d..b4cf07c 100644 (file)
 [% L.hidden_tag('follow_up_trans_info_1', follow_up_trans_info) %]
 [% L.hidden_tag('follow_up_rowcount', 1) %]
 
+<h1>[% title | html %]</h1>
+
 [%- IF saved_message %]<p>[% saved_message | html  %]</p>[% END %]
 
+<div class="tabwidget">
+ <ul>
+  <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
+[%- IF id %]
+  <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Invoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
+  <li><a href="[% 'controller.pl?action=AccTrans/list_transactions&trans_id=' _ HTML.url(id) | html %]">[% LxERP.t8('Transactions') %]</a></li>
+[%- END %]
+ </ul>
+
+<div id="ui-tabs-basic-data">
 <table width=100%>
-  <tr class=listtop>
-    <th class=listtop>[% title | html %]</th>
-  </tr>
-  <tr height="5"></tr>
   <tr valign=top>
     <td>
       <table width=100%>
@@ -32,9 +40,9 @@
                 <th align="right" nowrap>[% 'Customer' | $T8 %]</th>
                 <td colspan=3>
 [%- IF selectcustomer %]
-    <select id='customer' name="customer" onchange="document.getElementById('update_button').click();">[% selectcustomer %]</select>
+    <select id='customer' name="customer" onchange="document.getElementById('update_button').click();" class="initial_focus">[% selectcustomer %]</select>
 [%- ELSE %]
-    <input id='customer' name=customer value="[% customer | html %]" size=35>
+    <input id='customer' name=customer value="[% customer | html %]" size=35 class="initial_focus">
 [%- END %]
                 <input type="button" value="[% 'Details (one letter abbreviation)' | $T8 %]" onclick="show_vc_details('customer')"></td>
                 [% L.hidden_tag('selectcustomer', selectcustomer) %]
                 [% L.hidden_tag('customer_id', customer_id) %]
                 [% L.hidden_tag('terms', terms) %]
               </tr>
+[%- IF max_dunning_level || invoice_obj.dunning_config_id  %]
               <tr>
-                <td></td>
-                <td colspan=3>
-                  <table width=100%>
-                    <tr>
-                      <th align=left nowrap>[% 'Credit Limit' | $T8 %]</th>
-                      <td>[% LxERP.format_amount(creditlimit, 0) %][% L.hidden_tag('creditlimit', LxERP.format_amount(creditlimit, 0)) %]</td>
-                      <th align=left nowrap>[% 'Remaining' | $T8 %]</th>
-                      <td class="plus[% creditlimit < 0 ? 0 : 1 %]">[% LxERP.format_amount(creditremaining, 0) %][% L.hidden_tag('creditremaining', LxERP.format_amount(creditremaining, 0)) %]</td>
-                    </tr>
-                  </table>
+                <th align="right" valign="top">[% LxERP.t8("Dunning status") %]</th>
+                <td valign="top">
+                 [% IF invoice_obj.dunning_config_id %]
+                  <span class="dunned_invoice">[% LxERP.t8("This invoice's dunning level: #1", invoice_obj.dunning_config.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>
+                   [% LxERP.t8("Dunned open amount: #1", LxERP.format_amount(dunning_amount, 2)) %]
+                  </span>
+                 [% END %]
                 </td>
               </tr>
+[%- END %]
+              <tr>
+                <th align="right" valign="top">[% LxERP.t8("Credit Limit") %]</th>
+                <td>
+                 [% LxERP.format_amount(creditlimit, 0) %][% L.hidden_tag('creditlimit', LxERP.format_amount(creditlimit, 0)) %];
+                 [% LxERP.t8("Remaining") %]
+                 <span class="plus[% creditremaining < 0 ? 0 : 1 %]">[% LxERP.format_amount(creditremaining, 0) %][% L.hidden_tag('creditremaining', LxERP.format_amount(creditremaining, 0)) %]</span>
+                </td>
+              </tr>
+[%- 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 %]
               <tr>
                 <th align=right>[% 'Currency' | $T8 %]</th>
                 <td><select name=currency>[% selectcurrency %]</select></td>
@@ -66,7 +98,7 @@
                 [% L.hidden_tag('forex', forex) %]
                 [% IF show_exch %]
                    <th align=right>[% 'Exchangerate' | $T8 %]</th>
-                   <td>[%- IF forex %][% L.hidden_tag(exchangerate, LxERP.format_amount(exchangerate, 2)) %][% LxERP.format_amount(exchangerate, 2) %][%- ELSE %][% L.input_tag(exchangerate, LxERP.format_amount(exchangerate, 2), size=10) %][%- END %]</td>
+                   <td>[%- IF forex %][% L.hidden_tag('exchangerate', LxERP.format_amount(exchangerate, 2)) %][% LxERP.format_amount(exchangerate, 2) %][%- ELSE %][% L.input_tag('exchangerate', LxERP.format_amount(exchangerate, 2), size=10) %][%- END %]</td>
                 [% END %]
               </tr>
               [% department_html %]
               [%- END %]
               <tr>
                 <td align=right>[% L.checkbox_tag('taxincluded', checked=taxincluded) %]</td>
-                <th align=left nowrap>[% 'Tax Included' | $T8 %]</th>
+                <th align="left" nowrap><label for="taxincluded">[% 'Tax Included' | $T8 %]</label></th>
+              </tr>
+              <tr>
+                <td align="right">[% L.checkbox_tag('direct_debit', checked=direct_debit) %]</td>
+                <th align="left" nowrap><label for="direct_debit">[% 'direct debit' | $T8 %]</label></th>
               </tr>
             </table>
           </td>
         <tr>
           <th align=left width=1%>[% 'Notes' | $T8 %]</th>
           <td align=left><textarea name=notes rows="[% rows %]" cols=50 wrap=soft>[% notes | html %]</textarea></td>
+
+          <th align=left width=1%>[% 'Notes for customer' | $T8 %]</th>
+          <td align=left><textarea name=intnotes rows="[% rows %]" cols=50 wrap=soft readonly>[% intnotes | html %]</textarea></td>
         </tr>
       </table>
     </td>
          <th>[% 'Source' | $T8 %]</th>
          <th>[% 'Memo' | $T8 %]</th>
          <th>[% 'Amount' | $T8 %]</th>
+         <th></th>
 [%- IF show_exch %]
          <th>[% 'Exch' | $T8 %]</th>
 [%- END %]
         <tr>
          <td align=center>
   [%- IF row.changeable %]
-          [% L.date_tag('datepaid_' _ loop.count, row.datepaid) %]
+          [% L.date_tag('datepaid_' _ loop.count, row.datepaid ? row.datepaid : today) %]
   [%- ELSE %]
          [% row.datepaid | html %][% L.hidden_tag('datepaid_' _ loop.count, row.datepaid) %]
   [%- END %]
          [% row.paid | html %]<input type=hidden name="paid_[% loop.count %]" value="[% row.paid ? LxERP.format_amount(row.paid, 2) : '' | html %]">
   [%- END %]
          </td>
+         <td>
+           [% IF row.changeable && loop.last && paid_missing > 0 %]
+             <input type="button" id="ar_set_to_paid_missing" value="[% "Set to paid missing" | $T8 %]">
+           [% END %]
+         </td>
 [%- IF show_exch %]
          <td align=center>
     [%- IF row.forex || !row.changeable%]
       </table>
     </td>
   </tr>
-  <tr>
-    <td><hr size=3 noshade></td>
-  </tr>
 </table>
+</div>
+</div>
+
+<script type='text/javascript'>
+ $('#ar_set_to_paid_missing').click(function(){ $('input[name^="paid_"]:last').val('[% LxERP.format_amount(paid_missing, 2) %]') });
+</script>