It makes such deductions or payments illegal unless they are in pursuance of a contract; and it provides that deductions (or payments) for (a) fines, (b) bad work and damaged goods, (c) materials, machines, and any other thing provided by the employer in relation to the work shall be reasonable, and that particulars of the same in writing shall be given to the workman.