Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / templates / webpages / payment_term / form.html
index c77e719..c371c46 100755 (executable)
@@ -1,34 +1,23 @@
-[% USE HTML %][% USE T8 %][% USE L %][% USE LxERP %]
+[% USE HTML %][% USE T8 %][% USE L %][% USE LxERP %][%- USE P -%]
 <h1>[% FORM.title %]</h1>
 
- <form method="post" action="controller.pl">
+ <form method="post" action="controller.pl" id="form">
 
 [%- INCLUDE 'common/flash.html' %]
 
   <table>
-   <tr>
-    <td>[%- 'Description' | $T8 %]</td>
-    <td>
-     <input name="payment_term.description" value="[%- HTML.escape(SELF.payment_term.description) %]">
-    </td>
+   <tr class="listheading">
+    <th></th>
+    <th>[% LxERP.t8("General settings") %]</th>
    </tr>
 
    <tr>
-    <td>[%- 'Long Description' | $T8 %]</td>
+    <td>[%- 'Description' | $T8 %]</td>
     <td>
-     <input name="payment_term.description_long" value="[%- HTML.escape(SELF.payment_term.description_long) %]" size="60">
+     [% P.input_tag("payment_term.description", SELF.payment_term.description, "data-validate"="required", "data-title"=LxERP.t8("Description")) %]
     </td>
    </tr>
 
-   [%- FOREACH language = SELF.languages %]
-    <tr>
-     <td>[%- HTML.escape(language.description) %] ([%- LxERP.t8('Translation') %])</td>
-     <td>
-      <input name="translation_[% language.id %]" value="[%- HTML.escape(SELF.payment_term.translated_attribute('description_long', language, 1)) %]" size="60">
-     </td>
-    </tr>
-   [%- END %]
-
    <tr>
     <td>[% LxERP.t8("Calculate due date automatically") %]</td>
     <td>[% L.yes_no_tag("payment_term.auto_calculation", SELF.payment_term.auto_calculation, "data-auto-calculation-toggle"="1") %]</td>
      <input name="payment_term.percent_skonto_as_percent" value="[%- HTML.escape(SELF.payment_term.percent_skonto_as_percent) %]" size="6">%
     </td>
    </tr>
-  </table>
 
-  <p>
-   <input type="hidden" name="id" value="[% SELF.payment_term.id %]">
-   <input type="hidden" name="action" value="PaymentTerm/dispatch">
-   <input type="submit" class="submit" name="action_[% IF SELF.payment_term.id %]update[% ELSE %]create[% END %]" value="[% 'Save' | $T8 %]">
-   [%- IF SELF.payment_term.id %]
-    <input type="submit" class="submit" name="action_destroy" value="[% 'Delete' | $T8 %]"
-           onclick="if (confirm('[% 'Are you sure you want to delete this payment term?' | $T8 %]')) return true; else return false;">
+   [% IF SELF.payment_term.id %]
+   <tr>
+     <td>[% 'Obsolete' | $T8 %]</td>
+     <td>[% L.checkbox_tag('payment_term.obsolete', checked = SELF.payment_term.obsolete, for_submit=1) %]</td>
+   </tr>
+   </tr>
+   [% END %]
+
+   <tr class="listheading">
+    <th></th>
+    <th>[% LxERP.t8("Texts for quotations & orders") %]</th>
+    <th>[% LxERP.t8("Texts for invoices") %]</th>
+   </tr>
+
+   <tr>
+    <td>[%- 'Long Description' | $T8 %]</td>
+    <td>
+     [% P.input_tag("payment_term.description_long", SELF.payment_term.description_long, size="60", "data-validate"="required", "data-title"=LxERP.t8("Long Description for quotations & orders")) %]
+    </td>
+
+    <td>
+     [% P.input_tag("payment_term.description_long_invoice", SELF.payment_term.description_long_invoice, size="60", "data-validate"="required", "data-title"=LxERP.t8("Long Description for invoices")) %]
+    </td>
+   </tr>
+
+   [%- FOREACH language = SELF.languages %]
+    <tr>
+     <td>[%- HTML.escape(language.description) %] ([%- LxERP.t8('Translation') %])</td>
+     <td>
+      <input name="translation_[% language.id %]" value="[%- HTML.escape(SELF.payment_term.translated_attribute('description_long', language, 1)) %]" size="60">
+     </td>
+
+     <td>
+      <input name="translation_invoice_[% language.id %]" value="[%- HTML.escape(SELF.payment_term.translated_attribute('description_long_invoice', language, 1)) %]" size="60">
+     </td>
+    </tr>
    [%- END %]
-   <a href="[% SELF.url_for(action => 'list') %]">[%- 'Abort' | $T8 %]</a>
-  </p>
+  </table>
+
+  [% P.hidden_tag("id", SELF.payment_term.id) %]
 
   <hr size="3" noshade>
 
@@ -73,8 +91,6 @@
 
   <table>
    <tr class="listheading"><th>[%- LxERP.t8('Field') %]</th><th>[%- LxERP.t8('Description') %]</th></tr>
-   <tr><td>&lt;%payment_terms%&gt;</td><td>[% LxERP.t8("Payment description") %]</td></tr>
-   <tr><td>&lt;%payment_description%&gt;</td><td>[% LxERP.t8("Payment description detail") %]</td></tr>
    <tr><td>&lt;%netto_date%&gt;</td><td>[% LxERP.t8("Date the payment is due in full") %]</td></tr>
    <tr><td>&lt;%skonto_date%&gt;</td><td>[% LxERP.t8("Date the payment is due with discount") %]</td></tr>
    <tr><td>&lt;%skonto_amount%&gt;</td><td>[% LxERP.t8("The deductible amount") %]</td></tr>