
35 Ill. App.3d 383 (1976)
342 N.E.2d 131
RALPH E. PEIFER, Plaintiff-Appellant,
v.
THE BOARD OF TRUSTEES OF THE POLICE PENSION FUND OF THE VILLAGE OF WINNETKA, Defendant-Appellee.
No. 61270.
Illinois Appellate Court  First District (2nd Division).
Opinion filed January 6, 1976.
Rehearing denied February 10, 1976.
*384 Richard F. McPartlin, of Chicago, for appellant.
Dean C. Cameron and David N. Cook, both of Chicago (Schiff, Hardin & Waite, of counsel), for appellee.
Reversed and remanded.
Mr. JUSTICE DOWNING delivered the opinion of the court:
Ralph E. Peifer (plaintiff) appeals the dismissal of his declaratory judgment complaint brought to determine his right to retire from the Village of Winnetka police force and receive a regular pension, after having been on a disability pension for a number of years.
Plaintiff became an active member of the Winnetka Police Department on January 10, 1949. He was promoted in 1952 to sergeant and in 1960 to lieutenant. In 1964 plaintiff underwent major surgery and applied for a disability pension as a result of his condition. In accord with plaintiff's request, the pension board of the Winnetka Police Department (defendant) placed plaintiff on "disability status."
In May 1973, while still on disability, plaintiff wrote to defendant inquiring as to the amount he would receive if he elected to retire from the police force according to section 3-114 of the Illinois Pension Code. (Ill. Rev. Stat. 1971, ch. 108 1/2, par. 3-114.) The letter also referred to an opinion by this court in People ex rel. Anastasia v. Civil Service Com. (1st Dist. 1973), 10 Ill. App.3d 583, 586-87, 295 N.E.2d 127, which construed section 3-114. This court held that a policeman on disability who elects to retire would receive a regular pension of 50% of the salary attached to his rank for one year immediately prior to his retirement rather than one year prior to his disability leave. On October 19, 1973, defendant informed plaintiff he did not qualify for the election to retire referred to in plaintiff's letter and pointed out recent amendments to the statute.
While plaintiff was on the disability pension, there were several changes in the applicable Illinois Pension Code. When plaintiff was placed on disability, section 3-114 provided:
"Whenever a policeman becomes physically or mentally disabled to an extent which necessitates the suspension of his duty on, or retirement from, the police force, he shall be paid a pension * * *. If the disability continues for a period which, when added to his period of active service equals 20 years, the policeman shall, if he is age 50 and if he elects to then retire from the police force, be paid a regular pension in lieu of such disability pension."
*385 In 1973 the Illinois legislature enacted Public Act 78-317, effective October 1, 1973, which repealed section 3-114 of the pension code and replaced it with section 3-114.1, 3-114.2 and 3-116.1. The new provisions altered the amount a disabled policeman was entitled to receive upon electing to retire. Section 3-116.1 provides:
"A policeman who completes 20 years of service and is age 50 or more, and who is on the disability pension roll * * * may * * * continue to receive, in lieu of any amounts which otherwise would be payable to him * * * a retirement pension * * * of 1/2 of the salary attached to his rank on the police force at the date of his retirement on disability."
As the result of the defendant's letter of October 19, 1973, plaintiff filed a declaratory judgment suit (Ill. Rev. Stat. 1973, ch. 110, par. 57.1) asking the circuit court to determine his right to elect to retire pursuant to the provisions of section 3-114 and to be paid a regular pension under the provisions of section 3-111 of the pension code.[1] Defendant filed a motion to dismiss and for involuntary dismissal. This motion cited section 45 of the Civil Practice Act which allows the dismissal of a complaint where it is substantially insufficient in law, and section 48(1)(i) of the Civil Practice Act which provides a complaint may be involuntarily dismissed where the claim against defendant is barred by other affirmative matter avoiding the legal effect of or defeating the claim or demand. (Ill. Rev. Stat. 1973, ch. 110, pars. 45, 48(1) (i).) Defendant based its motion on the following theories: (1) Public Act 78-317 repealed section 3-114 and added section 3-114.2; (2) plaintiff has never made the election he is now urging and therefore there is no justiciable controversy; (3) plaintiff retired because of a permanent disability in 1964 and may not elect to retire again; and (4) plaintiff did not satisfy the 20-year creditable service requirement for retirement.
Upon the trial court's granting the motion to dismiss, the plaintiff appeals, raising the following issues: (1) whether a declaratory judgment action was proper in this case; (2) whether application of Public Act 78-317 to plaintiff's situation violates the 1970 Illinois Constitution; and (3) whether plaintiff qualified for the provisions of section 3-114 which *386 were applicable to persons on disability status, thereby enabling him to retire under section 3-111.

