A Football League tribunal has instructed Brentford to pay Walsall an initial fee of £325,000 for Will Grigg.
The striker, 22,
moved in the summer
after turning down a new contract.
Walsall are also due £30,000 for every 20 competitive match Grigg plays, up to a maximum of 100, and will receive 20% of any future transfer fee.
Brentford will have to pay £50,000 if promoted to the Championship and £250,000 if they reach the top flight during Grigg's time at Griffin Park.
The Bees had to pay for Grigg even though he was out of contract because he was under 24 - and the clubs could not agree on a fee.
The Northern Ireland international has scored two goals in seven appearances since joining the Bees.
Brentford chief executive Mark Devlin said: "We thank the panel for their time on Wednesday and for giving us a fair hearing.
"We are glad that a decision has been reached and Will can now go back to concentrating on his football."