fixed: PartyFinancialHistory throws an error (OFBIZ-13099)

This is a rewrite for different reasons.

The queryIterators were called twice, for instance
while (invIterator.next()) {
    invoice = nvIterator.next()

They are now called only once, else an instance would be lost
while (invoice = invIterator.next()) {

The expression above raises the CodeNarc rule AssignmentInConditional
So I had to locally bypass it using comments
I have added a warning in EntityListIterator::hasNext about that.

Also the queryIterators must be closed as documented in
EntityQuery::queryIterator:
NOTE: THAT THIS MUST BE CLOSED (preferably in a finally block) WHEN YOU ARE DONE
WITH IT, AND DON'T LEAVE IT OPEN TOO LONG BEACUSE IT WILL MAINTAIN A DATABASE
CONNECTION.

It could be possible to implements AutoCloseable in the call stack but not
evident... EntityListIterator implements it...
4 files changed