When copying a sales order with an installment plan, the order lines and installment plan were not linked in the new order

When copying a sales order with an installment plan, the sales order lines and the installment plan were copied, but the lines in the new order were not linked to the installment plan.