[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.47 and 1.50

version 1.47, 2012/01/31 04:36:28 version 1.50, 2013/06/20 05:36:06
Line 1 
Line 1 
 #!/usr/bin/perl  #!/usr/bin/perl
 # $AFresh1: rt_invoices.pl,v 1.46 2012/01/27 04:13:45 andrew Exp $  # $AFresh1: rt_invoices.pl,v 1.49 2013/02/05 03:41:58 andrew Exp $
 ########################################################################  ########################################################################
 # Copyright (c) 2011 Andrew Fresh <andrew@afresh1.com>  # Copyright (c) 2011 Andrew Fresh <andrew@afresh1.com>
 #  #
Line 189 
Line 189 
     }      }
 }  }
   
   if ( my $credits = $state->credits ) {
       foreach my $custid ( keys %{$credits} ) {
   
           my $cust;
           foreach ( @{$customers} ) {
               if ( $_->{id} eq $custid ) {
                   $cust = $_;
                   last;
               }
           }
   
           next unless $cust;
           next unless $cust->{invoice};
           next unless $credits->{$custid} < 0;
   
           $cust->{invoice}->{credit} = $credits->{$custid};
   
           unshift @{ $cust->{invoice}->{projects} }, {
               title    => 'Credits',
               no_total => 1,
               fees     => [
                   {   contents => 'Available Credit',
                       count    => 1,
                       rate     => -$credits->{$custid},
                   }
               ],
           };
       }
   }
   
 foreach my $cust ( @{$customers} ) {  foreach my $cust ( @{$customers} ) {
     my $invoice = $cust->{invoice};      my $invoice = $cust->{invoice};
     next unless $invoice && $invoice->{projects} && @{ $invoice->{projects} };      next unless $invoice && $invoice->{projects} && @{ $invoice->{projects} };
Line 508 
Line 538 
     # XXX Only need $ticket for the alternate subject      # XXX Only need $ticket for the alternate subject
   
     my $work_time = sprintf "%.03f", $txn->time_taken / 60;      my $work_time = sprintf "%.03f", $txn->time_taken / 60;
     my $work_type = $txn->cf('WorkType');      my $work_type = $txn->cf('WorkType') || '';
   
     if ( $work_type =~ s/\s*Onsite//i ) {      if ( $work_type =~ s/\s*Onsite//i ) {
   

Legend:
Removed from v.1.47  
changed lines
  Added in v.1.50

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