
164 Cal.App.4th 580 (2008)
COUNTY OF SAN DIEGO, Plaintiff and Appellant,
v.
STATE OF CALIFORNIA et al., Defendants and Appellants.
COUNTY OF ORANGE, Plaintiff and Appellant,
v.
STATE OF CALIFORNIA et al., Defendants and Appellants.
No. D048743.
Court of Appeals of California, Fourth District, Division One.
July 1, 2008.
*586 John J. Sansone, County Counsel, and Timothy M. Barry, Deputy County Counsel, for Plaintiff and Appellant County of San Diego.
Benjamin P. de Mayo, County Counsel, John H. Abbott and Wendy J. Phillips, Deputy County Counsel, for Plaintiff and Appellant County of Orange.
Edmund G. Brown, Jr., Attorney General, Stacy Boulware Eurie, Assistant Attorney General, Jonathan K. Renner, Leslie R. Lopez and Anthony R. Hakl, Deputy Attorneys General, for Defendants and Appellants.


*587 OPINION
BENKE, J.
The County of San Diego (San Diego County) and the County of Orange (Orange County)[1] separately filed actions against the State of California, the State Controller, the State Treasurer, and the Director of the state Department of Finance (collectively, the State) seeking reimbursement under article XIII B, section 6 of the California Constitution[2] for the costs of providing state-mandated programs and services from the 1994-1995 fiscal year through the 2003-2004 fiscal year. Both complaints include a first cause of action for declaratory relief, a second cause of action entitled "`Failure to Reimburse Mandated Costs," and a third cause of action seeking a writ of mandate directing full payment on the Counties' claims for reimbursement. The actions were consolidated by stipulation and tried to the court. The court entered judgment for each of the Counties in the amount of its total claim for reimbursement ($41,652,974 for San Diego County and $72,755,977 for Orange County), plus interest at the legal rate of 7 percent from the date each filed its complaint. The judgment also directed issuance of a writ of mandate requiring the State to pay the amount of the judgment plus interest to the Counties "over the fifteen[-]year period required by Government Code[3] section 17617 (or a shorter period if the Legislature enacts a shorter period, elects to pay the debt off earlier or is otherwise required by law to pay the debt off over a shorter period) in equal installments beginning with the budget for the 2006-07 fiscal year and annually thereafter each successive budget until paid."
Both the State and the Counties appeal the judgment. The State contends (1) the judgment and writ relief fashioned by the court violate the separation of powers doctrine; (2) the Counties' sole mechanism to obtain payment on their reimbursement claims is through article XIII B, section 6 and its implementing Government Code provisions; and (3) because the Government Code provides the Counties' exclusive remedy for determining the amounts they are owed on their reimbursement claims, there is no case in controversy and, therefore, the trial court abused its discretion in granting declaratory relief. In their cross-appeal, the Counties contend (1) the court imposed a greater burden of proof on them than is required by law; (2) the court erroneously concluded they had not adequately pled a cause of action for breach of implied contract; (3) the court erroneously applied Proposition 1A (a ballot initiative) and section 17617 retroactively to this case; and (4) the court erroneously denied the Counties prejudgment interest on their claims. We reverse the judgment and direct the trial court to vacate the writ of mandate.


*588 BACKGROUND
Article XIII B, section 6(a), provides, in relevant part: "Whenever the Legislature or any state agency mandates a new program or higher level of service on any local government, the State shall provide a subvention of funds to reimburse that local government for the costs of the program or increased level of service . . . ."[4] The purpose of this provision "is to preclude the state from shifting financial responsibility for carrying out governmental functions to local agencies, which are `ill equipped' to assume increased financial responsibilities because of the taxing and spending limitations that articles XIII A and XIII B impose. [Citations.]" (County of San Diego v. State of California (1997) 15 Cal.4th 68, 81 [61 Cal.Rptr.2d 134, 931 P.2d 312].)[5]
After the adoption of article XIII B, the Legislature enacted a comprehensive statutory and administrative scheme for implementing article XIII A, section 6, and resolving claims and disputes arising out of its provisions. (§ 17500 et seq.; Kinlaw v. State of California (1991) 54 Cal.3d 326, 331-333 [285 Cal.Rptr. 66, 814 P.2d 1308] (Kinlaw).) Under section 17581, subdivision (a), the Legislature may identify a mandate in the state budget act as being one for which reimbursement will not be provided that fiscal year. If the Legislature does not provide funding for a reimbursable mandate in the budget act, local agencies are not required to provide the mandated program or services during that fiscal year. (§ 17581, subd. (a).)
The Counties' original complaints, filed in early 2004, alleged that the State had failed to promptly and fully reimburse the Counties for the costs of state-mandated programs and services for the 2001-2002 and 2002-2003 fiscal years and that the state budget for fiscal year 2003-2004 also failed to appropriate funding to reimburse the Counties for state-mandated programs and services. The Counties respectively alleged that by the end of fiscal year 2003-2004, the State would owe San Diego County more than $30 million and Orange County more than $110 million for the provision of state-mandated services and programs.
In August 2004 the Counties jointly moved for judgment on the pleadings as to the first causes of action for declaratory relief and their requests for a *589 writ of mandate. The Counties sought a judicial determination that the State has a constitutional and statutory obligation to fully and promptly reimburse them for the costs they have incurred in providing programs and services and that the State also has a contractual obligation to reimburse them apart from its constitutional and statutory obligation.[6] Asserting that a traditional writ of mandate was "the correct method of compelling the State to perform a clear and present ministerial legal obligation," the Counties asked the court to "issue a writ of mandamus directing [the State] to identify appropriated but unencumbered funds in the State Budget from which the claims can be paid and to pay the [C]ounties on their claims for reimbursement, or to appear at a later date . . . and prove why such claims are not valid."
At the hearing on the motion in October 2004, the State advised the court that Proposition 1A, a statewide initiative measure on the upcoming November 2, 2004, election ballot, would, if adopted, amend the California Constitution to allow the State to pay its mandate-reimbursement obligations over time. The State argued the passage of Proposition 1A would render the Counties' action moot. The court asked the parties to file letter briefs addressing how the adoption of Proposition 1A would affect the Counties' action.
After the parties filed their letter briefs, the court granted the motion for judgment on the pleadings as to the declaratory relief cause of action "inasmuch as [the Counties] seek a judicial declaration that [the State] failed to reimburse costs incurred in providing state-mandated services and programs for fiscal years 2002-2004 in violation of the State's constitutional and statutory obligations." The court denied judgment on the pleadings "as far as the request for a finding that the State had a contractual obligation for reimbursement." The court concluded the Counties had not pled "a right to declaratory relief pursuant to an implied contract." The court denied the Counties' request for a writ of mandate as to the second and third causes of action on the ground the separation of powers doctrine prohibited the court "from compelling payment where petitioner has not shown appropriate funds have been appropriated by the Legislature." The court noted the Counties had "not identified an existing, reasonably available appropriation from which this court could order payment." However, the denial was without prejudice to the Counties' right to "proceed with discovery to determine if there are sufficient specific budget allocations to fund the mandates at issue here." The court ruled that Proposition 1A, which the voters had adopted, and its companion *590 statute, section 17617,[7] did not render this action moot because they did not "preclude a county from seeking other remedies for earlier payment of funds owed;" they did not guarantee that the State would actually pay the Counties' reimbursement claims; and the court saw "no reason why a county should have to wait as long as five years to be repaid funds owed."
After the court ruled on the Counties' motion for judgment on the pleadings, the parties stipulated and the court ordered that the Counties' complaints be amended to include the Counties' reimbursement claims dating back to the 1994-1995 fiscal year, and the State filed answers to the complaints. In August 2005, the State filed a motion for summary judgment/adjudication.
One of the grounds on which the State sought summary judgment was that as a result of the passage of Proposition 1A, the State did not have a clear, present, ministerial duty to immediately reimburse the Counties and, therefore, the court lacked authority to issue a writ of mandate compelling immediate reimbursement. The court denied the State's motion, concluding, among other things, that Proposition 1A had no effect on the Counties' action because "nothing in Proposition 1A appears to preclude the Counties from seeking other remedies for earlier repayment of funds owed." The court further ruled: "Even if the constitutional and legislative scheme was meant to preclude any other method for reimbursement such that the Counties would not be entitled to immediate reimbursement as the State argues, [the] writ petition could continue. First, the Counties have not sought immediate reimbursement, but rather prompt reimbursement. Second, at the very least, they should be entitled to a declaration as to which programs should be reimbursed and the amount of such reimbursement. This determination was not affected by Proposition 1A. The Counties are also entitled to a determination of amounts due and payable under . . . [section] 17617."
The case was tried to the court, and in March 2006 the court filed a lengthy statement of decision, which began: "Declaratory Relief and Mandate Proceedings. Declaratory relief granted to Plaintiffs. Writ of Mandate granted to enforce the provisions of Government Code section 17617 and denied in all other respects." The court noted the Counties were seeking a judgment in the total amount of $114,408,951, consisting of $41,652,974 owed to San Diego County and $72,755,977 owed to Orange County, and that the State agreed it *591 owed the Counties those amounts under article XIII B, section 6.[8] The court cited Butt v. State of California (1992) 4 Cal.4th 668 [15 Cal.Rptr.2d 480, 842 P.2d 1240] (Butt) for the proposition that "[i]n order to have a court order the immediate embargo of State budget funds owed to pay a State debt, California Courts have required the funds in the state budget be generally related to the funds missing." The court noted the Counties had relied on the expert testimony of William Hamm, a former Legislative Analyst for the State, to make the required connection between the budgets for specific state agencies and the specific mandates for which the Counties sought reimbursement. The court then listed each of the 50 mandated programs for which the Counties sought immediate reimbursement and for each program, the specific agency budget from which the Counties sought reimbursement.[9]
The court summarized the State's defense as follows: "[The State] generally put on witnesses from various state agencies who testified the specific items in their budgets had historically never been used to fund local mandates. Rather, they were used to fund salaries, expenditures and programs of the state agency. Several of the agencies also could not guarantee funds would be available at the end of the fiscal year. They also indicated state law precluded agencies from functioning with a deficit." The court noted the parties had stipulated that the specific potential funding sources the Counties had identified through Hamm's testimony "`have historically not been used to provide reimbursement to local agencies for the State mandated costs at issue in this lawsuit . . . .'"
The court found a lack of general relationship between many of the mandates at issue and the funds targeted by the Counties for those mandates and, accordingly, denied the Counties' request for immediate reimbursement. The court also denied the Counties' request to find in their favor on an implied contract theory, noting it had ruled on their motion for judgment on the pleadings that they had not pled that theory. The court denied as untimely the Counties' request for leave to amend their complaints to conform to proof by adding a cause of action for breach of implied contract.[10]
*592 However, the court concluded the Counties "are entitled to some assurance the money they are owed will be paid in accord with [section 17617]." Accordingly, the court ruled the Counties "are entitled to a writ of mandate ordering the State to pay the funds owed over the 15 year period set forth in . . . section 17617 or a shorter period if the statute is amended or the State elects to pay the debt owed in less than 15 years. Payments are to begin with the 2006-2007 fiscal year budget and be paid out of each budget thereafter. In addition, fundamental fairness dictates the funds be paid in equal amounts over the 15 year period unless the State elects to make greater payments to pay off the claims sooner. [The Counties] are also entitled to interest as mandated by law." The court decided the Counties were not entitled to prejudgment interest, but each was entitled to interest at the legal rate of 7 percent from the date it filed its complaint. However, the court added that "while [the Counties] are entitled to mandate relief . . . , compliance with the judgment rests solely in the discretion of the Legislature. [Citations.]"[11]
In the conclusion section of its statement of decision, the court ruled: "San Diego County is entitled to declaratory relief stating [it] is owed $41,652,974 by the State of California. Orange County is entitled to the same relief noting it is entitled to a sum of $72,755,977. These declarations are based on a prior declaratory relief order of this court, evidence at trial, and agreement by the State at trial that the sums are owed." The court ruled the Counties were the prevailing parties and were entitled to costs, but added that "ultimate enforcement and compliance with this order rests in reality with the Legislature." The court entered judgment in accordance with its statement of decision.


