Lookup previous payment and verify all is good.
This commit is contained in:
parent
9b7858843b
commit
0f0b60eada
1 changed files with 32 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
###############################################################################
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue