6 <script type="text/javascript" src="js/FormManager.js" >
7 /****************************************************
8 * Form Dependency Manager- By Twey- http://www.twey.co.uk
9 * Visit Dynamic Drive for this script and more: http://www.dynamicdrive.com
10 ****************************************************/
13 <script type="text/javascript">
15 setupDependencies('EditAccount'); //name of form(s). Separate each with a comma (ie: 'weboptions', 'myotherform' )
19 <form method="post" name="EditAccount" action="am.pl" id="form">
21 <input type="hidden" name="id" value="[% HTML.escape(id) %]">
22 <input type="hidden" name="type" value="account">
23 <input type="hidden" name="orphaned" value="[% HTML.escape(orphaned) %]">
24 <input type="hidden" name="new_chart_valid" value="[% HTML.escape(new_chart_valid) %]">
25 <input type="hidden" name="inventory_accno_id" value="[% HTML.escape(inventory_accno_id) %]">
26 <input type="hidden" name="income_accno_id" value="[% HTML.escape(income_accno_id) %]">
27 <input type="hidden" name="expense_accno_id" value="[% HTML.escape(expense_accno_id) %]">
28 <input type="hidden" name="fxgain_accno_id" value="[% HTML.escape(fxgain_accno_id) %]">
29 <input type="hidden" name="fxloss_accno_id" value="[% HTML.escape(fxloss_accno_id) %]">
30 <input type="hidden" name="rndgain_accno_id" value="[% HTML.escape(rndgain_accno_id) %]">
31 <input type="hidden" name="rndloss_accno_id" value="[% HTML.escape(rndloss_accno_id) %]">
35 [% 'Main Preferences' | $T8 %]
41 [% 'Account Number' | $T8 %]
43 <td><input id="accno" name="accno" size="20" value="[% HTML.escape(accno) %]"></td>
48 [% 'Description' | $T8 %]
51 <td><input id="description" name="description" size="40" value="[% HTML.escape(description) %]"></td>
56 [% 'Chart Type' | $T8 %]
61 [% IF AccountIsPosted %]
62 [% L.select_tag('dummy_charttype',
66 default => selected_charttype,
68 [% L.hidden_tag('charttype', selected_charttype) %]
70 [% L.select_tag('charttype',
74 default => selected_charttype) %]
79 <td>[% 'Invalid' | $T8 %] </td>
80 <td>[% L.checkbox_tag('invalid', value => 1, checked => invalid, class => 'checkbox') %]</td>
85 <fieldset class="DEPENDS ON charttype BEING A">
86 <legend>[% 'Account Type' | $T8 %]</legend>
87 <select name="category" id="AccountType" class="DEPENDS ON charttype BEING A">
88 [% select_category %]</select>
91 [% IF ChartTypeIsAccount %]
92 <fieldset class="DEPENDS ON charttype BEING A">
93 <legend>[% 'Is this a summary account to record' | $T8 %]</legend>
94 [% L.radio_button_tag('summary_account',
96 disabled => AccountIsPosted,
98 [% 'AR' | $T8 %]
99 [% L.radio_button_tag('summary_account',
101 disabled => AccountIsPosted,
103 [% 'AP' | $T8 %]
104 [% L.radio_button_tag('summary_account',
106 disabled => AccountIsPosted,
108 [% 'Inventory' | $T8 %]
109 [% L.radio_button_tag('summary_account',
111 disabled => AccountIsPosted) %]
112 [% 'No summary account' | $T8 %]
114 [% IF AccountIsPosted %]
115 [% IF AR %] [% L.hidden_tag('AR', 'AR') %] [% END %]
116 [% IF AP %] [% L.hidden_tag('AP', 'AP') %] [% END %]
117 [% IF IC %] [% L.hidden_tag('IC', 'IC') %] [% END %]
122 [% IF AccountIsPosted %]
123 [% IF AR_amount %] [% L.hidden_tag('AR_amount', 'AR_amount') %] [% END %]
124 [% IF AR_paid %] [% L.hidden_tag('AR_paid', 'AR_paid') %] [% END %]
125 [% IF AR_tax %] [% L.hidden_tag('AR_tax', 'AR_tax') %] [% END %]
126 [% IF AP_amount %] [% L.hidden_tag('AP_amount', 'AP_amount') %] [% END %]
127 [% IF AP_paid %] [% L.hidden_tag('AP_paid', 'AP_paid') %] [% END %]
128 [% IF AP_tax %] [% L.hidden_tag('AP_tax', 'AP_tax') %] [% END %]
129 [%- SET DIS = ' disabled="disabled"' %]
131 <fieldset class="DEPENDS ON charttype BEING A">
132 <legend>[% 'Include in drop-down menus' | $T8 %]</legend>
133 <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>
134 <p style='font-weight:normal'>[% 'Changes to Receivables and Payables are only possible if no transactions to this account are posted yet.' | $T8 %]
135 [% '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>
138 <th align="left">[% 'Receivables' | $T8 %]</th>
139 <th align="left">[% 'Payables' | $T8 %]</th>
140 <th align="left">[% 'Parts Inventory' | $T8 %]</th>
141 <th align="left">[% 'Service Items' | $T8 %]</th>
145 [% L.radio_button_tag('AR_include_in_dropdown',
146 value => 'AR_amount',
147 disabled => AccountIsPosted,
148 checked => AR_amount) %]
149 [% 'Revenue' | $T8 %] <br>
150 [% L.radio_button_tag('AR_include_in_dropdown',
152 disabled => AccountIsPosted,
153 checked => AR_paid) %]
154 [% 'Receipt' | $T8 %] <br>
155 [% L.radio_button_tag('AR_include_in_dropdown',
157 disabled => AccountIsPosted,
158 checked => AR_tax) %]
159 [% 'Tax' | $T8 %] <br>
160 [% L.radio_button_tag('AR_include_in_dropdown',
162 disabled => AccountIsPosted) %]
163 [% 'do not include' | $T8 %]
166 [% L.radio_button_tag('AP_include_in_dropdown',
167 value => 'AP_amount',
168 disabled => AccountIsPosted,
169 checked => AP_amount) %]
170 [% 'Expense/Asset' | $T8 %] <br>
171 [% L.radio_button_tag('AP_include_in_dropdown',
173 disabled => AccountIsPosted,
174 checked => AP_paid) %]
175 [% 'Payment' | $T8 %] <br>
176 [% L.radio_button_tag('AP_include_in_dropdown',
178 disabled => AccountIsPosted,
179 checked => AP_tax) %]
180 [% 'Tax' | $T8 %] <br>
181 [% L.radio_button_tag('AP_include_in_dropdown',
183 disabled => AccountIsPosted) %]
184 [% 'do not include' | $T8 %]
187 <input name="IC_sale" type="checkbox" class="checkbox" value="IC_sale"
188 [% HTML.escape(IC_sale) %]>
189 [% 'Revenue' | $T8 %] <br>
190 <input name="IC_cogs" type="checkbox" class="checkbox" value="IC_cogs"
191 [% HTML.escape(IC_cogs) %]>
192 [% 'Expense' | $T8 %] <br>
193 <input name="IC_taxpart" type="checkbox" class="checkbox" value="IC_taxpart"
194 [% HTML.escape(IC_taxpart) %]>
199 <input name=IC_income type=checkbox class=checkbox value="IC_income"
200 [% HTML.escape(IC_income) %]>
201 [% 'Revenue' | $T8 %] <br>
202 <input name=IC_expense type=checkbox class=checkbox value="IC_expense"
203 [% HTML.escape(IC_expense) %]>
204 [% 'Expense' | $T8 %] <br>
205 <input name=IC_taxservice type=checkbox class=checkbox value="IC_taxservice"
206 [% HTML.escape(IC_taxservice) %]>
214 <fieldset class="DEPENDS ON charttype BEING A">
216 [% 'Taxkeys and Taxreport Preferences' | $T8 %]
218 <p style='font-weight:normal'>[% 'Note: Taxkeys must have a "valid from" date, and will not behave correctly without.' | $T8 %]</p>
222 <th align="left">[% 'Taxkey' | $T8 %]</th>
223 <th align="left">[% 'valid from' | $T8 %]</th>
224 [% IF feature_ustva %]
225 <th align="left">[% 'pos_ustva' | $T8 %]</th>
227 <th align="left">[% 'delete' | $T8 %] ? </th>
229 [% FOREACH tk = ACCOUNT_TAXKEYS %]
233 <input type="hidden" name="taxkey_id_[% tk.runningnumber %]" value="[% tk.id %]">
234 <td><select name="taxkey_tax_[% tk.runningnumber %]">[% tk.selecttaxkey %]</select></td>
235 <td><input name="taxkey_startdate_[% tk.runningnumber %]" value="[% HTML.escape(tk.startdate) %]"></td>
236 [% IF feature_ustva %]
237 <td><select name="taxkey_pos_ustva_[% tk.runningnumber %]">[% tk.select_tax %]</select></td>
239 <td><input name="taxkey_del_[% tk.runningnumber %]" type="checkbox"
240 class="checkbox" value="delete"></td>
242 <input type="hidden" name="taxkey_id_[% tk.runningnumber %]" value="NEW">
243 <td><select name="taxkey_tax_[% tk.runningnumber %]">[% tk.selecttaxkey %]</select></td>
244 <td><input name="taxkey_startdate_[% tk.runningnumber %]" value="[% HTML.escape(tk.startdate) %]"></td>
245 [% IF feature_ustva %]
246 <td><select name="taxkey_pos_ustva_[% tk.runningnumber %]">[% tk.select_tax %]</select></td>
257 <fieldset class="DEPENDS ON charttype BEING A">
258 <legend>[% 'Report and misc. Preferences' | $T8 %]</legend>
260 [% IF feature_erfolgsrechnung %]
262 <th align="left">[% 'Erfolgsrechnung' | $T8 %]</th>
263 <td colspan="3"><select name="pos_er">[% select_er %]</select></td>
266 [% IF feature_eurechnung %]
268 <th align="left">[% 'EUER' | $T8 %]</th>
269 <td colspan="3"><select name="pos_eur">[% select_eur %]</select></td>
272 <th align="left">[% 'BWA' | $T8 %]</th>
273 <td colspan="3"><select name="pos_bwa">[% select_bwa %]</select></td>
276 [% IF feature_balance %]
277 <!-- Diese Steuerfunktion hat keine Auswirkung in der Bilanz und wird erstmal deaktiviert. -->
279 <th align="left">[% 'Bilanz' | $T8 %]</th>
280 <td colspan="3"><select name="pos_bilanz">[% select_bilanz %]</select></td>
283 [% IF feature_datev %]
285 <th align="left">[% 'Datevautomatik' | $T8 %]</th>
286 <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>
290 <th align="left">[% 'Folgekonto' | $T8 %]</th>
291 <td><select name="new_chart_id">[% selectnewaccount %]</select></td>
292 <th align="left">[% 'Valid from' | $T8 %]</th>
293 <td><input name="valid_from" value="[% valid_from %]"></td>
298 <hr size="3" noshade>
301 <script type="text/javascript">
302 function callback_save() {
303 var prev_desc = "[% description | html %]";
304 var prev_accno = "[% accno | html %]";
305 var cur_desc = $("#description").val();
306 var cur_accno = $("#accno").val();
308 if ( prev_desc != cur_desc || prev_accno != cur_accno )
309 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]));
315 [% L.hidden_tag('callback', callback) %]