*593 DISCUSSION

I. Writ of Mandate Issued by the Court

Code of Civil Procedure section 1085, subdivision (a), provides: "A writ of mandate may be issued by any court to any inferior tribunal, corporation, board, or person, to compel the performance of an act which the law specially enjoins, as a duty resulting from an office, trust, or station . . . ." A writ of mandate "will issue against a county, city or other public body . . . . [Citations.]" (Venice Town Council, Inc. v. City of Los Angeles (1996) 47 Cal.App.4th 1547, 1558 [55 Cal.Rptr.2d 465].)[12]
To obtain writ relief under Code of Civil Procedure section 1085, the petitioner must show there is no other plain, speedy, and adequate remedy; the respondent has a clear, present, and ministerial duty to act in a particular way; and the petitioner has a clear, present and beneficial right to performance of that duty. (Morgan v. City of Los Angeles Bd. of Pension Comrs. (2000) 85 Cal.App.4th 836, 842 [102 Cal.Rptr.2d 468].) A ministerial duty is one that is required to be performed in a prescribed manner under the mandate of legal authority without the exercise of discretion or judgment. (Id. at p. 843; Unnamed Physician v. Board of Trustees (2001) 93 Cal.App.4th 607, 618 [113 Cal.Rptr.2d 309].)
Issuance of a writ of mandate "`"is not necessarily a matter of right, but lies rather in the discretion of the court, but where one has a substantial right to protect or enforce, and this may be accomplished by such a writ, and there is no other plain, speedy and adequate remedy in the ordinary course of law, [the petitioner] is entitled as a matter of right to the writ, or perhaps more correctly, in other words, it would be an abuse of discretion to refuse it."' [Citations.]" (Powers v. City of Richmond (1995) 10 Cal.4th 85, 114 [40 Cal.Rptr.2d 839, 893 P.2d 1160].) The State contends the court abused its discretion in issuing the writ of mandate because the relief the court ordered violates the separation of powers doctrine. We agree.
"[T]he California Constitution's separation of powers clause precludes any branch from usurping or improperly interfering with the essential *594 operations of either of the other two branches. [Citations.]" (Butt, supra, 4 Cal.4th at p. 700, fn. 26.) "Article III, section 3 . . . provides that `[t]he powers of state government are legislative, executive, and judicial. Persons charged with the exercise of one power may not exercise either of the others except as permitted by this Constitution.' Article XVI, section 7 provides that `[m]oney may be drawn from the Treasury only through an appropriation made by law and upon a Controller's duly drawn warrant.' Article IV, sections 10 and 12 set forth the respective powers of the Legislature and Governor over the enactment of appropriations. It has long been clear that these separation-of-powers principles limit judicial authority over appropriations. [Citations.]" (Id. at p. 698.) Courts cannot directly order the Legislature to appropriate funds or order the payment of funds the Legislature has not appropriated. (Mandel, supra, 29 Cal.3d at pp. 539-540; Long Beach Unified Sch. Dist. v. State of California (1990) 225 Cal.App.3d 155, 180 [275 Cal.Rptr. 449] (Long Beach); Serrano v. Priest (1982) 131 Cal.App.3d 188, 196 [182 Cal.Rptr. 387] [trial court could not order payment of judgment against state defendants from funds not yet appropriated by the Legislature].)
"Indeed, the broader rule is that mandamus will not lie to compel the Legislature to enact any legislation." (City of Sacramento v. California State Legislature (1986) 187 Cal.App.3d 393, 397 [231 Cal.Rptr. 686], italics added.) "A separation of powers does allow for some incidental overlap of function. [Citation.] But a judicially compelled enactment of legislation is not an incidental overlap; it is the very exercise of legislative power itself." (Id. at p. 399.)
The writ of mandate the court issued in this case violates the separation of powers doctrine because it effectively orders the Legislature to appropriate funds in future state budget acts. The writ, issued in May 2006, commanded the State to pay the judgment in favor of the Counties over a 15 year period in equal installments "beginning with the 2006-07 fiscal year and annually thereafter from each successive budget until the amounts owed with interest are paid in full." Under the separation of powers doctrine, the Legislature cannot be judicially compelled to appropriate sufficient funds to satisfy the State's subject reimbursement obligations through future legislation and to pay those funds to the Counties.
In support of the writ relief fashioned by the court, the Counties rely on the principle, articulated in Mandel, that "once funds have already been appropriated by legislative action, a court transgresses no constitutional principle when it orders the State Controller or other similar official to make appropriate expenditures from such funds. [Citations.]" (Mandel, supra, 29 Cal.3d at p. 540.) Mandel affirmed a trial court order directing the State Controller to pay the plaintiff $25,000 in attorney fees awarded in a judgment against *595 various state agencies. The court ordered payment of the fee award from funds appropriated in the 1978-1979 state budget for operating expenses of the Department of Health Services, the principal defendant in the underlying case. (Id. at p. 535.) Mandel concluded the order was proper because "the operating expense appropriation at which the trial court's order . . . was directed was generally available for the payment of court-awarded attorney fees." (Id. at p. 545, fn. omitted.)[13]
The Counties argue the writ relief the court issued does not require the Legislature to appropriate funds. The Counties note they asked the court to find there were appropriated but unencumbered funds in various departmental budgets that were generally related in purpose to the various mandated programs and services for which the Counties seek reimbursement, and they asked the court to order the named State officials to issue warrants to the Counties from such appropriations to satisfy their past due reimbursement claims.
The Counties' argument on this point is based on the relief they requested rather than the relief the court actually granted. The court did not make the "general relationship" findings the Counties requested; to the contrary, the court expressly found that "in many of the mandates, there is no general relationship between the mandate at issue and the funds sought." Nor did the court grant the Counties' request to order the named State officials to issue warrants for immediate reimbursement. The court found the Counties had "not established their entitlement to immediate reimbursement under Mandel . . . and its progeny," and, accordingly, denied the Counties' request for "a writ of mandate to order the immediate reimbursement of funds to [the Counties] from the specific budgets of several state agencies." Thus, the principle that a court may, under certain circumstances, order the State to pay already-appropriated funds has no bearing on the propriety of the writ relief the court actually granted in this case. The writ relief the court fashioned is improper because it commands the payment of funds not yet appropriated. (Long Beach, supra, 225 Cal.App.3d at p. 180.)[14]
In addition to violating the separation of powers doctrine, the writ of mandate issued in this case is improper because it is unnecessary. "As a general proposition courts will not issue a writ of mandate to enforce an abstract right of no practical benefit to petitioner, or where to issue the writ *596 would be useless, unenforceable, or unavailing." (Kirstowsky v. Superior Court (1956) 143 Cal.App.2d 745, 749 [300 P.2d 163]; see Ballard v. Anderson (1971) 4 Cal.3d 873, 876 [95 Cal.Rptr. 1, 484 P.2d 1345].) Accordingly, a writ of mandate will not issue where the petitioner's rights are otherwise protected. (Grant v. Board of Medical Examiners (1965) 232 Cal.App.2d 820, 827 [43 Cal.Rptr. 270]; Hutchison v. Reclamation Dist. No. 1619 (1927) 81 Cal.App. 427, 432-433 [254 P. 606] [a writ of mandate compelling a ministerial act is properly denied when the respondent shows a willingness to do the act, or the writ is unnecessary because the petitioner will obtain the relief sought without the writ].)
Here, the writ compelling the State to reimburse the Counties over a 15-year period is unnecessary and unavailing because section 17617 requires the State to accomplish that result independent of the writ. By essentially granting the Counties the same relief they receive under section 17617, the writ merely enforces the Counties' "abstract right" to payment without affording them any substantial benefit.
Moreover, the court tacitly recognized the writ is unenforceable and unavailing by expressly acknowledging that compliance with the judgment rests in the discretion of the Legislature.[15] The court's acknowledgement also appears to be a tacit recognition that the acts mandated by the writ are not ministerial acts that the State has a clear, present, ministerial duty to perform. "Mandate will not issue to compel action unless it is shown the duty to do the thing asked for is plain and unmixed with discretionary power or the exercise of judgment. [Citation.]" (Unnamed Physician v. Board of Trustees, supra, 93 Cal.App.4th at p. 618, italics added.) The court's observation that the State, through the Legislature, has the discretion to not comply with the writ underscores that the acts the writ directs are not ministerial and, therefore, cannot properly be compelled by a writ of mandate. (Morgan v. City of Los Angeles Bd. of Pension Comrs., supra, 85 Cal.App.4th at pp. 842-843.)
The court largely based its decision to issue the writ on its view that section 17617 does not provide the Counties an adequate remedy because it does not guarantee the State would actually satisfy its reimbursement obligations to the Counties within the statutory 15-year period. The court noted: "[T]he Legislature could repeal [section 17617] at any time. Indeed, in the last year it changed the time for repayment from five years to fifteen years. . . . Nothing *597 prevents the [L]egislature from making the payment period 30 years if it so chooses, or repealing the section."
The court's speculation that section 17617 might be amended or repealed in the future was not a proper basis for the issuance of a writ of mandate. "[A] court's authority to second-guess the legislative determinations of a legislative body is extremely limited. It is a `well-settled principle that the legislative branch is entitled to deference from the courts because of the constitutional separation of powers.' [Citation.] It also is hornbook law that courts are not authorized to second-guess the motives of a legislative body and that, if reasonable, legislation will not be disturbed. [Citation.]" (Connecticut Indemnity Co. v. Superior Court (2000) 23 Cal.4th 807, 814 [98 Cal.Rptr.2d 221, 3 P.3d 868].) A court's "judicial task is to decide what the Legislature has done, not what it should have done." (Crowl v. Commission on Professional Competence (1990) 225 Cal.App.3d 334, 351 [275 Cal.Rptr. 86].) Along the same line, a court's judicial task is to decide and rule in accordance with what the Legislature has done, rather than what it might do in the future. "As long as that body does not exceed its powers, and its judgment is not influenced by corruption, a court cannot substitute its judgment for that of the Legislature. [Citation.]" (Topanga Assn. for a Scenic Community v. County of Los Angeles (1989) 214 Cal.App.3d 1348, 1365 [263 Cal.Rptr. 214].)
Accordingly, a court must follow reasonable legislation applicable to the matter before it. Here, the court was not authorized to second-guess the Legislature's motive in amending section 17617 to increase the time for reimbursement under article XIII B, section 6, from five to 15 years, and the court could not properly base the issuance of a writ of mandate on speculation that the Legislature might amend the statute in the future to further increase the reimbursement period, or repeal the statute. The court was constrained to give effect to section 17617 as it existed at the time the court rendered its decision.
For the reasons discussed above, we conclude the writ relief fashioned by the court cannot stand.

II. Mandamus Relief Sought by the Counties

We next consider whether the court erred in denying the relief the Counties actually soughti.e., immediate or prompt reimbursement of the undisputed costs they incurred in complying with the numerous state mandates at issue in this case. In their cross-appeal, the Counties contend the court imposed a greater burden of proof on them than is required by law with respect to their request for a writ of mandate compelling prompt reimbursement from the *598 appropriations they identified in the 2005-2006 budget. The Counties argue they were entitled to full and prompt reimbursement because they proved, as required by case law, a general relationship between the purpose of each of the specified appropriations and the purpose of the corresponding mandated program for which it was targeted, and that the reimbursement funds were available at the time of trial. We conclude the court did not abuse its discretion in denying the relief the Counties sought.
As noted, Mandel upheld a trial court order directing the State Controller to pay court awarded attorney fees from a state budget appropriation that was generally or reasonably available for that purpose. (Mandel, supra, 29 Cal.3d at pp. 542-545.) Relying primarily on Mandel, the Court of Appeal in Carmel Valley Fire Protection Dist. v. State of California (1987) 190 Cal.App.3d 521 [234 Cal.Rptr. 795] (Carmel Valley) upheld the issuance of a writ of mandate requiring the State Controller to draw warrants against certain funds appropriated to the Department of Industrial Relations in the 1984-1985 state budget to reimburse the plaintiff counties (and other local governmental entities) for state mandated costs of providing protective clothing and equipment to fire fighters. (Carmel Valley, supra, 190 Cal.App.3d at pp. 530-533.) Carmel Valley concluded "these funds, although not specifically appropriated for the reimbursement in question, were generally related to the nature of costs incurred by [the plaintiffs] and . . . therefore reasonably available for reimbursement." (Id. at p. 541.)
In Long Beach, the Court of Appeal distilled these principles from Mandel and Carmel Valley as follows: "A court cannot compel the Legislature either to appropriate funds or to pay funds not yet appropriated. [Citations.] However, no violation of the separation of powers doctrine occurs when a court orders appropriate expenditures from already existing funds. [Citations.] The test is whether such funds are `reasonably available for the expenditures in question . . . .' [Citations.] Funds are `reasonably available' for reimbursement when the purposes for which those funds were appropriated are `generally related to the nature of costs incurred . . . .' [Citation.] There is no requirement that the appropriation specifically refer to the particular expenditure [citations], nor must past administrative practice sanction coverage from a particular fund [citation]." (Long Beach, supra, 225 Cal.App.3d at pp. 180-181.)
In Butt the California Supreme Court reversed the portion of a remedial order (issued in connection with a preliminary injunction) approving funding of an emergency loan to the Richmond Unified School District from an unused special appropriation to the Oakland Unified School District and an unused appropriation to the State Department of Education earmarked for its Greater Avenues for Independence program. (Butt, supra, 4 Cal.4th at pp. 697, *599 704.) Butt acknowledged Long Beach's and Carmel Valley's "occasional use of the term `generally related' to describe Mandel's principle of reasonable or general `availability.' [Citations.]" (Butt, supra, 4 Cal.4th at pp. 699-700.) However, Butt concluded "nothing in those cases supports the . . . view that funds appropriated for one specific educational purpose may be judicially diverted to another. So far as the face of the opinions discloses, the stated intent of the target appropriation in each case, or its historical uses, indicated that the court's application of the funds was plausibly within purposes the Legislature might have contemplated. No court has suggested that Mandel principles permit court-ordered diversion of an appropriation away from a clear, narrow, and valid purpose specified by the Legislature. We affirm that the words `generally related,' as used in Long Beach and Carmel Valley, do not countenance such judicial incursions into the legislative power over appropriations." (Butt, supra, 4 Cal.4th at p. 700, fns. omitted.) "[T]he test of reasonable availability under Mandel does not extend to uses clearly outside the particular purpose for which an appropriation was reserved." (Id. at p. 701.)
Although, as we noted above, it generally is an abuse of discretion to deny writ relief where the petitioner has shown a substantial right to enforce or protect and there is no other plain, speedy and adequate remedy in the ordinary course of law (Powers v. City of Richmond, supra, 10 Cal.4th at p. 114), "`"cases may . . . arise where the applicant for relief has an undoubted legal right, for which mandamus is the appropriate remedy, but where the court may, in the exercise of a wise discretion, still refuse the relief."'" (Fawkes v. City of Burbank (1922) 188 Cal. 399, 402 [205 P. 675].) Considering the unique circumstances surrounding the Counties' petition for writ of mandate in this case, we conclude the court acted well within the bounds of judicial discretion in denying the relief the Counties sought.[16]
In its statement of decision, the court noted that Butt seems to limit Mandel and other earlier cases that addressed the issue of judicial authority over state budget appropriations and that "Butt and the other cases require a showing the funds are actually available to support the incursion into the budget." The court further noted that previous cases authorizing an "incursion into the state budget involve one mandate and generally involve amounts that are far less than those at issue here."
In contrast to those cases, the Counties here asked the court to order payment to them from the budgets of numerous state agencies, including the State Controller, the State Treasurer, the Secretary of State, the Department *600 of Justice, the Department of Corrections and Rehabilitation, the State Department of Education, the Department of Child Support Services, the State Department of Social Services, the Department of Motor Vehicles, the State Department of Mental Health, the State Department of Developmental Services, the Department of Food and Agriculture, the Department of Industrial Relations, the Department of Forestry and Fire Protection, the Department of Housing and Community Development, the California State Council on Developmental Disabilities, the Office of Emergency Services, the Office of Health Services, the State Personnel Board, the State Board of Equalization, the Commission on Peace Officer Standards and Training, and the California Highway Patrol.
The court gave examples of the Counties' targeting the budgets of certain agencies for multiple mandates, stating: "[T]he Department of Justice budget and the budget of the Department of Corrections and Rehabilitation, according to [the Counties], each may be the subject of approximately 6-8 mandates. The Department of Mental Health budget is also subject to scrutiny for more than eight mandates. Moreover, under mandates 29 and 30 alone, the Department of Mental Health budget could be subject to an assessment in the neighborhood of $80 million dollars." The court did not believe case law countenances "the wholesale dismemberment of agency budgets" sought by the Counties. The court expressed concern that if it authorized "such an assault on these budgets, other counties might try the same approach" with the result that "the budgets of the state agencies would be in shambles."
The court also concluded the Counties' evidence was insufficient to justify "the incursion," finding the Counties had not met their burden of proving the money they sought was available. Specifically, the court noted the Counties' expert, Hamm, "had an idea of what was in an agency budget for October 31, 2005, but did not really know what funds would be available on later dates." Comparing the evidence on both sides of the availability issue, the court noted: "[Hamm] generally speculated the money might be available because most agencies spent their money in equal parts over the 12 months so it could be estimated what was available. However, he was unable to provide specific assurances for each of the many agencies that money would be available on a date certain. [¶] By contrast the State presented evidence from various agencies that some were running deficits and would very likely have no funds as the end of the fiscal year approached. Some of the representatives [who testified] noted by law they were not allowed to run a deficit. Mr. Hamm's lack of specificity might not be a problem in the other cases with smaller amounts at issue. However, here with over $114 million at issue, there is a reasonable likelihood that some or all of the funds sought may not be available."
*601 The court also found that the Counties failed to show the required general relationship between many of the subject mandates and the funds sought. In its statement of decision, the court offered a number of specific examples to support its general finding on this issue, and the Counties have not challenged the sufficiency of the evidence to support the court's findings.[17]
The court found that although the Counties' expert witness Hamm indicated Mandate 1 for grand jury proceedings could be funded from the budget items of the Department of Justice relating to criminal law, most of the criminal law budget goes to support the criminal division that represents the State in the Courts of Appeal and the Supreme Court on appeals and writs and has nothing to do with grand jury proceedings. The court also found that six other mandates for which the Counties sought funding from the Department of Justice were not related to the primary law enforcement and criminal function of the Department of Justice at the state level.[18]
The Counties sought reimbursement from the office of the Secretary of State for Mandates 8 through 12 concerning absentee ballots and county election functions. However, a representative from the Secretary of State's office testified that the office had no involvement with absentee ballots or the county election process and did not have a budget for specific programs. The court noted that the Treasurer and Controller have similar funding. Consequently, the court found that the money the Counties sought would have to come from the general funding of those agencies for salary and equipment and, therefore, "a lien against funds of these agencies could affect their ability to pay salaries and operate efficiently."
Noting the Counties' case also implicated the Treasurer in Mandates 13 (County Treasury Oversight) and 14 (Investment Reportslocal agencies), the court accepted testimony by a witness from the Treasurer's office that the Treasurer historically had no oversight responsibilities for local agencies. The court similarly found "the Controller historically has no local oversight responsibilities for local agencies. Thus, there is no reason to conclude that Mandates 42 (Redevelopment Agencies) and 43 (Senior Citizens Property Tax Deferral) are generally related to the budget of the Controller."
*602 The court then addressed Mandate 40, which concerns allowing extra time for cats and dogs to reside in county facilities before being euthanized. The Counties presented evidence that funding for this mandate could come from the Department of Food and Agriculture. However, the court found the mandate "has no relationship to the Department of Food and Agriculture[,] which deals with food issues, pests, diseases, and domestic farm animals. The agency has nothing to do with pets such as cats and dogs."
The Counties sought funding from the Department of Corrections and Rehabilitation and the State Department of Mental Health for a number of mandates involving commitment of sex offenders, juveniles, and violent offenders by county prosecutors or agencies (e.g., Mandates 26-28, 31, 36). However, the court found these mandates were not related to the "housing of inmates by the Department of Corrections and Rehabilitation or maintenance of state hospitals and facilities by the State Department of Mental Health."
The court found many of the mandates at issue concerning the funding of local programs relating to child care, AIDS, peace officer rights, crime victims and other local social programs "have nothing to do with the facilities, salary costs, and program costs of the state agencies at issue. Moreover, budget line items for community programs in the agency budgets represent community services provided on a statewide basis for these agencies. This line item is not designed to fund local activities of county government." The court found that "historically all of these budget items related to operations of state agencies at the state level and their locally monitored or sponsored programs. These mandates historically were not used to fund county programs." Noting the Counties had not presented any credible evidence to compel a contrary conclusion, the court found "it is a stretch to say that any of the budget items discussed here are generally related to the local mandates."
Finally, the court noted the "broad brush of [the Counties'] position" was shown by their allegation that "the budgets of all state agencies may be liable for mandates relating to Law Enforcement Sexual Harassment training (Mandate 39), mandate reimbursements (Mandate 46), and the Brown Act relating to public meetings. (Mandate 47)" The court concluded: "[The Counties] have not established their entitlement to immediate relief under Mandel v. Myers, supra and its progeny. Thus, the court declines to issue a writ of mandate to order the immediate reimbursement of funds to [the Counties] from the specific budgets of several state agencies."
As noted, to obtain writ relief under Code of Civil Procedure section 1085, the petitioner must show the respondent has a clear, present, and ministerial duty to act in a particular way; and the petitioner has a clear, present and *603 beneficial right to performance of that duty. (Morgan v. City of Los Angeles Bd. of Pension Comrs., supra, 85 Cal.App.4th at p. 842.) Although it may be said that the State generally has a ministerial duty to reimburse local agencies for state-mandated programs and services, in the present case the existence of a clear, present, ministerial duty to fully pay the Counties' subject reimbursement claims from the state budget of the single fiscal year in question was negated by the enormity of the relief the Counties sought. Given the magnitude of the Counties' reimbursement claims, the large number of mandates at issue, the large number of agencies from which the Counties sought reimbursement, and, most important, the insufficiency of the Counties' evidence to show that the purposes of the subject mandates were generally related to the various appropriations from which the Counties sought reimbursement, or that the targeted funds were reasonably available, the court acted well within its discretion in denying the Counties' request for a writ of mandate compelling prompt payment of their reimbursement claims from the state's 2005-2006 fiscal year budget.[19]

