X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Frp.pl;h=f618c5b69226570dab2c760f5fdc6bcc74271205;hb=26456e6e241a4487e5b52c70e36d275eb073db5b;hp=33bba42a911622e53db1a2c896ee2d7b93465402;hpb=f50a5cf37c61c72a11c215e82e117e19e27fcdaf;p=kivitendo-erp.git diff --git a/bin/mozilla/rp.pl b/bin/mozilla/rp.pl index 33bba42a9..f618c5b69 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 @@ -41,14 +41,16 @@ 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; - -# 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') @@ -105,19 +107,30 @@ my $rp_access_map = { 'balance_sheet' => 'report', }; +# subs use these pretty freely, so declare them here +our (%column_data, @column_index); +our ($subtotalnetamount, $subtotaltax, $subtotal); + 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(); + $main::lxdebug->enter_sub(); check_rp_access(); - %title = ('balance_sheet' => 'Balance Sheet', + my $form = $main::form; + my %myconfig = %main::myconfig; + my $locale = $main::locale; + + my %title = ( + 'balance_sheet' => 'Balance Sheet', 'income_statement' => 'Income Statement', 'trial_balance' => 'Trial Balance', 'ar_aging' => 'AR Aging', @@ -129,27 +142,28 @@ sub report { 'receipts' => 'Receipts', 'payments' => 'Payments', 'projects' => 'Project Transactions', - 'bwa' => 'Betriebswirtschaftliche Auswertung',); + 'bwa' => 'Betriebswirtschaftliche Auswertung', + ); $form->{title} = $locale->text($title{ $form->{report} }); - $accrual = ($eur) ? "" : "checked"; - $cash = ($eur) ? "checked" : ""; + my $accrual = ($main::eur) ? "" : "checked"; + my $cash = ($main::eur) ? "checked" : ""; - $year = (localtime)[5] + 1900; + my $year = (localtime)[5] + 1900; # get departments $form->all_departments(\%myconfig); - if (@{ $form->{all_departments} }) { + if (@{ $form->{all_departments} || [] }) { $form->{selectdepartment} = "