Revision 82684e3d
Von Sven Schöling vor etwa 13 Jahren hinzugefügt
bin/mozilla/ca.pl | ||
---|---|---|
149 | 149 |
} |
150 | 150 |
|
151 | 151 |
sub list { |
152 |
$main::lxdebug->enter_sub(); |
|
152 |
$::lxdebug->enter_sub; |
|
153 |
$::auth->assert('report'); |
|
153 | 154 |
|
154 |
my $form = $main::form; |
|
155 |
my %myconfig = %main::myconfig; |
|
156 |
my $locale = $main::locale; |
|
155 |
$::form->{title} = $::locale->text('List Transactions') . " - " . $::locale->text('Account') . " $::form->{accno}"; |
|
157 | 156 |
|
158 |
$main::auth->assert('report'); |
|
159 |
|
|
160 |
$form->{title} = $locale->text('List Transactions'); |
|
161 |
$form->{title} .= " - " . $locale->text('Account') . " $form->{accno}"; |
|
162 |
my $year = (localtime)[5] + 1900; |
|
163 |
|
|
164 |
# get departments |
|
165 |
$form->all_departments(\%myconfig); |
|
166 |
if (@{ $form->{all_departments} || [] }) { |
|
167 |
$form->{selectdepartment} = "<option>\n"; |
|
168 |
|
|
169 |
map { |
|
170 |
$form->{selectdepartment} .= |
|
171 |
"<option>$_->{description}--$_->{id}\n" |
|
172 |
} (@{ $form->{all_departments} || [] }); |
|
173 |
} |
|
174 |
|
|
175 |
my $department = qq| |
|
176 |
<tr> |
|
177 |
<th align=right nowrap>| . $locale->text('Department') . qq|</th> |
|
178 |
<td colspan=3><select name=department>$form->{selectdepartment}</select></td> |
|
179 |
</tr> |
|
180 |
| if $form->{selectdepartment}; |
|
181 |
my $accrual = $::instance_conf->get_accounting_method eq 'cash' ? "" : "checked"; |
|
182 |
my $cash = $::instance_conf->get_accounting_method eq 'cash' ? "checked" : ""; |
|
183 |
|
|
184 |
my $name_1 = "fromdate"; |
|
185 |
my $id_1 = "fromdate"; |
|
186 |
my $value_1 = "$form->{fromdate}"; |
|
187 |
my $trigger_1 = "trigger1"; |
|
188 |
my $name_2 = "todate"; |
|
189 |
my $id_2 = "todate"; |
|
190 |
my $value_2 = ""; |
|
191 |
my $trigger_2 = "trigger2"; |
|
192 |
|
|
193 |
my ($button1, $button1_2, $button2, $button2_2, $jsscript); |
|
194 |
|
|
195 |
# with JavaScript Calendar |
|
196 |
if ($form->{jsscript}) { |
|
197 |
if ($name_1 eq "") { |
|
198 |
|
|
199 |
$button1 = qq| |
|
200 |
<input name=$name_2 id=$id_2 size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">|; |
|
201 |
$button1_2 = qq| |
|
202 |
<input type=button name=$name_2 id="$trigger_2" value=| |
|
203 |
. $locale->text('button') . qq|>|; |
|
204 |
|
|
205 |
#write Trigger |
|
206 |
$jsscript = |
|
207 |
Form->write_trigger(\%myconfig, "1", "$name_2", "BR", "$trigger_2"); |
|
208 |
} else { |
|
209 |
$button1 = qq| |
|
210 |
<input name=$name_1 id=$id_1 size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\" value="$value_1">|; |
|
211 |
$button1_2 = qq| |
|
212 |
<input type=button name=$name_1 id="$trigger_1" value=| |
|
213 |
. $locale->text('button') . qq|>|; |
|
214 |
$button2 = qq| |
|
215 |
<input name=$name_2 id=$id_2 size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">|; |
|
216 |
$button2_2 = qq| |
|
217 |
<input type=button name=$name_2 id="$trigger_2" value=| |
|
218 |
. $locale->text('button') . qq|> |
|
219 |
|; |
|
220 |
|
|
221 |
#write Trigger |
|
222 |
$jsscript = |
|
223 |
Form->write_trigger(\%myconfig, "2", "$name_1", "BR", "$trigger_1", |
|
224 |
"$name_2", "BL", "$trigger_2"); |
|
225 |
} |
|
226 |
} else { |
|
227 |
|
|
228 |
# without JavaScript Calendar |
|
229 |
if ($name_1 eq "") { |
|
230 |
$button1 = |
|
231 |
qq|<input name=$name_2 id=$id_2 size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">|; |
|
232 |
} else { |
|
233 |
$button1 = |
|
234 |
qq|<input name=$name_1 id=$id_1 size=11 title="$myconfig{dateformat}" value="$value_1" onBlur=\"check_right_date_format(this)\">|; |
|
235 |
$button2 = |
|
236 |
qq|<input name=$name_2 id=$id_2 size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">|; |
|
237 |
} |
|
238 |
} |
|
239 |
$form->{javascript} .= qq|<script type="text/javascript" src="js/common.js"></script>|; |
|
240 |
$form->header; |
|
241 | 157 |
my $onload = qq|focus()|; |
242 |
$onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|; |
|
243 |
$onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|; |
|
244 |
|
|
245 |
|
|
246 |
$form->header; |
|
247 |
|
|
248 |
$form->{description} =~ s/\"/"/g; |
|
249 |
|
|
250 |
my $eur = $::instance_conf->get_accounting_method eq 'cash' ? 1 : 0; |
|
251 |
|
|
252 |
print qq| |
|
253 |
<body onLoad="$onload"> |
|
254 |
|
|
255 |
<form method=post action=$form->{script}> |
|
256 |
|
|
257 |
<input type=hidden name=accno value=$form->{accno}> |
|
258 |
<input type=hidden name=description value="$form->{description}"> |
|
259 |
<input type=hidden name=sort value=transdate> |
|
260 |
<input type=hidden name=eur value=$eur> |
|
261 |
<input type=hidden name=accounttype value=$form->{accounttype}> |
|
262 |
|
|
263 |
<table border=0 width=100%> |
|
264 |
<tr> |
|
265 |
<th class=listtop>$form->{title}</th> |
|
266 |
</tr> |
|
267 |
|
|
268 |
</table> |
|
269 |
<table> |
|
270 |
<tr> |
|
271 |
<th align=left><input name=reporttype class=radio type=radio value="custom" checked> | |
|
272 |
. $locale->text('Customized Report') . qq|</th> |
|
273 |
</tr> |
|
274 |
<tr> |
|
275 |
<th colspan=1>| . $locale->text('Year') . qq|</th> |
|
276 |
<td><input name=year size=11 title="| |
|
277 |
. $locale->text('YYYY') . qq|" value="$year"></td> |
|
278 |
</tr> |
|
279 |
|; |
|
280 |
|
|
281 |
print qq| |
|
282 |
<tr> |
|
283 |
<td align=right> |
|
284 |
<b> | . $locale->text('Yearly') . qq|</b> </td> |
|
285 |
<th align=left>| . $locale->text('Quarterly') . qq|</th> |
|
286 |
<th align=left colspan=3>| . $locale->text('Monthly') . qq|</th> |
|
287 |
</tr> |
|
288 |
<tr> |
|
289 |
<td align=right> <input name=duetyp class=radio type=radio value="13"></td> |
|
290 |
<td><input name=duetyp class=radio type=radio value="A"> 1. | . $locale->text('Quarter') . qq|</td> |
|
291 |
<td><input name=duetyp class=radio type=radio value="1" "checked"> | . $locale->text('January') . qq|</td> |
|
292 |
<td><input name=duetyp class=radio type=radio value="5" > | . $locale->text('May') . qq|</td> |
|
293 |
<td><input name=duetyp class=radio type=radio value="9" > | . $locale->text('September') . qq|</td> |
|
294 |
|
|
295 |
</tr> |
|
296 |
<tr> |
|
297 |
<td align= right> </td> |
|
298 |
<td><input name=duetyp class=radio type=radio value="B"> 2. | . $locale->text('Quarter') . qq|</td> |
|
299 |
<td><input name=duetyp class=radio type=radio value="2" > | . $locale->text('February') . qq|</td> |
|
300 |
<td><input name=duetyp class=radio type=radio value="6" > | . $locale->text('June') . qq|</td> |
|
301 |
<td><input name=duetyp class=radio type=radio value="10" > | . $locale->text('October') . qq|</td> |
|
302 |
</tr> |
|
303 |
<tr> |
|
304 |
<td> </td> |
|
305 |
<td><input name=duetyp class=radio type=radio value="C"> 3. | . $locale->text('Quarter') . qq|</td> |
|
306 |
<td><input name=duetyp class=radio type=radio value="3" > | . $locale->text('March') . qq|</td> |
|
307 |
<td><input name=duetyp class=radio type=radio value="7" > | . $locale->text('July') . qq|</td> |
|
308 |
<td><input name=duetyp class=radio type=radio value="11" > | . $locale->text('November') . qq|</td> |
|
309 |
|
|
310 |
</tr> |
|
311 |
<tr> |
|
312 |
<td> </td> |
|
313 |
<td><input name=duetyp class=radio type=radio value="D"> 4. | . $locale->text('Quarter') . qq| </td> |
|
314 |
<td><input name=duetyp class=radio type=radio value="4" > | . $locale->text('April') . qq|</td> |
|
315 |
<td><input name=duetyp class=radio type=radio value="8" > | . $locale->text('August') . qq|</td> |
|
316 |
<td><input name=duetyp class=radio type=radio value="12" > | . $locale->text('December') . qq|</td> |
|
317 |
|
|
318 |
</tr> |
|
319 |
<tr> |
|
320 |
<td colspan=5><hr size=3 noshade></td> |
|
321 |
</tr> |
|
322 |
<tr> |
|
323 |
<th align=left><input name=reporttype class=radio type=radio value="free"> | . $locale->text('Free report period') . qq|</th> |
|
324 |
<td align=left colspan=4>| . $locale->text('From') . qq| |
|
325 |
$button1 |
|
326 |
$button1_2 |
|
327 |
| . $locale->text('Bis') . qq| |
|
328 |
$button2 |
|
329 |
$button2_2 |
|
330 |
</td> |
|
331 |
</tr> |
|
332 |
<tr> |
|
333 |
<td colspan=5><hr size=3 noshade></td> |
|
334 |
</tr> |
|
335 |
<tr> |
|
336 |
<th align=leftt>| . $locale->text('Method') . qq|</th> |
|
337 |
<td colspan=3><input name=method class=radio type=radio value=accrual $accrual>| . $locale->text('Accrual') . qq| |
|
338 |
<input name=method class=radio type=radio value=cash $cash>| . $locale->text('EUR') . qq|</td> |
|
339 |
</tr> |
|
340 |
<tr> |
|
341 |
<th align=right colspan=4>| . $locale->text('Decimalplaces') . qq|</th> |
|
342 |
<td><input name=decimalplaces size=3 value="2"></td> |
|
343 |
</tr> |
|
344 |
<tr> |
|
345 |
<td><input name="subtotal" class=checkbox type=checkbox value=1> | . $locale->text('Subtotal') . qq|</td> |
|
346 |
</tr> |
|
347 |
|
|
348 |
$jsscript |
|
349 |
<tr><td colspan=5 ><hr size=3 noshade></td></tr> |
|
350 |
</table> |
|
351 |
|
|
352 |
<br><input class=submit type=submit name=action value="| |
|
353 |
. $locale->text('List Transactions') . qq|"> |
|
354 |
</form> |
|
355 |
|
|
356 |
</body> |
|
357 |
</html> |
|
358 |
|; |
|
158 |
$onload .= qq|;setupDateFormat('$::myconfig{dateformat}', '|. $::locale->text("Falsches Datumsformat!") .qq|')|; |
|
159 |
$onload .= qq|;setupPoints('$::myconfig{numberformat}', '|. $::locale->text("wrongformat") .qq|')|; |
|
359 | 160 |
|
360 |
$main::lxdebug->leave_sub(); |
|
161 |
$::form->header; |
|
162 |
print $::form->parse_html_template('ca/list', { |
|
163 |
onload => $onload, |
|
164 |
year => DateTime->today->year, |
|
165 |
cash => $::instance_conf->get_accounting_method eq 'cash', |
|
166 |
}); |
|
167 |
|
|
168 |
$::lxdebug->leave_sub; |
|
361 | 169 |
} |
362 | 170 |
|
363 | 171 |
sub format_debit_credit { |
Auch abrufbar als: Unified diff
chart of account suche in template ausgelagert