Since this script allows the user to provide a query, that query may
or may not include tickets in it that are not in the
'ready-for-payment' state. As such, add a check for that, and output
the status of any ticket in the detail list that is not actually
'ready-for-payment'.
--subTotals implies --showAmounts, and when you use it, the ticket amounts
are grouped by payment type, and the subtotal for each payment type is
printed.
Note that I left some code duplication in the $subTotalOk / $overallTotalOk
support stuff. It was just laziness. There should be a sub that tests the
values for validity.
The Python script save-feedback.py now sets payment-N-approved, so this
script will run against tickets that are in needs-project-ok state and
payment-N-approved is set (for now, anyway).
This script was originally written to handle the approval data appearing in
files in a directory rather than the ticket traffic itself. This change
reworks that so that the script is always processing a group of tickets, and
searches for payment approval in the ticket traffic itself.
Note that this change is not yet secure, as the interns, if they know format,
could "approve themselves". The "security" comes from the script before (or
a by hand action with someone with RT access to set the completed-internship
field to 'payment-N-approved'.
I made various improvements quickly while processing payment 1 in 2018-12 and
this is the result. I didn't commit incrementally, but I do now see that I
added the support for activating the travel ticket and some error message
cleanup.
My initial drafting of this script could not support Payment 1 properly, as I
started the script after Payment 1 in 2018-05 round was already done.
These changes, while not yet fully tested, probably should work to handle
Payment 1 tickets.
Travel reimbursement tickets might already be activated. We track activation
by leaving them to "dependson" the main travel ticket, and hav them only
refersto relationship once activated.
In cases where the dependson link does not exist, then we should send notice
upon failure when rejecting the ticket.