III. The Counties' Implied Contract Claim

The Counties contend article XIII B, section 6 and its implementing statutes create an implied contract between them and the State, under which the State is obligated to pay their reimbursement claims. The Counties further contend section 17617 impairs their contractual right to reimbursement and thus violates the constitutional prohibition against impairment of contracts.[20] In a related vein, the Counties argue the court erred by ruling they did not plead a cause of action for breach of implied contract and by denying them leave to amend their complaints to conform to proof to plead that cause of action. We conclude article XIII B, section 6, and the statutory scheme for reimbursement of state mandated costs do not create an implied contract between the State and local agencies entitled to reimbursement.
(10) "In California law, a legislative intent to grant contractual rights can be implied from a statute if it contains an unambiguous element of exchange of consideration by a private party for consideration offered by the state." (California Teachers Assn. v. Cory (1984) 155 Cal.App.3d 494, 505 [202 Cal.Rptr. 611] (Cory).) The Counties rely on Cory and County of San Luis *604 Obispo v. Gage (1903) 139 Cal. 398 [73 P. 174] (Gage) as authority for the existence of an implied contractual right to the reimbursement money they seek in this action.
In Cory the state appropriated less money than required by statute to a public teachers' retirement fund. Cory noted: "The subject of the legislation, pension rights, has long been characterized as within the domain of contract. [Citation.] A statute offering pension rights in return for employee services expresses an element of exchange and thereby implies these rights will be private rights in the nature of contract." (Cory, supra, 155 Cal.App.3d at pp. 505-506.) Noting the statutory obligation to fund the teachers' retirement fund reflected a "commitment to permanency of funding," Cory implied "a promise of funding in exchange for the valuable services rendered by the state's teachers." (Id. at p. 506.)
(11) Article XIII B, section 6, and its implementing statutes do not similarly reflect an intent to grant contractual rights. The state's statutory funding obligation in Cory was unambiguously contractual in nature because it provided a form of compensation (i.e., consideration) in exchange for services performed by teachers under public employment contracts. In contrast, the mandate-reimbursement scheme under article XIII B, section 6, provides the mechanism by which the state satisfies its constitutional requirement to reimburse the costs local agencies incur in providing state-mandated services and programs. Thus, article XIII B, section 6, and its implementing statutes, involve an exchange of performance compelled by law on both sides rather than an unambiguous exchange of contractual consideration.
Gage is also inapposite. Gage involved a statutory enactment by which the state effectively promised each county that if the county provided maintenance and support for orphans and abandoned children, the state would appropriate funds in specified amounts for each child. Gage held: "This was the equivalent of an offer upon condition, and upon the performance of the condition by any county the offer became a promise, and binding as such upon the state.... It is analogous to the case where a natural person offers a reward for the performance of some particular act, as the recovery of property or the apprehension of a criminal. The offer is made to no person in particular; but when the act upon which it depends is performed, the offer and the act combined make a complete contract between the person making the offer and the person who performs the act, and this may be the subject of an action, and a recovery may be had thereon against the person making the offer, for the amount of the reward. [Citations.]" (Gage, supra, 139 Cal. at p. 407.) Gage noted that although some obligations arising by operation of law are not contractual in nature, the state's obligation in question was "in substance and effect" contractual because the statutory scheme and "the *605 subsequent performance of the conditions by the [Counties] furnishes all the elements ... necessary to the formation and existence of an implied contract." (Id. at p. 408.)
The critical distinction between Gage and the present case is that in Gage, the state offered compensation for performance (supporting orphaned and abandoned children) that the counties were not obligated to undertakei.e., the counties could choose not to perform or choose to accept the state's offer by performing, thereby forming a binding contract. Thus, as in Cory, there was an unambiguous element of exchange of consideration by a party for consideration offered by the state. Article XIII B, section 6, and its implementing statutes do not involve a Legislative offer to pay in exchange for the performance of certain acts; they involve a constitutional requirement to reimburse the costs local agencies incur in providing services and programs mandated by the state.
The Counties' reimbursement rights at issue in this case are constitutional and statutory, not contractual. Accordingly, to the extent the court erred by ruling the Counties did not plead a cause of action for breach of implied contract or by denying the Counties leave to amend their complaints to conform to proof to plead that cause of action, the error was harmless.

