-sub report {
- $lxdebug->enter_sub();
-
- %title = ('balance_sheet' => 'Balance Sheet',
- 'income_statement' => 'Income Statement',
- 'trial_balance' => 'Trial Balance',
- 'ar_aging' => 'AR Aging',
- 'ap_aging' => 'Offene Verbindlichkeiten',
- 'tax_collected' => 'Tax collected',
- 'tax_paid' => 'Tax paid',
- 'nontaxable_sales' => 'Non-taxable Sales',
- 'nontaxable_purchases' => 'Non-taxable Purchases',
- 'receipts' => 'Receipts',
- 'payments' => 'Payments',
- 'projects' => 'Project Transactions',
- 'bwa' => 'Betriebswirtschaftliche Auswertung',
- 'ustva' => 'Umsatzsteuervoranmeldung',);
-
- $form->{title} = $locale->text($title{ $form->{report} });
-
- $accrual = ($eur) ? "" : "checked";
- $cash = ($eur) ? "checked" : "";
-
- ($null, $null, $null, $null, $null, $year, $null, $null, $null) =
- localtime();
- $year += 1900;
-
- # get departments
- $form->all_departments(\%myconfig);
- if (@{ $form->{all_departments} }) {
- $form->{selectdepartment} = "<option>\n";
-
- map {
- $form->{selectdepartment} .=
- "<option>$_->{description}--$_->{id}\n"
- } (@{ $form->{all_departments} });
- }
-
- $department = qq|
- <tr>
- <th align=right nowrap>| . $locale->text('Department') . qq|</th>
- <td colspan=3><select name=department>$form->{selectdepartment}</select></td>
- </tr>
-| if $form->{selectdepartment};
-
- # use JavaScript Calendar or not
- $form->{jsscript} = $jscalendar;
- $jsscript = "";
- if ($form->{report} eq "ustva") {
- $department = "";
- } else {
- if ($form->{report} eq "balance_sheet") {
- $name_1 = "asofdate";
- $id_1 = "asofdate";
- $value_1 = "$form->{asofdate}";
- $trigger_1 = "trigger1";
- $name_2 = "compareasofdate";
- $id_2 = "compareasofdate";
- $value_2 = "$form->{compareasofdate}";
- $trigger_2 = "trigger2";
- } elsif ($form->{report} =~ /(receipts|payments)$/) {
- $name_1 = "fromdate";
- $id_1 = "fromdate";
- $value_1 = "$form->{fromdate}";
- $trigger_1 = "trigger1";
- $name_2 = "todate";
- $id_2 = "todate";
- $value_2 = "";
- $trigger_2 = "trigger2";
- } else {
- if (($form->{report} eq "ar_aging") || ($form->{report} eq "ap_aging")) {
- $name_1 = "";
- $id_1 = "";
- $value_1 = "";
- $trigger_1 = "";
- $name_2 = "todate";
- $id_2 = "todate";
- $value_2 = "";
- $trigger_2 = "trigger2";
-
- } else {
- $name_1 = "fromdate";
- $id_1 = "fromdate";
- $value_1 = "$form->{fromdate}";
- $trigger_1 = "trigger1";
- $name_2 = "todate";
- $id_2 = "todate";
- $value_2 = "";
- $trigger_2 = "trigger2";
- }
- }
- }
-
- # with JavaScript Calendar
- if ($form->{jsscript}) {
- if ($name_1 eq "") {
-
- $button1 = qq|
- <input name=$name_2 id=$id_2 size=11 title="$myconfig{dateformat}">|;
- $button1_2 = qq|
- <input type=button name=$name_2 id="$trigger_2" value=|
- . $locale->text('button') . qq|>|;
-
- #write Trigger
- $jsscript =
- Form->write_trigger(\%myconfig, "1", "$name_2", "BR", "$trigger_2");
- } else {
- $button1 = qq|
- <input name=$name_1 id=$id_1 size=11 title="$myconfig{dateformat}" value=$value_1>|;
- $button1_2 = qq|
- <input type=button name=$name_1 id="$trigger_1" value=|
- . $locale->text('button') . qq|>|;
- $button2 = qq|
- <input name=$name_2 id=$id_2 size=11 title="$myconfig{dateformat}">|;
- $button2_2 = qq|
- <input type=button name=$name_2 id="$trigger_2" value=|
- . $locale->text('button') . qq|>
- |;
-
- #write Trigger
- $jsscript =
- Form->write_trigger(\%myconfig, "2", "$name_1", "BR", "$trigger_1",
- "$name_2", "BL", "$trigger_2");
- }
- } else {
-
- # without JavaScript Calendar
- if ($name_1 eq "") {
- $button1 =
- qq|<input name=$name_2 id=$id_2 size=11 title="$myconfig{dateformat}">|;
- } else {
- $button1 =
- qq|<input name=$name_1 id=$id_1 size=11 title="$myconfig{dateformat}" value=$value_1>|;
- $button2 =
- qq|<input name=$name_2 id=$id_2 size=11 title="$myconfig{dateformat}">|;
- }
- }
-
- $form->header;
-
- print qq|
-<body>
-
-<form method=post action=$form->{script}>
-
-<input type=hidden name=title value="$form->{title}">
-
-<table width=100%>
- <tr>
- <th class=listtop>$form->{title}</th>
- </tr>
- <tr height="5"></tr>
- <tr>
- <td>
- <table>
- $department
-|;
-
- if ($form->{report} eq "projects") {
- print qq|
- <tr>
- <th align=right nowrap>| . $locale->text('Project') . qq|</th>
- <td colspan=5><input name=projectnumber size=25</td>
- </tr>
- <input type=hidden name=nextsub value=generate_projects>
- <tr>
- <th align=right>| . $locale->text('From') . qq|</th>
- <td>$button1</td>
- <td>$button1_2</td>
- <th align=right>| . $locale->text('Bis') . qq|</th>
- <td>$button2</td>
- <td>$button2_2</td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td>
- <table>
- <tr>
- <th align=right nowrap>| . $locale->text('Include in Report') . qq|</th>
- <td><input name=l_heading class=checkbox type=checkbox value=Y> |
- . $locale->text('Heading') . qq|
- <input name=l_subtotal class=checkbox type=checkbox value=Y> |
- . $locale->text('Subtotal') . qq|</td>
- </tr>
-
-$jsscript
-|;
- }
-
- if ($form->{report} eq "income_statement") {
- print qq|
- <tr>
- <th align=right nowrap>| . $locale->text('Project') . qq|</th>
- <td colspan=3><input name=projectnumber size=25</td>
- </tr>
- <input type=hidden name=nextsub value=generate_income_statement>
-</table>
-<table>
- <tr>
- <th align=left><input name=reporttype class=radio type=radio value="custom" checked> |
- . $locale->text('Customized Report') . qq|</th>
- </tr>
- <tr>
- <th colspan=1>| . $locale->text('Year') . qq|</th>
- <td><input name=year size=11 title="|
- . $locale->text('YYYY') . qq|" value="$year"></td>
- </tr>
-|;
-
- print qq|
- <tr>
- <td align=right>
-<b> | . $locale->text('Yearly') . qq|</b> </td>
- <th align=left>| . $locale->text('Quarterly') . qq|</th>
- <th align=left colspan=3>| . $locale->text('Monthly') . qq|</th>
- </tr>
- <tr>
- <td align=right> <input name=duetyp class=radio type=radio value="13"
-"checked"></td>
- <td><input name=duetyp class=radio type=radio value="A" $checked > 1. |
- . $locale->text('Quarter') . qq|</td>
-|;
- $checked = "";
- print qq|
- <td><input name=duetyp class=radio type=radio value="1" $checked > |
- . $locale->text('January') . qq|</td>
-|;
- $checked = "";
- print qq|
- <td><input name=duetyp class=radio type=radio value="5" $checked > |
- . $locale->text('May') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="9" $checked > |
- . $locale->text('September') . qq|</td>
-
- </tr>
- <tr>
- <td align= right> </td>
- <td><input name=duetyp class=radio type=radio value="B" $checked> 2. |
- . $locale->text('Quarter') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="2" $checked > |
- . $locale->text('February') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="6" $checked > |
- . $locale->text('June') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="10" $checked > |
- . $locale->text('October') . qq|</td>
- </tr>
- <tr>
- <td> </td>
- <td><input name=duetyp class=radio type=radio value="C" $checked> 3. |
- . $locale->text('Quarter') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="3" $checked > |
- . $locale->text('March') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="7" $checked > |
- . $locale->text('July') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="11" $checked > |
- . $locale->text('November') . qq|</td>
-
- </tr>
- <tr>
- <td> </td>
- <td><input name=duetyp class=radio type=radio value="D" $checked> 4. |
- . $locale->text('Quarter') . qq| </td>
- <td><input name=duetyp class=radio type=radio value="4" $checked > |
- . $locale->text('April') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="8" $checked > |
- . $locale->text('August') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="12" $checked > |
- . $locale->text('December') . qq|</td>
-
- </tr>
- <tr>
- <td colspan=5><hr size=3 noshade></td>
- </tr>
- <tr>
- <th align=left><input name=reporttype class=radio type=radio value="free" $checked> |
- . $locale->text('Free report period') . qq|</th>
- <td align=left colspan=4>| . $locale->text('From') . qq|
- $button1
- $button1_2
- | . $locale->text('Bis') . qq|
- $button2
- $button2_2
- </td>
- </tr>
- <tr>
- <td colspan=5><hr size=3 noshade></td>
- </tr>
- <tr>
- <th align=leftt>| . $locale->text('Method') . qq|</th>
- <td colspan=3><input name=method class=radio type=radio value=accrual $accrual>|
- . $locale->text('Accrual') . qq|
- <input name=method class=radio type=radio value=cash $cash>|
- . $locale->text('EUR') . qq|</td>
- </tr>
-
-$jsscript
-|;
- }
-
- if ($form->{report} eq "bwa") {
- print qq|
- <tr>
- <th align=right nowrap>| . $locale->text('Project') . qq|</th>
- <td colspan=3><input name=projectnumber size=25</td>
- </tr>
- <input type=hidden name=nextsub value=generate_bwa>
-</table>
-<table>
- <tr>
- <th align=left><input name=reporttype class=radio type=radio value="custom" checked> |
- . $locale->text('Customized Report') . qq|</th>
- </tr>
- <tr>
- <th colspan=1>| . $locale->text('Year') . qq|</th>
- <td><input name=year size=11 title="|
- . $locale->text('YYYY') . qq|" value="$year"></td>
- </tr>
-|;
-
- print qq|
- <tr>
- <td align=right>
-<b> | . $locale->text('Yearly') . qq|</b> </td>
- <th align=left>| . $locale->text('Quarterly') . qq|</th>
- <th align=left colspan=3>| . $locale->text('Monthly') . qq|</th>
- </tr>
- <tr>
- <td align=right> <input name=duetyp class=radio type=radio value="13"
-$checked></td>
- <td><input name=duetyp class=radio type=radio value="A" $checked > 1. |
- . $locale->text('Quarter') . qq|</td>
-|;
- $checked = "checked";
- print qq|
- <td><input name=duetyp class=radio type=radio value="1" $checked > |
- . $locale->text('January') . qq|</td>
-|;
- $checked = "";
- print qq|
- <td><input name=duetyp class=radio type=radio value="5" $checked > |
- . $locale->text('May') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="9" $checked > |
- . $locale->text('September') . qq|</td>
-
- </tr>
- <tr>
- <td align= right> </td>
- <td><input name=duetyp class=radio type=radio value="B" $checked> 2. |
- . $locale->text('Quarter') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="2" $checked > |
- . $locale->text('February') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="6" $checked > |
- . $locale->text('June') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="10" $checked > |
- . $locale->text('October') . qq|</td>
- </tr>
- <tr>
- <td> </td>
- <td><input name=duetyp class=radio type=radio value="C" $checked> 3. |
- . $locale->text('Quarter') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="3" $checked > |
- . $locale->text('March') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="7" $checked > |
- . $locale->text('July') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="11" $checked > |
- . $locale->text('November') . qq|</td>
-
- </tr>
- <tr>
- <td> </td>
- <td><input name=duetyp class=radio type=radio value="D" $checked> 4. |
- . $locale->text('Quarter') . qq| </td>
- <td><input name=duetyp class=radio type=radio value="4" $checked > |
- . $locale->text('April') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="8" $checked > |
- . $locale->text('August') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="12" $checked > |
- . $locale->text('December') . qq|</td>
-
- </tr>
- <tr>
- <td colspan=5><hr size=3 noshade></td>
- </tr>
- <tr>
- <th align=left><input name=reporttype class=radio type=radio value="free" $checked> |
- . $locale->text('Free report period') . qq|</th>
- <td align=left colspan=4>| . $locale->text('From') . qq|
- $button1
- $button1_2
- | . $locale->text('Bis') . qq|
- $button2
- $button2_2
- </td>
- </tr>
- <tr>
- <td colspan=5><hr size=3 noshade></td>
- </tr>
- <tr>
- <th align=leftt>| . $locale->text('Method') . qq|</th>
- <td colspan=3><input name=method class=radio type=radio value=accrual $accrual>|
- . $locale->text('Accrual') . qq|
- <input name=method class=radio type=radio value=cash $cash>|
- . $locale->text('EUR') . qq|</td>
- </tr>
- <tr>
- <th align=right colspan=4>|
- . $locale->text('Decimalplaces')
- . qq|</th>
- <td><input name=decimalplaces size=3 value="2"></td>
- </tr>
-
-$jsscript
-|;
- }
-
- if ($form->{report} eq "ustva") {
-
- print qq|
-
- <br>
- <input type=hidden name=nextsub value=generate_ustva>
-</table>
-<table>
- <tr>
- <th align=left><input name=reporttype class=radio type=radio value="custom" checked> |
- . $locale->text('Zeitraum') . qq|</th>
- </tr>
- <tr>
- <th colspan=1>| . $locale->text('Year') . qq|</th>
- <td><input name=year size=11 title="|
- . $locale->text('YYYY') . qq|" value="$year"></td>
- </tr>
-|;
-
- print qq|
- <tr>
- <td align=right>
-<b> | . $locale->text('Yearly') . qq|</b> </td>
- <th align=left>| . $locale->text('Quarterly') . qq|</th>
- <th align=left colspan=3>| . $locale->text('Monthly') . qq|</th>
- </tr>
- <tr>
- <td align=right> <input name=duetyp class=radio type=radio value="13"
-$checked></td>
- <td><input name=duetyp class=radio type=radio value="A" $checked > 1. |
- . $locale->text('Quarter') . qq|</td>
-|;
- $checked = "checked";
- print qq|
- <td><input name=duetyp class=radio type=radio value="1" $checked > |
- . $locale->text('January') . qq|</td>
-|;
- $checked = "";
- print qq|
- <td><input name=duetyp class=radio type=radio value="5" $checked > |
- . $locale->text('May') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="9" $checked > |
- . $locale->text('September') . qq|</td>
-
- </tr>
- <tr>
- <td align= right> </td>
- <td><input name=duetyp class=radio type=radio value="B" $checked> 2. |
- . $locale->text('Quarter') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="2" $checked > |
- . $locale->text('February') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="6" $checked > |
- . $locale->text('June') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="10" $checked > |
- . $locale->text('October') . qq|</td>
- </tr>
- <tr>
- <td> </td>
- <td><input name=duetyp class=radio type=radio value="C" $checked> 3. |
- . $locale->text('Quarter') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="3" $checked > |
- . $locale->text('March') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="7" $checked > |
- . $locale->text('July') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="11" $checked > |
- . $locale->text('November') . qq|</td>
-
- </tr>
- <tr>
- <td> </td>
- <td><input name=duetyp class=radio type=radio value="D" $checked> 4. |
- . $locale->text('Quarter') . qq| </td>
- <td><input name=duetyp class=radio type=radio value="4" $checked > |
- . $locale->text('April') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="8" $checked > |
- . $locale->text('August') . qq|</td>
- <td><input name=duetyp class=radio type=radio value="12" $checked > |
- . $locale->text('December') . qq|</td>
-
- </tr>
- <tr>
- <td colspan=5><hr size=3 noshade></td>
- </tr>
- <tr>
- <th align=left>| . $locale->text('Method') . qq|</th>
- <td colspan=3><input name=method class=radio type=radio value=accrual $accrual>|
- . $locale->text('Accrual') . qq|
- <input name=method class=radio type=radio value=cash $cash>|
- . $locale->text('EUR') . qq|</td>
- </tr>
- <tr>
- <th colspan=4>|;
-##########
-
- &print_options();
- print qq|
- </th>
- </tr>
-|;
- }
-
- if ($form->{report} eq "balance_sheet") {
- print qq|
- <input type=hidden name=nextsub value=generate_balance_sheet>
- <tr>
- <th align=right>| . $locale->text('as at') . qq|</th>
- <td>
- $button1
- $button1_2
- </td>
- <th align=right nowrap>| . $locale->text('Compare to') . qq|</th>
- <td>
- $button2
- $button2_2
- </td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Decimalplaces') . qq|</th>
- <td><input name=decimalplaces size=3 value="2"></td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td>
- <table>
- <tr>
- <th align=right>| . $locale->text('Method') . qq|</th>
- <td colspan=3><input name=method class=radio type=radio value=accrual $accrual>|
- . $locale->text('Accrual') . qq|
- <input name=method class=radio type=radio value=cash $cash>|
- . $locale->text('EUR') . qq|</td>
- </tr>
-
- <tr>
- <th align=right nowrap>| . $locale->text('Include in Report') . qq|</th>
- <td><input name=l_heading class=checkbox type=checkbox value=Y> |
- . $locale->text('Heading') . qq|
- <input name=l_subtotal class=checkbox type=checkbox value=Y> |
- . $locale->text('Subtotal') . qq|
- <input name=l_accno class=checkbox type=checkbox value=Y> |
- . $locale->text('Account Number') . qq|</td>
- </tr>
-
-$jsscript
-|;
- }
-
- if ($form->{report} eq "trial_balance") {
- print qq|
- <input type=hidden name=nextsub value=generate_trial_balance>
- <input type=hidden name=eur value=$eur>
- <tr>
- <th align=right>| . $locale->text('From') . qq|</th>
- <td>
- $button1
- $button1_2
- </td>
- <th align=right>| . $locale->text('Bis') . qq|</th>
- <td>
- $button2
- $button2_2
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td>
- <table>
- <tr>
- <th align=right nowrap>| . $locale->text('Include in Report') . qq|</th>
- <td><input name=l_heading class=checkbox type=checkbox value=Y> |
- . $locale->text('Heading') . qq|
- <input name=l_subtotal class=checkbox type=checkbox value=Y> |
- . $locale->text('Subtotal') . qq|
- <input name=all_accounts class=checkbox type=checkbox value=Y> |
- . $locale->text('All Accounts') . qq|</td>
- </tr>
-
-$jsscript
-|;
- }
-
- if ($form->{report} =~ /^tax_/) {
- $gifi = "";
-
- $form->{db} = ($form->{report} =~ /_collected/) ? "ar" : "ap";
-
- RP->get_taxaccounts(\%myconfig, \%$form);
-
- print qq|
- <input type=hidden name=nextsub value=generate_tax_report>
- <tr>
- <th align=right>| . $locale->text('From') . qq|</th>
- <td><input name=fromdate size=11 title="$myconfig{dateformat}" value=$form->{fromdate}></td>
- <th align=right>| . $locale->text('Bis') . qq|</th>
- <td><input name=todate size=11 title="$myconfig{dateformat}"></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Report for') . qq|</th>
- <td colspan=3>
-|;
-
- $checked = "checked";
- foreach $ref (@{ $form->{taxaccounts} }) {
-
- print
- qq|<input name=accno class=radio type=radio value=$ref->{accno} $checked> $ref->{description}
-
- <input name="$ref->{accno}_description" type=hidden value="$ref->{description}">
- <input name="$ref->{accno}_rate" type=hidden value="$ref->{rate}">|;
-
- $checked = "";
-
- }
-
- print qq|
- <input type=hidden name=db value=$form->{db}>
- <input type=hidden name=sort value=transdate>
-
- </td>
- </tr>
-|;
-
- if (@{ $form->{gifi_taxaccounts} }) {
- print qq|
- <tr>
- <th align=right>| . $locale->text('GIFI') . qq|</th>
- <td colspan=3>
-|;