From 2e8f9c42d1ba56852bdc8a7ea63ee3591bc63f13 Mon Sep 17 00:00:00 2001
From: "Bradley M. Kuhn" <bkuhn@ebb.org>
Date: Wed, 25 Jul 2018 09:44:19 -0700
Subject: [PATCH] Correct rt show output; add verbosity there.

Note that "rt show ticket/NUMBER" does not give the entire ticket traffic,
whereas "rt show NUMBER" does.
---
 scripts/rt-bulk-prep-pay.plx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/rt-bulk-prep-pay.plx b/scripts/rt-bulk-prep-pay.plx
index 959c005..84eeb88 100755
--- a/scripts/rt-bulk-prep-pay.plx
+++ b/scripts/rt-bulk-prep-pay.plx
@@ -28,9 +28,10 @@ sub TicketIDsReadyForPayment () {
 sub FindMostRecentPaymentMethodForTicket ($) {
   my($ticketSpec) = @_;
   my $paymentMethod;
-
-  open(my $rtShowFH, "-|", "$RT_CMD", "ls", "-i", "Status = 'ready-for-payment'");
+  $ticketSpec =~ s%^\s*ticket\s*/\s*%%;
+  open(my $rtShowFH, "-|", "$RT_CMD", "show", $ticketSpec);
   while (my $showLine = <$rtShowFH>) {
+    print STDERR "rt show line for $ticketSpec: $showLine" if ($VERBOSE >= 10);
     $paymentMethod = $1
       if ($showLine =~ /\s+PAYMENT\s+METHOD\s*:\s*(.*?)\s*$/);
     # don't 'last' when found as we want the last one.