Logic for setting payment dates

Could anyone help me with the logic to set payment dates…?
I have a marketplace and I want to pay out an amount to connected Stripe accounts on the 24th of each month. That amount is total of all transactions that have been made at that venue using my marketplace since the 24th of the previous month.
I have a pop up that shows the manager of each venue what was paid to their account in the LAST payment run and how much is due to be paid to them in the NEXT payment run.

It looks like this
Screenshot 2023-04-27 105559

However, today is the 27th April yet the date of the next payment run is showing as the 24th April so my logic is clearly dodgy. The dates are simply displaying a Custom State that is set with the results of a calculation as follows…

Screenshot 2023-04-27 105917
When the date is BEFORE on ON the 24th of the month


Screenshot 2023-04-27 105927
when the current date is AFTER the 24th of the month.

But I can’t understand why today, which is the 27th April, the date of the Next Payment Run is appearing as 24th April because, in my SpongeBob brain, the day of the month is greater than 24 so the Custom State should be updated with the Current Date/Time +1 month (ie 27th May) with the date changed to the 24th (ie 24th May)

As ever, if anyone can help me with this and explain what I need to change, I’d be very grateful.

Hi there, @joefarrowsmith… I kind of glazed over the payment-related stuff in your post, but try changing day to date in your conditions because day is the day of the week (0 = Sunday, 1 = Monday, 2 = Tuesday, etc.) while date is a particular day of a month.

Hope this helps.


1 Like

You, Sir, are a genius! Thank you so much!
Seems simple but that would have taken me forever to work that out. I’ve learned. It’s fixed. Are you available to go to Geneva to receive a Nobel Prize for NoCode?

1 Like