X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Frp.pl;h=d455d5aae5f9ca221095dcdc146d016f61e75fb6;hb=937e37ad007405c6a3a389ee18006379ffecc073;hp=bc2eab6e2406328622d1b8d0a836fcbfe88573dc;hpb=e958a6f7392a515a4a9d9e24358c5a082015d370;p=kivitendo-erp.git diff --git a/bin/mozilla/rp.pl b/bin/mozilla/rp.pl index bc2eab6e2..d455d5aae 100644 --- a/bin/mozilla/rp.pl +++ b/bin/mozilla/rp.pl @@ -37,11 +37,13 @@ use POSIX qw(strftime); +use SL::DB::Project; use SL::PE; use SL::RP; use SL::Iconv; use SL::ReportGenerator; use Data::Dumper; +use List::MoreUtils qw(any); require "bin/mozilla/arap.pl"; require "bin/mozilla/common.pl"; @@ -92,8 +94,6 @@ use strict; # $locale->text('Receipts') # $locale->text('Payments') # $locale->text('Project Transactions') -# $locale->text('Non-taxable Sales') -# $locale->text('Non-taxable Purchases') # $locale->text('Business evaluation') # $form->parse_html_template('rp/html_report_susa') @@ -132,8 +132,6 @@ sub report { ap_aging => $::locale->text('Search AP Aging'), tax_collected => $::locale->text('Tax collected'), tax_paid => $::locale->text('Tax paid'), - nontaxable_sales => $::locale->text('Non-taxable Sales'), - nontaxable_purchases => $::locale->text('Non-taxable Purchases'), receipts => $::locale->text('Receipts'), payments => $::locale->text('Payments'), projects => $::locale->text('Project Transactions'), @@ -213,35 +211,6 @@ sub report { sub continue { call_sub($main::form->{"nextsub"}); } -sub get_project { - $main::lxdebug->enter_sub(); - - $main::auth->assert('report'); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - my $nextsub = shift; - - $form->{project_id} = $form->{project_id_1}; - if ($form->{projectnumber} && !$form->{project_id}) { - $form->{rowcount} = 1; - - # call this instead of update - $form->{update} = $nextsub; - $form->{projectnumber_1} = $form->{projectnumber}; - - delete $form->{sort}; - check_project('generate_projects'); - - # if there is one only, assign id - $form->{project_id} = $form->{project_id_1}; - } - - $main::lxdebug->leave_sub(); -} - sub generate_income_statement { $main::lxdebug->enter_sub(); @@ -460,8 +429,8 @@ sub generate_projects { my %myconfig = %main::myconfig; my $locale = $main::locale; - &get_project("generate_projects"); - $form->{projectnumber} = $form->{projectnumber_1}; + my $project = $form->{project_id} ? SL::DB::Project->new(id => $form->{project_id})->load : undef; + $form->{projectnumber} = $project ? $project->projectnumber : ''; $form->{nextsub} = "generate_projects"; $form->{title} = $locale->text('Project Transactions'); @@ -1000,7 +969,7 @@ sub aging { $report->set_columns(%column_defs); $report->set_column_order(@columns); - my @hidden_variables = qw(todate customer vendor arap title ct); + my @hidden_variables = qw(todate customer vendor arap title ct fordate reporttype); $report->set_export_options('generate_' . ($form->{arap} eq 'ar' ? 'ar' : 'ap') . '_aging', @hidden_variables); my @options;