added roundings on prints
[kivitendo-erp.git] / templates / webpages / oe / form_footer.html
index e22ee11..6c6072e 100644 (file)
@@ -2,6 +2,15 @@
 [%- USE HTML %]
 [%- USE LxERP %]
 [%- USE L %]
+[%- IF is_req_quo || is_pur_ord %]
+  [%- SET allow_invoice=1 %]
+[%- ELSIF is_sales_quo && INSTANCE_CONF.get_allow_sales_invoice_from_sales_quotation %]
+  [%- SET allow_invoice=1 %]
+[%- ELSIF is_sales_ord && INSTANCE_CONF.get_allow_sales_invoice_from_sales_order %]
+  [%- SET allow_invoice=1 %]
+[%- ELSE %]
+  [%- SET allow_invoice=0 %]
+[%- END %]
   <tr>
     <td>
       <table width="100%">
                            label_key  = 'description',
                            show_empty = 1 -%]
                 </td>
-            </tr>
+              </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>
 
 [%- IF is_sales_ord %]
             <tr>
@@ -36,6 +49,7 @@
               [% L.button_tag("edit_periodic_invoices_config(); return false;", LxERP.t8('Configure')) %]
               ([% HTML.escape(periodic_invoices_status) %])
               [% L.hidden_tag("periodic_invoices_config", periodic_invoices_config) %]
+              <a href="doc/html/ch03.html#features.periodic-invoices.variables" target="_blank">?</a>
              </td>
             </tr>
 [%- END %]
       [%- END %]
       </table>
           </td>
+      [%- IF show_weight %]
+          <td>
+            <table>
+            <tr>
+              <th  align="left">[% 'Total weight' | $T8 %]</th>
+              <td align="right">
+                [% LxERP.format_amount(totalweight, 3) %] [% HTML.escape(weightunit) %]
+              </td>
+            </tr>
+            </table>
+          </td>
+      [%- END %]
 [%- IF is_sales %]
           <td>
             <table>
           </td>
 [%- END %]
           <td align="right">
+
 [%- IF taxaccounts %]
-            <input name="taxincluded" class="checkbox" type="checkbox" value="1"[% IF taxincluded %] checked[% END %]><b>[% 'Tax Included' | $T8 %]</b><br><br>
+            <input type="hidden" name="taxincluded_changed_by_user" id="taxincluded_changed_by_user" value="[% taxincluded_changed_by_user ? '1' : '0' %]">
+            <input name="taxincluded" class="checkbox" onclick="document.getElementById('taxincluded_changed_by_user').value = '1';" type="checkbox" value="1"[% IF taxincluded %] checked[% END %]><b>[% 'Tax Included' | $T8 %]</b><br><br>
 [%- END %]
             <table>
 [%- IF NOT taxincluded %]
               </tr>
 [%- END %]
               [% tax %]
+[%- IF rounding %]
+              <tr>
+                <th align='right'>[% 'Rounding' | $T8 %]</th>
+                <td align='right'>[% LxERP.format_amount(rounding, 2) %]</td>
+              </tr>
+[%- END %]
               <tr>
                 <th align="right">[% 'Total' | $T8 %]</th>
                 <td align="right">[% LxERP.format_amount(invtotal, 2) %]
       </table>
     </td>
   </tr>
-  <tr>
-    <td><hr size="3" noshade></td>
-  </tr>
+</table>
 
-[%- IF webdav %]
-  <tr>
-    <th class="listtop" align="left">Dokumente im Webdav-Repository</th>
-  </tr>
-  <tr>
-   <td>
-    <table width="100%">
-     <tr>
-      <td align="left" width="30%"><b>Dateiname</b></td>
-      <td align="left" width="70%"><b>Webdavlink</b></td>
-     </tr>
- [%- FOREACH file = WEBDAV %]
-      <tr>
-        <td align="left">[% HTML.escape(file.name) %]</td>
-        <td align="left"><a href="[% file.link %]">[% HTML.escape(file.type) %]</a></td>
-      </tr>
- [%- END %]
-    </table>
-   </td>
-  </tr>
-  <tr>
-    <td><hr size="3" noshade></td>
-  </tr>
-[%- END %]
+</div>
+[%- PROCESS 'webdav/_list.html' %]
+<div id="ui-tabs-1">
+ [%- LxERP.t8("Loading...") %]
+</div>
+</div>
 
-  <tr>
-    <td>
-      [% print_options %]
-    </td>
-  </tr>
-</table>
+<hr size="3" noshade>
+
+<p>[% print_options %]</p>
 
 [% label_edit %]<br>
 <input class="submit" type="submit" name="action_update" id="update_button" value="[% 'Update' | $T8 %]">
 <input class="submit" type="submit" name="action_ship_to" value="[% 'Ship to' | $T8 %]">
-<input class="submit" type="submit" name="action_print" value="[% 'Print' | $T8 %]">
-<input class="submit" type="submit" name="action_e_mail" value="[% 'E-mail' | $T8 %]">
-<input class="submit" type="submit" name="action_save" value="[% 'Save' | $T8 %]">
-<input class="submit" type="submit" name="action_save_and_close" value="[% 'Save and Close' | $T8 %]">
+<input class="submit" type="submit" name="action_print" value="[% 'Print' | $T8 %]" data-require-transaction-description="[% INSTANCE_CONF.get_require_transaction_description_ps %]">
+<input class="submit" type="submit" name="action_e_mail" value="[% 'E-mail' | $T8 %]" data-require-transaction-description="[% INSTANCE_CONF.get_require_transaction_description_ps %]">
+
+[% IF not tpca_reminder %]
+  <input class="submit" type="submit" name="action_save" value="[% 'Save' | $T8 %]"[% IF warn_save_active_periodic_invoice %] data-warn-save-active-periodic-invoice="1"[% END %] data-require-transaction-description="[% INSTANCE_CONF.get_require_transaction_description_ps %]">
+  <input class="submit" type="submit" name="action_save_and_close" value="[% 'Save and Close' | $T8 %]"[% IF warn_save_active_periodic_invoice %] data-warn-save-active-periodic-invoice="1"[% END %] data-require-transaction-description="[% INSTANCE_CONF.get_require_transaction_description_ps %]">
+[% ELSE %]
+  [% IF warn_save_active_periodic_invoice  %] [% warn_save_active_periodic_invoice=1 %] [% END %]
+    [% L.submit_tag('action_save', LxERP.t8('Save'), confirm=LxERP.t8('Missing transport cost: #1  Are you sure?', tpca_reminder), 'data-require-transaction-description'=INSTANCE_CONF.get_require_transaction_description_ps, 'data-warn-save-active-periodic-invoice'=warn_save_active_periodic_invoice) %]
+    [% L.submit_tag('action_save_and_close', LxERP.t8('Save and close'), confirm=LxERP.t8('Missing transport cost: #1  Are you sure?', tpca_reminder), 'data-require-transaction-description'=INSTANCE_CONF.get_require_transaction_description_ps, 'data-warn-save-active-periodic-invoice'=warn_save_active_periodic_invoice) %]
+[% END %]
 
 [%- IF id %]
   <input type="button" class="submit" onclick="follow_up_window()" value="[% 'Follow-Up' | $T8 %]">
-  <input type="button" class="submit" onclick="set_history_window([% HTML.escape(id) %])" name="history" id="history" value="[% 'history' | $T8 %]">
+  <input type="button" class="submit" onclick="set_history_window([% HTML.escape(id) %], 'id')" name="history" id="history" value="[% 'history' | $T8 %]">
 
   <br>[% label_workflow %]<br>
-  <input class="submit" type="submit" name="action_save_as_new" value="[% 'Save as new' | $T8 %]">
-  <input class="submit" type="submit" name="action_delete" value="[% 'Delete' | $T8 %]">
+  <input class="submit" type="submit" name="action_save_as_new" value="[% 'Save as new' | $T8 %]" data-require-transaction-description="[% INSTANCE_CONF.get_require_transaction_description_ps %]">
+
+  [%- UNLESS (is_sales_ord && !INSTANCE_CONF.get_sales_order_show_delete) || (is_pur_ord && !INSTANCE_CONF.get_purchase_order_show_delete) %]
+    [% L.submit_tag('action_delete', LxERP.t8('Delete'), confirm=LxERP.t8('Are you sure?')) %]
+  [%- END %]
 
   [%- IF is_sales_quo %]
     <input class="submit" type="submit" name="action_sales_order" value="[% 'Sales Order' | $T8 %]">
     <input class="submit" type="submit" name="action_purchase_order" value="[% 'Purchase Order' | $T8 %]">
   [%- END %]
 
-  [%- IF is_sales_ord || is_pur_ord  && !delivered%]
+  [%- IF is_sales_ord || is_pur_ord %]
     <input class="submit" type="submit" name="action_delivery_order" value="[% 'Delivery Order' | $T8 %]">
   [%- END %]
 
+  [%- IF allow_invoice %]
   <input class="submit" type="submit" name="action_invoice" value="[% 'Invoice' | $T8 %]">
+  [%- END %]
 
   [%- IF is_sales_ord || is_pur_ord %]
-    <br>[% heading %] als neue Vorlage verwenden f&uuml;r<br>
+    <br>[% heading %] [% 'to be used as template for' | $T8 %]<br>
     [%- IF is_sales_ord %]
       <input class="submit" type="submit" name="action_purchase_order" value="[% 'Purchase Order' | $T8 %]">
      <input class="submit" type="submit" name="action_quotation" value="[% 'Quotation' | $T8 %]">
 [% END %]
 
 </form>
-
-</body>
-</html>
+<script type='text/javascript'>
+ $(kivi.SalesPurchase.init_on_submit_checks);
+</script>