Is there a way to count the number of permutations of $n$ non-negative integers $[X_1,\ldots, X_n]$ (i.e., order matters) with $\sum_{i=1}^nX_i\leq M$ for a positive $M$ and $X_i\leq m_i$ for $n$ positive $m_i$'s?
If $m_i$'s are equally $m$, the problem would be reduced to find the numbers of permutations satisfying $\sum_iX_i=k$ with $X_i\leq m,\forall i$, $k=0,1,\ldots,M$, respectively, and then adds the numbers together. For each individual $k$, the question has been answered, using stars-and-bars and inclusion-exclusion. For example: How many ways can $b$ balls be distributed in $c$ containers with no more than $n$ balls in any given container?
However, what if $m_i$'s in the constraints can be different?