[%- 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
</script>
<script type="text/javascript">
-window.onload = function() {
- setupDependencies('EditAccount'); //name of form(s). Seperate each with a comma (ie: 'weboptions', 'myotherform' )
- };
+$(function() {
+ setupDependencies('EditAccount'); //name of form(s). Separate each with a comma (ie: 'weboptions', 'myotherform' )
+});
</script>
-<body>
<form method="post" name="EditAccount" action="am.pl">
<input type="hidden" name="id" value="[% HTML.escape(id) %]">
<input type="hidden" name="type" value="account">
<input type="hidden" name="orphaned" value="[% HTML.escape(orphaned) %]">
<input type="hidden" name="new_chart_valid" value="[% HTML.escape(new_chart_valid) %]">
-<input type="hidden" name="original_accno" value="[% HTML.escape(accno) %]">
<input type="hidden" name="inventory_accno_id" value="[% HTML.escape(inventory_accno_id) %]">
<input type="hidden" name="income_accno_id" value="[% HTML.escape(income_accno_id) %]">
<input type="hidden" name="expense_accno_id" value="[% HTML.escape(expense_accno_id) %]">
<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>
+<input type="hidden" name="rndgain_accno_id" value="[% HTML.escape(rndgain_accno_id) %]">
+<input type="hidden" name="rndloss_accno_id" value="[% HTML.escape(rndloss_accno_id) %]">
<fieldset>
<legend>
<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>
[% '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>
[% 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) %] [% 'AR' | $T8 %]
- [% L.checkbox_tag('AP', value => 'AP', checked => AP, class => 'checkbox', disabled => AccountIsPosted) %] [% 'AP' | $T8 %]
- [% L.checkbox_tag('IC', value => 'IC', checked => IC, class => 'checkbox', disabled => AccountIsPosted) %] [% 'Inventory' | $T8 %]
+ [% L.radio_button_tag('summary_account',
+ value => 'AR',
+ disabled => AccountIsPosted,
+ checked => AR) %]
+ [% 'AR' | $T8 %]
+ [% L.radio_button_tag('summary_account',
+ value => 'AP',
+ disabled => AccountIsPosted,
+ checked => AP) %]
+ [% 'AP' | $T8 %]
+ [% L.radio_button_tag('summary_account',
+ value => 'IC',
+ disabled => AccountIsPosted,
+ checked => IC) %]
+ [% 'Inventory' | $T8 %]
+ [% L.radio_button_tag('summary_account',
+ value => '',
+ disabled => AccountIsPosted) %]
+ [% 'No summary account' | $T8 %]
[% IF AccountIsPosted %]
[% IF AR %] [% L.hidden_tag('AR', 'AR') %] [% END %]
<legend>[% 'Include in drop-down menus' | $T8 %]</legend>
<p style='font-weight:normal'>[% 'Changes in this block are only sensible if the account is NOT a summary account AND there exists one valid taxkey. To select both Receivables and Payables only make sense for Payment / Receipt (i.e. account cash).' | $T8 %]</p>
<p style='font-weight:normal'>[% 'Changes to Receivables and Payables are only possible if no transactions to this account are posted yet.' | $T8 %]
- [% 'The changing of tax-o-matic account is NOT recommended, but if you do so please also (re)configure buchungsgruppen and reconfigure ALL charts which point to this tax-o-matic account. ' | $T8 %]</p>
+ [% 'The changing of tax-o-matic account is NOT recommended, but if you do so please also (re)configure booking groups and reconfigure ALL charts which point to this tax-o-matic account. ' | $T8 %]</p>
<table width="100%">
<tr>
<th align="left">[% 'Receivables' | $T8 %]</th>
<p style='font-weight:normal'>[% 'Note: Taxkeys must have a "valid from" date, and will not behave correctly without.' | $T8 %]</p>
<table>
-[% IF account_exists %]
<tr>
<th align="left">[% 'Taxkey' | $T8 %]</th>
<th align="left">[% 'valid from' | $T8 %]</th>
- <th align="left">[% 'pos_ustva' | $T8 %]</th>
+ [% IF feature_ustva %]
+ <th align="left">[% 'pos_ustva' | $T8 %]</th>
+ [% END %]
<th align="left">[% 'delete' | $T8 %] ? </th>
</tr>
[% FOREACH tk = ACCOUNT_TAXKEYS %]
+
<tr>
[% IF tk.id %]
<input type="hidden" name="taxkey_id_[% tk.runningnumber %]" value="[% tk.id %]">
<td><select name="taxkey_tax_[% tk.runningnumber %]">[% tk.selecttaxkey %]</select></td>
<td><input name="taxkey_startdate_[% tk.runningnumber %]" value="[% HTML.escape(tk.startdate) %]"></td>
- <td><select name="taxkey_pos_ustva_[% tk.runningnumber %]">[% tk.select_tax %]</select></td>
+ [% IF feature_ustva %]
+ <td><select name="taxkey_pos_ustva_[% tk.runningnumber %]">[% tk.select_tax %]</select></td>
+ [% END %]
<td><input name="taxkey_del_[% tk.runningnumber %]" type="checkbox"
class="checkbox" value="delete"></td>
[% ELSE %]
<input type="hidden" name="taxkey_id_[% tk.runningnumber %]" value="NEW">
<td><select name="taxkey_tax_[% tk.runningnumber %]">[% tk.selecttaxkey %]</select></td>
<td><input name="taxkey_startdate_[% tk.runningnumber %]" value="[% HTML.escape(tk.startdate) %]"></td>
- <td><select name="taxkey_pos_ustva_[% tk.runningnumber %]">[% tk.select_tax %]</select></td>
+ [% IF feature_ustva %]
+ <td><select name="taxkey_pos_ustva_[% tk.runningnumber %]">[% tk.select_tax %]</select></td>
+ [% END %]
<td> </td>
[% END %]
</tr>
+
[% END %]
-[% ELSE %]
-<tr>
- <td align="center" colspan="4"><p>[% 'Save account first to insert taxkeys' | $T8 %]</p>
- </td>
-</tr>
-[% END %]
- </table>
+ </table>
</fieldset>
<fieldset class="DEPENDS ON charttype BEING A">
<legend>[% 'Report and misc. Preferences' | $T8 %]</legend>
<table>
- <tr>
- <th align="left">[% 'EUER' | $T8 %]</th>
- <td colspan="3"><select name="pos_eur">[% select_eur %]</select></td>
- </tr>
- <tr>
- <th align="left">[% 'BWA' | $T8 %]</th>
- <td colspan="3"><select name="pos_bwa">[% select_bwa %]</select></td>
- </tr>
- <!-- Diese Steuerfunktion hat keine Auswirkung in der Bilanz und wird erstmal deaktiviert. -->
- <!-- tr>
- <th align="left">[% 'Bilanz' | $T8 %]</th>
- <td colspan="3"><select name="pos_bilanz">[% select_bilanz %]</select></td>
- </tr -->
- <tr>
- <th align="left">[% 'Datevautomatik' | $T8 %]</th>
- <td colspan="3"><input name="datevautomatik" type="checkbox" class="checkbox" value="T" [% IF datevautomatik %]checked [% END %]>[% 'If checked the taxkey will not be exported in the DATEV Export, but only IF chart taxkeys differ from general ledger taxkeys' | $T8 %] </td>
- </tr>
+ [% IF feature_erfolgsrechnung %]
+ <tr>
+ <th align="left">[% 'Erfolgsrechnung' | $T8 %]</th>
+ <td colspan="3"><select name="pos_er">[% select_er %]</select></td>
+ </tr>
+ [% END %]
+ [% IF feature_eurechnung %]
+ <tr>
+ <th align="left">[% 'EUER' | $T8 %]</th>
+ <td colspan="3"><select name="pos_eur">[% select_eur %]</select></td>
+ </tr>
+ <tr>
+ <th align="left">[% 'BWA' | $T8 %]</th>
+ <td colspan="3"><select name="pos_bwa">[% select_bwa %]</select></td>
+ </tr>
+ [% END %]
+ [% IF feature_balance %]
+ <!-- Diese Steuerfunktion hat keine Auswirkung in der Bilanz und wird erstmal deaktiviert. -->
+ <!-- tr>
+ <th align="left">[% 'Bilanz' | $T8 %]</th>
+ <td colspan="3"><select name="pos_bilanz">[% select_bilanz %]</select></td>
+ </tr -->
+ [% END %]
+ [% IF feature_datev %]
+ <tr>
+ <th align="left">[% 'Datevautomatik' | $T8 %]</th>
+ <td colspan="3"><input name="datevautomatik" type="checkbox" class="checkbox" value="T" [% IF datevautomatik %]checked [% END %]>[% 'If checked the taxkey will not be exported in the DATEV Export, but only IF chart taxkeys differ from general ledger taxkeys' | $T8 %] </td>
+ </tr>
+ [% END %]
<tr>
<th align="left">[% 'Folgekonto' | $T8 %]</th>
<td><select name="new_chart_id">[% selectnewaccount %]</select></td>
[% 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 %]