The fee for each certificate under seal shall be set by the board of supervisors in an amount necessary to recover the direct and indirect costs of providing the product or service or the cost of enforcing any regulation for which the fee or charge is levied.