Purchase order creation

Purchase order creation

 Please advise how to have the system auto create the purchase orders from sales orders or invoices.