X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Frp.pl;h=41148c8e8363589f371f4067c3c2d71a0e573fcc;hb=35b8018a80c96a075a1107dbef9eefbb9e0f59b8;hp=32ec6efb0073ab1bce035eff4fa29404bf93c067;hpb=8d19aa002666b22761822ba2fdc8be4ee204c5f1;p=kivitendo-erp.git diff --git a/bin/mozilla/rp.pl b/bin/mozilla/rp.pl index 32ec6efb0..41148c8e8 100644 --- a/bin/mozilla/rp.pl +++ b/bin/mozilla/rp.pl @@ -35,10 +35,17 @@ # #====================================================================== -require "$form->{path}/arap.pl"; +use POSIX qw(strftime); use SL::PE; use SL::RP; +use SL::Iconv; +use SL::ReportGenerator; +use Data::Dumper; + +require "bin/mozilla/arap.pl"; +require "bin/mozilla/common.pl"; +require "bin/mozilla/reportgenerator.pl"; 1; @@ -85,9 +92,32 @@ use SL::RP; # $locale->text('Non-taxable Sales') # $locale->text('Non-taxable Purchases') +# $form->parse_html_template('rp/html_report_susa') + +my $rp_access_map = { + 'projects' => 'report', + 'ar_aging' => 'general_ledger', + 'ap_aging' => 'general_ledger', + 'receipts' => 'cash', + 'payments' => 'cash', + 'trial_balance' => 'report', + 'income_statement' => 'report', + 'bwa' => 'report', + 'balance_sheet' => 'report', +}; + +sub check_rp_access { + my $right = $rp_access_map->{$form->{report}}; + $right ||= 'DOES_NOT_EXIST'; + + $auth->assert($right); +} + sub report { $lxdebug->enter_sub(); + check_rp_access(); + %title = ('balance_sheet' => 'Balance Sheet', 'income_statement' => 'Income Statement', 'trial_balance' => 'Trial Balance', @@ -100,27 +130,20 @@ sub report { 'receipts' => 'Receipts', 'payments' => 'Payments', 'projects' => 'Project Transactions', - 'bwa' => 'Betriebswirtschaftliche Auswertung', - 'ustva' => 'Umsatzsteuervoranmeldung',); + 'bwa' => 'Betriebswirtschaftliche Auswertung',); $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; + $year = (localtime)[5] + 1900; # get departments $form->all_departments(\%myconfig); if (@{ $form->{all_departments} }) { $form->{selectdepartment} = "