Issue #24594:correctly calculate uninvoicedReceived and uninvoicedReject...

...ed