Section 24. In determining the amount of the tax payable under sections twenty-two and twenty-three, there shall be deducted all premiums on policies written but not taken, or cancelled through default of payment, and all premiums returned or credited to policyholders during the year for which the tax is determined, but not including premiums returned or credited on reinsurance assumed, provided that all premiums for which deduction is claimed have been included as premium receipts in a return made under section twelve of chapter sixty-two C and a tax assessed thereon.