Agreement between the teaching unions and authorities on new rights to annual leave has been reached.
The deal, in the Scottish Negotiating Committee for Teachers (SNCT), follows landmark decisions in the European Court and the House of Lords which give all employees the right to accrue holiday while on maternity or sick leave.
The rulings will hit local authorities with a multi-million pound bill, which is still being quantified.
In East Ayrshire, the cost of the new provisions is an estimated pound;250,000 a year, based on supply cover costing pound;205 per day and 35 women taking maternity leave a year. It also budgeted for an additional pound;40,000 to cover the cost of holidays built up by those on sick leave.
The agreement means that those who choose to go on maternity leave for a year will be able to claim back the number of days' leave they missed out on, up to a maximum of 66 days instead of just 10 as previously. All those on sick leave for a year will be entitled to the statutory minimum of 28 days. In both cases, time off can be carried forward into the following leave year.
Drew Morrice, assistant secretary of the Educational Institute of Scotland (EIS), said: "The SNCT cannot choose to disregard the legal and contractual consequences that arise from court decisions.
"The discussions that led to this agreement have been time-consuming and complex, and the EIS recognises that, for employers, these changes represent a considerable and unexpected financial burden.
"The SNCT has not yet resolved the issue of retrospective claims in respect of these changes. The EIS will consider this matter further, in consultation with our legal advisers."
Some education officials are predicting that the pressure on council budgets from these court decisions will get worse as many teachers retire, with the majority of their younger replacements likely to be female.
The European ruling involved the case of a Spanish woman, Merino Gomez, who took her employer to court after it refused to grant her leave following her return to work from maternity leave.