Remove a higher quantity from stock according to a variation

Thank to Akshat who gave me the first step here, after searching more i found this and it’s was exactly what i wanted
I hope this can help some other