I have a difficult task for you. I am developing a sales system for the company that I work for. Some customers require that tickets be issued due on specific days, eg:
The company Fulano LTDA demands that the ticket expire on a Wednesday.
It also has a paytable, Fulano LTDA company requires payments to be made every 21 days.
Let's say that the saleswoman made a sale today, she will generate a ticket with maturity for 21 days, 21 days will be July 23, ie it's a Monday, so what should happen is that these 21 days be postponed to "23" so that the maturity will arrive on a Wednesday. What I need is to check the customer's account for the day of the week in which he makes the payment, and that this payment is "pushed to the desired date", if he makes payments on Thursdays and the 21-day payment falls in the fourth, he pushes another day to fall on the fifth. I hope you understood me!