X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Frp.pl;h=845b1be3d9fb13194e2eb1defa2e58507ec12a16;hb=ad5f1dc8d6f01309c09ba0ea74ec883ad0b86afc;hp=d455d5aae5f9ca221095dcdc146d016f61e75fb6;hpb=cf8a444d01e67f5b06345721632e55cdbedbc905;p=kivitendo-erp.git diff --git a/bin/mozilla/rp.pl b/bin/mozilla/rp.pl index d455d5aae..845b1be3d 100644 --- a/bin/mozilla/rp.pl +++ b/bin/mozilla/rp.pl @@ -28,7 +28,8 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1335, USA. #====================================================================== # # module for preparing Income Statement and Balance Sheet @@ -37,8 +38,9 @@ use POSIX qw(strftime); +use SL::DB::Default; use SL::DB::Project; -use SL::PE; +use SL::DB::Customer; use SL::RP; use SL::Iconv; use SL::ReportGenerator; @@ -99,15 +101,16 @@ use strict; # $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', + 'projects' => 'report', + 'ar_aging' => 'general_ledger', + 'ap_aging' => 'general_ledger', + 'receipts' => 'cash', + 'payments' => 'cash', + 'trial_balance' => 'report', + 'income_statement' => 'report', + 'erfolgsrechnung' => 'report', + 'bwa' => 'report', + 'balance_sheet' => 'report', }; sub check_rp_access { @@ -127,6 +130,7 @@ sub report { my %title = ( balance_sheet => $::locale->text('Balance Sheet'), income_statement => $::locale->text('Income Statement'), + erfolgsrechnung => $::locale->text('Erfolgsrechnung'), trial_balance => $::locale->text('Trial Balance'), ar_aging => $::locale->text('Search AR Aging'), ap_aging => $::locale->text('Search AP Aging'), @@ -139,6 +143,10 @@ sub report { ); $::form->{title} = $title{$::form->{report}}; + $::request->{layout}->add_javascripts('autocomplete_customer.js'); + $::request->{layout}->add_javascripts('autocomplete_project.js'); + $::form->{fromdate} = DateTime->today->truncate(to => 'year')->to_kivitendo; + $::form->{todate} = DateTime->today->truncate(to => 'year')->add(years => 1)->add(days => -1)->to_kivitendo; # get departments $::form->all_departments(\%::myconfig); @@ -149,13 +157,14 @@ sub report { $::form->get_lists("projects" => { "key" => "ALL_PROJECTS", "all" => 1 }); - my $is_projects = $::form->{report} eq "projects"; - my $is_income_statement = $::form->{report} eq "income_statement"; - my $is_bwa = $::form->{report} eq "bwa"; - my $is_balance_sheet = $::form->{report} eq "balance_sheet"; - my $is_trial_balance = $::form->{report} eq "trial_balance"; - my $is_aging = $::form->{report} =~ /^a[rp]_aging$/; - my $is_payments = $::form->{report} =~ /(receipts|payments)$/; + my $is_projects = $::form->{report} eq "projects"; + my $is_income_statement = $::form->{report} eq "income_statement"; + my $is_erfolgsrechnung = $::form->{report} eq "erfolgsrechnung"; + my $is_bwa = $::form->{report} eq "bwa"; + my $is_balance_sheet = $::form->{report} eq "balance_sheet"; + my $is_trial_balance = $::form->{report} eq "trial_balance"; + my $is_aging = $::form->{report} =~ /^a[rp]_aging$/; + my $is_payments = $::form->{report} =~ /(receipts|payments)$/; my ($label, $nextsub, $vc); if ($is_aging) { @@ -169,8 +178,8 @@ sub report { $::form->all_vc(\%::myconfig, $::form->{vc}, $is_sales ? "AR" : "AP"); $vc .= "