
186 Kan. 637 (1960)
352 P.2d 70
UNITED STATES FIDELITY & GUARANTY COMPANY, a Corporation, Appellant and Cross Appellee,
v.
MARYLAND CASUALTY COMPANY, a Corporation, Appellee and Cross Appellant.
No. 41,800
Supreme Court of Kansas.
Opinion filed May 14, 1960.
James K. Cubbison, of Kansas City, argued the cause, and Blake A. Williamson, Lee Vaughan, Donald A. Hardy and A.C. Cooke, all of Kansas City, were with him on the brief for the appellant.
Thos. M. Van Cleave, of Kansas City, argued the cause, and Willard L. Phillips, P.B. McAnany, Thos. M. Van Cleave, Jr., and James J. Lysaught, all of Kansas City, were with him on the brief for the appellee.
The opinion of the court was delivered by
SCHROEDER, J.:
This is an action by the insurance carrier of the Griffin Construction Company, covered by the workmen's compensation act, against the insurance carrier of Wea Constructors, also covered by the workmen's compensation act, seeking to shift liability for the payment of workmen's compensation awards. The action is the outgrowth of this court's decision in Attebery v. Griffin Construction Co., 181 Kan. 450, 312 P.2d 598. Appeal has been duly perfected to this court from an order of the trial court sustaining a demurrer to the amended petition.
The basic questions presented are (1) whether the district court has jurisdiction of the subject of the action; and (2) whether the amended petition alleges facts sufficient to constitute a cause of action.
*639 The United States Fidelity & Guaranty Company, a corporation, appellant, (hereafter referred to as U.S.F. & G.), the insurance carrier of the Griffin Construction Company, (hereafter referred to as Griffin), filed an amended petition in the district court of Wyandotte County, Kansas, on the 8th day of October, 1958, against the Maryland Casualty Company, a corporation, appellee, (hereafter referred to as Maryland), the insurance carrier of Wea Constructors, a co-partnership of Paola, Kansas, (hereafter referred to as Wea), which insofar as material herein alleges in substance as follows:
Maryland insured Wea on a three-phase sewer job with the City of Paola, Kansas. On the third phase of the job, the building of the sanitary sewer, Wea subcontracted the work to Griffin. At the time the general contract was entered into between Wea and the City of Paola, Wea was operating with nonunion employees and Griffin was operating with union employees. In order to avoid imminent labor difficulties, which Wea was already encountering on its phase of the work under the contract "Wea and Griffin mutually, orally, agreed, ... on or about the first day of September, 1955, with respect to the subcontracted work, at approximately the time when the Griffin subcontract operation was about to commence at Paola, that Wea would carry all of the workmen to be employed on the Griffin subcontract job on the Wea payroll, pay the workmen, and make whatever deductions, for withholding taxes and for social security required to be made."
Thereupon a number of workmen were employed and the work of digging and laying sewer pipe commenced. Weekly payrolls on the sewer project were kept and processed by Wea who made deduction for withholding and social security taxes from the wages due the workmen, and thereafter the net earnings were paid to the workmen upon checks of Wea.
Wea from time to time received money from the City of Paola as the work progressed and accounted to Griffin, making deductions in such accounting for the wages Wea had paid, for performance and statutory bond premiums, and for payroll insurance for workmen's compensation and credited Griffin with the remainder of the money received.
Under the provisions of the general construction agreement between Wea and the City of Paola, Wea agreed, if a part of the contract was sublet, to cover any and all subcontractors' risks involved in Wea's insurance policies, including workmen's compensation risk, or in the alternative, that Wea could require the subcontractor, *640 in lieu thereof, to secure insurance against such risks as were not covered by the Wea policies. The agreement also provided that no subcontractor would be allowed to start any construction work until all insurance certificates required under said general contract were filed with the City. The amended petition then alleges:
"... that Wea did not request Griffin, at any time, to furnish any workmen's compensation insurance or certificate showing Griffin was carrying workmen's compensation; that Wea furnished an insurance certificate to the city, certified to by defendant herein, that it and defendant company were carrying all risks required under the general contract, including workmen's compensation (defendant's policy No. 01-186694 which is made a part hereof by reference as though fully set out herein); that no certificate of insurance was ever filed with the city showing Griffin was carrying any insurance risks on said job, either by Griffin or by plaintiff herein (who, at the time, was Griffin's general insurer), on employees carried on Griffin's payroll.
"8. That said sanitary sewer construction operations were thus carried on by Griffin until the ninth day of January, 1956, when three workmen were crushed to death, by a cavein in the sewer ditch in which they were working, i.e., Buford E. Attebery, Roy Ludwig and Wayne Cokely.
"9. That during the period while said sanitary sewer operations were being carried on, under the Workmen's Compensation policy of insurance furnished by Maryland to Wea, as referred to in the certificate furnished the City of Paola, defendant was authorized to audit Wea's books quarterly; that the premiums prescribed for said policy were to be based on the entire payroll of the said contractors; that more than one quarter period of time had expired under said policy before the death of said laborers; that under said policy, Wea was required to maintain records of the information necessary for premium computation by defendant; and to send copies of all such records to defendant; that said records, showing said sanitary sewer payroll of Wea, including the said deceased workmen's names, were furnished defendant by Wea."
The amended petition further alleges that claims for benefits under the workmen's compensation act were filed against both Wea and Griffin by the dependents of the three deceased workmen, and that during the trial thereon, said claimants elected to proceed against Griffin only, and dismissed their actions against Wea. The proceedings based upon these workmen's compensation claims resulted in a final award or judgment for compensation against Griffin and U.S.F. & G., said claims and the amounts awarded being respectively set forth in the amended petition, and alleging payments due in weekly installments. It is alleged U.S.F. & G. has made all payments required to be made under the running awards.
The prayer reads:
"Wherefore, defendant is primarily liable for the payment of said awards or judgments; that plaintiff is entitled to reimbursement for all sums paid under said awards and judgments; that subrogation should be invoked and *641 applied; that defendant's liability to the dependents of the deceased workmen for the unpaid portions of the running awards or judgments should be established without releasing the plaintiff as secondarily liable for the payment of said awards or judgments to said claimants; and plaintiff prays that subrogation be invoked in favor of the plaintiff and against the defendant; that plaintiff be reimbursed for all sums it has paid under said workmen's compensation awards or judgments; that defendant's liability to the dependents of the deceased workmen for the unpaid portion of the running awards or judgments obtained should be established; and for such other and further relief as the court may deem just and equitable." (Emphasis added.)
Maryland demurred to the amended petition of U.S.F. & G. for the following reasons:
"a. That the court has no jurisdiction of the subject of the action.
"b. That the petition does not state facts sufficient to constitute a cause of action against defendant and in favor of plaintiff."
The trial court overruled the first ground and sustained the demurrer on the second ground giving as its reason therefor that "the action cannot be prosecuted until the amount claimed by subrogation is shown to have been fully paid."
Appeal was duly perfected by U.S.F. & G. from the order of the trial court sustaining the demurrer on the second ground, and Maryland has cross-appealed from the order of the trial court overruling the demurrer on the first ground and overruling the demurrer on the second ground except for the reason stated.
Does the trial court have jurisdiction of the subject of the action?
It may be observed this court has given a green light for the instant action by one insurance carrier against the other in Attebery v. Griffin Construction Co., supra. An attempt was made in the Attebery case to adjudicate which of the two insurance companies is liable for payment of compensation, or whether both are liable, in a workmen's compensation proceeding by the dependent of one of the deceased workmen. It was there held that the commissioner properly dismissed Wea and Maryland from the proceeding at the request of the claimant who elected under the act to proceed against Griffin and U.S.F. & G., saying:
"By this appeal U.S.F. & G., who was a party to the proceedings before the Workmen's Compensation Commissioner, seeks to draw in another respondent and its insurance carrier and litigate rights, not relative to the obligation of U.S.F. & G. on its own policy to the respondent, Griffin, or the claimant, but its rights against the other insurance carrier. We are of the opinion that this is not only contrary to the spirit of the Workmen's Compensation Act but also contrary to the intention of the legislature in applying the *642 Act which is designed primarily for the protection of the injured workman or his dependents.
"At no place is this procedure authorized by the Workmen's Compensation Act itself. It follows that the remedies under the Workmen's Compensation Act are exhausted, thereby giving rise to an independent action by one insurance carrier against another on such matters incidentally arising out of contract which have no direct relation to the injured workman's right to compensation. Independent action arising out of incidental matters was contemplated by the Act where reference is made to indemnity and rights of subrogation." (p. 460.) (Emphasis added.)
The foregoing language was interpreted by this court in Haren v. Elevator Sales & Service Co., 186 Kan. 529, 351 P.2d 29, to clearly indicate that the "exhaustion of remedies" under the workmen's compensation act has reference to the exhaustion of remedies of the workman to recover compensation.
The appellee argues that if the action is based on the workmen's compensation act of Kansas it must be commenced before the Kansas compensation commissioner, citing Employers' Liability Assurance Corp. v. Matlock, 151 Kan. 293, 98 P.2d 456; and Hartford Accident & Ind. Co. v. Tri-State Casualty Ins. Co., (1951), 205 Okla. 117, 235 P.2d 703.
The concern of this court under the workmen's compensation act pertains primarily to the liability of the employer to the workman and not to the settlement of independent controversies which may arise between the various insurance carriers. (Justice v. Continental Can Co., 174 Kan. 539, 257 P.2d 564; and Attebery v. Griffin Construction Co., supra.) The Matlock case was fully discussed and reviewed in the Attebery case where it was factually distinguished from the instant action which is primarily between two insurance carriers. We therefore hold the trial court had jurisdiction of the subject of the action, and the action was properly instituted in the district court.
Various contentions of the parties will be discussed under the question whether the amended petition states sufficient facts to constitute a cause of action.
Recovery in the instant action is sought on the theory of "legal" subrogation. It was said in Hay v. Crawford, 159 Kan. 723, 158 P.2d 463:
"... `Legal' subrogation  which appellant invokes, as distinguished from `conventional' subrogation which is founded on contract  is grounded in equity and arises by operation of law. (60 C.J. 694 et seq.; 50 Am. Jur. 678 et seq.) But no rule can be laid down which will determine all cases. Its *643 applicability is to be determined from the facts and circumstances of each particular case. (50 Am. Jur. 688 et seq.; 60 C.J. 705, 707.) ..." (p. 732.)
Subrogation is founded on the principle that one cannot enrich himself by getting free of debt at the expense of another, not so fundamentally or primarily bound, by permitting him to pay the debt. The matter is one of comparative equities, the root of the doctrine being in justice and equity and not in contract. Whether or not the doctrine of subrogation is applicable depends upon the facts and circumstances of each particular case and upon principles of natural justice. In general it is applied where demanded by the dictates of equity, justice and good conscience. (Tillotson v. Goodman, 154 Kan. 31, 114 P.2d 845; Katschor v. Ley, 153 Kan. 569, 113 P.2d 127; and 83 C.J.S., Subrogation, § 5, p. 588.)
It has recently been recognized that the right to legal subrogation as distinguished from conventional subrogation arises by operation of law and does not depend upon contract, assignment or agreement. (Fenly v. Revell, 170 Kan. 705, 709, 228 P.2d 905.) The remedy is broad enough to include every instance in which one person, not a mere volunteer, pays a debt for which another is primarily liable and which in equity and good conscience should have been discharged by the latter. (83 C.J.S., Subrogation, § 5, p. 588.)
This court has recognized that a person secondarily liable who makes a payment for which subrogation is claimed for the protection of his own interest or in discharge of an existing liability is not to be regarded as a mere volunteer. (Old Colony Ins. Co. v. Kansas Public Ser. Co., 154 Kan. 643, 121 P.2d 193.)
Is the right to prosecute an action for "legal" subrogation barred because only partial payment has been made by U.S.F. & G. on the awards?
In Standard Surety & Cas. Co. v. Standard Acc. Ins. Co., 104 F.2d 492, subrogation was sought on the part of the insurer secondarily liable, and the lower court's decision allowing subrogation under a Kansas compensation proceeding was affirmed. Though the facts there presented were not similar to those in the instant appeal, the rule of law stated concerning subrogation nevertheless has application. The court said:
"The appellant seeks to invoke the general rule that one may not be subrogated to the rights and securities of a creditor until the claim of that creditor has been paid in full ... The reason for the rule against subrogation on *644 part payment is that the creditor cannot equitably be compelled to split his securities and give up control of any part until he is fully paid. `It [the rule] is for the benefit of the creditor, and he alone can object to subrogation under a partial payment and only to the extent that it would impair his preferred rights. The rule extends only so far as its reason goes, and is never invoked to defeat contract obligations in the interest of the debtor alone.' 60 C.J. 721. It is obvious that no reason exists for applying the rule here. The dependents of Joe Evans have been deprived of nothing by the decree appealed from, and have, if anything, been furnished additional security. The judgment which they procured in the District Court of Wyandotte County, upon its face, bound only the employer and the appellee; the decree in this suit establishes the appellant's liability to the dependents of Joe Evans for the unpaid portion of the judgment which they obtained, without releasing the appellee as a judgment debtor to them. Under such circumstances, subrogation will not be denied ..." (p. 497.)
It must be noted in the instant action that none of the dependents of the three deceased workmen will be deprived of anything by allowing subrogation, because in its amended petition U.S.F. & G. has requested that Maryland be held primarily liable for the payment of the three awards, but without releasing U.S.F. & G. as secondarily liable for the payment of said awards.
The principle of subrogation applied in the Standard Surety case has been recognized by this court in Jones v. Jones, 158 Kan. 196, 146 P.2d 405, where the court quoted 60 C.J. 720, as follows:
"`It is not necessary that payment be in money; anything accepted by the creditor is sufficient, provided it is actually accepted. However, where the special circumstances of the case demand it, equity has allowed subrogation in cases were [where] a liability only, and not payment, was shown.'" (p. 199.) (See, 83 C.J.S., Subrogation, § 10, p. 608.)
The position is taken by U.S.F. & G. in its brief that under the factual allegations of the amended petition Griffin and Wea occupied a position similar to that of general and special employer, respectively, of the deceased workmen under the workmen's compensation act, conceding secondary liability on the part of Griffin and citing Bright v. Bragg, 175 Kan. 404, 264 P.2d 494; and Mendel v. Fort Scott Hydraulic Cement Co., 147 Kan. 719, 78 P.2d 868.
In the instant action the dependents of the deceased workmen, the creditors, would be deprived of nothing by permitting subrogation as requested in the amended petition, but would, if anything, be furnished additional security, if U.S.F. & G. ultimately prevails in the action. Under these special circumstances we hold the allegations of the amended petition are sufficient to entitle U.S.F. & G. to prosecute this action for "legal" subrogation even though only *645 partial payment has been made by U.S.F. & G. on the awards, and the rule upon which Maryland relies, citing Bolman v. Commercial National Bank, 173 Kan. 155, 244 P.2d 1175; 50 Am. Jur., Subrogation, § 28; and 83 C.J.S., Subrogation, § 10, has no application.
Maryland contends the Kansas workmen's compensation act, G.S. 1949, 44-503, Subcontracting, determines the relationship of a contractor and a subcontractor and the legal obligation of each. This section states that the subcontractor is primarily liable and the contractor is secondarily liable. It is argued U.S.F. & G. is attempting to reverse the plain provisions of 44-503, supra, and claim that the contractor is primarily liable and the subcontractor is secondarily liable. In accordance with this theory Maryland raises the following questions:
Does the act create any legal obligation from a principal contractor to a subcontractor? Can a subcontractor seek subrogation from a principal contractor under the act? Can a subcontractor's insurance carrier sue the principal's insurance carrier without first determining the liability of the principal contractor?
Consideration of the foregoing questions on this appeal is immaterial. Maryland presupposes Wea to be the principal contractor and Griffin to be the subcontractor. U.S.F. & G. assumes the burden of proving otherwise.
The contention of U.S.F. & G. with respect to the allegations of the amended petition is that the original status of the parties  that of principal and subcontractor  was later modified by the acts of the parties. It was alleged Wea agreed to carry the employees on the Wea payroll and this, coupled with other facts alleged, changed the status of Wea and its relationship to Griffin so that in equity the insurer secondarily liable (U.S.F. & G.), who was required to furnish the money to pay the compensation awards, should be subrogated and entitled to recover from the insurer primarily liable (Maryland).
The amended petition of U.S.F. & G., construed as on demurrer by giving it all favorable inferences, is susceptible of the interpretation given it by U.S.F. & G. as above contended. Whether U.S.F. & G. can ultimately establish its position in the trial court must await the proof and ultimate determination by the trial court.
In the Attebery case the trial court found, upon the record there presented, that Griffin was the immediate employer of the deceased workman and that Griffin was the subcontractor of Wea, in accordance *646 with the burden of proof assumed by the claimant in that proceeding, but it was specifically recognized that Wea and Maryland were not parties to that action. It was said:
"... As between Wea and Griffin or U.S.F. & G. and Maryland their rights have not res judicata.. ." (p. 462.)
The finding of the trial court in the Attebery case, that the relation of principal-contractor existed between Wea and Griffin, respectively, was held to be supported by an abundance of substantial, competent evidence presented by the record therein.
It does not follow, however, that this court can on demurrer determine as a matter of law from the facts alleged in the amended petition herein that the relation of principal-contractor between Wea and Griffin, respectively, is established. Assuming the issue is properly joined by appropriate pleadings, this remains an open question for ultimate determination at the trial of the action.
Maryland contends there is no pleading to indicate that it has a contract or obligation to either Griffin or U.S.F. & G., and that the Attebery decision can only be interpreted as giving U.S.F. & G. a cause of action on a contract or matters incidentally arising out of contract. This point is not well taken.
Under the provisions of G.S. 1949, 44-532, the insurer is subrogated to the rights and duties of the employer under the act so far as appropriate. Thus, U.S.F.& G. is subrogated to the rights and duties of Griffin, and Maryland is subrogated to the rights and duties of Wea. In other words, U.S.F. & G. and Maryland stand in the shoes of Griffin and Wea, respectively. It was therefore proper for U.S.F. & G. to file this action directly against Maryland without joining Griffin or Wea as parties.
The amended petition alleged an oral agreement between Griffin and Maryland and performance in accordance therewith. This may be construed as altering the original relationship of principal and contractor between Wea and Griffin, respectively, viewing all of the allegations in the amended petition as on demurrer. Actually, the instant action incidentally arises out of three contracts, two policies of insurance and the independent oral agreement between Griffin and Wea after the original subletting by Wea to Griffin. This action incidentally arising out of the foregoing contracts has no direct relation to the right of the dependents of the deceased workmen to compensation. As heretofore emphasized in the quoted portion of the Attebery decision independent action arising out of *647 incidental matters was contemplated by the workmen's compensation act where reference is made to indemnity and rights of subrogation.
What was said in the Attebery decision regarding the certificate of insurance filed by Maryland with the city of Paola, showing workmen's compensation insurance coverage on Wea's contract with the City, is not inconsistent with the rights of U.S.F. & G. to maintain this action on the allegations in the amended petition. The argument advanced in the Attebery case was said to be without merit in that action where the trial court was weighing the evidence strictly from the viewpoint of the claimant's right to compensation. Here on the trial of the case the court will be required to weigh the evidence submitted under the allegations of the amended petition strictly from the equitable standpoint raised as to whether "legal" subrogation exists upon the facts.
In the supplemental counter abstract of Maryland the "Workmen's Compensation and Employers' Liability Policy Schedule" of U.S.F. & G. has been set forth. This cannot be considered a part of the amended petition, since it was furnished to Maryland under an order of the court directing U.S.F. & G. to attach a copy of its insurance policy with Griffin to the petition, or in the alternative, to allow Maryland to inspect and make a copy of said policy. Insofar as the record discloses the policy was not attached to the amended petition. In ruling on a demurrer a court is not justified in reaching out to make additional facts a part of the pleading under attack. This proposition of law applies equally to facts appearing in the Attebery case.
In construing the amended petition in accordance with the applicable rules on demurrer, it indicates Wea was carrying the payroll of the deceased workmen, which was the basis for premiums due Maryland who was carrying Wea's risk under the workmen's compensation act. A fair inference from the allegations is that the deceased workmen were not shown as employees on Griffin's payroll for this job, thus U.S.F. & G., who was carrying Griffin's risk under the workmen's compensation act, would not be entitled to charge premiums based on a payroll for such workmen under its policy. Under these circumstances the amended petition, viewed as on demurrer, states a cause of action against Maryland for primary liability on the several workmen's compensation awards entered against U.S.F. & G., and in equity and good conscience the awards should *648 be satisfied primarily by Maryland, if upon trial of the action U.S.F. & G. can sustain its burden of proof.
The judgment of the trial court as to the appeal is reversed and as to the cross appeal is affirmed.
