Opinion by
Judge Doyle,Before this Court is an appeal by the Borough of Ridgway (Borough) from a decision and order of the Pennsylvania Public Utility Commission (PUC) requiring the Borough to permit the Eidgway Limited Partnership (Partnership) to establish, at its own expense, a connection with the Borough operated sewer system. The decision also directed the Borough to apply to the PUC for a certificate of public convenience on the grounds that it was operating a public utility service beyond its corporate limits. See Section 1501 of the Public Utility Code (Code), 66 Pa. C. S. §1501.
The facts of this case are essentially undisputed. In 1980, the Partnership commenced discussions with the Borough regarding the construction of an apartment complex in the Borough. During the course of these discussions the Partnership was advised that if connections to the Borough’s sewer system were to be made, it would be necessary to obtain approval therefor from the Pennsylvania Department of Environmental Resources (DEE) inasmuch as the DEE had placed the Borough under a sewage connection prohibition because of hydraulic overload problems. The Partnership accordingly arranged a meeting with representatives of DEE to discuss the situation, at which the Borough was represented by its engineer. Subsequently the Borough submitted a report on its *382sewer system and treatment plant for the year 1980 to the DEE. In the report, the Borough included the connections necessary to service the Partnership’s proposed apartment complex as part of its requested allocation for 1981. Owing to steps taken by the Borough to alleviate the hydraulic overload problem, the DEE lifted the connection prohibition and notified the Borough that twenty equivalent dwelling units plus the apartment complex could be permitted to connect to the Borough’s system.
At some point during the DEE’s consideration of the Borough’s request, the Partnership concluded that there were no feasible sites inside the Borough upon which to construct the apartments. It therefore chose a site north of the Borough, in Eidgway Township1 (Township), known as the Montmorenci Area. Pursuant to a procedure then in effect between the Township and the Borough, and following the DEE’s allocation of 1981 tap-ins, the Partnership then submitted to the Township Municipal Authority (Authority) a request to connect with the Borough’s system.2 Having no objection thereto, the Authority in turn forwarded the Partnership’s application to the Borough Council which rejected it five to one at its April 26, 1982 meeting.3
The Partnership responded to the Borough’s rejection of its application by filing actions in mandamus and for a mandatory injunction with the Court of Common Pleas of the Fifty-Ninth Judicial District, Elk County Branch. Both complaints alleged that the rejection was discriminatory and unreason*383able. The common pleas court denied the mandamus on the grounds that “the permission requested is not a ministerial act but one involving legislative discretion.” Ridgway Limited Partnership v. Borough of Ridgway, (No. 82-361 filed June 24, 1982), slip op. at 4. The mandatory injunction was refused on the basis of the Partnership failing to meet its burden of proof.
On May 10, 1982, the Partnership again challenged the Borough’s action, this time by filing a complaint with the PUC. A hearing was held on July 14, 1982, before Administrative Law Judge (ALJ) Joseph I. Lewis who, after consideration of the testimony before him and the depositions and exhibits introduced into evidence by the parties, entered an Initial Decision, finding, in pertinent part:
7. The Partnership optioned land on Montmorenci Road is some 500 feet from the [Borough’s] sewer line (Tr. 27) and in order to connect to the existing manhole it is necessary to pump the sewage uphill into the manhole. (Tr. 27).
8. Boro [sic] operates a sewer system in both Ridgway Borough and Ridgway Township. (Tr. 45).
9. The sewage disposal plant is in Ridgway Township (Tr. 45), and is operated by the Boro. (Tr. 46).
10. The Boro sewer line extension on the east (Tr. 58) borough side is called Boot Jack where it extends into Ridgway Township (Tr. 47-48) and is about a mile and a half in length; this is metered by the Township Authority and billed directly by the Township Authority to the customers (Tr. 64), which then pays the Boro.
*38411. The Boro sewer line extension on the west borough side has some 30 customers in the Township (Tr. 49), and these as well as the Boot Jack residents on the east side get both water and sewer service from the Boro. (Tr. 50).
12. The Partnership optioned land is to the north of Boro (Tr. 52), where Montmorenci Avenue is located (Tr. 53), and the only service rendered by Boro in Ridgway Township at this point is to the Ridgway Borough fire station (Tr. 52) which pays neither for water nor sewer service provided by the Boro, and has been tapped into the Boro system since 1960. (Tr. 59).
13. Neither the Boot Jack area (Tr. 63) nor the West End area (Tr. 60) connect in any way with the Montmorenci (Partnership’s) area.
14. In the Boot Jack area, the Township Authority collects from the customers and then pays the Boro, whereas in the West End area, the Authority meters the use, but the Boro collects directly from the customers. (Tr. 66).
From these findings the ALJ concluded:
1. The Borough of Ridgway operates as a public utility beyond its boundaries where it directly bills the residents of Ridgway Township for sewer service.
2. The Public Utility Commission has jurisdiction.
3. The providing of sewer service by the borough to its firehouse in Ridgway Township, is a municipal, not a public utility service.
4. The refusal to provide sewer service to applicant is reasonable and non-discriminatory.
5. The complaint is denied.
*385Both the Borough and the Partnership filed exceptions to specific aspects of the ALJ’s decision.4 The trial staff of the PUC, which has automatic party standing and may file exceptions to any decision by an administrative law judge, Section 332(h) of the Code, 66 Pa. C. S. §332 (h), also filed exceptions herein.5 All exceptions were denied by order entered November 23, 1982, and the decision of the ALJ became final.
The Partnership appealed the denial of its exceptions to the PUC. No appeal was taken by the Borough. On February 10, 1983, the PUC, after consideration of arguments and review of the record, issued a decision stating, in pertinent part:
The fundamental question raised by the Partnership’s Appeal is whether the Borough’s failure to extend service to the Partnership was unreasonable. The Partnership’s arguments in its appeal are persuasive. When we consider that the Partnership has expressed its intention to pay all capital costs involved in the main extension, that the Borough’s own engineer indicated that the Borough’s sewer system requires growth in order to remain viable, and that the Partnership’s proposed apartment complex would use only three per cent of the Borough’s surplus capacity, we conclude that the ALJ’s dismissal of the complaint must be reversed.
The PUC went on to conclude that, inasmuch as the ALJ had determined that the Borough operated as a *386public utility by providing service beyond its boundaries, a certificate of public convenience was necessary. It was accordingly ordered :
1. That the Borough of Ridgway shall file, within 30 days of entry of this Opinion ‘and Order, an application with this .Commission for a Certificate of Public Convenience.
2. That the Borough of Ridgway shall permit the sewer connection requested by the Ridgway Limited Partnership.
3. That the Ridgway Limited Partnership shall, as it explicitely [sic] agreed, make any reasonable capital contribution required to extend sewer service.
4. That the ratepayers of the Borough of Ridgway shall not bear any of the costs associated with the sewer extension.
The appeal to this Court followed, in which the Borough asserts that the PUC lacks jurisdiction over this matter and cannot require a certificate of public convenience; that the complaint herein should have been dismissed on the grounds of res judicata and that the refusal to provide sewer service to the Partnership was reasonable and non-discriminatory.
This Court’s scope of review of matters such as this requires that we affirm the decision of the PUC unless there has been a violation of constitutional rights or an error of law or unless the crucial findings are not supported by substantial evidence. Dutchland Tours, Inc. v. Pennsylvania Public Utility Commission, 13 Pa. Commonwealth Ct. 54, 318 A.2d 394 (1974). See Section 704 of the Administrative Agency Law, 2 Pa. C. S. §704.
With respect to the question of the PUC’s jurisdiction over this matter, where it is determined that a municipality has unilaterally extended uncertified utility service directly to the public beyond its boun*387daries for compensation, it is within the jurisdiction of the PUC to order reasonable extensions of the extraterritorial service. City of Erie v. Pennsylvania Public Utility Commission, 60 Pa. Commonwealth Ct. 102, 430 A.2d 1037 (1981); Section 1501 of the Code, 66 Pa. C. S. §1501.6 The primary consideration in making such a determination is whether the municipality holds itself out, by express or implied terms, as a supplier of the utility service to the public beyond its boundaries, as a class or a limited portion thereof, to the extent that the capacity of the municipality’s utility permits. See Borough of Ambridge v. Public Service Commission, 108 Pa. Superior Ct. 298, 165 A. 47 (1933).7 That an independent authority or another municipality intervenes in the transaction between a municipality’s utility and extraterritorial consumers does not preclude a conclusion that the provision of service to the public beyond the municipality’s borders subjects the municipality to PUC regulation. East Hempfield Township v. Lancaster, 441 Pa. 406, 273 A. 2d 333 (1971). In such circumstances, if ultimate control of the decision whether to provide extraterritorial service to a particular customer and of the particulars of the transaction itself remains vested with the municipality which owns the utility, then jurisdiction of the PU 0 and a determination that the municipality is providing service beyond its corporate limits for the purposes of Section 1501 of the Code is appropriate. East Hempfield.
*388In the case at bar, the Authority is a factor in the provision of sewer service by the Borough to Township residents. Its role clearly varies depending on the locale. The ALJ, however, determined that, insofar as the residents of the West End of the Township were concerned, the direct billing of them by the Borough for the service provided is indicative of a degree of direct control over extraterritorial service sufficient to provide the PUC with jurisdiction to adjudicate the reasonableness of the Borough’s refusal to extend service to the Partnership. The Borough filed exceptions to this aspect of the ALJ’s decision but failed to appeal the denial thereof to the PUC. Pursuant to Section 332(h) of the Code, 66 Pa. C. S. §332 (h), the conclusion that the Borough was providing extraterritorial service to the public was an appealable issue and, absent an appeal, the resolution thereof became final. The PUC accordingly was within its discretion in treating the determination as controlling for the purpose of addressing the Partnership’s appeal. Moreover, as the issue was not raised on appeal to the PUC, it has not been preserved for purposes of an appeal to this Court and may not now be raised. Section 703 of the Administrative Agency Law, 2 Pa. C. S. §703. See Duquesne Light Co. v. Battisti, 44 Pa. Commonwealth Ct. 350, 403 A.2d 1352 (1979). Hence, the answer to the question of whether the Borough is subject to the jurisdiction of the PUC in this matter, inasmuch as it is controlled by the conclusion that the Borough is a direct provider of extraterritorial sewer service to the public, must be yes.8 Such being the case, a certificate *389of public convenience is necessary, Section 1102(a)(5) of tbe Code, 66 Pa. C. S. §1102(a)(5), and we affirm the order of the PUC requiring the Borough to apply for one.
In view of the above resolution of the jurisdictional question herein, we must also reject the Borough’s assertion that, because the Partnership sought to obtain the denied service first by filing actions in mandamus and for a mandatory injunction in the court of common pleas, the PUC was barred from acting on the Partnership’s complaint by the doctrine of res judicata. For the doctrine of res judicata to operate as a bar to litigation, the court which has previously litigated the merits of a cause of action must have been of competent jurisdiction to do so. Bearoff v. Bearoff Brothers, Inc., 458 Pa. 494, 327 A.2d 72 (1974). The court of common pleas, because jurisdiction over the Partnership’s complaint against the Borough lay with the PUC, had no jurisdiction to address the actions brought before it by the Partner*390ship.9 East Hempfield. Res judicata therefore does not apply in this matter.10
The last question confronting us in this case is whether the PUC erred in holding that the Borough’s refusal of sewer service to the Partnership was unreasonable.11 The Borough presents five reasons *391why the PUC’s order should be deemed unreasonable. First, the Borough advances the argument that there is no sewer service to the Montmorenci Area and the other extraterritorial service it does provide is at least one mile away. While it is true that the PUC’s power in these matters is not unlimited and it cannot arbitrarily order extraterritorial service which may be miles away from existing service, Phoenixville v. Pennsylvania Public Utility Commission, 3 Pa. Commonwealth Ct. 56, 280 A.2d 471 (1971), here the Partnership’s apartment complex would be 500 to 1,000 feet away from a fire hall serviced by the Borough from its existing sewer line running up Montmorenci Avenue into the Township. The geographic proximity of existing service to the apartments is such that the absence of current residential service in the Montmorenci Area does not render the PUC’s order per se unreasonable.
The Borough’s second challenge to the reasonableness of the PUC order is the absence of an agreement with the Township to extend service into the Montmorenci Area. Making orders to provide extraterritorial service to a particular area contingent on contractual agreements with the neighboring municipality would, however, vitiate the statutory jurisdiction of the PUC over these matters under Section 1501 of the Code. A municipality could retain absolute control over the service to be provided by it by simply refusing to enter into a contract. As emphasized in Phoenixville, such a state of affairs should not be permitted. Adequate protection from orders to extend service beyond desired limits may be obtained through a certificate of public convenience. Id.
Next, the Borough argues that the record indicates that the Partnership’s property is “not readily accessible to the existing sewer system.” The distance of the property from the existing system and the need *392to pump sewage uphill are the two factors prominently cited in this regard. The relevance of such a contention escapes us. Pursuant to the order of the PUC, all of the costs connected to the Partnership’s tap into the Borough’s system are to be borne by the Partnership. The inaccessibility of the Borough’s system from the apartments is, if anything, a disincentive to the Partnership, and hardly operates to make the order of the PUC granting the Partnership’s request unreasonable.
Fourth, the Borough states that the Partnership “has not demonstrated the lack of other viable alternatives for disposition of its sewage.” If viable alternatives are shown to exist, the feasibility would undoubtedly be weighed against the pending request in the determination of whether the latter was reasonable. We find no authority, however, for the proposition that a lack of alternatives must be demonstrated as a prerequisite to an order to extend service.
Finally, the Borough challenges the PUC’s order on the grounds that “no hard evidence has been presented” to the effect that the revenues accruing to the Borough from the Partnership’s connection to the system will be necessary to the economic vitality of the system and that the PUC’s order is an intrusion into the fiscal discretion of the Borough officers. The Borough’s own engineer testified that the Partnership’s apartment complex would require approximately only three per cent of the system’s surplus capacity and that growth is necessary for the system to remain viable. Thus, there was substantial evidence to justify the PUC’s consideration of these factors in its overall determination of reasonableness. As for the fiscal discretion of Borough officers, we can only point out once again that the matter is completely within the jurisdiction of the PUC.
*393In conclusion, there is substantial evidence on the record supporting the determination of the PUC that the Borough’s existing service is within close proximity of the Partnership’s project, that the Borough system has sufficient capacity to meet the project’s needs and that allowing the requested tap-in will be of future benefit to the Borough’s system. And, in view of these factors and the additional fact that the Partnership is to absorb the costs of connecting to the Borough’s sewer system, we affirm the order of the PUC.
Order,
Now, June 26, 1984, the opinion and order of the Pennsylvania Public Utility Commission in the above captioned matter, entered February 10, 1983, C-823011, is hereby affirmed.
Ridgway Township completely surrounds the Borough of Ridgway.
The Township does not have a sewer system of its own.
No written decision was issued nor was a reason given for the Borough Council’s action.
While the decision of the AU was, on the whole, favorable to the Borough, the Borough did except to the conclusion of the AU that it, was operating as a public utility.
In light of the AU’s conclusion that the Borough was operating as a public utility, the trial staff excepted to his failure to require the Borough to apply for a certificate of public convenience.
Section 1501 of the Code reads, in pertinent part:
Any public utility service being furnished or rendered by a municipal corporation beyond its corporate limits shall be subject to regulation and control by the commission as to service and extensions, in the same force and in like manner as if such service were rendered by a public utility,
This consideration is the focal point, of the PUC’s analysis in its own opinions addressing this issue. See Lehigh Valley Cooperative Farmers v. City of Allentown, 54 Pa. P.U.C. 495 (1980).
The Borough’s assertion that it should not be precluded from an appeal on this issue because the ALJ’s decision “in no way adversely affected it” and because it “could not possibly have been on notice that it needed to appeal the ruling on exceptions ... in *389order to preserve its rights relative to the necessity for filing a certificate of public convenience” is devoid of merit. Sections 332(h) of the Code and 703 of the Administrative Agency Law and cases relative thereto are clear as to what must be done to preserve an appeal. We do note, however, that our review of the record discloses that that AM’s conclusion is supported by substantial evidence including, inter alia, evidence that the Borough has final authority over whether a party may tap into the system (as it exercised here) despite the presence of the Township Authority and control over maintenance of the system. There is also evidence to the effect that the Borough holds itself out as a provider of sewage service for compensation to pax-ties in the Township who make reasonable requests for service and who can be accommodated by the Borough’s system. While the Borough points to evidence which conflicts with the AM’s determination, it is the latter’s prerogative to weigh and resolve conflicts in the evidence and to determine its legal sufficiency. Philboro Coach Corp. v. Pennsylvania Public Utility Commission, 67 Pa. Commonwealth Ct. 176, 446 A.2d 725 (1982).
The fact that the actions were voluntarily submitted to the court of common pleas by 'the Partnership is of no moment. Jurisdiction over a cause of action or subject matter cannot be conferred on a court because the parties may agree to it. Calabrese v. Collier Township Municipal Authority, 430 Pa. 289, 240 A.2d 544 (1968).
If the court which addresses a matter on its merits is of competent jurisdiction, then the doctrine of res judicata bars future litigation if four elements are in concurrence: (1) identity of issues, (2) identity of causes of action, (3) identity of persons and parties (including those who are in privity with actual parties), and (4) identity of the quality or capacity of the parties. Day v. Volkswagenwerk Aktiengesellschaft, Pa. Superior Ct. , 464 A.2d 1313 (1983). In the instant case, the Partnership sought to obtain sewer service from the Borough through the court of common pleas via mandamus or mandatory injunction. Mandamus was denied because there were discretionary elements to the decision and hence no clear legal right to the service. See Philadelphia Newspapers, Inc. v. Jerome, 478 Pa. 484, 387 A.2d 425 (1978), appeal dismissed, 443 U.S. 913 (1979). The mandatory injunction was denied because the Partnership did not meet its burden of proof, i.e., that it was clearly entitled to immediate relief and would suffer irreparable injury if relief was not granted. See Allen v. Colautti, 53 Pa. Commonwealth Ct. 392, 417 A.2d 1303 (1980). By way of contrast, to prevail in its complaint before the PUC, the Partnership merely had to establish by substantial evidence that it would be reasonable for the Borough to provide it with sewer service. Given the obvious distinction in the burdens to be met by the Partnership, before the court of common pleas and the PUC, respectively it is clear that even were there jurisdiction in both forums, the common pleas decision essentially holding that the Partnership had not established that it had a right to service as a matter of law would not preclude a PUC decision to the effect that service would be reasonable and should be provided based on the facts of the case.
The focus of the PUC’s decision was the reasonableness of the requested service. The discrimination issue was not independently addressed and therefore need not be addressed here.