$form->{jsscript} = 1;
$form->{callback} ||= build_std_url("action=show_invoices", qw(login password customer invnumber ordnumber groupinvoices minamount dunning_level notes));
- $form->{PRINT_OPTIONS} = print_options({ 'inline' => 1,
- 'no_queue' => 1,
- 'no_postscript' => 1,
- 'no_html' => 1,
- 'no_opendocument' => 1, });
+ $form->{PRINT_OPTIONS} = print_options('inline' => 1,
+ 'no_queue' => 1,
+ 'no_postscript' => 1,
+ 'no_html' => 1,
+ 'no_opendocument' => 1,);
$form->header();
print $form->parse_html_template("dunning/show_invoices");
'languages' => 'languages');
$form->{type} = 'dunning';
- $form->{PRINT_OPTIONS} = print_options({ 'inline' => 1,
- 'no_queue' => 1,
- 'no_postscript' => 1,
- 'no_html' => 1,
- 'no_opendocument' => 1, });
+ $form->{PRINT_OPTIONS} = print_options('inline' => 1,
+ 'no_queue' => 1,
+ 'no_postscript' => 1,
+ 'no_html' => 1,
+ 'no_opendocument' => 1,);
$form->{title} = $locale->text('Dunning overview');
my $report = SL::ReportGenerator->new(\%myconfig, $form);
sub print_options {
$lxdebug->enter_sub();
- my ($options) = @_;
-
- $options ||= { };
+ my %options = @_;
# names 3 parameters and returns a hashref, for use in templates
sub opthash { +{ value => shift, selected => shift, oname => shift } }
opthash("screen", $form->{OP}{screen}, $locale->text('Screen')),
(scalar @{ $form->{printers} } && $latex_templates) ?
opthash("printer", $form->{OP}{printer}, $locale->text('Printer')) : undef,
- ($latex_templates && !$options->{no_queue}) ?
+ ($latex_templates && !$options{no_queue}) ?
opthash("queue", $form->{OP}{queue}, $locale->text('Queue')) : undef
if ($form->{media} ne 'email');
push @FORMAT, grep $_,
($opendocument_templates && $openofficeorg_writer_bin && $xvfb_bin && (-x $openofficeorg_writer_bin) && (-x $xvfb_bin)
- && !$options->{no_opendocument_pdf}) ?
+ && !$options{no_opendocument_pdf}) ?
opthash("opendocument_pdf", $form->{DF}{"opendocument_pdf"}, $locale->text("PDF (OpenDocument/OASIS)")) : undef,
($latex_templates) ?
opthash("pdf", $form->{DF}{pdf}, $locale->text('PDF')) : undef,
- ($latex_templates && !$options->{no_postscript}) ?
+ ($latex_templates && !$options{no_postscript}) ?
opthash("postscript", $form->{DF}{postscript}, $locale->text('Postscript')) : undef,
- (!$options->{no_html}) ?
+ (!$options{no_html}) ?
opthash("html", $form->{DF}{html}, "HTML") : undef,
- ($opendocument_templates && !$options->{no_opendocument}) ?
+ ($opendocument_templates && !$options{no_opendocument}) ?
opthash("opendocument", $form->{DF}{opendocument}, $locale->text("OpenDocument/OASIS")) : undef;
push @LANGUAGE_ID,
map { opthash($_->{id}, ($_->{id} eq $form->{printer_id} ? 'selected' : ''), $_->{printer_description}) } +{}, @{ $form->{printers} }
if ((ref $form->{printers} eq 'ARRAY') && scalar @{ $form->{printers } });
- @SELECTS = map { sname => lc $_, DATA => \@$_, show => scalar @$_ }, qw(FORMNAME LANGUAGE_ID FORMAT SENDMODE MEDIA PRINTER_ID);
+ @SELECTS = map { sname => lc $_, DATA => \@$_, show => !$options{"hide_" . lc($_)} && scalar @$_ }, qw(FORMNAME LANGUAGE_ID FORMAT SENDMODE MEDIA PRINTER_ID);
my %dont_display_groupitems = (
'dunning' => 1,
my $print_options = $form->parse_html_template("generic/print_options", { SELECTS => \@SELECTS, %template_vars } );
- if ($options->{inline}) {
+ if ($options{inline}) {
$lxdebug->leave_sub() and return $print_options;
} else {
print $print_options; $lxdebug->leave_sub();