In your case, as you have mentioned that the company is asking you to payback the advance, probably you could do that to get the settlement.
Submit a request, quoting the terms (if specific clauses are there in the agreement, how to deal with advance, settlement etc.) to release final settlement.
6th March 2019 From India, Bangalore
6th March 2019 From India, Delhi