A planning saga has come to an end as plans for a hotel have been turned down by Kirklees Council.