[BACK]Return to rt_invoices.pl CVS log [TXT][DIR] Up to [local] / RT / Invoicing

Diff for /RT/Invoicing/rt_invoices.pl between version 1.23 and 1.24

version 1.23, 2011/04/08 19:00:16 version 1.24, 2011/04/12 20:32:15
Line 1 
Line 1 
 #!/usr/bin/perl  #!/usr/bin/perl
 # $AFresh1: rt_invoices.pl,v 1.22 2011/04/08 17:10:28 andrew Exp $  # $AFresh1: rt_invoices.pl,v 1.23 2011/04/08 18:00:16 andrew Exp $
 ########################################################################  ########################################################################
 # Copyright (c) 2011 Andrew Fresh <andrew@afresh1.com>  # Copyright (c) 2011 Andrew Fresh <andrew@afresh1.com>
 #  #
Line 322 
Line 322 
         default { die "Unknown per [$per]\n" }          default { die "Unknown per [$per]\n" }
     }      }
   
     my $billends = DateTime->now->set( hour => 0, minute => 0, second => 0 );      my $billends = DateTime->now
           ->subtract( days => 1 )
           ->set( hour => 23, minute => 59, second => 59 );
   
     # XXX This is helpful, but monthly and billday > 28 == !!!      # XXX This is helpful, but monthly and billday > 28 == !!!
     $billends->subtract( days => 1 )      $billends->subtract( days => 1 )
         while $day && $billends->$day_method != $day;          while $day && $billends->$day_method != $day;
   
     my $date = $billends->clone->subtract( $per => $freq );      my $date = $billends->clone->subtract( $per => $freq )
           ->set( hour => 0, minute => 0, second => 0 );
   
     my %invoice = ( end => $billends->clone->subtract( seconds => 1 ) );      my %invoice = ( end => $billends->clone->subtract( seconds => 1 ) );
   
Line 345 
Line 348 
   
     # Is the start date more than $freq $per before the end date?      # Is the start date more than $freq $per before the end date?
     my $diff = $billends - $date;      my $diff = $billends - $date;
     return unless $diff->subtract( $per => $freq )->is_positive;      return if $diff->in_units($per) < 1;
   
     if ( $cust->{base_rate} ) {      if ( $cust->{base_rate} ) {
         my ( $project, $hours ) = make_base_project(          my ( $project, $hours ) = make_base_project(

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

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