IV. Entry of a Money Judgment in the Amount of the Counties' Reimbursement Claims

We asked for supplemental briefing on whether the court erred in reducing the reimbursement amounts sought by the Counties to a money judgment. We conclude the monetary award in the judgment must be reversed because it was not properly awarded as either declaratory relief or damages.

A. Money Judgment As Declaratory Relief

The record shows the court awarded monetary relief in the judgment under the Counties' causes of action for declaratory relief. As noted, in ruling on the State's summary judgment motion, the court stated that "at the very least, [the Counties] should be entitled to a declaration as to which programs should be reimbursed and the amount of such reimbursement." In its statement of decision after trial, the court ruled: "Declaratory relief granted to Plaintiffs." Later in the statement of decision the court stated: "[T]here is no dispute the State owes [the Counties] the amounts sought to reimburse [the Counties] for the mandates at issue here pursuant to [article XIIIB, section 6]. Thus San Diego County is entitled to a judgment declaring it is owed $41,652,974. Orange County is entitled to a judgment declaring it is owed $72,755,977." In the conclusion section of the statement of decision, the *606 court expressly referred to the monetary awards as declaratory relief, stating: "San Diego County is entitled to declaratory relief stating [it] is owed $41,652,974 by the State of California. Orange County is entitled to the same relief noting it is entitled to a sum of $72,755,977. These declarations are based on a prior declaratory relief order of this court, evidence at trial, and agreement by the State at trial that the sums are owed."
(12) We conclude the monetary award in the judgment is improper as declaratory relief because there was no actual controversy at trial as to the State's constitutional and statutory obligation to pay the Counties' reimbursement claims or as to the amount of the claims. Code of Civil Procedure section 1060 provides: "Any person ... who desires a declaration of his or her rights or duties with respect to another ... may, in cases of actual controversy relating to the legal rights and duties of the respective parties, bring an original action ... in the superior court...." (Italics added.) "`Thus, declaratory relief is appropriate only where there is an actual controversy, not simply an abstract or academic dispute.' [Citations.]" (Connerly v. Schwarzenegger (2007) 146 Cal.App.4th 739, 746 [53 Cal.Rptr.3d 203] (Connerly).) "The `actual controversy' language in Code of Civil Procedure section 1060 encompasses a probable future controversy relating to the legal rights and duties of the parties. [Citation.] For a probable future controversy to constitute an `actual controversy,' however, the probable future controversy must be ripe. [Citations.] A `controversy is "ripe" when it has reached, but has not passed, the point that the facts have sufficiently congealed to permit an intelligent and useful decision to be made.' [Citation.] [¶] Whether a claim presents an `actual controversy' within the meaning of Code of Civil Procedure section 1060 is a question of law that we review de novo." (Environmental Defense Project of Sierra County v. County of Sierra (2008) 158 Cal.App.4th 877, 885 [70 Cal.Rptr.3d 474], italics added.)
In their causes of action for declaratory relief, the Counties did not seek a declaration of the amounts the State was obligated to pay them on their reimbursement claims; they sought a declaration that the state was constitutionally and statutorily required to promptly and fully pay them those amounts.[21] Because there was no dispute at trial as to the amount of their claims, there was no present controversy on that point, let alone a probable future controversy, to be resolved by declaratory relief.
*607 Relying on Connerly, supra, 146 Cal.App.4th 739, the State argues the court erred by issuing a declaratory judgment that merely states the undisputed amounts it owes the Counties because that information has already been provided to the Legislature under sections 17562 and 17565.[22] In Connerly the plaintiff filed an action for declaratory and injunctive relief seeking a declaration that section 8315 is unconstitutional because it contains an invalid definition of "racial discrimination." Connerly held there was no actual controversy because while the action was pending, an appellate court in another case issued a published opinion holding the statute was unconstitutional, and the California Supreme Court denied review in that case. (146 Cal.App.4th at p. 747.) Connerly concluded it was an "idle and superfluous act for the trial court to issue a declaratory judgment that merely restates the holding of [the other case]." (Ibid., citing Civ. Code, § 3532.)[23]
We agree with the State that it was an idle and superfluous act for the court here to issue a declaratory judgment that merely states the State's undisputed obligation to pay the Counties' subject reimbursement claims and the undisputed amounts of those claims, which information presumably has been reported to the Legislature as required by the statutory scheme implementing article XIII B, section 6.[24] The "declaratory" money judgment serves no useful purpose because the Counties have to rely on the Legislature to appropriate funds to pay the obligation at issue, regardless of whether they are paid as a money judgment or as money the State is obligated to reimburse under article XIII B, section 6, and its implementing statutes.
(13) Moreover, "[d]eclaratory relief operates prospectively to declare future rights, rather than to redress past wrongs. [Citation.]" (Canova v. Trustees of Imperial Irrigation Dist. Employee Pension Plan (2007) 150 Cal.App.4th 1487, 1497 [59 Cal.Rptr.3d 587]; see Environmental Defense Project of Sierra County v. County of Sierra, supra, 158 Cal.App.4th at p. 885.) A declaratory judgment "`serves to set controversies at rest before they lead to repudiation of obligations, invasion of rights or commission of wrongs; in short, the remedy is to be used in the interests of preventive *608 justice, to declare rights rather than execute them.' [Citations.]" (Babb v. Superior Court (1971) 3 Cal.3d 841, 848 [92 Cal.Rptr. 179, 479 P.2d 379].) The portion of the judgment awarding the Counties the amount of their reimbursement claims as declaratory relief does not operate prospectively to declare future rights; it redresses the State's "past wrongs" in failing to meet its constitutional obligations under article XIII B, section 6.
(14) We recognize that a court can award monetary relief in a declaratory relief action under appropriate circumstances. (Macmorris Sales Corp. v. Kozak (1968) 263 Cal.App.2d 430, 439 [69 Cal.Rptr. 719]; California Bank v. Diamond (1956) 144 Cal.App.2d 387, 390 [301 P.2d 60].) For example, if parties to a contract seek declaratory relief as to the validity of a contract, the court can declare the contract to be valid and enforceable and award damages for its breach in the interest of disposing of the entire controversy between the parties and granting complete relief. (See Bertero v. National General Corp. (1967) 254 Cal.App.2d 126, 145-148 [62 Cal.Rptr. 714].) However, such appropriate circumstances for awarding damages in connection with declaratory relief do not exist here because there is no actual controversy as to the validity or the amounts of the Counties' claims.

