1 #=====================================================================
4 # Based on SQL-Ledger Version 2.1.9
5 # Web http://www.lx-office.org
7 #=====================================================================
8 # SQL-Ledger Accounting
9 # Copyright (c) 1998-2002
11 # Author: Dieter Simader
12 # Email: dsimader@sql-ledger.org
13 # Web: http://www.sql-ledger.org
16 # This program is free software; you can redistribute it and/or modify
17 # it under the terms of the GNU General Public License as published by
18 # the Free Software Foundation; either version 2 of the License, or
19 # (at your option) any later version.
21 # This program is distributed in the hope that it will be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 # GNU General Public License for more details.
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write to the Free Software
27 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #======================================================================
32 #======================================================================
37 require "$form->{path}/arap.pl";
43 # this is for our long dates
44 # $locale->text('January')
45 # $locale->text('February')
46 # $locale->text('March')
47 # $locale->text('April')
48 # $locale->text('May ')
49 # $locale->text('June')
50 # $locale->text('July')
51 # $locale->text('August')
52 # $locale->text('September')
53 # $locale->text('October')
54 # $locale->text('November')
55 # $locale->text('December')
57 # this is for our short month
58 # $locale->text('Jan')
59 # $locale->text('Feb')
60 # $locale->text('Mar')
61 # $locale->text('Apr')
62 # $locale->text('May')
63 # $locale->text('Jun')
64 # $locale->text('Jul')
65 # $locale->text('Aug')
66 # $locale->text('Sep')
67 # $locale->text('Oct')
68 # $locale->text('Nov')
69 # $locale->text('Dec')
72 $lxdebug->enter_sub();
74 $form->{title} = "Add";
77 "$form->{script}?action=add&path=$form->{path}&login=$form->{login}&password=$form->{password}"
78 unless $form->{callback};
80 # we use this only to set a default date
81 GL->transaction(\%myconfig, \%$form);
85 "<option value=\"$_->{accno}--$_->{tax_id}\">$_->{accno}--$_->{description}</option>"
86 } @{ $form->{chart} };
89 qq|<option value="$_->{id}--$_->{rate}">$_->{taxdescription} |
90 . ($_->{rate} * 100) . qq| %|
93 $form->{chart} = $chart;
94 $form->{chartinit} = $chart;
95 $form->{rowcount} = 2;
97 $form->{debitchart} = $chart;
98 $form->{creditchart} = $chart;
99 $form->{taxchart} = $tax;
106 $form->all_departments(\%myconfig);
107 if (@{ $form->{all_departments} }) {
108 $form->{selectdepartment} = "<option>\n";
111 $form->{selectdepartment} .=
112 "<option>$_->{description}--$_->{id}\n"
113 } (@{ $form->{all_departments} });
117 $lxdebug->leave_sub();
122 $lxdebug->enter_sub();
124 GL->transaction(\%myconfig, \%$form);
127 "<option value=\"$_->{accno}--$_->{tax_id}\">$_->{accno}--$_->{description}</option>"
128 } @{ $form->{chart} };
132 qq|<option value="$_->{id}--$_->{rate}">$_->{taxdescription} |
133 . ($_->{rate} * 100) . qq| %|
136 $form->{chart} = $chart;
138 $form->{taxchart} = $tax;
140 $form->{amount} = $form->format_amount(\%myconfig, $form->{amount}, 2);
143 $form->all_departments(\%myconfig);
144 if (@{ $form->{all_departments} }) {
145 $form->{selectdepartment} = "<option>\n";
148 $form->{selectdepartment} .=
149 "<option>$_->{description}--$_->{id}\n"
150 } (@{ $form->{all_departments} });
156 foreach $ref (@{ $form->{GL} }) {
157 $form->{"projectnumber_$i"} = "$ref->{projectnumber}--$ref->{project_id}";
160 if ($tax && ($ref->{accno} eq $taxaccno)) {
161 $form->{"tax_$j"} = abs($ref->{amount});
162 $form->{"taxchart_$j"} = $ref->{id} . "--" . $ref->{taxrate};
163 if ($form->{taxincluded}) {
164 if ($ref->{amount} < 0) {
165 $form->{"debit_$j"} += $form->{"tax_$j"};
167 $form->{"credit_$j"} += $form->{"tax_$j"};
171 $form->{"accno_$i"} = "$ref->{accno}--$ref->{tax_id}";
172 for (qw(fx_transaction source memo)) { $form->{"${_}_$i"} = $ref->{$_} }
173 if ($ref->{amount} < 0) {
174 $form->{totaldebit} -= $ref->{amount};
175 $form->{"debit_$i"} = $ref->{amount} * -1;
177 $form->{totalcredit} += $ref->{amount};
178 $form->{"credit_$i"} = $ref->{amount};
180 $form->{"taxchart_$i"} = "0--0.00";
183 if ($ref->{taxaccno} && !$tax) {
184 $taxaccno = $ref->{taxaccno};
193 $form->{rowcount} = $i;
195 ($form->datetonum($form->{transdate}, \%myconfig) <=
196 $form->datetonum($form->{closedto}, \%myconfig));
198 $form->{title} = "Edit";
203 $lxdebug->leave_sub();
208 $lxdebug->enter_sub();
210 $form->{title} = $locale->text('Buchungsjournal');
212 $form->all_departments(\%myconfig);
215 if (@{ $form->{all_departments} }) {
216 $form->{selectdepartment} = "<option>\n";
219 $form->{selectdepartment} .=
220 "<option>$_->{description}--$_->{id}\n"
221 } (@{ $form->{all_departments} });
226 <th align=right nowrap>| . $locale->text('Department') . qq|</th>
227 <td colspan=3><select name=department>$form->{selectdepartment}</select></td>
229 | if $form->{selectdepartment};
231 # use JavaScript Calendar or not
232 $form->{jsscript} = $jscalendar;
234 if ($form->{jsscript}) {
236 # with JavaScript Calendar
238 <td><input name=datefrom id=datefrom size=11 title="$myconfig{dateformat}">
239 <input type=button name=datefrom id="trigger1" value=|
240 . $locale->text('button') . qq|></td>
243 <td><input name=dateto id=dateto size=11 title="$myconfig{dateformat}">
244 <input type=button name=dateto id="trigger2" value=|
245 . $locale->text('button') . qq|></td>
250 Form->write_trigger(\%myconfig, "2", "datefrom", "BR", "trigger1",
251 "dateto", "BL", "trigger2");
254 # without JavaScript Calendar
256 qq|<td><input name=datefrom id=datefrom size=11 title="$myconfig{dateformat}"></td>|;
258 qq|<td><input name=dateto id=dateto size=11 title="$myconfig{dateformat}"></td>|;
266 <form method=post action=$form->{script}>
268 <input type=hidden name=sort value=transdate>
272 <th class=listtop>$form->{title}</th>
279 <th align=right>| . $locale->text('Reference') . qq|</th>
280 <td><input name=reference size=20></td>
281 <th align=right>| . $locale->text('Source') . qq|</th>
282 <td><input name=source size=20></td>
286 <th align=right>| . $locale->text('Description') . qq|</th>
287 <td colspan=3><input name=description size=40></td>
290 <th align=right>| . $locale->text('Notes') . qq|</th>
291 <td colspan=3><input name=notes size=40></td>
294 <th align=right>| . $locale->text('From') . qq|</th>
296 <th align=right>| . $locale->text('To (time)') . qq|</th>
300 <th align=right>| . $locale->text('Include in Report') . qq|</th>
305 <input name="category" class=radio type=radio value=X checked> |
306 . $locale->text('All') . qq|
307 <input name="category" class=radio type=radio value=A> |
308 . $locale->text('Asset') . qq|
309 <input name="category" class=radio type=radio value=L> |
310 . $locale->text('Liability') . qq|
311 <input name="category" class=radio type=radio value=I> |
312 . $locale->text('Revenue') . qq|
313 <input name="category" class=radio type=radio value=E> |
314 . $locale->text('Expense') . qq|
320 <td align=right><input name="l_id" class=checkbox type=checkbox value=Y></td>
321 <td>| . $locale->text('ID') . qq|</td>
322 <td align=right><input name="l_transdate" class=checkbox type=checkbox value=Y checked></td>
323 <td>| . $locale->text('Date') . qq|</td>
324 <td align=right><input name="l_reference" class=checkbox type=checkbox value=Y checked></td>
325 <td>| . $locale->text('Reference') . qq|</td>
326 <td align=right><input name="l_description" class=checkbox type=checkbox value=Y checked></td>
327 <td>| . $locale->text('Description') . qq|</td>
328 <td align=right><input name="l_notes" class=checkbox type=checkbox value=Y></td>
329 <td>| . $locale->text('Notes') . qq|</td>
332 <td align=right><input name="l_debit" class=checkbox type=checkbox value=Y checked></td>
333 <td>| . $locale->text('Debit') . qq|</td>
334 <td align=right><input name="l_credit" class=checkbox type=checkbox value=Y checked></td>
335 <td>| . $locale->text('Credit') . qq|</td>
336 <td align=right><input name="l_source" class=checkbox type=checkbox value=Y checked></td>
337 <td>| . $locale->text('Source') . qq|</td>
338 <td align=right><input name="l_accno" class=checkbox type=checkbox value=Y checked></td>
339 <td>| . $locale->text('Account') . qq|</td>
340 <td align=right><input name="l_gifi_accno" class=checkbox type=checkbox value=Y></td>
341 <td>| . $locale->text('GIFI') . qq|</td>
344 <td align=right><input name="l_subtotal" class=checkbox type=checkbox value=Y></td>
345 <td>| . $locale->text('Subtotal') . qq|</td>
355 <td><hr size=3 noshade></td>
361 <input type=hidden name=nextsub value=generate_report>
363 <input type=hidden name=path value=$form->{path}>
364 <input type=hidden name=login value=$form->{login}>
365 <input type=hidden name=password value=$form->{password}>
368 <input class=submit type=submit name=action value="|
369 . $locale->text('Continue') . qq|">
375 $lxdebug->leave_sub();
378 sub generate_report {
379 $lxdebug->enter_sub();
381 $form->{sort} = "transdate" unless $form->{sort};
383 GL->all_transactions(\%myconfig, \%$form);
386 "$form->{script}?action=generate_report&path=$form->{path}&login=$form->{login}&password=$form->{password}";
390 %acctype = ('A' => $locale->text('Asset'),
391 'C' => $locale->text('Contra'),
392 'L' => $locale->text('Liability'),
393 'Q' => $locale->text('Equity'),
394 'I' => $locale->text('Revenue'),
395 'E' => $locale->text('Expense'),);
397 $form->{title} = $locale->text('General Ledger');
399 $ml = ($form->{ml} =~ /(A|E|Q)/) ? -1 : 1;
401 unless ($form->{category} eq 'X') {
402 $form->{title} .= " : " . $locale->text($acctype{ $form->{category} });
404 if ($form->{accno}) {
405 $href .= "&accno=" . $form->escape($form->{accno});
406 $callback .= "&accno=" . $form->escape($form->{accno}, 1);
408 $locale->text('Account')
409 . " : $form->{accno} $form->{account_description}";
411 if ($form->{gifi_accno}) {
412 $href .= "&gifi_accno=" . $form->escape($form->{gifi_accno});
413 $callback .= "&gifi_accno=" . $form->escape($form->{gifi_accno}, 1);
414 $option .= "\n<br>" if $option;
416 $locale->text('GIFI')
417 . " : $form->{gifi_accno} $form->{gifi_account_description}";
419 if ($form->{source}) {
420 $href .= "&source=" . $form->escape($form->{source});
421 $callback .= "&source=" . $form->escape($form->{source}, 1);
422 $option .= "\n<br>" if $option;
423 $option .= $locale->text('Source') . " : $form->{source}";
425 if ($form->{reference}) {
426 $href .= "&reference=" . $form->escape($form->{reference});
427 $callback .= "&reference=" . $form->escape($form->{reference}, 1);
428 $option .= "\n<br>" if $option;
429 $option .= $locale->text('Reference') . " : $form->{reference}";
431 if ($form->{department}) {
432 $href .= "&department=" . $form->escape($form->{department});
433 $callback .= "&department=" . $form->escape($form->{department}, 1);
434 ($department) = split /--/, $form->{department};
435 $option .= "\n<br>" if $option;
436 $option .= $locale->text('Department') . " : $department";
439 if ($form->{description}) {
440 $href .= "&description=" . $form->escape($form->{description});
441 $callback .= "&description=" . $form->escape($form->{description}, 1);
442 $option .= "\n<br>" if $option;
443 $option .= $locale->text('Description') . " : $form->{description}";
445 if ($form->{notes}) {
446 $href .= "¬es=" . $form->escape($form->{notes});
447 $callback .= "¬es=" . $form->escape($form->{notes}, 1);
448 $option .= "\n<br>" if $option;
449 $option .= $locale->text('Notes') . " : $form->{notes}";
452 if ($form->{datefrom}) {
453 $href .= "&datefrom=$form->{datefrom}";
454 $callback .= "&datefrom=$form->{datefrom}";
455 $option .= "\n<br>" if $option;
457 $locale->text('From') . " "
458 . $locale->date(\%myconfig, $form->{datefrom}, 1);
460 if ($form->{dateto}) {
461 $href .= "&dateto=$form->{dateto}";
462 $callback .= "&dateto=$form->{dateto}";
463 if ($form->{datefrom}) {
466 $option .= "\n<br>" if $option;
469 $locale->text('Bis') . " "
470 . $locale->date(\%myconfig, $form->{dateto}, 1);
473 @columns = $form->sort_columns(
474 qw(transdate id reference description notes source debit debit_accno credit credit_accno debit_tax debit_tax_accno credit_tax credit_tax_accno accno gifi_accno)
477 if ($form->{accno} || $form->{gifi_accno}) {
478 @columns = grep !/(accno|gifi_accno)/, @columns;
479 push @columns, "balance";
480 $form->{l_balance} = "Y";
484 $form->{l_credit_accno} = "Y";
485 $form->{l_debit_accno} = "Y";
486 $form->{l_credit_tax} = "Y";
487 $form->{l_debit_tax} = "Y";
488 $form->{l_credit_tax_accno} = "Y";
489 $form->{l_debit_tax_accno} = "Y";
490 $form->{l_accno} = "N";
491 foreach $item (@columns) {
492 if ($form->{"l_$item"} eq "Y") {
493 push @column_index, $item;
495 # add column to href and callback
496 $callback .= "&l_$item=Y";
497 $href .= "&l_$item=Y";
501 if ($form->{l_subtotal} eq 'Y') {
502 $callback .= "&l_subtotal=Y";
503 $href .= "&l_subtotal=Y";
506 $callback .= "&category=$form->{category}";
507 $href .= "&category=$form->{category}";
510 "<th><a class=listheading href=$href&sort=id>"
511 . $locale->text('ID')
513 $column_header{transdate} =
514 "<th><a class=listheading href=$href&sort=transdate>"
515 . $locale->text('Date')
517 $column_header{reference} =
518 "<th><a class=listheading href=$href&sort=reference>"
519 . $locale->text('Reference')
521 $column_header{source} =
522 "<th><a class=listheading href=$href&sort=source>"
523 . $locale->text('Source')
525 $column_header{description} =
526 "<th><a class=listheading href=$href&sort=description>"
527 . $locale->text('Description')
529 $column_header{notes} =
530 "<th class=listheading>" . $locale->text('Notes') . "</th>";
531 $column_header{debit} =
532 "<th class=listheading>" . $locale->text('Debit') . "</th>";
533 $column_header{debit_accno} =
534 "<th><a class=listheading href=$href&sort=accno>"
535 . $locale->text('Debit Account')
537 $column_header{credit} =
538 "<th class=listheading>" . $locale->text('Credit') . "</th>";
539 $column_header{credit_accno} =
540 "<th><a class=listheading href=$href&sort=accno>"
541 . $locale->text('Credit Account')
543 $column_header{debit_tax} =
544 "<th><a class=listheading href=$href&sort=accno>"
545 . $locale->text('Debit Tax')
547 $column_header{debit_tax_accno} =
548 "<th><a class=listheading href=$href&sort=accno>"
549 . $locale->text('Debit Tax Account')
551 $column_header{credit_tax} =
552 "<th><a class=listheading href=$href&sort=accno>"
553 . $locale->text('Credit Tax')
555 $column_header{credit_tax_accno} =
556 "<th><a class=listheading href=$href&sort=accno>"
557 . $locale->text('Credit Tax Account')
559 $column_header{gifi_accno} =
560 "<th><a class=listheading href=$href&sort=gifi_accno>"
561 . $locale->text('GIFI')
563 $column_header{balance} = "<th>" . $locale->text('Balance') . "</th>";
565 $form->{landscape} = 1;
574 <th class=listtop>$form->{title}</th>
584 <tr class=listheading>
587 map { print "$column_header{$_}\n" } @column_index;
596 # add sort to callback
597 $form->{callback} = "$callback&sort=$form->{sort}";
598 $callback = $form->escape($form->{callback});
600 # initial item for subtotals
601 if (@{ $form->{GL} }) {
602 $sameitem = $form->{GL}->[0]->{ $form->{sort} };
605 if (($form->{accno} || $form->{gifi_accno}) && $form->{balance}) {
607 map { $column_data{$_} = "<td> </td>" } @column_index;
608 $column_data{balance} =
610 . $form->format_amount(\%myconfig, $form->{balance} * $ml, 2, 0)
618 map { print "$column_data{$_}\n" } @column_index;
624 $form->{balance} *= $ml;
625 foreach $ref (@{ $form->{GL} }) {
626 $form->{balance} *= $ml;
628 # if item ne sort print subtotal
629 if ($form->{l_subtotal} eq 'Y') {
630 if ($sameitem ne $ref->{ $form->{sort} }) {
635 #foreach $key (sort keys(%{ $ref->{amount} })) {
636 # $form->{balance} += $ref->{amount}{$key};
640 foreach $key (sort keys(%{ $ref->{debit} })) {
641 $subtotaldebit += $ref->{debit}{$key};
642 $totaldebit += $ref->{debit}{$key};
644 $debit = $form->format_amount(\%myconfig, $ref->{debit}{$key}, 2, 0);
647 "<br>" . $form->format_amount(\%myconfig, $ref->{debit}{$key}, 2, 0);
649 $form->{balance} = abs($form->{balance}) - abs($ref->{debit}{$key});
653 foreach $key (sort keys(%{ $ref->{credit} })) {
654 $subtotalcredit += $ref->{credit}{$key};
655 $totalcredit += $ref->{credit}{$key};
657 $credit = $form->format_amount(\%myconfig, $ref->{credit}{$key}, 2, 0);
660 . $form->format_amount(\%myconfig, $ref->{credit}{$key}, 2, 0);
662 $form->{balance} = abs($form->{balance}) - abs($ref->{credit}{$key});
666 foreach $key (sort keys(%{ $ref->{debit_tax} })) {
667 $subtotaldebittax += $ref->{debit_tax}{$key};
668 $totaldebittax += $ref->{debit_tax}{$key};
671 $form->format_amount(\%myconfig, $ref->{debit_tax}{$key}, 2, 0);
674 . $form->format_amount(\%myconfig, $ref->{debit_tax}{$key}, 2, 0);
676 $form->{balance} = abs($form->{balance}) - abs($ref->{debit_tax}{$key});
680 foreach $key (sort keys(%{ $ref->{credit_tax} })) {
681 $subtotalcredittax += $ref->{credit_tax}{$key};
682 $totalcredittax += $ref->{credit_tax}{$key};
685 $form->format_amount(\%myconfig, $ref->{credit_tax}{$key}, 2, 0);
688 . $form->format_amount(\%myconfig, $ref->{credit_tax}{$key}, 2, 0);
690 $form->{balance} = abs($form->{balance}) - abs($ref->{credit_tax}{$key});
696 foreach $key (sort keys(%{ $ref->{debit_accno} })) {
699 "<a href=$href&accno=$ref->{debit_accno}{$key}&callback=$callback>$ref->{debit_accno}{$key}</a>";
702 "<br><a href=$href&accno=$ref->{debit_accno}{$key}&callback=$callback>$ref->{debit_accno}{$key}</a>";
705 # if ($ref->{debit_taxkey}{$key} eq $debittaxkey) {
706 # $ref->{debit_tax_accno}{$key} = $taxaccno;
708 $taxaccno = $ref->{debit_tax_accno}{$key};
709 $debittaxkey = $ref->{debit_taxkey}{$key};
715 foreach $key (sort keys(%{ $ref->{credit_accno} })) {
718 "<a href=$href&accno=$ref->{credit_accno}{$key}&callback=$callback>$ref->{credit_accno}{$key}</a>";
721 "<br><a href=$href&accno=$ref->{credit_accno}{$key}&callback=$callback>$ref->{credit_accno}{$key}</a>";
724 # if ($ref->{credit_taxkey}{$key} eq $credittaxkey) {
725 # $ref->{credit_tax_accno}{$key} = $taxaccno;
727 $taxaccno = $ref->{credit_tax_accno}{$key};
728 $credittaxkey = $ref->{credit_taxkey}{$key};
732 foreach $key (sort keys(%{ $ref->{debit_tax_accno} })) {
735 "<a href=$href&accno=$ref->{debit_tax_accno}{$key}&callback=$callback>$ref->{debit_tax_accno}{$key}</a>";
738 "<br><a href=$href&accno=$ref->{debit_tax_accno}{$key}&callback=$callback>$ref->{debit_tax_accno}{$key}</a>";
742 $credittaxaccno = "";
743 foreach $key (sort keys(%{ $ref->{credit_tax_accno} })) {
746 "<a href=$href&accno=$ref->{credit_tax_accno}{$key}&callback=$callback>$ref->{credit_tax_accno}{$key}</a>";
749 "<br><a href=$href&accno=$ref->{credit_tax_accno}{$key}&callback=$callback>$ref->{credit_tax_accno}{$key}</a>";
753 # $ref->{debit} = $form->format_amount(\%myconfig, $ref->{debit}, 2, " ");
754 # $ref->{credit} = $form->format_amount(\%myconfig, $ref->{credit}, 2, " ");
756 $column_data{id} = "<td align=right> $ref->{id} </td>";
757 $column_data{transdate} =
758 "<td align=center> $ref->{transdate} </td>";
759 $column_data{reference} =
760 "<td align=center><a href=$ref->{module}.pl?action=edit&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{reference}</td>";
761 $column_data{description} =
762 "<td align=center>$ref->{description} </td>";
763 $column_data{source} = "<td align=center>$ref->{source} </td>";
764 $column_data{notes} = "<td align=center>$ref->{notes} </td>";
765 $column_data{debit} = "<td align=right>$debit</td>";
766 $column_data{debit_accno} = "<td align=center>$debitaccno</td>";
767 $column_data{credit} = "<td align=right>$credit</td>";
768 $column_data{credit_accno} = "<td align=center>$creditaccno</td>";
769 $column_data{debit_tax} =
770 ($ref->{debit_tax_accno} ne "")
771 ? "<td align=right>$debittax</td>"
773 $column_data{debit_tax_accno} = "<td align=center>$debittaxaccno</td>";
774 $column_data{gifi_accno} =
775 "<td><a href=$href&gifi_accno=$ref->{gifi_accno}&callback=$callback>$ref->{gifi_accno}</a> </td>";
776 $column_data{credit_tax} =
777 ($ref->{credit_tax_accno} ne "")
778 ? "<td align=right>$credittax</td>"
780 $column_data{credit_tax_accno} = "<td align=center>$credittaxaccno</td>";
781 $column_data{gifi_accno} =
782 "<td><a href=$href&gifi_accno=$ref->{gifi_accno}&callback=$callback>$ref->{gifi_accno}</a> </td>";
783 $column_data{balance} =
785 . $form->format_amount(\%myconfig, $form->{balance}, 2, 0) . "</td>";
790 <tr class=listrow$i>";
791 map { print "$column_data{$_}\n" } @column_index;
796 &gl_subtotal if ($form->{l_subtotal} eq 'Y');
798 map { $column_data{$_} = "<td> </td>" } @column_index;
800 $column_data{debit} =
801 "<th align=right class=listtotal>"
802 . $form->format_amount(\%myconfig, $totaldebit, 2, " ") . "</th>";
803 $column_data{credit} =
804 "<th align=right class=listtotal>"
805 . $form->format_amount(\%myconfig, $totalcredit, 2, " ") . "</th>";
806 $column_data{debit_tax} =
807 "<th align=right class=listtotal>"
808 . $form->format_amount(\%myconfig, $totaldebittax, 2, " ") . "</th>";
809 $column_data{credit_tax} =
810 "<th align=right class=listtotal>"
811 . $form->format_amount(\%myconfig, $totalcredittax, 2, " ") . "</th>";
812 $column_data{balance} =
813 "<th align=right class=listtotal>"
814 . $form->format_amount(\%myconfig, $form->{balance} * $ml, 2, 0) . "</th>";
820 map { print "$column_data{$_}\n" } @column_index;
829 <td><hr size=3 noshade></td>
835 <form method=post action=$form->{script}>
837 <input name=callback type=hidden value="$form->{callback}">
839 <input type=hidden name=path value=$form->{path}>
840 <input type=hidden name=login value=$form->{login}>
841 <input type=hidden name=password value=$form->{password}>
843 <input class=submit type=submit name=action value="|
844 . $locale->text('GL Transaction') . qq|">
845 <input class=submit type=submit name=action value="|
846 . $locale->text('AR Transaction') . qq|">
847 <input class=submit type=submit name=action value="|
848 . $locale->text('AP Transaction') . qq|">
849 <input class=submit type=submit name=action value="|
850 . $locale->text('Sales Invoice') . qq|">
851 <input class=submit type=submit name=action value="|
852 . $locale->text('Vendor Invoice') . qq|">
859 $lxdebug->leave_sub();
864 $lxdebug->enter_sub();
867 $form->format_amount(\%myconfig, $subtotaldebit, 2, " ");
869 $form->format_amount(\%myconfig, $subtotalcredit, 2, " ");
871 map { $column_data{$_} = "<td> </td>" }
872 qw(transdate id reference source description accno);
873 $column_data{debit} = "<th align=right>$subtotaldebit</td>";
874 $column_data{credit} = "<th align=right>$subtotalcredit</td>";
876 print "<tr class=listsubtotal>";
877 map { print "$column_data{$_}\n" } @column_index;
883 $sameitem = $ref->{ $form->{sort} };
884 $lxdebug->leave_sub();
889 $lxdebug->enter_sub();
891 if ($form->{transdate} ne $form->{oldtransdate}) {
892 if ($form->{selectprojectnumber}) {
893 $form->all_projects(\%myconfig, undef, $form->{transdate});
894 if (@{ $form->{all_project} }) {
895 $form->{selectprojectnumber} = "<option>\n";
896 for (@{ $form->{all_project} }) {
897 $form->{selectprojectnumber} .=
898 qq|<option value="$_->{projectnumber}--$_->{id}">$_->{projectnumber}\n|;
900 $form->{selectprojectnumber} =
901 $form->escape($form->{selectprojectnumber}, 1);
904 $form->{oldtransdate} = $form->{transdate};
917 qw(accno debit credit projectnumber fx_transaction source memo tax taxchart);
919 for my $i (1 .. $form->{rowcount}) {
921 unless (($form->{"debit_$i"} eq "") && ($form->{"credit_$i"} eq "")) {
922 for (qw(debit credit tax)) {
924 $form->parse_amount(\%myconfig, $form->{"${_}_$i"});
928 $debitcredit = ($form->{"debit_$i"} == 0) ? "0" : "1";
935 if (($debitcount >= 2) && ($creditcount == 2)) {
936 $form->{"credit_$i"} = 0;
937 $form->{"tax_$i"} = 0;
941 if (($creditcount >= 2) && ($debitcount == 2)) {
942 $form->{"debit_$i"} = 0;
943 $form->{"tax_$i"} = 0;
947 if (($creditcount == 1) && ($debitcount == 2)) {
950 if (($creditcount == 2) && ($debitcount == 1)) {
953 if ($debitcredit && $credittax) {
954 $form->{"taxchart_$i"} = "0--0.00";
956 if (!$debitcredit && $debittax) {
957 $form->{"taxchart_$i"} = "0--0.00";
960 ($form->{"debit_$i"} == 0)
961 ? $form->{"credit_$i"}
962 : $form->{"debit_$i"};
964 if (($debitcredit && $credittax) || (!$debitcredit && $debittax)) {
965 $form->{"taxchart_$i"} = "0--0.00";
966 $form->{"tax_$i"} = 0;
968 if (!$form->{"korrektur_$i"}) {
969 ($taxkey, $rate) = split(/--/, $form->{"taxchart_$i"});
976 if ($form->{taxincluded}) {
977 $form->{"tax_$i"} = $amount / ($rate + 1) * $rate;
979 $form->{"tax_$i"} = $amount * $rate;
982 $form->{"tax_$i"} = 0;
986 for (@flds) { $a[$j]->{$_} = $form->{"${_}_$i"} }
991 for $i (1 .. $count) {
993 for (@flds) { $form->{"${_}_$i"} = $a[$j]->{$_} }
996 for $i ($count + 1 .. $form->{rowcount}) {
997 for (@flds) { delete $form->{"${_}_$i"} }
1000 $form->{rowcount} = $count + 1;
1003 $lxdebug->leave_sub();
1009 $lxdebug->enter_sub();
1011 &form_header($init);
1013 # for $i (1 .. $form->{rowcount}) {
1014 # $form->{totaldebit} += $form->parse_amount(\%myconfig, $form->{"debit_$i"});
1015 # $form->{totalcredit} += $form->parse_amount(\%myconfig, $form->{"credit_$i"});
1019 &display_rows($init);
1021 $lxdebug->leave_sub();
1027 $lxdebug->enter_sub();
1029 $form->{selectprojectnumber} = $form->unescape($form->{selectprojectnumber})
1030 if $form->{selectprojectnumber};
1032 $form->{totaldebit} = 0;
1033 $form->{totalcredit} = 0;
1034 my $chart = $form->{chart};
1035 $chart = $form->unquote($chart);
1036 $form->{taxchart} = $form->unquote($form->{taxchart});
1037 $taxchart = $form->{taxchart};
1038 for $i (1 .. $form->{rowcount}) {
1041 <td><input name="source_$i" value="$form->{"source_$i"}" size="16" tabindex=|
1042 . ($i + 11 + (($i - 1) * 8)) . qq|></td>|;
1044 <td><input name="memo_$i" value="$form->{"memo_$i"}" size="16" tabindex=|
1045 . ($i + 12 + (($i - 1) * 8)) . qq|></td>|;
1049 <td><select name="accno_$i" onChange="setTaxkey(this, $i)" style="width:200px" tabindex=|
1050 . ($i + 5 + (($i - 1) * 8)) . qq|>$form->{chartinit}</select></td>|;
1052 qq|<td><select id="taxchart_$i" name="taxchart_$i" style="width:200px" tabindex=|
1053 . ($i + 10 + (($i - 1) * 8))
1054 . qq|>$form->{taxchart}</select></td>|;
1056 # if ($form->{selectprojectnumber}) {
1058 # <td><select name="projectnumber_$i">$form->{selectprojectnumber}</select></td>|;
1061 qq|<td><input type="checkbox" name="korrektur_$i" value="1" tabindex=|
1062 . ($i + 9 + (($i - 1) * 8))
1064 if ($form->{transfer}) {
1065 $fx_transaction = qq|
1066 <td><input name="fx_transaction_$i" class=checkbox type=checkbox value=1></td>
1071 if ($form->{"debit_$i"} != 0) {
1072 $form->{totaldebit} += $form->{"debit_$i"};
1073 if (!$form->{taxincluded}) {
1074 $form->{totaldebit} += $form->{"tax_$i"};
1077 $form->{totalcredit} += $form->{"credit_$i"};
1078 if (!$form->{taxincluded}) {
1079 $form->{totalcredit} += $form->{"tax_$i"};
1083 for (qw(debit credit tax)) {
1084 $form->{"${_}_$i"} =
1085 ($form->{"${_}_$i"})
1086 ? $form->format_amount(\%myconfig, $form->{"${_}_$i"}, 2)
1090 if ($i < $form->{rowcount}) {
1093 $chart_selected = $form->{"accno_$i"};
1095 s/value=\"$chart_selected\"/value=\"$chart_selected\" selected/;
1097 qq|<td><select name="accno_$i" onChange="setTaxkey(this, $i)" style="width:200px" tabindex=|
1098 . ($i + 5 + (($i - 1) * 8))
1099 . qq|>$accno</select></td>|;
1101 $tax_selected = $form->{"taxchart_$i"};
1102 print(STDERR "TAX_SELCTED $tax_selected\n");
1103 $tax =~ s/value=\"$tax_selected\"/value=\"$tax_selected\" selected/;
1105 qq|<td><select id="taxchart_$i" name="taxchart_$i" tabindex=|
1106 . ($i + 10 + (($i - 1) * 8))
1107 . qq|>$tax</select></td>|;
1109 # if ($form->{selectprojectnumber}) {
1110 # $form->{"projectnumber_$i"} = ""
1111 # if $form->{selectprojectnumber} !~ /$form->{"projectnumber_$i"}/;
1113 # $project = $form->{"projectnumber_$i"};
1114 # $project =~ s/--.*//;
1115 # $project = qq|<td>$project</td>|;
1118 if ($form->{transfer}) {
1119 $checked = ($form->{"fx_transaction_$i"}) ? "1" : "";
1120 $x = ($checked) ? "x" : "";
1121 $fx_transaction = qq|
1122 <td><input type=hidden name="fx_transaction_$i" value="$checked">$x</td>
1125 $checked = ($form->{"korrektur_$i"}) ? "checked" : "";
1127 qq|<td><input type="checkbox" name="korrektur_$i" value="1" $checked tabindex=|
1128 . ($i + 9 + (($i - 1) * 8))
1130 $form->hide_form("accno_$i");
1135 <td><select name="accno_$i" onChange="setTaxkey(this, $i)" style="width:300px" tabindex=|
1136 . ($i + 5 + (($i - 1) * 8)) . qq|>$chart</select></td>|;
1138 <td><select id="taxchart_$i" name="taxchart_$i" tabindex=|
1139 . ($i + 10 + (($i - 1) * 8)) . qq|>$taxchart</select></td>|;
1141 # if ($form->{selectprojectnumber}) {
1143 # <td><select name="projectnumber_$i">$form->{selectprojectnumber}</select></td>|;
1146 qq|<td><input type="checkbox" name="korrektur_$i" value="1" tabindex=|
1147 . ($i + 9 + (($i - 1) * 8))
1149 if ($form->{transfer}) {
1150 $fx_transaction = qq|
1151 <td><input name="fx_transaction_$i" class=checkbox type=checkbox value=1></td>
1156 my $debitreadonly = "";
1157 my $creditreadonly = "";
1158 if ($i == $form->{rowcount}) {
1160 $debitreadonly = "readonly";
1161 } elsif ($creditlock) {
1162 $creditreadonly = "readonly";
1166 print qq|<tr valign=top>
1169 <td><input name="debit_$i" size=8 value="$form->{"debit_$i"}" accesskey=$i tabindex=|
1170 . ($i + 6 + (($i - 1) * 8)) . qq| $debitreadonly></td>
1171 <td><input name="credit_$i" size=8 value="$form->{"credit_$i"}" tabindex=|
1172 . ($i + 7 + (($i - 1) * 8)) . qq| $creditreadonly></td>
1173 <td><input name="tax_$i" size=6 value="$form->{"tax_$i"}" tabindex=|
1174 . ($i + 8 + (($i - 1) * 8)) . qq|></td>
1184 $form->hide_form(qw(rowcount selectaccno));
1187 # <input type=hidden name=selectprojectnumber value="|
1188 # . $form->escape($form->{selectprojectnumber}, 1) . qq|">|;
1189 $lxdebug->leave_sub();
1195 $lxdebug->enter_sub();
1196 $title = $form->{title};
1197 $form->{title} = $locale->text("$title General Ledger Transaction");
1198 $readonly = ($form->{id}) ? "readonly" : "";
1200 # $locale->text('Add General Ledger Transaction')
1201 # $locale->text('Edit General Ledger Transaction')
1203 map { $form->{$_} =~ s/\"/"/g }
1204 qw(reference description chart taxchart);
1205 $form->{javascript} = qq|<script type="text/javascript">
1207 function setTaxkey(accno, row) {
1208 var taxkey = accno.options[accno.selectedIndex].value;
1209 var reg = /--([0-9]*)/;
1210 var found = reg.exec(taxkey);
1211 var index = found[1];
1212 index = parseInt(index);
1213 var tax = 'taxchart_' + row;
1214 for (var i = 0; i < document.getElementById(tax).options.length; ++i) {
1215 var reg2 = new RegExp("^"+ index, "");
1216 if (reg2.exec(document.getElementById(tax).options[i].value)) {
1217 document.getElementById(tax).options[i].selected = true;
1225 $form->{selectdepartment} =~ s/ selected//;
1226 $form->{selectdepartment} =~
1227 s/option>\Q$form->{department}\E/option selected>$form->{department}/;
1229 if (($rows = $form->numtextrows($form->{description}, 50)) > 1) {
1231 qq|<textarea name=description rows=$rows cols=50 wrap=soft $readonly >$form->{description}</textarea>|;
1234 qq|<input name=description size=50 value="$form->{description}" tabindex="3" $readonly>|;
1237 $taxincluded = ($form->{taxincluded}) ? "checked" : "";
1240 $taxincluded = "checked";
1245 <th align=right nowrap>| . $locale->text('Department') . qq|</th>
1246 <td colspan=3><select name=department>$form->{selectdepartment}</select></td>
1247 <input type=hidden name=selectdepartment value="$form->{selectdepartment}">
1249 | if $form->{selectdepartment};
1251 $form->{fokus} = "gl.reference";
1253 $form->{fokus} = qq|gl.accno_$form->{rowcount}|;
1256 # use JavaScript Calendar or not
1257 $form->{jsscript} = $jscalendar;
1259 if ($form->{jsscript}) {
1261 # with JavaScript Calendar
1263 <td><input name=transdate id=transdate size=11 title="$myconfig{dateformat}" value="$form->{transdate}" tabindex="2" $readonly>
1264 <input type=button name=transdate id="trigger1" value=|
1265 . $locale->text('button') . qq|></td>
1270 Form->write_trigger(\%myconfig, "1", "transdate", "BL", "trigger1");
1273 # without JavaScript Calendar
1275 qq|<td><input name=transdate id=transdate size=11 title="$myconfig{dateformat}" value="$form->{transdate}" tabindex="2" $readonly></td>|;
1281 <body onLoad="fokus()">
1283 <form method=post name="gl" action=$form->{script}>
1285 <input name=id type=hidden value=$form->{id}>
1287 <input type=hidden name=closedto value=$form->{closedto}>
1288 <input type=hidden name=locked value=$form->{locked}>
1289 <input type=hidden name=title value="$title">
1290 <input type=hidden name=taxchart value="$form->{taxchart}">
1291 <input type=hidden name=chart value="$form->{chart}">
1296 <th class=listtop>$form->{title}</th>
1298 <tr height="5"></tr>
1303 <th align=left>| . $locale->text('Reference') . qq|</th>
1304 <td><input name=reference size=20 value="$form->{reference}" tabindex="1" $readonly></td>
1308 <th align=right nowrap>| . $locale->text('Date') . qq|</th>
1317 <th align=right>| . $locale->text('Belegnummer') . qq|</th>
1318 <td><input name=id size=20 value="$form->{id}" $readonly></td>
1322 <th align=right width=50%>| . $locale->text('Buchungsdatum') . qq|</th>
1323 <td align=left><input name=gldate size=11 title="$myconfig{dateformat}" value=$form->{gldate} $readonly></td>
1334 <th align=left width=1%>| . $locale->text('Description') . qq|</th>
1335 <td width=1%>$description</td>
1339 <th align=left>| . $locale->text('MwSt. inkl.') . qq|</th>
1340 <td><input type=checkbox name=taxincluded value=1 tabindex="5" $taxincluded></td>
1347 <th align=right width=50%>| . $locale->text('Mitarbeiter') . qq|</th>
1348 <td align=left><input name=employee size=11 value=$form->{employee} $readonly></td>
1356 <th align=left width=1%>| . $locale->text('Description') . qq|</th>
1357 <td width=1%>$description</td>
1361 <th align=left>| . $locale->text('MwSt. inkl.') . qq|</th>
1362 <td><input type=checkbox name=taxincluded value=1 tabindex="5" $taxincluded></td>
1372 <tr class=listheading>
1373 <th class=listheading style="width:15%">|
1374 . $locale->text('Account') . qq|</th>
1375 <th class=listheading style="width:10%">|
1376 . $locale->text('Debit') . qq|</th>
1377 <th class=listheading style="width:10%">|
1378 . $locale->text('Credit') . qq|</th>
1379 <th class=listheading style="width:10%">|
1380 . $locale->text('Tax') . qq|</th>
1381 <th class=listheading style="width:5%">|
1382 . $locale->text('Korrektur') . qq|</th>
1383 <th class=listheading style="width:10%">|
1384 . $locale->text('Taxkey') . qq|</th>
1385 <th class=listheading style="width:20%">|
1386 . $locale->text('Source') . qq|</th>
1387 <th class=listheading style="width:20%">| . $locale->text('Memo') . qq|</th>
1393 $lxdebug->leave_sub();
1398 $lxdebug->enter_sub();
1399 ($dec) = ($form->{totaldebit} =~ /\.(\d+)/);
1401 $decimalplaces = ($dec > 2) ? $dec : 2;
1402 $radieren = ($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0;
1406 $form->format_amount(\%myconfig, $form->{$_}, 2, " ")
1407 } qw(totaldebit totalcredit);
1410 <tr class=listtotal>
1412 <th align=right class=listtotal> $form->{totaldebit}</th>
1413 <th align=right class=listtotal> $form->{totalcredit}</th>
1421 <input type=hidden name=path value=$form->{path}>
1422 <input type=hidden name=login value=$form->{login}>
1423 <input type=hidden name=password value=$form->{password}>
1425 <input name=callback type=hidden value="$form->{callback}">
1430 $transdate = $form->datetonum($form->{transdate}, \%myconfig);
1431 $closedto = $form->datetonum($form->{closedto}, \%myconfig);
1435 print qq|<input class=submit type=submit name=action value="|
1436 . $locale->text('Storno') . qq|">|;
1438 # Löschen und ändern von Buchungen nicht mehr möglich (GoB) nur am selben Tag möglich
1440 if (!$form->{locked} && $radieren) {
1442 <input class=submit type=submit name=action value="|
1443 . $locale->text('Post') . qq|" accesskey="b">
1444 <input class=submit type=submit name=action value="|
1445 . $locale->text('Delete') . qq|">|;
1448 # if ($transdate > $closedto) {
1450 # <input class=submit type=submit name=action value="|.$locale->text('Post as new').qq|">|;
1453 if ($transdate > $closedto) {
1454 print qq|<input class=submit type=submit name=action value="|
1455 . $locale->text('Update') . qq|">
1456 <input class=submit type=submit name=action value="|
1457 . $locale->text('Post') . qq|">|;
1467 $lxdebug->leave_sub();
1472 $lxdebug->enter_sub();
1479 <form method=post action=$form->{script}>
1482 map { $form->{$_} =~ s/\"/"/g } qw(reference description chart taxchart);
1484 delete $form->{header};
1486 foreach $key (keys %$form) {
1487 print qq|<input type="hidden" name="$key" value="$form->{$key}">\n|;
1491 <h2 class=confirm>| . $locale->text('Confirm!') . qq|</h2>
1494 . $locale->text('Are you sure you want to delete Transaction')
1495 . qq| $form->{reference}</h4>
1497 <input name=action class=submit type=submit value="|
1498 . $locale->text('Yes') . qq|">
1501 $lxdebug->leave_sub();
1506 $lxdebug->enter_sub();
1508 $form->redirect($locale->text('Transaction deleted!'))
1509 if (GL->delete_transaction(\%myconfig, \%$form));
1510 $form->error($locale->text('Cannot delete transaction!'));
1511 $lxdebug->leave_sub();
1516 $lxdebug->enter_sub();
1518 # check if there is something in reference and date
1519 $form->isblank("reference", $locale->text('Reference missing!'));
1520 $form->isblank("transdate", $locale->text('Transaction Date missing!'));
1521 $form->isblank("description", $locale->text('Description missing!'));
1523 $transdate = $form->datetonum($form->{transdate}, \%myconfig);
1524 $closedto = $form->datetonum($form->{closedto}, \%myconfig);
1534 my $creditcount = 0;
1539 qw(accno debit credit projectnumber fx_transaction source memo tax taxchart);
1540 if ($form->{storno}) {
1541 for my $i (1 .. $form->{rowcount}) {
1542 unless (($form->{"debit_$i"} eq "") && ($form->{"credit_$i"} eq "")) {
1543 if ($form->{"debit_$i"} ne "") {
1544 $form->{"credit_$i"} = $form->{"debit_$i"};
1545 $form->{"debit_$i"} = "";
1546 } elsif ($form->{"credit_$i"} ne "") {
1547 $form->{"debit_$i"} = $form->{"credit_$i"};
1548 $form->{"credit_$i"} = "";
1554 for my $i (1 .. $form->{rowcount}) {
1556 unless (($form->{"debit_$i"} eq "") && ($form->{"credit_$i"} eq "")) {
1557 for (qw(debit credit tax)) {
1558 $form->{"${_}_$i"} =
1559 $form->parse_amount(\%myconfig, $form->{"${_}_$i"});
1563 $debitcredit = ($form->{"debit_$i"} == 0) ? "0" : "1";
1571 if (($debitcount >= 2) && ($creditcount == 2)) {
1572 $form->{"credit_$i"} = 0;
1573 $form->{"tax_$i"} = 0;
1577 if (($creditcount >= 2) && ($debitcount == 2)) {
1578 $form->{"debit_$i"} = 0;
1579 $form->{"tax_$i"} = 0;
1583 if (($creditcount == 1) && ($debitcount == 2)) {
1586 if (($creditcount == 2) && ($debitcount == 1)) {
1589 if ($debitcredit && $credittax) {
1590 $form->{"taxchart_$i"} = "0--0.00";
1592 if (!$debitcredit && $debittax) {
1593 $form->{"taxchart_$i"} = "0--0.00";
1596 ($form->{"debit_$i"} == 0)
1597 ? $form->{"credit_$i"}
1598 : $form->{"debit_$i"};
1600 if (($debitcredit && $credittax) || (!$debitcredit && $debittax)) {
1601 $form->{"taxchart_$i"} = "0--0.00";
1602 $form->{"tax_$i"} = 0;
1604 if (!$form->{"korrektur_$i"}) {
1605 ($taxkey, $rate) = split(/--/, $form->{"taxchart_$i"});
1612 if ($form->{taxincluded}) {
1613 $form->{"tax_$i"} = $amount / ($rate + 1) * $rate;
1615 $form->{"debit_$i"} = $form->{"debit_$i"} - $form->{"tax_$i"};
1617 $form->{"credit_$i"} = $form->{"credit_$i"} - $form->{"tax_$i"};
1620 $form->{"tax_$i"} = $amount * $rate;
1623 $form->{"tax_$i"} = 0;
1625 } elsif ($form->{taxincluded}) {
1627 $form->{"debit_$i"} = $form->{"debit_$i"} - $form->{"tax_$i"};
1629 $form->{"credit_$i"} = $form->{"credit_$i"} - $form->{"tax_$i"};
1633 for (@flds) { $a[$j]->{$_} = $form->{"${_}_$i"} }
1638 for $i (1 .. $count) {
1640 for (@flds) { $form->{"${_}_$i"} = $a[$j]->{$_} }
1643 for $i ($count + 1 .. $form->{rowcount}) {
1644 for (@flds) { delete $form->{"${_}_$i"} }
1647 for $i (1 .. $form->{rowcount}) {
1648 $dr = $form->{"debit_$i"};
1649 $cr = $form->{"credit_$i"};
1650 $tax = $form->{"tax_$i"};
1654 'Cannot post transaction with a debit and credit entry for the same account!'
1657 if ($form->{taxincluded}) {
1659 $debit += $dr + $tax;
1662 $credit += $cr + $tax;
1667 $debit += $dr + $tax;
1670 $credit += $cr + $tax;
1675 $form->{taxincluded} = 0;
1678 # this is just for the wise guys
1679 $form->error($locale->text('Cannot post transaction for a closed period!'))
1680 if ($transdate <= $closedto);
1681 if ($form->round_amount($debit, 2) != $form->round_amount($credit, 2)) {
1682 $form->error($locale->text('Out of balance transaction!'));
1685 if ($form->round_amount($debit, 2) + $form->round_amount($credit, 2) == 0) {
1686 $form->error($locale->text('Empty transaction!'));
1689 if (($errno = GL->post_transaction(\%myconfig, \%$form)) <= -1) {
1691 $err[1] = $locale->text('Cannot have a value in both Debit and Credit!');
1692 $err[2] = $locale->text('Debit and credit out of balance!');
1693 $err[3] = $locale->text('Cannot post a transaction without a value!');
1695 $form->error($err[$errno]);
1697 undef($form->{callback});
1698 $form->redirect("Buchung gespeichert. Buchungsnummer = " . $form->{id});
1699 $lxdebug->leave_sub();
1704 $lxdebug->enter_sub();
1708 $lxdebug->leave_sub();
1713 $lxdebug->enter_sub();
1716 $form->{storno} = 1;
1718 $lxdebug->leave_sub();