[BACK]Return to report_time CVS log [TXT][DIR] Up to [local] / RT / Invoicing

Diff for /RT/Invoicing/report_time between version 1.4 and 1.5

version 1.4, 2020/08/04 02:24:44 version 1.5, 2020/08/04 02:28:24
Line 1 
Line 1 
 #!/usr/bin/perl  #!/usr/bin/perl
 # $AFresh1: report_time,v 1.3 2020/08/04 01:23:48 afresh1 Exp $  # $AFresh1: report_time,v 1.4 2020/08/04 01:24:44 afresh1 Exp $
 use v5.16;  use v5.16;
 use warnings;  use warnings;
   
Line 74 
Line 74 
         }          }
 }  }
   
   my $total = 0;
 foreach my $date ( sort keys %total ) {  foreach my $date ( sort keys %total ) {
           my $subtotal = 0;
         foreach my $key ( sort keys %{ $total{$date} } ) {          foreach my $key ( sort keys %{ $total{$date} } ) {
                 my $hours = $total{$date}{$key}->hours;                  my $hours = $total{$date}{$key}->hours;
   
                 # round to the quarter hour                  # round to the quarter hour
                 $hours = sprintf "%.2f",                  $hours = sprintf "%.02f",
                     25 * sprintf "%.2f", $hours / 25;                      25 * sprintf "%.02f", $hours / 25;
   
                 say "$date $hours $key";# if $hours != 0;                  say "$date $hours $key" if $hours != 0;
   
                   $subtotal += $hours;
                   $total    += $hours;
         }          }
           printf "# %s %.02f\n", $date, $subtotal;
 }  }
   printf "# Total %.02f\n", $total;
   
 sub descr_to_key {  sub descr_to_key {
         my ($descr) = @_;          my ($descr) = @_;

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>