- my ($date,$date2,$time,@events) = @_;
- my $output = ' \Fee{'.strftime('%A, %B %e, %H:%M',localtime(UnixDate($date,'%s'))).
- ' to '.strftime('%H:%M %Z',localtime(UnixDate($date2,'%s')))."\n".
- ' \begin{itemize*}'."\n";
- $output .= join('',map {" \\item $_\n"} @events);
- $output .= ' \end{itemize*}}{50.00}{'.$time.'}'."\n";
+ my %param = validate_with(params => \@_,
+ spec => {time => {type => SCALAR,
+ },
+ date => {type => SCALAR,
+ },
+ date2 => {type => SCALAR,
+ },
+ total => {type => SCALARREF,
+ },
+ events => {type => ARRAYREF,
+ },
+ },
+ );
+ ${$param{total}} += $param{time} * $options{hourly_fee};
+
+# $param{date} =~ s/\s+\d+\:\d+\:\d+\s+[A-Z]{0,3}\s*//;
+ my $output = '\hline'."\n".' \mbox{'.strftime('%A, %B %e, %H:%M',localtime($param{date})).
+ ' to '.strftime('%H:%M %Z',localtime($param{date2}))."}\n\n".
+ ' \begin{itemize*}'."\n";
+ $output .= join('',map { s/_/\\_/g; " \\item $_\n";} @{$param{events}});
+ $output .= ' \end{itemize*} & \$'.sprintf('%.2f',$options{hourly_fee}).' & '.sprintf('%.2f',$param{time}).
+ ' & \$'.sprintf('%.2f',$param{time}*$options{hourly_fee}).' & \$'.
+ sprintf('%.2f',${$param{total}}) .
+ " \\\\\n";