Vergessene locals
[kivitendo-erp.git] / templates / webpages / ar / form_header.html
index 5388631..b4cf07c 100644 (file)
@@ -24,6 +24,7 @@
   <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>
 
                 [% 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>
          <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>
 </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>