]> wagnertech.de Git - mfinanz.git/blobdiff - templates/webpages/ap/form_header.html
date error in mapping
[mfinanz.git] / templates / webpages / ap / form_header.html
index e3bc2e9c765e07161e95f4113eb9b9ef8e7f089c..ec1a17a1914524e1984b4b90b66895a6f9ce4af8 100644 (file)
@@ -4,7 +4,10 @@
 [%- USE T8 %]
 [%- USE LxERP %][%- USE P -%]
 
-<h1>[% title | html %]</h1>
+<h1>
+  [% IF workflow_email_journal_id; LxERP.t8("Email Journal Workflow") _ " - "; END; %]
+  [% title %]
+</h1>
 
 [%- INCLUDE 'common/flash.html' %]
 
 <input type="hidden" name="rowcount" value="[% rowcount | html %]">
 
 <input type="hidden" name="paidaccounts" value="[% paidaccounts | html %]">
+[% L.hidden_tag('zugferd_session_file', zugferd_session_file) %]
 
 [%- P.hidden_tag('convert_from_oe_id', convert_from_oe_id) -%]
 
+[% IF !id %]
+[%   L.hidden_tag('form_validity_token', form_validity_token) %]
+[% END %]
+[% L.hidden_tag('email_journal_id',             email_journal_id) %]
+[% L.hidden_tag('email_attachment_id',          email_attachment_id) %]
+[% L.hidden_tag('workflow_email_journal_id',    workflow_email_journal_id) %]
+[% L.hidden_tag('workflow_email_attachment_id', workflow_email_attachment_id) %]
+[% L.hidden_tag('workflow_email_callback',      workflow_email_callback) %]
+
 [% FOREACH i IN [1..paidaccounts] %]
   [% temp = "acc_trans_id_"_ i %]
   <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
@@ -59,6 +72,9 @@
 <div id="ap_tabs" class="tabwidget">
  <ul>
   <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
+[% IF email_attachment_id || workflow_email_attachment_id %]
+  <li><a href="controller.pl?action=EmailJournal/attachment_preview&attachment_id=[% HTML.url(email_attachment_id || workflow_email_attachment_id) %]">[% 'Email Attachment Preview' | $T8 %]</a></li>
+[% END %]
 [%- IF INSTANCE_CONF.get_webdav %]
   <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
 [%- END %]
               <tr>
                 <th align="right" nowrap>[% 'Vendor' | $T8 %]</th>
                 <td colspan="3">
-                 [% P.customer_vendor.picker("vendor_id", vendor_id, type="vendor", style="width: 330px", onchange="\$('#update_button').click()") %]
-                 [% L.button_tag("show_vc_details('vendor')", LxERP.t8('Details (one letter abbreviation)')) %]
+                 [% P.customer_vendor.picker("vendor_id", vendor_id, type="vendor", show_details="1",
+                      style="width: 330px", class=(initial_focus == 'vendor_id' ? "initial_focus" : "")) %]
                  [% L.hidden_tag("previous_vendor_id", vendor_id) %]
                 </td>
               </tr>
                  <span class="plus[% creditremaining_plus %]">[% creditremaining | html %]</span>
                 </td>
               </tr>
-
 [%- IF invoice_obj.sepa_exports.as_list.size %]
               <tr>
                 <th align="right">[% LxERP.t8("SEPA exports") %]</th>
                 </td>
               </tr>
 [%- END %]
-
               <tr>
                 <th align="right" nowrap>[% 'Currency' | $T8 %]</th>
-                <td>[% L.select_tag("currency", currencies, default=currency, value_key="name", title_key="name") %]</td>
-
+                <td>
+                   [%- IF readonly  %]
+                     [% HTML.escape(currency) %]
+                     [% L.hidden_tag("currency", currency) %]
+                   [%- ELSE %]
+                     [% L.select_tag("currency", currencies, default=currency, value_key="name", title_key="name") %]
+                   [%- END %]
+                </td>
                 [% IF ( defaultcurrency && (currency != defaultcurrency) ) %]
                   <th align=right>[% 'Exchangerate' | $T8 %]</th>
