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
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…
When the date is BEFORE on ON the 24th of the month
and
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.
Regards
Joe