use Carp;
use CGI;
-use CGI::Ajax;
use List::Util qw(min max first);
use SL::CVar;
# calculate onhand
if ($form->{"id_$i"}) {
my $part = IC->get_basic_part_info(id => $form->{"id_$i"});
- my $onhand_color = 'color="#ff0000"' if $part->{onhand} < $part->{rop};
+ my $onhand_color = $part->{onhand} < $part->{rop} ? 'color="#ff0000"' : '';
push @ROW2, { value => sprintf "<b>%s</b> <font %s>%s %s</font>",
$locale->text('On Hand'),
$onhand_color,
subject => $subject,
print_options => print_options('inline' => 1),
HIDDEN => [ map +{ name => $_, value => $form->{$_} }, @hidden_keys ],
- SHOW_BCC => $myconfig{role} eq 'admin' });
+ SHOW_BCC => $::auth->assert('email_bcc', 'may fail') });
$main::lxdebug->leave_sub();
}
$output_longdates = 1;
}
+ # Store the output number format so that the template modules know
+ # how to parse the amounts back if requested.
+ $myconfig{output_numberformat} = $output_numberformat || $myconfig{numberformat};
+
($form->{employee}) = split /--/, $form->{employee};
# create the form variables
$extension = 'xls';
}
- my $email_extension = '_email' if (($form->{media} eq 'email') && (-f "$myconfig{templates}/$form->{formname}_email$form->{language}${printer_code}.${extension}"));
+ my $email_extension = (($form->{media} eq 'email') && (-f "$myconfig{templates}/$form->{formname}_email$form->{language}${printer_code}.${extension}")) ? '_email' : '';
$form->{IN} = "$form->{formname}${email_extension}$form->{language}${printer_code}.${extension}";