Section 29. The fees for attending as a witness before the general court, the supreme judicial court, the superior court, the land court, a probate court or court of insolvency, a district court, county commissioners, a trial justice, a referee, an arbitrator, the division of industrial accidents or the board of conciliation and arbitration, or on any other occasion for which no express provision is made, or allowed to persons, except the debtor, who are examined under section eighty-two of chapter two hundred and sixteen, unless fraudulent conduct is charged and proved against them, shall be six dollars a day, and ten cents a mile for travel out and home; provided, that if the witness has a usual place of business or employment in the city or town where the court trial or hearing is held, travel shall be reckoned out and to such place of business or employment, and not out and home. Each witness shall certify in writing the amount of his travel and attendance.
Any person who at the request of the attorney general or a district attorney, for the purpose of assisting him in the investigation of any matter within his jurisdiction as such attorney general or district attorney, attends the attorney general at any place, or the office of such district attorney at a courthouse, shall receive the fees provided in the preceding paragraph for a witness attending the superior court and subject to the same provisions, except that the certificate required by the last sentence of said paragraph shall be accompanied by a voucher signed by the attorney general or the district attorney that such fees are due said person for his attendance as provided in this paragraph.
Expenses incurred by witnesses summonsed on behalf of a defendant determined to be indigent, as well as expenses incurred by witnesses summonsed on behalf of the commonwealth, as such expenses are determined in accordance with this section, shall be paid by the commonwealth after such witness has certified with the court the amount of his travel and attendance.