I.
 1 Defendant's motion to dismiss questioned the propriety of plaintiff's action for a declaratory judgment to determine plaintiff's retirement benefits while plaintiff was still on disability. Plaintiff cited People ex rel. Anastasia v. Civil Service Com. (1st Dist. 1973), 10 Ill. App.3d 583, 586, 295 N.E.2d 127:
"[T]he plaintiff asked the trial court to construe the Illinois Pension Code to determine the amount of the pension he would receive if he elects to retire from the force. An actual controversy existed in the dispute between the plaintiff and the defendants over the amount to be paid. * * * [T]he lower court properly rendered a declaratory judgment to resolve the controversy."
The case at bar also presents an actual controversy between plaintiff and defendant regarding plaintiff's right to elect to retire from the force and the amount to be paid upon such retirement. Plaintiff's complaint sets forth the facts pointing out the controversy which had arisen with respect to his pension situation. The prayer for relief requested the circuit court to find and declare plaintiff's rights under the statute. Thus the plaintiff has satisfied the criteria of section 57.1 of the Illinois Civil Practice Act. This is a proper case for declaratory judgment since a decision in this case would terminate the controversy between the parties. Ill. Rev. Stat. 1973, ch. 110, par. 57.1.

II.
Section 5 of article XIII of the 1970 Illinois Constitution provides:
"Membership in any pension or retirement system of the State, any unit of local government or school district, or any agency or instrumentality thereof, shall be an enforceable contractual relationship, the benefits of which shall not be diminished or impaired."
This provision has been considered by our supreme court in Peters v. City of Springfield (1974), 57 Ill.2d 142, 150-51, 311 N.E.2d 107, and People ex rel. Illinois Federation of Teachers v. Lindberg (1975), 60 Ill.2d 266, 271-72, 326 N.E.2d 749. In Peters, a case involving an ordinance of the City of Springfield which reduced the mandatory retirement age of its policemen and firemen from 63 years to 60 years, the supreme court reviewed this constitutional provision, as it was urged the ordinance impaired *387 and diminished plaintiff's pension benefits. The court said, at pages 151-52:
"From our review of the constitutional debates and the authorities, we conclude that the purpose and intent of the constitution provision was to insure that pension rights of public employees which had been earned should not be `diminished or impaired' but that it was not intended, and did not serve, to prevent the defendant City from reducing the maximum retirement age, even though the reduction might affect the pensions which plaintiffs would ultimately have received." (Emphasis supplied.)
In the Teachers case the supreme court had before it suits brought by members of several teachers' pension funds challenging the authority of the Governor in making item reductions of certain appropriations made to these pension funds for the fiscal year 1974. Again the proceedings of the 1970 Illinois Constitutional Convention as related to section 5 of article XIII were reviewed. The supreme court concluded that this constitutional provision did not restrict the Governor's constitutional authority to reduce or veto a pension appropriation measure. So far as we can determine, these are the only cases on this point by a court of review in this State.
In the case at bar, when plaintiff was placed on "disability status" in 1964, section 3-114 stated:
"If the disability continues for a period which, when added to his period of active service equals 20 years, the policeman shall, if he is age 50 and if he elects to then retire from the police force, be paid a regular pension in lieu of such disability pension." (Ill. Rev. Stat. 1965, ch. 108 1/2, par. 3-114.)
According to the record, in May 1973 plaintiff had 15 years, 7 months and 22 days active service plus 8 years, 8 months and 2 days on disability. Thus when the disability period is added to the active service as permitted in section 3-114 in effect on May 10, 1973 (the date of plaintiff's letter to the defendant), the plaintiff had some 24 years, 3 months total service, well in excess of the 20 years required in section 3-114. The record further indicates that in 1966 plaintiff was age 47, thus indicating that as of May 10, 1973, he was over age 50, thereby meeting the second requirement of section 3-114. The record also indicates that as of May 10, 1973, plaintiff's disability still continued. Thus plaintiff, according to the record, clearly complied with the requirements of section 3-114. Consequently, on May 10, 1973, he was entitled to "be paid a regular pension in lieu of such disability pension." The regular pension then in *388 effect as provided in section 3-111 was a yearly pension equal to one-half of the salary attached to the rank he held on such police force for 1 year immediately prior to his retirement. Thus plaintiff correctly argues that the position of defendant diminished or impaired the benefits of the pension system as applied to him on May 10, 1973.
Public Act 78-317, effective October 1, 1973, repealed section 3-114 and enacted section 3-116.1 which provided:
"A policeman who completes 20 years of service and is age 50 or more, and who is on the disability pension roll * * * may * * * continue to receive, in lieu of any amounts which otherwise would be payable to him under Section 3-111 of this Article, a retirement pension for the remainder of his life, of 1/2 of the salary attached to his rank on the police force at the date of his retirement on disability." (Emphasis added.)
This is a drastic reduction in the amount plaintiff would be entitled to upon retirement under section 3-114 as interpreted by this court in Anastasia at page 587:
"A policeman who receives disability payments and then elects to retire receives a regular pension (in lieu of his disability pension) based on the salary attached to his rank for one year immediately prior to his retirement." (Emphasis added.)
 2 The new provisions of Public Act 78-317 may not be used to diminish the retirement benefits which plaintiff became eligible for under section 3-114. To allow this reduction in retirement benefits in our opinion would be a violation of plaintiff's contractual rights and section 5 of article XIII of the Illinois Constitution of 1970.
Therefore we must now determine if plaintiff was eligible to elect to retire from the police force pursuant to section 3-114.

III
 3 Defendant contends the retirement option of section 3-114 and Anastasia apply only to persons who have been suspended from their duties on the police force as a result of a temporary disability, not to persons who have retired from the force with a permanent disability. Defendant argues plaintiff had a permanent disability at the time his pension was allowed in 1964 and he, in effect, retired at that time and cannot elect to retire again.
So far as we can determine from the record, the first time defendant adopted its theory was in the October 1973 letter to plaintiff explaining plaintiff did not qualify for the retirement option of section 3-114. In its 1964 resolution responding to plaintiff's request to be placed on disability, *389 defendant stated plaintiff was being placed "on disability status." Its resolution contained no description of that disability as temporary or permanent, nor did it characterize the action as a retirement from the police force.
Furthermore, from 1964 to 1969 plaintiff submitted himself to medical examinations and had reports of these examinations sent to defendant in compliance with section 3-115 which then required and still requires:
"Medical examination of a policeman retired for disability shall be made at least once each year prior to attainment of age 50, as a check of the continuance of disability for service as a policeman. No examination shall be required after such age."
Section 3-115 provides that a "disability pension shall not be paid" unless certain stated requirements are fulfilled. Section 3-116 states that "[a] policeman whose duty is suspended because of disability" must submit himself to examinations and may be ordered restored to duty if "no longer disabled," unless the policeman has voluntarily retired after 20 years service. In our opinion these sections, when read together with the other pertinent provisions of the statute, clearly imply a policeman on disability is not permanently retired. Therefore, the option to elect to permanently retire as specified in section 3-114 remained open to disabled policemen prior to the October 1, 1973, repeal of this section.
Both parties cite Sup v. Cervenka (1928), 331 Ill. 459, 163 N.E. 396, defendant to support its argument that retirement because of disability and retirement because of length of service have the same meaning. Plaintiff refers to the discussion in the opinion regarding the distinction between a disability pension and a permanent retirement pension. Cervenka involved a claim to the right of increases in a disability pension every time there was a parallel increase for those on active duty. The court held the disability pension, like a retirement pension, cannot fluctuate once it is set. The simple fact here is that from 1964 until October 1973, the record does not indicate defendant ever considered plaintiff as retired. In our opinion Cervenka has no application to the set of facts in this case.
Our review of the record clearly indicates that defendant from 1964 to 1973 considered plaintiff to be on disability status, not retirement.

IV.
Defendant contends the trial court properly dismissed plaintiff's complaint because plaintiff was not entitled to retire under the creditable service clause of the pension code. (Ill. Rev. Stat. 1971, ch. 108 1/2, pars. 3-110, 3-111.) The retirement provisions of the 1971 pension code, *390 section 3-111 provided a policeman must have "creditable service of 20 years or more" before he is entitled to retire. Section 3-110 defined creditable service as:
"[T]he time served by a policeman as a member of a regularly constituted police force of a municipality. In computing creditable service * * * all periods of disability retirement for which a policeman has not received any disability pension payments under Section 3-114 of this Article shall be counted."
Defendant argues plaintiff does not have 20 years of creditable service since he only has 15 years of regular service and has received disability pension payments for the remaining years.
However, the language of section 3-114 clearly makes an exception to the creditable service provision for policemen on disability status:
"If disability continues for a period which, when added to his period of active service equals 20 years, the policeman shall, if he is age 50 and if he elects to then retire from the police force, be paid a regular pension in lieu of such disability pension." (Emphasis added.) Ill. Rev. Stat. 1971, ch. 108 1/2, par. 3-114.
Section 3-114 clearly provides for a tacking on of periods during which a disability pension may have been received if the policeman is on disability, is 50 years of age and if the period of disability plus the period of active service equals 20 years.
 4, 5 In considering the legislative intent in the construction of a statute, it is fundamental that the courts should construe the statute in its entirety. (34 Ill.L.&Pr. Statutes § 123 (1958).) Also when the legislative intent can be ascertained from the language used in the statute, that intent should prevail. (Berwyn Lumber Co. v. Korshak (1966), 34 Ill.2d 320, 323, 215 N.E.2d 240.) In our opinion the statute clearly provided  prior to the 1973 amendment  that under the conditions set forth in section 3-114 creditable service could include the period of disability.
Plaintiff satisfies the conditions set forth in section 3-114, thus he may elect to retire and be paid a regular pension provided in section 3-111. Cf. People ex rel. Anastasia v. Civil Service Com.
The dismissal of the complaint by the circuit court of Cook County is reversed and the matter is remanded for further proceedings consistent with the views expressed herein.
Reversed and remanded.
LEIGHTON, P.J., and HAYES, J., concur.
NOTES
[1]  Section 3-111 (Ill. Rev. Stat. 1971, ch. 108 1/2, par. 3-111), so far as pertinent, provides:

"Any policeman who has creditable service of 20 years or more and has reached age 50 and who is no longer in the service as a policeman, shall be entitled to a yearly pension equal to 1/2 of the salary attached to the rank he held on such police force for 1 year immediately prior to his retirement, payable from the police pension fund of the municipality; provided, that the pension shall be increased by 1% of such salary for each additional year of such service over 20 years, to a maximum of 60% of such salary."
