X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Frp.pl;h=966df6e025f5132cf60b4d44561dd9d5a5892475;hb=9d0ebf2831c46d1be13fb79cb3627a05f6681376;hp=5772e1697e0a49fade7a48efbe06f107b77f82a1;hpb=d319704a66e9be64da837ccea10af6774c2b0838;p=kivitendo-erp.git
diff --git a/bin/mozilla/rp.pl b/bin/mozilla/rp.pl
index 5772e1697..966df6e02 100644
--- a/bin/mozilla/rp.pl
+++ b/bin/mozilla/rp.pl
@@ -36,6 +36,7 @@
#======================================================================
require "$form->{path}/arap.pl";
+require "bin/mozilla/common.pl";
use SL::PE;
use SL::RP;
@@ -130,6 +131,21 @@ sub report {
| if $form->{selectdepartment};
+ $form->get_lists("projects" => { "key" => "ALL_PROJECTS",
+ "all" => 1 });
+
+ my %project_labels = ();
+ my @project_values = ("");
+ foreach my $item (@{ $form->{"ALL_PROJECTS"} }) {
+ push(@project_values, $item->{"id"});
+ $project_labels{$item->{"id"}} = $item->{"projectnumber"};
+ }
+
+ my $projectnumber =
+ NTI($cgi->popup_menu('-name' => "project_id",
+ '-values' => \@project_values,
+ '-labels' => \%project_labels));
+
# use JavaScript Calendar or not
$form->{jsscript} = $jscalendar;
$jsscript = "";
@@ -137,13 +153,13 @@ sub report {
$department = "";
} else {
if ($form->{report} eq "balance_sheet") {
- $name_1 = "compareasofdate";
- $id_1 = "compareasofdate";
- $value_1 = "";
+ $name_1 = "asofdate";
+ $id_1 = "asofdate";
+ $value_1 = "$form->{asofdate}";
$trigger_1 = "trigger1";
- $name_2 = "asofdate";
- $id_2 = "asofdate";
- $value_2 = "$form->{asofdate}";
+ $name_2 = "compareasofdate";
+ $id_2 = "compareasofdate";
+ $value_2 = "$form->{compareasofdate}";
$trigger_2 = "trigger2";
} elsif ($form->{report} =~ /(receipts|payments)$/) {
$name_1 = "fromdate";
@@ -190,8 +206,7 @@ sub report {
#write Trigger
$jsscript =
- Form->write_trigger(\%myconfig, "1", "$name_2", "BR", "$trigger_2", "",
- "", "");
+ Form->write_trigger(\%myconfig, "1", "$name_2", "BR", "$trigger_2");
} else {
$button1 = qq|
|;
@@ -200,7 +215,7 @@ sub report {
. $locale->text('button') . qq|>|;
$button2 = qq|
|;
- $button2_2 = qq|
+ $button2_2 = qq|
text('button') . qq|>
|;
@@ -270,8 +285,7 @@ sub report {
|
. $locale->text('Heading') . qq|
|
- . $locale->text('Subtotal')
- . qq| |
+ . $locale->text('Subtotal') . qq|
$jsscript
@@ -282,21 +296,19 @@ $jsscript
print qq|
| . $locale->text('Project') . qq| |
-
+ | $projectnumber |
@@ -688,8 +649,7 @@ $checked>
|
. $locale->text('Accrual') . qq|
|
- . $locale->text('EUR')
- . qq| |
+ . $locale->text('EUR') . qq|
@@ -699,10 +659,9 @@ $checked>
|
. $locale->text('Subtotal') . qq|
|
- . $locale->text('Account Number')
- . qq|
+ . $locale->text('Account Number') . qq|
-
+
$jsscript
|;
}
@@ -736,10 +695,9 @@ $jsscript
|
. $locale->text('Subtotal') . qq|
|
- . $locale->text('All Accounts')
- . qq|
+ . $locale->text('All Accounts') . qq|
-
+
$jsscript
|;
}
@@ -814,8 +772,7 @@ $jsscript
|
. $locale->text('Accrual') . qq|
|
- . $locale->text('EUR')
- . qq| |
+ . $locale->text('EUR') . qq|
@@ -888,8 +845,7 @@ $jsscript
|
. $locale->text('Accrual') . qq|
|
- . $locale->text('EUR')
- . qq| |
+ . $locale->text('EUR') . qq|
| . $locale->text('Include in Report') . qq| |
@@ -974,7 +930,7 @@ $jsscript
-
+
$jsscript
|;
}
@@ -1031,12 +987,11 @@ $jsscript
|
|
- . $locale->text('Include Exchangerate Difference')
- . qq|
+ . $locale->text('Include Exchangerate Difference') . qq|
|
-$jsscript
-
+$jsscript
+
{db}>
|;
@@ -1123,10 +1078,6 @@ sub generate_income_statement {
$form->{endbold} = "";
$form->{br} = "
";
- &get_project(generate_income_statement);
-
- $form->{projectnumber} = $form->{projectnumber_1};
-
if ($form->{reporttype} eq "custom") {
#forgotten the year --> thisyear
@@ -1249,10 +1200,10 @@ sub generate_income_statement {
$longfromdate = $locale->date(\%myconfig, $form->{fromdate}, 1);
$shortfromdate = $locale->date(\%myconfig, $form->{fromdate}, 0);
- $form->{this_period} = "$shortfromdate
\n$shorttodate";
+ $form->{this_period} = "$shortfromdate\n$shorttodate";
$form->{period} =
$locale->text('for Period')
- . qq|
\n$longfromdate |
+ . qq|\n$longfromdate |
. $locale->text('Bis')
. qq| $longtodate|;
}
@@ -1266,9 +1217,9 @@ sub generate_income_statement {
$longcomparetodate = $locale->date(\%myconfig, $form->{comparetodate}, 1);
$shortcomparetodate = $locale->date(\%myconfig, $form->{comparetodate}, 0);
- $form->{last_period} = "$shortcomparefromdate
\n$shortcomparetodate";
+ $form->{last_period} = "$shortcomparefromdate\n$shortcomparetodate";
$form->{period} .=
- "
\n$longcomparefromdate "
+ "\n$longcomparefromdate "
. $locale->text('Bis')
. qq| $longcomparetodate|;
}
@@ -1276,7 +1227,6 @@ sub generate_income_statement {
# setup variables for the form
@a = qw(company address businessnumber);
map { $form->{$_} = $myconfig{$_} } @a;
- $form->{address} =~ s/\\n/
/g;
$form->{templates} = $myconfig{templates};
@@ -1315,9 +1265,9 @@ sub generate_balance_sheet {
$form->{IN} = "balance_sheet.html";
# setup company variables for the form
- map { $form->{$_} = $myconfig{$_} }
+ map { $form->{$_} = $myconfig{$_};
+ $form->{$_} =~ s/\\n/\n/g; }
(qw(company address businessnumber nativecurr));
- $form->{address} =~ s/\\n/
/g;
$form->{templates} = $myconfig{templates};
@@ -1455,8 +1405,8 @@ sub list_accounts {
$ml = ($ref->{category} =~ /(A|C|E)/) ? -1 : 1;
- $debit = $form->format_amount(\%myconfig, $ref->{debit}, 2, " ");
- $credit = $form->format_amount(\%myconfig, $ref->{credit}, 2, " ");
+ $debit = ($ref->{debit} != 0) ? $form->format_amount(\%myconfig, $ref->{debit}, 2, " ") : " ";
+ $credit = ($ref->{credit} != 0) ? $form->format_amount(\%myconfig, $ref->{credit}, 2, " ") : " ";
$begbalance =
$form->format_amount(\%myconfig, $ref->{balance} * $ml, 2, " ");
$endbalance =
@@ -1735,14 +1685,14 @@ sub aging {
$i++;
if ($subtotal) {
- $c0subtotal =
- $form->format_amount(\%myconfig, $c0subtotal, 2, " ");
- $c30subtotal =
- $form->format_amount(\%myconfig, $c30subtotal, 2, " ");
- $c60subtotal =
- $form->format_amount(\%myconfig, $c60subtotal, 2, " ");
- $c90subtotal =
- $form->format_amount(\%myconfig, $c90subtotal, 2, " ");
+ $c0subtotal = ($c0subtotal != 0) ?
+ $form->format_amount(\%myconfig, $c0subtotal, 2, " ") : "";
+ $c30subtotal = ($c30subtotal != 0) ?
+ $form->format_amount(\%myconfig, $c30subtotal, 2, " ") : "";
+ $c60subtotal = ($c60subtotal != 0) ?
+ $form->format_amount(\%myconfig, $c60subtotal, 2, " ") : "";
+ $c90subtotal = ($c90subtotal != 0) ?
+ $form->format_amount(\%myconfig, $c90subtotal, 2, " ") : "";
}
$column_data{ct} = qq| | |;
@@ -1798,10 +1748,10 @@ sub aging {
$c60total += $ref->{c60};
$c90total += $ref->{c90};
- $ref->{c0} = $form->format_amount(\%myconfig, $ref->{c0}, 2, " ");
- $ref->{c30} = $form->format_amount(\%myconfig, $ref->{c30}, 2, " ");
- $ref->{c60} = $form->format_amount(\%myconfig, $ref->{c60}, 2, " ");
- $ref->{c90} = $form->format_amount(\%myconfig, $ref->{c90}, 2, " ");
+ $ref->{c0} = ($ref->{c0} != 0) ? $form->format_amount(\%myconfig, $ref->{c0}, 2, " ") : "";
+ $ref->{c30} = ($ref->{c30} != 0) ? $form->format_amount(\%myconfig, $ref->{c30}, 2, " ") : "";
+ $ref->{c60} = ($ref->{c60} != 0) ? $form->format_amount(\%myconfig, $ref->{c60}, 2, " ") : "";
+ $ref->{c90} = ($ref->{c90} != 0) ? $form->format_amount(\%myconfig, $ref->{c90}, 2, " ") : "";
$href =
qq|$ref->{module}.pl?path=$form->{path}&action=edit&id=$ref->{id}&login=$form->{login}&password=$form->{password}&callback=|
@@ -1906,23 +1856,17 @@ sub aging {
{path}>
{login}>
{password}>
-
+
-|;
- }
-
- if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
- &menubar;
- }
+ . $locale->text('E-mail') . qq|">|;
+}
- print qq|
+print qq|