version 1.47, 2012/01/31 04:36:28 |
version 1.48, 2012/11/28 02:23:34 |
|
|
#!/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.47 2012/01/31 04:36:28 andrew Exp $ |
######################################################################## |
######################################################################## |
# Copyright (c) 2011 Andrew Fresh <andrew@afresh1.com> |
# Copyright (c) 2011 Andrew Fresh <andrew@afresh1.com> |
# |
# |
|
|
|
|
unshift @{ $cust->{invoice}->{projects} }, \%project; |
unshift @{ $cust->{invoice}->{projects} }, \%project; |
} |
} |
|
} |
|
} |
|
|
|
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}; |
|
|
|
$cust->{invoice}->{credit} = $credits->{$custid}; |
|
|
|
unshift @{ $cust->{invoice}->{projects} }, { |
|
title => 'Credits', |
|
no_total => 1, |
|
fees => [ |
|
{ contents => 'Available Credit', |
|
count => 1, |
|
rate => -$credits->{$custid}, |
|
} |
|
], |
|
}; |
} |
} |
} |
} |
|
|