=================================================================== RCS file: /cvs/RT/Invoicing/rt_invoices.pl,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- RT/Invoicing/rt_invoices.pl 2011/05/18 20:02:36 1.35 +++ RT/Invoicing/rt_invoices.pl 2011/05/18 20:03:17 1.36 @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $AFresh1: rt_invoices.pl,v 1.34 2011/05/07 02:34:17 andrew Exp $ +# $AFresh1: rt_invoices.pl,v 1.35 2011/05/18 19:02:36 andrew Exp $ ######################################################################## # Copyright (c) 2011 Andrew Fresh # @@ -97,7 +97,7 @@ my $hours = hours_for_date( $cust->{invoice}, $fee->{date} ); my $type = 'unknown'; - while ($type && $type ne 'default' ) { + while ( $type && $type ne 'default' ) { $type = exists $hours->{ $fee->{type} } && $hours->{ $fee->{type} } > 0 ? $fee->{type} : 'default'; @@ -116,7 +116,8 @@ if ($discount_time) { $cust->{invoice}->{discount}->{amount} += round( $discount_time * $fee->{rate} ); - $cust->{invoice}->{discount}->{hours}{$type} += $discount_time; + $cust->{invoice}->{discount}->{hours}{$type} + += $discount_time; $type = '' if $type eq 'default'; $fee->{detail} .= " $discount_time $type Hours Discounted"; @@ -132,8 +133,8 @@ next unless $invoice && $invoice->{projects} && @{ $invoice->{projects} }; my %li = ( - custid => $cust->{id}, - invdate => DateTime->now( time_zone => 'local' )->ymd, + custid => $cust->{id}, + invdate => DateTime->now( time_zone => 'local' )->ymd, transactions => [], ); @@ -473,7 +474,7 @@ while ( my $txn = $txn_i->() ) { next if $state->txn_is_invoiced( $txn->id ); - if (my $expense = make_expense( $txn, $ticket ) ) { + if ( my $expense = make_expense( $txn, $ticket ) ) { push @{ $project{expenses} }, $expense; $project{transactions}{ $txn->id } = 1; } @@ -497,7 +498,7 @@ } next if $invoice->{end} < $fee->{date}; - push @{ $project{fees} }, $fee; + push @{ $project{fees} }, $fee; $project{transactions}{ $txn->id } = 1; } @@ -513,6 +514,7 @@ my $work_type = $txn->cf('WorkType'); if ( $work_type =~ s/\s*Onsite//i ) { + # XXX Do something special for onsite activities } @@ -549,6 +551,7 @@ . ( $txn->data || $ticket->subject ), amount => $amount, date => ymd_to_DateTime( $txn->created ), + # detail => ???, );