X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Frp.pl;h=9f6d848fd7e3e240e76a0504d653b4b9d298fa0f;hb=7f8599c0909affd56ad82fd842015bb51c6a3dbf;hp=f6abae908e936845361605fe12941f3b9b92e1df;hpb=ad5a6910a9b76e1f42b24832f92010ee2c903012;p=kivitendo-erp.git diff --git a/bin/mozilla/rp.pl b/bin/mozilla/rp.pl index f6abae908..9f6d848fd 100644 --- a/bin/mozilla/rp.pl +++ b/bin/mozilla/rp.pl @@ -14,8 +14,8 @@ # # Contributors: Antonio Gallardo # Benjamin Lee -# Philip Reetz -# Udo Spallek +# Philip Reetz +# Udo Spallek # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -37,19 +37,22 @@ 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"; require "bin/mozilla/reportgenerator.pl"; -1; - -# end of main +# note: this file was particularly hard to strictify. +# alot of the vars are passed carelessly between invocations +# should there be any missing vars, declare them globally +use strict; # this is for our long dates # $locale->text('January') @@ -84,6 +87,8 @@ require "bin/mozilla/reportgenerator.pl"; # $locale->text('Trial Balance') # $locale->text('AR Aging') # $locale->text('AP Aging') +# $locale->text('Search AR Aging') +# $locale->text('Search AP Aging') # $locale->text('Tax collected') # $locale->text('Tax paid') # $locale->text('Receipts') @@ -91,6 +96,7 @@ require "bin/mozilla/reportgenerator.pl"; # $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') @@ -107,820 +113,116 @@ my $rp_access_map = { }; sub check_rp_access { + my $form = $main::form; + my $right = $rp_access_map->{$form->{report}}; $right ||= 'DOES_NOT_EXIST'; - $auth->assert($right); + $main::auth->assert($right); } sub report { - $lxdebug->enter_sub(); + $::lxdebug->enter_sub; check_rp_access(); - %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',); - - $form->{title} = $locale->text($title{ $form->{report} }); - - $accrual = ($eur) ? "" : "checked"; - $cash = ($eur) ? "checked" : ""; + my %title = ( + balance_sheet => $::locale->text('Balance Sheet'), + income_statement => $::locale->text('Income Statement'), + trial_balance => $::locale->text('Trial Balance'), + ar_aging => $::locale->text('Search AR Aging'), + 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'), + bwa => $::locale->text('Business evaluation'), + ); - $year = (localtime)[5] + 1900; + $::form->{title} = $title{$::form->{report}}; # get departments - $form->all_departments(\%myconfig); - if (@{ $form->{all_departments} }) { - $form->{selectdepartment} = "