Annotation of RT/Invoicing/report_unpaid.pl, Revision 1.1
1.1 ! afresh1 1: #!/usr/bin/perl
! 2: use strict;
! 3: use warnings;
! 4: use 5.010;
! 5:
! 6: use List::Util qw/ sum /;
! 7:
! 8: use lib 'lib';
! 9: use RTI::State;
! 10:
! 11: my $state = RTI::State->new('rt_invoice.state');
! 12:
! 13: my $unpaid = $state->unpaid_invoices;
! 14: foreach my $custid (sort keys %{ $unpaid }) {
! 15: my @invoices = sort { $a <=> $b } keys %{ $unpaid->{$custid} };
! 16: my $owing = sum values %{ $unpaid->{$custid} };
! 17: printf "%-25s %7.2f [@invoices]\n", $custid, $owing;
! 18: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>