From 6615abe535ec257e5f9d3b651de86b15cb8c9db3 Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Fri, 11 Mar 2016 11:05:05 -0800 Subject: [PATCH] Print request data if it exists. --- scripts/find-supporter.plx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/scripts/find-supporter.plx b/scripts/find-supporter.plx index 7feffda..d219586 100755 --- a/scripts/find-supporter.plx +++ b/scripts/find-supporter.plx @@ -30,14 +30,29 @@ if ($CRITERION ne 'id') { } else { push(@supporterIds, $SEARCH_PARAMETER); } +my @requestTypes = $sp->getRequestType(); foreach my $id (@supporterIds) { print "Found: $id, ", $sp->getLedgerEntityId($id), "\n"; my(%addr) = $sp->getEmailAddresses($id); print " Email Addresses: ", join(", ", keys %addr), "\n"; my(%postalAddresses) = $sp->getPostalAddresses($id); print " Postal Addresses: ", join("\n\n", keys %postalAddresses), "\n"; - $found = 1; + foreach my $requestType (@requestTypes) { + my $req = $sp->getRequest({ donorId => $id, requestType => $requestType}); + if (defined $req) { + print " Request $req->{requestType}"; + print "($req->{requestConfiguration})" if defined $req->{requestConfiguration}; + print " made on $req->{requestDate}"; + if (not defined $req->{fulfillDate}) { + print "\n"; + } else { + print "...\n fulfilled on $req->{fulfillDate}"; + print "...\n notes: $req->{notes}" if defined $req->{notes}; + print "\n"; + } + } + } } print "No entries found\n" unless $found; ###############################################################################