diff --git a/scripts/rt-outreachy-payment-next.plx b/scripts/rt-outreachy-payment-next.plx index 92f5c2c..85ddaa4 100755 --- a/scripts/rt-outreachy-payment-next.plx +++ b/scripts/rt-outreachy-payment-next.plx @@ -118,6 +118,38 @@ while (my $file = readdir $dh) { last if (defined $ticket); } } + if (not defined $ticket) { + if (not $INTERACTIVE) { + print STDERR "\"$file\": Skipped: unable to to find a matching ticket.\n"; + next; + } else { + # FIXME: prompt for ticket + die "interactive mode not yet supported"; + } + } + if ($PAYMENT_NUMBER == 1) { + print STDERR "Sorry, script does not yet support first payment\n"; + exit 1; + } + # Check to see if this payment was already made + my $thisPayDate = PaymentDateByTicket($ticket, $PAYMENT_NUMBER); + if (defined $thisPayDate) { + print STDERR "\"$file\": \"$ticket\": Skipped: payment $PAYMENT_NUMBER was already made"; + if ($pass) { + print STDERR ".\n"; + } else { + print STDERR "... BIG PROBLEM: the intern actually failed but got this payment.\n"; + } + } + # Check to see if previous payment was sent payment + my $prevPay = $PAYMENT_NUMBER - 1; + + my $lastPayDate = PaymentDateByTicket($ticket, $prevPay); + if ($pass and (not defined $lastPayDate)) { + print STDERR "\"$file\": \"$ticket\": Skipped: payment $prevPay was not made yet.\n"; + next; + } + } ############################################################################### #