Layout: title Ausgabe normalisieren
[kivitendo-erp.git] / templates / webpages / am / edit_accounts.html
index 4715741..95cd8c0 100644 (file)
@@ -1,6 +1,9 @@
 [%- USE T8 %]
 [%- USE L %]
-[% USE HTML %]<script type="text/javascript" src="js/FormManager.js" >
+[% USE HTML %]
+<h1>[% title %]</h1>
+
+<script type="text/javascript" src="js/FormManager.js" >
 /****************************************************
 * Form Dependency Manager- By Twey- http://www.twey.co.uk
 * Visit Dynamic Drive for this script and more: http://www.dynamicdrive.com
@@ -25,12 +28,6 @@ $(function() {
 <input type="hidden" name="fxgain_accno_id"    value="[% HTML.escape(fxgain_accno_id) %]">
 <input type="hidden" name="fxloss_accno_id"    value="[% HTML.escape(fxloss_accno_id) %]">
 
-<table border="0" width="100%">
-  <tr>
-    <th class="listtop">[% title %]</th>
-  </tr>
-</table>
-
 <fieldset>
   <legend>
     [% 'Main Preferences' | $T8 %]
@@ -41,7 +38,7 @@ $(function() {
         <label>
           [% 'Account Number' | $T8 %]
         </label></td>
-        <td><input name="accno" size="20" value="[% HTML.escape(accno) %]"></td>
+        <td><input id="accno" name="accno" size="20" value="[% HTML.escape(accno) %]"></td>
     </tr>
     <tr>
       <td>
@@ -49,7 +46,7 @@ $(function() {
           [% 'Description' | $T8 %]
         </label>
       </td>
-      <td><input name="description" size="40" value="[% HTML.escape(description) %]"></td>
+      <td><input id="description" name="description" size="40" value="[% HTML.escape(description) %]"></td>
     </tr>
     <tr>
       <td>
@@ -88,9 +85,25 @@ $(function() {
 [% IF ChartTypeIsAccount %]
 <fieldset class="DEPENDS ON charttype BEING A">
   <legend>[% 'Is this a summary account to record' | $T8 %]</legend>
-    [% L.checkbox_tag('AR', value => 'AR', checked => AR, class => 'checkbox', disabled => AccountIsPosted) %] &nbsp;[% 'AR' | $T8 %]
-    [% L.checkbox_tag('AP', value => 'AP', checked => AP, class => 'checkbox', disabled => AccountIsPosted) %] &nbsp;[% 'AP' | $T8 %]
-    [% L.checkbox_tag('IC', value => 'IC', checked => IC, class => 'checkbox', disabled => AccountIsPosted) %] &nbsp;[% 'Inventory' | $T8 %]
+        [% L.radio_button_tag('summary_account',
+          value => 'AR',
+          disabled => AccountIsPosted,
+          checked  => AR) %]
+        &nbsp;[% 'AR' | $T8 %]
+        [% L.radio_button_tag('summary_account',
+          value => 'AP',
+          disabled => AccountIsPosted,
+          checked  => AP) %]
+        &nbsp;[% 'AP' | $T8 %]
+        [% L.radio_button_tag('summary_account',
+          value => 'IC',
+          disabled => AccountIsPosted,
+          checked  => IC) %]
+        &nbsp;[% 'Inventory' | $T8 %]
+        [% L.radio_button_tag('summary_account',
+          value => '',
+          disabled => AccountIsPosted) %]
+        &nbsp;[% 'No summary account' | $T8 %]
 
 [% IF AccountIsPosted %]
     [% IF AR %] [% L.hidden_tag('AR', 'AR') %] [% END %]
@@ -218,11 +231,7 @@ $(function() {
     [% ELSE %]
                 <input type="hidden" name="taxkey_id_[% tk.runningnumber %]" value="NEW">
                 <td><select name="taxkey_tax_[% tk.runningnumber %]">[% tk.selecttaxkey %]</select></td>
-                [% IF account_exists %]
                 <td><input name="taxkey_startdate_[% tk.runningnumber %]" value="[% HTML.escape(tk.startdate) %]"></td>
-                [% ELSE %]
-                <td><input name="taxkey_startdate_[% tk.runningnumber %]" value="01.01.1970"></td>
-                [% END %]
                 <td><select name="taxkey_pos_ustva_[% tk.runningnumber %]">[% tk.select_tax %]</select></td>
                 <td>&nbsp;</td>
     [% END %]
@@ -263,3 +272,19 @@ $(function() {
 [% END %]
 </fieldset>
 <hr size="3" noshade>
+
+[% IF ( id ) %]
+  <script type="text/javascript">
+  function callback_save() {
+    var prev_desc = "[% description | html %]";
+    var prev_accno = "[% accno | html %]";
+    var cur_desc = $("#description").val();
+    var cur_accno = $("#accno").val();
+
+    if ( prev_desc != cur_desc || prev_accno != cur_accno )
+      return confirm(kivi.t8("Do you want to set the account number \"#1\" to \"#2\" and the name \"#3\" to \"#4\"?", [prev_accno, cur_accno, prev_desc, cur_desc]));
+    else
+      return true;
+  }
+  </script>
+[% END %]