use SL::DB::Default;
use SL::DB::Project;
+use SL::DB::Customer;
use SL::PE;
use SL::RP;
use SL::Iconv;
);
$::form->{title} = $title{$::form->{report}};
+ $::request->{layout}->add_javascripts('autocomplete_customer.js');
# get departments
$::form->all_departments(\%::myconfig);
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} = "<b>";
$form->{endbold} = "</b>";
}
if ( $::instance_conf->get_profit_determination eq 'balance' ) {
- $form->{income_statement_title} = $locale->text('Income Statement');
+ $form->{title} = $locale->text('Income Statement');
} elsif ( $::instance_conf->get_profit_determination eq 'income' ) {
- $form->{income_statement_title} = $locale->text('Net Income Statement');
+ $form->{title} = $locale->text('Net Income Statement');
} else {
- $form->{income_statement_title} = "";
+ $form->{title} = "";
};
if ( $form->{method} eq 'cash' ) {
$form->{accounting_method} = "";
};
- $::form->{report_date} = $locale->text('Report date') . ": " . $::form->current_date;
-
- $form->{IN} = "income_statement.html";
+ $form->{report_date} = $locale->text('Report date') . ": " . $form->current_date;
- $form->parse_template;
+ $form->header;
+ print $form->parse_html_template('rp/income_statement');
$main::lxdebug->leave_sub();
}
$::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} = "<b>";
$form->{company} = $locale->text('Company') . " " . $defaults->company;
push (@options, $form->{company});
+ if ($::form->{customer_id}) {
+ my $customer = SL::DB::Manager::Customer->find_by(id => $::form->{customer_id});
+ push @options, $::locale->text('Customer') . ' ' . $customer->displayable_name;
+ }
+
$form->{template_to} = $locale->date(\%myconfig, $form->{todate}, 0);
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} = "<b>";
$form->{endbold} = "</b>";
# if (defined ($form->{fromdate|todate}=='..'))
# immer wahr
if ($form->{fromdate}){
- my ($yy, $mm, $dd) = $locale->parse_date(\%myconfig, $form->{fromdate});
- my $datetime = $locale->parse_date_to_object(\%myconfig, $form->{fromdate});
+ my $datetime = $locale->parse_date_to_object($form->{fromdate});
$datetime->set( month => 1,
day => 1);
$form->{comparefromdate} = $locale->format_date(\%::myconfig, $datetime);
. qq| $longtodate|;
}
- $form->{IN} = "bwa.html";
+ $form->{report_date} = $locale->text('Report date') . ": " . $form->current_date;
+
+ if ( $form->{method} eq 'cash' ) {
+ $form->{accounting_method} = $locale->text('Cash accounting');
+ } elsif ( $form->{method} eq 'accrual' ) {
+ $form->{accounting_method} = $locale->text('Accrual accounting');
+ } else {
+ $form->{accounting_method} = "";
+ };
+
+ $form->{title} = $locale->text('BWA');
- $form->parse_template;
+ $::request->layout->add_stylesheets('bwa.css');
+ $form->header;
+ print $form->parse_html_template('rp/bwa');
$main::lxdebug->leave_sub();
}