X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/7f8599c0909affd56ad82fd842015bb51c6a3dbf..a3ae31c:/bin/mozilla/rp.pl diff --git a/bin/mozilla/rp.pl b/bin/mozilla/rp.pl index 9f6d848fd..8062dad90 100644 --- a/bin/mozilla/rp.pl +++ b/bin/mozilla/rp.pl @@ -37,6 +37,7 @@ use POSIX qw(strftime); +use SL::DB::Default; use SL::DB::Project; use SL::PE; use SL::RP; @@ -94,8 +95,6 @@ use strict; # $locale->text('Receipts') # $locale->text('Payments') # $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') @@ -134,8 +133,6 @@ sub report { 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'), @@ -224,6 +221,10 @@ sub generate_income_statement { my %myconfig = %main::myconfig; my $locale = $main::locale; + my $defaults = SL::DB::Default->get; + $form->error($::locale->text('No print templates have been created for this client yet. Please do so in the client configuration.')) if !$defaults->templates; + $form->{templates} = $defaults->templates; + $form->{padding} = "  "; $form->{bold} = ""; $form->{endbold} = ""; @@ -374,12 +375,6 @@ sub generate_income_statement { . qq| $longcomparetodate|; } - # setup variables for the form - my @a = qw(company address businessnumber); - map { $form->{$_} = $myconfig{$_} } @a; - - $form->{templates} = $myconfig{templates}; - $form->{IN} = "income_statement.html"; $form->parse_template; @@ -391,6 +386,9 @@ sub generate_balance_sheet { $::lxdebug->enter_sub; $::auth->assert('report'); + my $defaults = SL::DB::Default->get; + $::form->error($::locale->text('No print templates have been created for this client yet. Please do so in the client configuration.')) if !$defaults->templates; + $::form->{templates} = $defaults->templates; $::form->{decimalplaces} = $::form->{decimalplaces} * 1 || 2; $::form->{padding} = "  "; $::form->{bold} = ""; @@ -413,11 +411,6 @@ sub generate_balance_sheet { # $::form->{IN} = "balance_sheet.html"; - # setup company variables for the form - map { $::form->{$_} = $::myconfig{$_} } qw(company address businessnumber nativecurr); - - $::form->{templates} = $::myconfig{templates}; - $::form->header; print $::form->parse_html_template('rp/balance_sheet', $data); @@ -459,6 +452,7 @@ sub generate_trial_balance { my $form = $main::form; my %myconfig = %main::myconfig; my $locale = $main::locale; + my $defaults = SL::DB::Default->get; if ($form->{reporttype} eq "custom") { @@ -620,7 +614,7 @@ sub generate_trial_balance { $form->{print_date} = $locale->text('Create Date') . " " . $locale->date(\%myconfig, $form->current_date(\%myconfig), 0); push (@options, $form->{print_date}); - $form->{company} = $locale->text('Company') . " " . $myconfig{company}; + $form->{company} = $locale->text('Company') . " " . $defaults->company; push (@options, $form->{company}); @@ -973,7 +967,7 @@ sub aging { $report->set_columns(%column_defs); $report->set_column_order(@columns); - my @hidden_variables = qw(todate customer vendor arap title ct); + my @hidden_variables = qw(todate customer vendor arap title ct fordate reporttype); $report->set_export_options('generate_' . ($form->{arap} eq 'ar' ? 'ar' : 'ap') . '_aging', @hidden_variables); my @options; @@ -1199,9 +1193,11 @@ sub print_form { my %myconfig = %main::myconfig; my $locale = $main::locale; - $form->{statementdate} = $locale->date(\%myconfig, $form->{todate}, 1); + my $defaults = SL::DB::Default->get; + $form->error($::locale->text('No print templates have been created for this client yet. Please do so in the client configuration.')) if !$defaults->templates; + $form->{templates} = $defaults->templates; - $form->{templates} = "$myconfig{templates}"; + $form->{statementdate} = $locale->date(\%myconfig, $form->{todate}, 1); my $suffix = "html"; my $attachment_suffix = "html"; @@ -1635,6 +1631,10 @@ sub generate_bwa { my %myconfig = %main::myconfig; my $locale = $main::locale; + my $defaults = SL::DB::Default->get; + $form->error($::locale->text('No print templates have been created for this client yet. Please do so in the client configuration.')) if !$defaults->templates; + $form->{templates} = $defaults->templates; + $form->{padding} = "  "; $form->{bold} = ""; $form->{endbold} = ""; @@ -1822,11 +1822,6 @@ sub generate_bwa { . qq| $longtodate|; } - # setup variables for the form - my @a = qw(company address businessnumber); - map { $form->{$_} = $myconfig{$_} } @a; - $form->{templates} = $myconfig{templates}; - $form->{IN} = "bwa.html"; $form->parse_template;