7 <script type="text/javascript" src="js/FormManager.js" >
8 /****************************************************
9 * Form Dependency Manager- By Twey- http://www.twey.co.uk
10 * Visit Dynamic Drive for this script and more: http://www.dynamicdrive.com
11 ****************************************************/
14 <script type="text/javascript">
16 setupDependencies('EditAccount'); //name of form(s). Separate each with a comma (ie: 'weboptions', 'myotherform' )
20 <form method="post" name="EditAccount" action="am.pl" id="form">
24 <input type="hidden" name="id" value="[% HTML.escape(id) %]">
25 <input type="hidden" name="type" value="account">
26 <input type="hidden" name="orphaned" value="[% HTML.escape(orphaned) %]">
27 <input type="hidden" name="new_chart_valid" value="[% HTML.escape(new_chart_valid) %]">
28 <input type="hidden" name="inventory_accno_id" value="[% HTML.escape(inventory_accno_id) %]">
29 <input type="hidden" name="income_accno_id" value="[% HTML.escape(income_accno_id) %]">
30 <input type="hidden" name="expense_accno_id" value="[% HTML.escape(expense_accno_id) %]">
31 <input type="hidden" name="fxgain_accno_id" value="[% HTML.escape(fxgain_accno_id) %]">
32 <input type="hidden" name="fxloss_accno_id" value="[% HTML.escape(fxloss_accno_id) %]">
33 <input type="hidden" name="rndgain_accno_id" value="[% HTML.escape(rndgain_accno_id) %]">
34 <input type="hidden" name="rndloss_accno_id" value="[% HTML.escape(rndloss_accno_id) %]">
38 <table class="tbl-horizontal">
39 <caption>[% 'Main Preferences' | $T8 %]</caption>
40 <colgroup><col class="wi-mediumsmall"><col class="wi-wide"></colgroup>
43 <th> [% 'Account Number' | $T8 %] </th>
44 <td><input id="accno" name="accno" type="text" size="10" class="wi-small" value="[% HTML.escape(accno) %]"></td>
47 <th> [% 'Description' | $T8 %] </th>
48 <td><input id="description" name="description" type="text" size="40" class="wi-wide" value="[% HTML.escape(description) %]"></td>
51 <th> [% 'Chart Type' | $T8 %] </th>
52 <td> [% IF AccountIsPosted %]
53 [% L.select_tag('dummy_charttype',
57 default => selected_charttype,
60 [% L.hidden_tag('charttype', selected_charttype) %]
62 [% L.select_tag('charttype',
66 default => selected_charttype,
71 <th>[% 'Account Type' | $T8 %]</th>
72 <td><select name="category" id="AccountType" class="wi-wide">[% select_category %]</select></td>
75 <td>[% 'Invalid' | $T8 %] </td>
76 <td>[% L.checkbox_tag('invalid', value => 1, checked => invalid, class => 'checkbox') %]</td>
78 [% IF ChartTypeIsAccount %]
80 <th>[% 'Is this a summary account to record' | $T8 %]</th>
82 [% L.radio_button_tag('summary_account', value => 'AR', disabled => AccountIsPosted, checked => AR) %]
83 <label for="summary_account_AR">[% 'AR' | $T8 %]</label><br>
84 [% L.radio_button_tag('summary_account', value => 'AP', disabled => AccountIsPosted, checked => AP) %]
85 <label for="summary_account_AP">[% 'AP' | $T8 %]</label><br>
86 [% L.radio_button_tag('summary_account', value => 'IC', disabled => AccountIsPosted, checked => IC) %]
87 <label for="summary_account_IC">[% 'Inventory' | $T8 %]</label><br>
88 [% L.radio_button_tag('summary_account', value => '', disabled => AccountIsPosted) %]
89 <label for="summary_account_">[% 'No summary account' | $T8 %]</label>
91 [% IF AccountIsPosted %]
92 [% IF AR %] [% L.hidden_tag('AR', 'AR') %] [% END %]
93 [% IF AP %] [% L.hidden_tag('AP', 'AP') %] [% END %]
94 [% IF IC %] [% L.hidden_tag('IC', 'IC') %] [% END %]
97 [% IF AccountIsPosted %]
98 [% IF AR_amount %] [% L.hidden_tag('AR_amount', 'AR_amount') %] [% END %]
99 [% IF AR_paid %] [% L.hidden_tag('AR_paid', 'AR_paid') %] [% END %]
100 [% IF AR_tax %] [% L.hidden_tag('AR_tax', 'AR_tax') %] [% END %]
101 [% IF AP_amount %] [% L.hidden_tag('AP_amount', 'AP_amount') %] [% END %]
102 [% IF AP_paid %] [% L.hidden_tag('AP_paid', 'AP_paid') %] [% END %]
103 [% IF AP_tax %] [% L.hidden_tag('AP_tax', 'AP_tax') %] [% END %]
104 [% SET DIS = ' disabled="disabled"' %]
111 <h3 class="caption">[% 'Taxkeys and Taxreport Preferences' | $T8 %]</h3>
112 <div class="long-desc small">
113 <p>[% 'Note: Taxkeys must have a "valid from" date, and will not behave correctly without.' | $T8 %]</p>
115 <table class="tbl-horizontal">
118 <th>[% 'Taxkey' | $T8 %]</th>
119 <th>[% 'valid from' | $T8 %]</th>
120 [% IF feature_ustva %]<th>[% 'pos_ustva' | $T8 %]</th>[% END %]
121 <th>[% 'delete' | $T8 %]? </th>
125 [% FOREACH tk = ACCOUNT_TAXKEYS %]
129 <input type="hidden" name="taxkey_id_[% tk.runningnumber %]" value="[% tk.id %]">
130 <select name="taxkey_tax_[% tk.runningnumber %]" class="wi-wider">[% tk.selecttaxkey %]</select>
132 <td><input name="taxkey_startdate_[% tk.runningnumber %]" value="[% HTML.escape(tk.startdate) %]" type="text" class="wi-date"></td>
133 [% IF feature_ustva %]
134 <td><select name="taxkey_pos_ustva_[% tk.runningnumber %]" class="wi-wider">[% tk.select_tax %]</select></td>
137 <input name="taxkey_del_[% tk.runningnumber %]" type="checkbox" value="delete">
141 <input type="hidden" name="taxkey_id_[% tk.runningnumber %]" value="NEW">
142 <select name="taxkey_tax_[% tk.runningnumber %]" class="wi-wider">[% tk.selecttaxkey %]</select>
144 <td><input name="taxkey_startdate_[% tk.runningnumber %]" value="[% HTML.escape(tk.startdate) %]" type="text" class="wi-date"></td>
145 [% IF feature_ustva %]
146 <td><select name="taxkey_pos_ustva_[% tk.runningnumber %]" class="wi-wider">[% tk.select_tax %]</select></td>
156 <table class="tbl-horizontal">
157 <caption>[% 'Report and misc. Preferences' | $T8 %]</caption>
158 <colgroup><col class="wi-mediumsmall"><col class="wi-wide"></colgroup>
160 [% IF feature_erfolgsrechnung %]
162 <th>[% 'Erfolgsrechnung' | $T8 %]</th>
163 <td><select name="pos_er" class="wi-wider">[% select_er %]</select></td>
166 [% IF feature_eurechnung %]
168 <th>[% 'EUER' | $T8 %]</th>
169 <td><select name="pos_eur" class="wi-wider">[% select_eur %]</select></td>
172 <th>[% 'BWA' | $T8 %]</th>
173 <td><select name="pos_bwa" class="wi-wider">[% select_bwa %]</select></td>
176 [% IF feature_datev %]
178 <th>[% 'Datevautomatik' | $T8 %]</th>
179 <td><input name="datevautomatik" type="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>
183 <th>[% 'Folgekonto' | $T8 %]</th>
185 <select name="new_chart_id" class="wi-wider">[% selectnewaccount %]</select>
186 <span class="label with-element">[% 'Valid from' | $T8 %]
187 <input name="valid_from" value="[% valid_from %]" type="text" class="wi-mediumsmall"></span>
190 [% #IF feature_balance %]
191 <!-- PENDENT: UPDATE: Diese Steuerfunktion hat keine Auswirkung in der Bilanz und wird erstmal deaktiviert. -->
194 <th>[% 'Bilanz' | $T8 %]</th>
195 <td colspan="3"><select name="pos_bilanz">[% select_bilanz %]</select></td>
205 <div class="col" style="width:30.0em;">
208 <h3 class="caption">[% 'Include in drop-down menus' | $T8 %]</h3>
209 <div class="long-description small"><p>[% '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>
211 [% 'Changes to Receivables and Payables are only possible if no transactions to this account are posted yet.' | $T8 %]
212 [% '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>
213 </div><!-- /.long-description -->
216 <table class="tbl-horizontal">
217 <colgroup><col class="wi-normal"><col class="wi-normal"></colgroup>
220 <td><b>[% 'Receivables' | $T8 %]</b><br>
221 [% L.radio_button_tag('AR_include_in_dropdown', value => 'AR_amount', disabled => AccountIsPosted, checked => AR_amount) %]
222 <label for="AR_include_in_dropdown_AR_amount">[% 'Revenue' | $T8 %]</label><br>
223 [% L.radio_button_tag('AR_include_in_dropdown', value => 'AR_paid', disabled => AccountIsPosted, checked => AR_paid) %]
224 <label for="AR_include_in_dropdown_AR_paid">[% 'Receipt' | $T8 %]</label><br>
225 [% L.radio_button_tag('AR_include_in_dropdown', value => 'AR_tax', disabled => AccountIsPosted, checked => AR_tax) %]
226 <label for="AR_include_in_dropdown_AR_tax">[% 'Tax' | $T8 %]</label><br>
227 [% L.radio_button_tag('AR_include_in_dropdown', value => '', disabled => AccountIsPosted) %]
228 <label for="AR_include_in_dropdown_">[% 'do not include' | $T8 %]</label>
230 <td><b>[% 'Payables' | $T8 %]</b><br>
231 [% L.radio_button_tag('AP_include_in_dropdown', value => 'AP_amount', disabled => AccountIsPosted, checked => AP_amount) %]
232 <label for="AP_include_in_dropdown_AP_amount">[% 'Expense/Asset' | $T8 %]</label><br>
233 [% L.radio_button_tag('AP_include_in_dropdown', value => 'AP_paid', disabled => AccountIsPosted, checked => AP_paid) %]
234 <label for="AP_include_in_dropdown_AP_paid">[% 'Payment' | $T8 %]</label><br>
235 [% L.radio_button_tag('AP_include_in_dropdown', value => 'AP_tax', disabled => AccountIsPosted, checked => AP_tax) %]
236 <label for="AP_include_in_dropdown_AP_tax">[% 'Tax' | $T8 %]</label><br>
237 [% L.radio_button_tag('AP_include_in_dropdown', value => '', disabled => AccountIsPosted) %]
238 <label for="AP_include_in_dropdown_">[% 'do not include' | $T8 %]</label></td>
241 <td><b>[% 'Parts Inventory' | $T8 %]</b><br>
242 <input id="IC_sale" name="IC_sale" type="checkbox" value="IC_sale"[% HTML.escape(IC_sale) %]>
243 <label for="IC_sale">[% 'Revenue' | $T8 %]</label><br>
244 <input id="IC_cogs" name="IC_cogs" type="checkbox" value="IC_cogs"[% HTML.escape(IC_cogs) %]>
245 <label for="IC_cogs">[% 'Expense' | $T8 %]</label><br>
246 <input id="IC_taxpart" name="IC_taxpart" type="checkbox" value="IC_taxpart" [% HTML.escape(IC_taxpart) %]>
247 <label for="IC_taxpart">[% 'Tax' | $T8 %]</label>
249 <td><b>[% 'Service Items' | $T8 %]</b><br>
250 <input id="IC_income" name="IC_income" type="checkbox" value="IC_income"[% HTML.escape(IC_income) %]>
251 <label for="IC_income">[% 'Revenue' | $T8 %]</label><br>
252 <input id="IC_expense" name="IC_expense" type="checkbox" value="IC_expense"[% HTML.escape(IC_expense) %]>
253 <label for="IC_expense">[% 'Expense' | $T8 %]</label><br>
254 <input id="IC_taxservice" name="IC_taxservice" type="checkbox" value="IC_taxservice"[% HTML.escape(IC_taxservice) %]>
255 <label for="IC_taxservice">[% 'Tax' | $T8 %]</label>
267 <script type="text/javascript">
268 function callback_save() {
269 var prev_desc = "[% description | html %]";
270 var prev_accno = "[% accno | html %]";
271 var cur_desc = $("#description").val();
272 var cur_accno = $("#accno").val();
274 if ( prev_desc != cur_desc || prev_accno != cur_accno )
275 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]));
281 [% L.hidden_tag('callback', callback) %]