X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Frp.pl;h=25e62594e0ebe2c9353efa972f148d9c4c3456f4;hb=e9b11e128378926d08c0e468603627aa7617ce10;hp=5115ddd35e3ea9c5b3ef7830223135d9ad35aff5;hpb=08c340d2caca21066fd8797e29f07facfde7a07c;p=kivitendo-erp.git diff --git a/bin/mozilla/rp.pl b/bin/mozilla/rp.pl index 5115ddd35..630a2b5bd 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 @@ -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,13 +38,17 @@ use POSIX qw(strftime); -use SL::PE; +use SL::DB::Default; +use SL::DB::Project; +use SL::DB::Customer; use SL::RP; use SL::Iconv; +use SL::Locale::String qw(t8); +use SL::Presenter::Tag; 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"; @@ -85,32 +90,31 @@ use strict; # $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') # $locale->text('Payments') # $locale->text('Project Transactions') -# $locale->text('Non-taxable Sales') -# $locale->text('Non-taxable Purchases') +# $locale->text('Business evaluation') +# $locale->text('Final Invoice, please use mark as paid manually') # $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', }; -# 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; @@ -121,825 +125,103 @@ sub check_rp_access { } sub report { - $main::lxdebug->enter_sub(); + $::lxdebug->enter_sub; check_rp_access(); - 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', - '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', + 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'), + tax_collected => $::locale->text('Tax collected'), + tax_paid => $::locale->text('Tax paid'), + receipts => $::locale->text('Receipts'), + payments => $::locale->text('Payments'), + projects => $::locale->text('Project Transactions'), + bwa => $::locale->text('Business evaluation'), ); - $form->{title} = $locale->text($title{ $form->{report} }); - - my $accrual = ($main::eur) ? "" : "checked"; - my $cash = ($main::eur) ? "checked" : ""; - - my $year = (localtime)[5] + 1900; + $::form->{title} = $title{$::form->{report}}; + $::request->{layout}->add_javascripts('kivi.CustomerVendor.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); - if (@{ $form->{all_departments} }) { - $form->{selectdepartment} = "