-                  [% IF ( forex ) %]
-                    <td><input type="hidden" name="exchangerate" value="[% exchangerate | html %]">[% exchangerate | html %]</td>
-                  [% ELSE %]
-                    <td><input type="text" name="exchangerate" size="10" value="[% exchangerate | html %]"></td>
-                  [% END %]
+                  <td>
+                     [%- IF readonly  %]
+                       [% LxERP.format_amount(exchangerate, 5) %]
+                       [% L.hidden_tag("exchangerate", LxERP.format_amount(exchangerate, 5)) %]
+                     [%- ELSE %]
+                       <input name="exchangerate" size="10" value="[% HTML.escape(LxERP.format_amount(exchangerate)) %]">
+                     [%- END %]
+                     [% IF record_forex %][% 'record exchange rate' | $T8 %][%- ELSE %][% 'default exchange rate' | $T8 %][%- END %]
+                     [% L.hidden_tag("record_forex", record_forex) %]
                 [% END %]
-
               </tr>
 
               [% IF ALL_DEPARTMENTS %]
           <tr>
             <td>
               [% SET selected_chart_id = "AP_amount_chart_id_"_ i %]
-              [% P.chart.picker("AP_amount_chart_id_" _ i, $selected_chart_id, style="width: 400px", type="AP_amount", class=(initial_focus == 'row_' _ i ? "initial_focus" : "")) %]
+              [% P.chart.picker("AP_amount_chart_id_" _ i, $selected_chart_id, style="width: 400px", type="AP_amount", invalid=0, disabled=readonly, class=(initial_focus == 'row_' _ i ? "initial_focus" : "")) %]
               [% L.hidden_tag("previous_AP_amount_chart_id_" _ i, $selected_chart_id) %]
               <input type="hidden" name="tax_[% i %]" value="[% temp = "tax"_ i %][% $temp | html %]">
             </td>
             <td>
-              <input name="amount_[% i %]" size="10" value="[% temp = "amount_"_ i %][% $temp | html %]">
+              <input name="amount_[% i %]" size="10" [% readonly ? 'readonly' : '' %] value="[% temp = "amount_"_ i %][% $temp | html %]">
             </td>
             <td>
               [% temp_r = "tax_reverse_"_ i %]
             </td>
 
             [% temp = "paid_"_ i %]
-            <td align="center">
+            <td align="right">
               [% IF( changeable ) %]
                 <input name="[% temp %]" size="11" data-validate="number" class="numeric" value="[% $temp | html %]" id="[%- 'payment_' _ temp -%]">
               [% ELSE %]
                 [% $temp | html %]
-                <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
+                <input type="hidden" name="[% temp %]" value="[% $temp | html %]"> [% defaultcurrency %]
               [% END %]
             </td>
 
               <td align="center">
                 [% temp = "exchangerate_"_ i %]
                 [% temp_forex = "forex_"_ i %]
+                [% SET defaultcurrency_paid = 'defaultcurrency_paid_' _ i %]
+                [% SET record_forex = 'record_forex_' _ i %]
+                [% SET fx_transaction = 'fx_transaction_' _ i %]
 
                 [% IF( $temp_forex || !changeable ) %]
-                  [% $temp | html %]
+                  [% $temp | html %] = [% LxERP.format_amount($defaultcurrency_paid,2) %] [% defaultcurrency %] </br>
+                [% IF $record_forex %][% 'bank transaction exchange rate' | $T8 %][%- ELSE %][% 'default exchange rate' | $T8 %][%- END %]
+
                   <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
                 [% ELSE %]
                   <input name="[% temp %]" size="11" value="[% $temp | html %]">
                 [% END %]
-
                 <input type=hidden name="[% temp_forex %]" value="[% $temp_forex | html %]">
+                <input type="hidden" name="[% fx_transaction %]" value="1">
               </td>
             [% END %]
 
           <td></td>
           <td></td>
           <td align="center">[% 'Total' | $T8 %]</td>
-          <td align="center">[% LxERP.format_amount(totalpaid, 2) | html %]</td>
+          <td align="right">[% LxERP.format_amount(totalpaid, 2) | html %] [% currency %]</td>
+        [% IF ( !defaultcurrency || (currency != defaultcurrency) ) %]
+            <td></td>
+            <td align="center">[% LxERP.format_amount(defaultcurrency_totalpaid, 2) | html %] [% defaultcurrency %]</td>
+            <input type="hidden" name="defaultcurrency_totalpaid" value="[% defaultcurrency_totalpaid %]">
+            <input type="hidden" name="is_linked_bank_transaction" value="[% is_linked_bank_transaction %]">
+        [% END %]
+
         </tr>
         <tr>
           <td></td>
           <td></td>
           <td align="center">[% 'Missing amount' | $T8 %]</td>
-          <td align="center">[% LxERP.format_amount(paid_missing, 2) | html %]</td>
+          <td align="right">[% LxERP.format_amount(paid_missing, 2) | html %] [% currency %]</td>
         </tr>
       </table>
       [% END %]