A. Prior to the filing of a petition, and with the consent of the department, if the child is in the custody of the department, the court or district attorney may authorize an informal adjustment agreement or refer the matter to an intake officer as a families in need of services case.B. After the filing of a petition, and with the consent of the department, if a child is in the custody of the department, the court may authorize the district attorney to effect an informal adjustment agreement. The court may dismiss the petition or allow the petition to remain pending during the period of informal adjustment.