I am experiencing an issue where I will try to apply payment to invoices. I create the Cash Receipt and then select Apply. The window opens and I begin to select the invoices and by the time I select the second one I get this error message.
Unhandled script exception:
Long integer out of range. Results invalid.
EXCEPTION_CLASS_SCRIPT_OUT_OF_RANGE
SCRIPT_CMD_SET
I click OK and if I try to select again I see this error

The invoice appears to be fully applied but when you use the Receivables Transaction Inquiry there are no records for a payment applied.
A check links on receivables and a reconcile of outstanding balances on the customer ID brings the invoice back so I can apply payment but the same thing happens again.
Has anyone encountered this before and knows what might be the cause or how to resolve it?