In order to show that the generating function approach gives the same answer as the Inclusion-Exclusion approach, I have changed the variables in my answer to match those in joriki's answer.
The generating function for the number of ways to distribute $n$ identical objects across $k$ bins with sizes $\{a_j\}_{j=1}^k$ is
$$
\begin{align}
\prod_{j=1}^k\left(1+x+x^2+\cdots+x^{a_j}\right)
&=\prod_{j=1}^k\frac{1-x^{a_j+1}}{1-x}\\
&=\prod_{j=1}^k\left(1-x^{a_j+1}\right)\sum_{i=0}^\infty(-1)^i\binom{-k}{i}x^i\\
&=\bbox[5px,border:2px solid #C0A000]{\prod_{j=1}^k\left(1-x^{a_j+1}\right)\sum_{i=0}^\infty\binom{i+k-1}{k-1}x^i}\tag1
\end{align}
$$
Expanding the product in $(1)$ gives
$$
\prod_{j=1}^k\left(1-x^{a_j+1}\right)=\sum_{S\subset[1,k]}(-1)^{|S|}x^{\sum_{j\in S}(a_j+1)}\tag2
$$
For a given $S$, to get the coefficient of $x^n$ in $(1)$, we choose $i=n-\sum_{j\in S}(a_j+1)$. That is, the coefficient of $x^n$ in $(1)$ is
$$
\bbox[5px,border:2px solid #C0A000]{\sum_{S\subset[1,k]}(-1)^{|S|}\binom{n-\sum_{j\in S}(a_j+1)+k-1}{k-1}}\tag3
$$
which matches joriki's answer.