B. Money Judgment As Damages

We next consider whether the Counties' reimbursement claims were properly reduced to a money judgment under the Counties' second cause of action for damages, entitled "Failure to Reimburse Mandated Costs."[25] Although this cause of action does not clearly plead a particular theory, it suggests breach of contract by alleging the Counties provided the subject state-mandated services and programs "in reliance upon the State's promise to pay...." To the extent the second cause of action can be viewed as pleading breach of contract, it cannot support the money award in the judgment because, as we discussed, the State's obligation to pay the Counties' reimbursement claims under article XIII B, section 6 and its implementing statutes is not contractual.
The Counties' second cause of action also alleges the State's reimbursement obligations are "constitutional and statutory." Thus, we address whether the monetary award in the judgment can be sustained as damages for the State's violation of article XIII B, section 6, or its implementing statutes.
(15) "Article I, section 26 of the California Constitution states: `The provisions of this Constitution are mandatory and prohibitory, unless by *609 express words they are declared to be otherwise.' Under this provision, `all branches of government are required to comply with constitutional directives [citations] or prohibitions [citation].' [Citation.]" (Katzberg v. Regents of University of California (2002) 29 Cal.4th 300, 306-307 [127 Cal.Rptr.2d 482, 58 P.3d 339] (Katzberg).) In Katzberg the California Supreme Court set forth the appropriate analysis for determining whether a governmental violation of a state constitutional provision gives rise to an action for damages. First, the court inquires "whether there is evidence from which [it] may find or infer, within the constitutional provision at issue, an affirmative intent either to authorize or to withhold a damages action to remedy a violation. In undertaking this inquiry [the court considers] the language and history of the constitutional provision at issue, including whether it contains guidelines, mechanisms, or procedures implying a monetary remedy, as well as any pertinent common law history." (Id. at p. 317.)
(16) If the court finds no affirmative intent in the constitutional provision either to authorize or withhold a damages remedy, the court must undertake a "constitutional tort" analysis in which it considers "whether an adequate remedy exists, the extent to which a constitutional tort action would change established tort law, and the nature and significance of the constitutional provision. If [the court finds] that these factors militate against recognizing the constitutional tort, [the] inquiry ends. If, however, [the court finds] that these factors favor recognizing a constitutional tort, [it also considers] the existence of any special factors counseling hesitation in recognizing a damages action, including deference to legislative judgment, avoidance of adverse policy consequences, considerations of government fiscal policy, practical issues of proof, and the competence of courts to assess particular types of damages." (Katzberg, supra, 29 Cal.4th at p. 317.)
(17) Whether a statute gives rise to a private right of action is a question of legislative intent. (See County of Westchester v. New York (2d Cir. 2002) 286 F.3d 150, 153 [refusing to imply a private right of action in favor of counties for violations of federal Individuals with Disabilities Education Act (20 U.S.C. § 1400 et seq.) in the absence of clear congressional intent]. "If the Legislature intended a private right of action, that usually ends the inquiry. If the Legislature intended there be no private right of action, that usually ends the inquiry. If we determine the Legislature expressed no intent on the matter either way, directly or impliedly, there is no private right of action [citation], with the possible exception that compelling reasons of public policy might require judicial recognition of such a right. [Citations.]" (Animal Legal Defense Fund v. Mendes (2008) 160 Cal.App.4th 136, 142 [72 Cal.Rptr.3d 553].)
(18) Article XIII B, section 6, does not address remedies against the State for violation of the provision's reimbursement requirement. In line with the *610 presumption that an official duty will be regularly performed (Evid. Code, § 664; State Bd. of Education v. Honig (1993) 13 Cal.App.4th 720, 745 [16 Cal.Rptr.2d 727]), the provision contemplates the State will comply with its requirement to reimburse local governments for the costs of providing state-mandated programs and services and is silent as to the consequences of the State's failure to do so. Thus, we find no affirmative intent in the constitutional provision either to authorize or withhold a damages remedy.
However, the nature and purpose of article XIII B, section 6, militates against recognizing a "constitutional tort" for its violation. An implied right of action for violation of a constitutional provision typically is possessed by private persons who are harmed by state action that violates some individual constitutional right or freedom. (See, e.g., Gay Law Students Assn. v. Pacific Tel. & Tel. Co. (1979) 24 Cal.3d 458, 475 [156 Cal.Rptr. 14, 595 P.2d 592] [right of equal protection]; Porten v. University of San Francisco (1976) 64 Cal.App.3d 825, 829-830 [134 Cal.Rptr. 839] [right of privacy].) Article XIII B, section 6, concerns the State's obligation to reimburse the costs local agencies incur in providing state-mandated programs and services; it does not define or protect individual rights or freedoms, the infringement of which can cause harm of a tortious nature to private individuals or business entities. We have found no authority supporting an implied right of action on the part of a local governmental entity against the state government for violation of a constitutional provision concerning financial rights and obligations between the state and the local entity.
Section 17500 strongly evidences legislative judgment that there not be a private right of action on the part of local agencies against the State for the State's failure to comply with its reimbursement obligations under article XIII B, section 6, and we defer to the Legislature's judgment. (Katzberg, supra, 29 Cal.4th at p. 329 and cases cited in fn. 31.) Section 17500 notes that the prior statutory reimbursement scheme "led to an increasing reliance by local agencies and school districts on the judiciary...." Therefore, the Legislature enacted the present scheme "to relieve unnecessary congestion of the judicial system" and created the Commission on State Mandates "as a quasi-judicial body [to] act in a deliberative manner in accordance with the requirements of [article XIII B, section 6]." (§ 17500.)
Section 17612, subdivision (c), provides a remedy for the Legislature's failure to appropriate reimbursement funding for a state mandate, stating: "If the Legislature deletes from the annual Budget Act funding for a mandate, the local agency or school district may file in the Superior Court of the County of Sacramento an action in declaratory relief to declare the mandate unenforceable and enjoin its enforcement for that fiscal year." Generally, when a new right is created by statute, a party aggrieved by violation of the statute is *611 limited to the statutory remedy if one is provided. (Faria v. San Jacinto Unified School Dist. (1996) 50 Cal.App.4th 1939, 1947 [59 Cal.Rptr.2d 72].) Kinlaw held that the administrative procedure created by the statutes implementing article XIII B, section 6, for the resolution of state mandate claims is the sole and exclusive procedure by which a local agency may claim a reimbursable state mandate. (Kinlaw, supra, 54 Cal.3d at p. 333.) We infer from section 17500 and the overall statutory procedure for claiming reimbursement under article XIII B, section 6, the Legislature's intent not to authorize, but rather to foreclose, any right on the part of local agencies to pursue a legal action for damages against the State for failure to comply with article XIII B, section 6, and its implementing statutes.[26]
In their supplemental letter brief, the Counties argue that Carmel Valley and Long Beach establish precedent entitling them to a money judgment in this case. In both cases the State Board of Control (the predecessor agency to the Commission on State Mandates) determined certain programs and services were reimbursable state mandates, but the Legislature disagreed and deleted appropriations to reimburse the costs the plaintiffs incurred in providing those programs and services. (Carmel Valley, supra, 190 Cal.App.3d at p. 531; Long Beach, supra, 225 Cal.App.3d at pp. 166-167.) In both cases, the plaintiffs filed a petition for writ of mandate and complaint for declaratory relief seeking reimbursement, and the trial court entered a judgment that provided for a peremptory writ of mandate ordering the state defendants to pay the reimbursement claims, stated the amounts to be reimbursed, and awarded interest at the legal rate on those amounts. (Carmel Valley, supra, 190 Cal.App.3d at p. 532, fn. 7; Long Beach, supra, 225 Cal.App.3d at pp. 188-189, appen.)
Carmel Valley and Long Beach are distinguishable because the mandate-reimbursement claims at issue in those cases were disputed, and it was therefore necessary and proper for the court to adjudicate the issue of whether *612 the plaintiffs were constitutionally entitled to the reimbursement they sought and to reduce the state's disputed payment obligations to judgment as relief incidental to mandamus relief. It is proper to award "a money judgment in a mandamus [original italics] proceeding where other grounds for the issuance of a writ of mandate exist. [Citations.]" (Adams v. Wolff (1948) 84 Cal.App.2d 435, 439 [190 P.2d 665], italics added; see also Code Civ. Proc., § 1095; Cory v. Poway Unified School Dist. (1983) 147 Cal.App.3d 1158, 1167 [195 Cal.Rptr. 586].) Here, the Counties' entitlement to the money they sought was undisputed, and grounds for issuance of a writ of mandate did not exist because the writ relief the court granted was improper and the court acted within its discretion in denying the writ relief the Counties sought. Thus, the monetary award in the judgment cannot be sustained as being incidental to writ relief.
In summary, because there was no controversy as to the State's reimbursement obligations to the Counties for the subject state mandates or the amount of those obligations, the court did not properly award the monetary relief in the judgment as declaratory relief or relief incidental to declaratory relief, and the monetary award cannot be sustained as damages for violations of article XIII B, section 6, and its implementing statutes or as relief incidental to mandamus relief.[27]

CONCLUSION
(19) We are sympathetic to the financial burden placed on the Counties by the State's failure to meet its reimbursement requirements under article XIII B, section 6. Civil Code section 3523 provides that "[f]or every wrong there is a remedy." However, this statute does not permit a remedy through the courts when the remedy is with the Legislature. (Tulare County v. Kings County (1897) 117 Cal. 195, 202-203 [49 P. 8].) This case is more about *613 legislative inactioni.e., the Legislature's failure to appropriate money it was constitutionally required to appropriatethan the failure of state officials to carry out ministerial duties. As the California Supreme Court stated in Myers v. English (1858) 9 Cal. 341: "It is within the legitimate power of the judiciary, to declare the action of the Legislature unconstitutional, where that action exceeds the limits of the supreme law; but the Courts have no means, and no power, to avoid the effects of non-action. The Legislature being the creative element in the system, its action cannot be quickened by the other departments. Therefore, when the Legislature fails to make an appropriation, we cannot remedy that evil. It is a discretion specially confided by the Constitution to the body possessing the power of taxation. There may arise exigencies, in the progress of human affairs, when the first moneys in the treasury would be required for more pressing emergencies, and when it would be absolutely necessary to delay ... ordinary appropriations.... We must trust to the good faith and integrity of all the departments. Power must be placed somewhere, and confidence reposed in some one." (Id. at p. 349, disapproved on other grounds in Mandel, supra, 29 Cal.3d at p. 551, fn. 9.)[28]
In this case, we must trust to the integrity of the Legislature to comply with its constitutional and statutory obligations and must therefore presume the Counties will be fully reimbursed on their subject claims within the time allotted under article XIII B, section 6, subdivision (b)(2), and section 17617.[29]


*614 DISPOSITION
The judgment is reversed with directions to the superior court to vacate the peremptory writ of mandate issued on May 12, 2006, and enter a judgment denying the petition for writ of mandate. The State is entitled to recover costs on appeal.
McConnell, P. J., and McIntyre, J., concurred.
NOTES
[1]  We will refer to San Diego County and Orange County collectively as "the Counties."
[2]  All further article references are to the California Constitution unless otherwise specified.
[3]  All further statutory references are to the Government Code unless otherwise specified.
[4]  "`Subvention' generally means a grant of financial aid or assistance, or a subsidy. [Citation.]" (Hayes v. Commission on State Mandates (1992) 11 Cal.App.4th 1564, 1577 [15 Cal.Rptr.2d 547].)
[5]  The voters added article XIII A to the California Constitution by adopting Proposition 13 in 1978. (County of San Diego v. State of California, supra, 15 Cal.4th at p. 80.) The following year the voters approved Proposition 4, which added article XIII B to the state Constitution. (San Francisco Taxpayers Assn. v. Board of Supervisors (1992) 2 Cal.4th 571, 573-574 [7 Cal.Rptr.2d 245, 828 P.2d 147].)
[6]  The Counties noted the parties had agreed to bifurcate issues relating to the amounts the Counties were entitled to be paid on their reimbursement claims and that the motion for judgment on the pleadings was "asking the court to determine the legal issues relating to the [C]ounties' rights to immediate reimbursement."
[7]  Section 17617 was enacted in 2004 before the November election, presumably in anticipation of the voters' approval of Proposition 1A. The statute originally allowed the State to pay its reimbursement obligations under article XIII B, section 6, over a period of five years. The Legislature amended section 17617 in 2005 to extend the period for reimbursement to 15 years.
[8]  The State conceded at trial that the Counties are entitled to the money they seek in this action.
[9]  The statement of decision specifies each mandate by number (e.g., "Mandate 1"), summarizes the purpose of the mandate, and identifies the particular agency budget from which the Counties claimed the reimbursement amounts they sought could be funded, based largely on Hamm's testimony.
[10]  The court ruled the request was untimely because the Counties first raised the amendment issue two months after the evidentiary portion of the trial was completed. The court noted the Counties had not sought leave to amend after the court ruled on their motion for judgment on the pleadings, during trial, or in their objection to the court's tentative decision filed after trial.
[11]  The court cited section 965.7, subdivision (b), and Mandel v. Myers (1981) 29 Cal.3d 531, 550-551 [174 Cal.Rptr. 841, 629 P.2d 935] (Mandel). Section 965.7, subdivision (b) provides: "Nothing in this division affects the discretion of the Legislature in determining whether or not to: [¶] (1) Make an appropriation for the payment of a claim, compromise, settlement, or judgment or to provide an offset for a claim, compromise, settlement, or judgment, [¶] (2) Authorize such a payment or offset."

As discussed post, Mandel affirmed a court order directing an appropriate state official to pay, from already appropriated funds, an attorney fee award in a judgment against certain state defendants. The trial court here presumably intended to cite Mandel's discussion that begins with the statement: "We emphasize that our decision in this case in no way deprives the Legislature of its broad authority to control the state's fiscal affairs or to adopt appropriate measures to limit governmental expenditures." (Mandel, supra, 29 Cal.3d at pp. 550.) Mandel follows that statement with a discussion of various ways the Legislature could "restrict potential costs" in the form of attorney fee awards. (Id. at pp. 550-551.)
[12]  The "inferior tribunal" reference in Code of Civil Procedure section 1085 applies to a writ against an inferior court or other adjudicatory body. (See § 68097.1, subd. (d); Fam. Code, § 4901, subd. (v).) The state acts only through its officers or agents. (San Francisco etc. L. Co. v. Banbury (1895) 106 Cal. 129, 133 [39 P. 439].) Mandamus is available under Code of Civil Procedure section 1085 to compel an officer or agent of the state to perform an act that "the law specifically enjoins." (Code Civ. Proc., § 1085, subd. (a); see Venice Town Council, Inc. v. City of Los Angeles, supra, 47 Cal.App.4th at p. 1558.) Accordingly, we construe the Counties' petition for writ of mandate against the State of California as seeking a writ against the appropriate officers or agents of the state.
[13]  Mandel framed the question as being "whether the trial court could properly conclude that the appropriated funds . . . were reasonably available for payment of the attorney fees in question." (Mandel, supra, 29 Cal.3d at p. 542, italics added.)
[14]  Based on this conclusion, we deny the Counties' alternative request to modify the writ issued by the court to compel payment of the Counties' subject reimbursement claims over a period of five, rather than 15, years.
[15]  As noted, the court in its statement of decision twice referred to the Legislature's discretion to comply with the judgment. First, regarding the mandamus relief it fashioned, the court stated "compliance with the judgment rests solely in the discretion of the Legislature." (Italics added.) In a later paragraph the court stated the Counties were entitled to equal payments over 15 years plus "interest as mandated by law" and then added: "However, ultimate enforcement and compliance with this order rests in reality with the Legislature." (Italics added.)
[16]  The court expressly stated in its statement of decision: "The court, in its discretion, declines to order [the State to] immediately repay [the Counties] $114 million from the budgets of specific state agencies."
[17]  In their cross-appellants' opening brief, the Counties state: "Had the trial court properly interpreted and applied the law to the facts of the case, it should have found the Counties were entitled to prompt reimbursement on most, if not all, of the claims that were at issue. To be clear, the Counties are not requesting this Court to weigh the facts of the case and substitute its evaluation of the facts for that of the trial court." (Italics added.)
[18]  These six mandates concern, respectively, sex crimes (Mandate 3), booking and fingerprinting (Mandate 4), stolen vehicle notification (Mandate 7), Megan's Law (Mandate 6), MDO (mentally disordered offenders) extended commitments (Mandate 27) and coroners (Mandate 32).
[19]  In light of this conclusion, it is unnecessary to address the Counties' argument that the trial court improperly deprived them of their rights to reimbursement through a writ of mandate by retroactively applying Proposition 1A and section 17617.
[20]  Article I, section 10 of the United States Constitution provides, in relevant part, "No State shall ... pass any ... Law impairing the Obligation of Contracts." Article I, section 9, of the California Constitution provides, in relevant part, "A ... law impairing the obligation of contracts may not be passed."
[21]  The prayer for relief under the declaratory relief cause of action in the complaint of each county requests a judgment "1. Declaring that the State is constitutionally and statutorily obligated to promptly and fully reimburse [the county] on its claims for reimbursement for costs incurred in providing state mandated services and programs. [¶] 2. Declaring that defendants' failure to promptly and fully reimburse [the county] on its claims for reimbursement for costs incurred in providing state mandated services and programs is in clear violation of the State's constitutional and statutory obligation to fully and promptly reimburse local governments for costs they incur in providing programs and services mandated by the State."
[22]  Section 17562, along with sections 17600 and 17612, subdivision (a), sets forth certain reporting procedures that enable the Legislature to budget sufficient funds to meet the expense of state mandates. (Kinlaw, supra, 54 Cal.3d at p. 332.) Section 17567 requires the State Controller to prorate approved reimbursement claims when the amount appropriated for reimbursement is insufficient to pay all of the claims, and to immediately report taking that action to "the Department of Finance, the Chairperson of the Joint Legislative Budget Committee, and the Chairperson of the respective committee in each house of the Legislature which considers appropriations in order to assure appropriation of these funds in the Budget Act." (§ 17567.)
[23]  Civil Code section 3532 provides: "The law neither does nor requires idle acts."
[24]  We must presume that governmental agencies will obey and follow the law. (East Bay Mun. Utility Dist. v. Department of Forestry & Fire Protection (1996) 43 Cal.App.4th 1113, 1132 [51 Cal.Rptr.2d 299].)
[25]  The second cause of action in both complaints is substantially the same. The prayer for relief under the second cause of action appears to seek mandamus relief rather than damages because it does not request an award of damages but rather asks the court for a judgment "[d]irecting defendants to pay [the Counties] on [their] claims for reimbursement...."
[26]  We are aware that the Court of Appeal in Berkeley Unified School Dist. v. State of California (1995) 33 Cal.App.4th 350 [39 Cal.Rptr.2d 326] (Berkeley) referred to a "nonstatutory Mandel remedy" as being "judicially created to enforce the constitutional right arising under article XIII B, section 6." (Id. at p. 362.) However, Berkeley did not address the nature or form of a nonstatutory cause of action under Mandel; it simply addressed the applicable statute of limitations for such a cause of action and when the cause of action accrues for purposes of determining whether it is timebarred. There is no language in Berkeley supporting the proposition that article XIII B, section 6, or its implementing statutory scheme gives rise to a right of action for damages outside of the statutory scheme for the State's failure to promptly pay valid reimbursement claims. The "nonstatutory remedy" cases mentioned in Berkeley are Mandel, Carmel Valley and Long Beach, none of which involved a cause of action for damages. As noted, in Mandel the claimant brought a postjudgment motion for an order enforcing an award of attorney fees in a judgment against the state. As discussed ante, both Carmel Valley and Long Beach involved a petition for writ of mandate and a cause of action for declaratory relief.
[27]  Relying on Kinlaw, the State argues the court could not properly reduce the Counties' claims to a money judgment or grant mandamus relief because the statutes implementing article XIII B, section 6, provide the sole and exclusive means to obtain reimbursement of the costs of providing state-mandated programs and services. Under the State's analysis, a local agency could never properly petition for a writ of mandate to redress the state's failure to meet its reimbursement obligations under article XIII B, section 6. We do not go that far in our analysis. Although we conclude the court acted within its discretion in denying the writ relief the Counties sought in this case, due largely to the enormity of the Counties' claims and the insufficiency of their evidence to establish either appropriate connections between targeted appropriations and the specific mandates in question or the availability of the targeted funds, we note that Mandel, Carmel Valley and Long Beach support the view that under certain circumstances, writ relief outside of article XIII B, section 6's implementing statutes may be appropriate to compel the State to pay a reimbursement claime.g., where payment of an unreimbursed mandate is sought from appropriated funds that are clearly available in an area of the budget that is sufficiently unrestricted and related to the mandate to subject to payment by court order.
[28]  Although the Counties are denied the judicial remedy they seek in this case, it is important to note that the statutory scheme implementing article XIII A, section 6, does not leave local agencies remediless for the Legislature's failure to fund state mandates. Under section 17581, subdivision (a), if a state-mandated program is specifically identified in a budget act as a mandate for which funding is not provided for that fiscal year, local agencies can choose not to implement the program during that fiscal year. However, this relief is not available when a mandate is nominally, but not fully, funded; it is available only when the Legislature specifically identifies a mandate as unfunded in accordance with section 17581, subdivision (a). (Tri-County Special Educ. Local Plan Area v. County of Tuolumne (2004) 123 Cal.App.4th 563, 573 [19 Cal.Rptr.3d 884] (Tri-County).) When the Legislature provides only nominal funding for a mandate, as was the case with many of the mandates at issue here, the local agency's remedy is to file an action under section 17612, subdivision (c), to declare the mandate unenforceable and to enjoin its enforcement for that fiscal year. (See Tri-County, supra, 123 Cal.App.4th at p. 572, fn. 1.)
[29]  In light of our disposition of this case, it is unnecessary to address the State's contention that writ relief is inappropriate against the State Treasurer, State Controller, and Director of Finance because they have no statutory power to pay the judgment and have no statutory duty to report to the court regarding future legislative appropriations or the Counties' contention that the court erred in denying them prejudgment interest on their claims. We deny the parties' pending requests for judicial notice on the ground the materials in question are unnecessary to resolution of the appeal. (JRS Products, Inc. v. Matsushita Electric Corp. of America (2004) 115 Cal.App.4th 168, 174 [8 Cal.Rptr.3d 840].)
