Create automatic Purchase Order for specific Supplier on a weekly basis?

Dear Erpnext experts;

I would like to automatically create a purchase order, on a weekly basis, for specific materials. Currently I calculate the values through a PHP script.

Would there be a possibility to generate and print the PO to PDF, retrieve it with PHP and send it to the supplier?

Or would there be a better possibility for this purpose?

The required quantities unfortunately dont come from ERP Next itself, but from a external PHP script.