Section 6A. If a city, town or district has been allotted a grant by the commonwealth, or any agency or department thereof, for any purpose for which the city, town or district may incur debt that may be payable over a term of five years or longer, and is required primarily to pay that proportion of the expense for which reimbursement is to be received from the commonwealth, such reimbursement first having been agreed upon by the commonwealth or such agency or department, in order to provide the necessary funds to meet the expense for which reimbursement is to be made, the treasurer of the city may, with the approval of the official whose approval is required by the city charter in the borrowing of money, the treasurer of the town may, with the approval of the board of selectmen, and the treasurer of the district may, with the approval of the prudential committee, if any, otherwise the commissioners, incur debt outside the debt limit and issue notes therefor for a period not exceeding two years from their dates, and may refund the same from time to time; provided, however, that no loan shall be so refunded unless the auditor, in the case of a city, or the accountant or chief accounting officer in the case of a town or district which has such an officer, otherwise the treasurer, shall certify in a writing filed in the office of the treasurer, where it shall be open to inspection by the public, that at the time such loan is refunded, the city, town or district remains entitled to receive reimbursement in an amount at least equal to the amount of the refunding loan. The proceeds of such reimbursement shall be applied to the discharge of the loan, without the necessity of further appropriation. In the event the city, town or district shall no longer be entitled to receive reimbursement in an amount sufficient to pay all or any portion of a loan issued under this section at the time such loan matures, the loan shall be paid from revenue funds of the city, town or district to the extent it can no longer be refunded under this section. A payment made by a city, town or district as provided in the preceding sentence shall be reported by the auditor or accountant of the city, town or district, or other officer having similar duties, or by the treasurer if there be no such officer, to the assessors, who shall include the amount so reported in the determination of the next annual tax rate, unless the city, town or district has otherwise made provision therefor.