use POSIX qw(strftime);
+use SL::DB::Default;
use SL::DB::Project;
use SL::PE;
use SL::RP;
$::form->all_vc(\%::myconfig, $::form->{vc}, $is_sales ? "AR" : "AP");
$vc .= "<option>$_->{name}--$_->{id}\n" for @{ $::form->{"all_$::form->{vc}"} };
$vc = ($vc)
- ? qq|<select name=$::form->{vc}><option>\n$vc</select>|
- : qq|<input name=$::form->{vc} size=35>|;
+ ? qq|<select name=$::form->{vc} class="initial_focus"><option>\n$vc</select>|
+ : qq|<input name=$::form->{vc} size=35 class="initial_focus">|;
}
my ($selection, $paymentaccounts);
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>";
. 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;
$::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->{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);
my $form = $main::form;
my %myconfig = %main::myconfig;
my $locale = $main::locale;
+ my $defaults = SL::DB::Default->get;
if ($form->{reporttype} eq "custom") {
$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});
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";
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>";
. 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;