Suppose we have an element $x\in B$. Then it's image in $B_{f_i}$ is equal to some $F^i( \frac{b^i_1}{f_i^{k^i_1}} ,\ldots ,\frac{b^i_{j_i}}{f_i^{k^i_{j_i}}})$, where $\frac{b^i_j}{f_i^{k^i_j}}$ are the finite set of generators of $B_{f_i}$ over $A$, with $b^i_j\in A$, and $F^i$ some polynomials with coefficients in $A$. After multiplying by a large power of $f_i$ this gives us $n$ equalities in $B$ looking like $f_i^{N}x=F'^i(b^i_1,\ldots,b^i_{j_i})$, again with coefficients in $A$. But as $f_i$ generate unit ideal in $B$, their $N$th powers do as well, so there exist $a_i$ such that $a_1f_1^N+\cdots+a_nf_n^N=1$. After multiplying previous equations by $a_i$ and summing them up, you get that $x$ is expressed as a polynomial of $b^i_j$ with coefficients in $A$, so $b^i_j$ generate $B$ as $A$-algebra. Looking it up in EGA as Georges suggests is also a good idea, I just thought you might not be ready for that yet.