(a) This section applies only to executors and trustees acting under wills of testators who die after July 1, 1957 and whose wills are admitted to probate in this state, but does not apply if a contrary provision has been made by the testator, or by the executor or a trustee under the will pursuant to a power given him by the testator. "Executor" includes an administrator with the will annexed.
(b) The executor shall determine net probate income as follows:
(1) He shall ascertain the amount of property received by him which is the product of the property which passed to him by the will or by the execution of a power of appointment, or of any substitute for such property obtained by the executor by purchase, exchange, or otherwise.
(2) He shall include in the amount so ascertained the product of property used by the executor to discharge liabilities of the testator, or of the executor in his representative capacity, including legacies payable in money and interest thereon, or of any donee under the will.
(3) He shall determine how much of the amount so ascertained is classed as income under the other sections of this chapter.
(4) From the amount so determined he shall deduct any income taxes paid thereon by the executor except taxes on capital gains, and that share of the expenses of administration which is properly payable out of probate income. The amount remaining after the deduction is the net probate income.
(c) The executor at the time of distribution
(1) shall pay over to the trustee of any trust or other legatee to whom specific property other than money is bequeathed the net probate income of such property; and
(2) shall pay over all other net probate income to
(A) the trustee of any trust created out of the residue, and
(B) any legatee for life or years of any portion of the residue, and
(C) any legatee of an absolute interest in any portion of the residue, and
(D) any trustee of a sum of money under a trust created by the will but not payable out of the residue in pro rata shares, in accordance with the respective values of the property bequeathed or given in trust at the death of the testator as determined by the executor. If the executor makes a partial distribution to any legatee or trustee under subdivision (c)(2) above, the partial distributee shall share in the net probate income collected to that date but his share in the net probate income later collected by the executor shall be reduced accordingly.
(d) The amount of any net probate income distributed by the executor to each trustee or other distributee shall be stated in any decree of distribution.
(e) A testamentary trustee who received net probate income from an executor shall treat it as income of the trust for which he is acting.