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

File: [local] / RT / Invoicing / report_unpaid.pl (download)

Revision 1.1, Thu Aug 20 02:11:55 2020 UTC (3 years, 8 months ago) by afresh1
Branch: MAIN
CVS Tags: HEAD

Add some helper tools

#!/usr/bin/perl
use strict;
use warnings;
use 5.010;

use List::Util qw/ sum /;

use lib 'lib';
use RTI::State;

my $state = RTI::State->new('rt_invoice.state');

my $unpaid = $state->unpaid_invoices;
foreach my $custid (sort keys %{ $unpaid }) {
	my @invoices = sort { $a <=> $b } keys %{ $unpaid->{$custid} };
	my $owing = sum values %{ $unpaid->{$custid} };
	printf "%-25s %7.2f [@invoices]\n", $custid, $owing;
}