my $label = ucfirst($_);
$label =~ s/_/ /;
include('/elements/tr-input-date-field.html',{
- 'name' => $_,
- 'value' => $cgi->param($_) || '',
- 'label' => $label,
+ 'name' => $_,
+ 'value' => ( scalar($cgi->param($_)) || '' ),
+ 'label' => $label,
'noinit' => $noinit++
});
}
# set from/subject/html_body based on date range
$cgi->param('from',
- $opt{'conf'}->config('invoice_from')
+ $opt{'conf'}->config('invoice_from', $cust_main->agentnum)
);
# shortcut for common text
($cgi->param('end_date') ? ' through ' : '') .
$cgi->param('end_date');
- $cgi->param('subject',
- $opt{'conf'}->config('company_name') .
- ' statement for ' .
- $summary_text
- );
+ my $company_name = $opt{'conf'}->config('company_name', $cust_main->agentnum);
+
+ my $subject = "$company_name statement for $summary_text";
+
+ $cgi->param('subject', $subject);
$cgi->param('html_body',
- '<P>' .
- $opt{'conf'}->config('company_name') .
- ' statement of charges and payments for ' .
- $summary_text .
- "</P>" .
+ "<P>$subject</P>".
include('/elements/customer-statement.html',
'history' => [
$cust_main->payment_history(