1. Except as provided in subd. 2., a state agency and the department of revenue shall enter into a written agreement to have the department collect any amount owed to the state agency that is more than 90 days past due, unless any of the following applies: a. Negotiations between the agency and debtor are actively ongoing. b. The debt is the subject of legal action or administrative proceedings. c. The agency determines that the debtor is adhering to an acceptable payment arrangement. d. The debt is an amount owed under ch. 108 or under a federal unemployment benefit program administered by the department of workforce development. 1m. At least 30 days before the department pursues the collection of any debt referred by a state agency, either the department or the agency shall provide the debtor with a written notice that the debt will be referred to the department for collection. The department may collect amounts owed, pursuant to the written agreement, from the debtor in addition to offsetting the amounts as provided under sub. (3). The department shall charge each debtor whose debt is subject to collection under this paragraph a collection fee and that amount shall be credited to the appropriation under s. 20.566 (1) (h). 2. The department may enter into agreements described under subd. 1. with the courts, the legislature, authorities, as defined in s. 16.41 (4), and local units of government. 4. The secretary of revenue may waive the referral of certain types of debt. The department’s determination that a debt is not collectable does not prevent the referring agency from taking additional collection actions. 5. The department may collect debts and assess interest on delinquent amounts under this paragraph in the same manner that it collects taxes and assesses interest under ss. 71.82 (2), 71.91, 71.92, and 73.03 (20). The department’s use of tax returns and related information to collect debts under this paragraph is not a violation of s. 71.78, 72.06, 77.61 (5), 78.80 (3), or 139.38 (6). 6. If the debtor owes debt to the department and to other entities, payments shall first apply to debts owed to the department then to the other entities in the order determined under sub. (3) (a).