Section 62. Any city, town or district officer who knowingly violates, or authorizes or directs any official or employee to violate, any provision of this chapter, or any other provision of general law relating to the incurring of liability or expenditure of public funds on account of any city, town or district, or any provision of special law relating to the incurring of liability or expenditure of public funds as aforesaid, shall, except as otherwise provided, be punished by a fine of not more than one thousand dollars or by imprisonment for not more than one year, or both; and the mayor, selectmen, prudential committee, or commissioners, shall, and five taxpayers may, report such violation to the district attorney who shall investigate and prosecute the same.