Change field in one module using data from a related module

I have a module with member information. It has a one to many relationship with a payments module. Is there a way to iterate through all payments associated with a related member and report a month that a payment was missed. Also report on the first month a related member made a payment (first payment).

For instance: payment made and recorded in june and august. Report july as unpaid.

And the second. A member has been paying for 6 months. Report the month of the first payment.

I’ve tried a workflow and it doesnt seem to work.

Payments Module
Payment date>april
Payment date< june

Action: modify record

Member Module
May paid checkbox filled

Report is configured to show if payment month is unchecked

This sounds too complex for a workflow…

You would need to write some custom code, I guess.