Annotation of RT/Invoicing/report_paid.pl, Revision 1.1
1.1 ! afresh1 1: #!/usr/bin/perl
! 2: use strict;
! 3: use warnings;
! 4: use 5.010;
! 5:
! 6: use YAML::XS qw/ LoadFile Dump /;
! 7:
! 8: my $state = LoadFile('rt_invoice.state');
! 9:
! 10: foreach my $invoice (keys %{ $state->{invoice}->{$date} }) {
! 11: my $i = $state->{invoice}->{$date}->{$invoice};
! 12: next unless $i->{custid};
! 13: next unless $i->{custid} eq 'WireFree';
! 14: #next unless $i->{custid} eq 'speakman';
! 15: #next unless $i->{custid} eq 'jscherz@itc-home.com';
! 16: next if $i->{void};
! 17: #print Dump $i;
! 18:
! 19: printf "Invoice %s for \$%0.2f on %s\n", $invoice, $i->{total}, $i->{invdate};
! 20: my $owes = $i->{total};
! 21: if ($i->{paid}) {
! 22: $owes -= $i->{paid};
! 23: printf ' Paid: $%0.2f', $i->{paid};
! 24: print ' on ', $i->{pmt_date} if $i->{pmt_date};
! 25: print ' with check ', $i->{check} if $i->{check};
! 26: print "\n";
! 27: }
! 28: printf " Owing \$%0.2f\n", $owes;
! 29: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>