How to make purchase order and automatically creating PR and PI and Payment Entry

Please check the reference: