Bonds, contracts, or other papers relating to or connected with the settlement of any account may, in the same manner, be proved by the production of a certified copy, but the court may require the production of the original contract or other writing, when this appears to be necessary for the attainment of justice.