Pending vendor invoices

Hi All,

Does anyone know how to create pending vendor invoice from purchase order/Product receipt through x++ code or via Batch job?

If yes then please share it with me.

Or else you can suggest/guide me through the way to achieve the goal.

Thanks in advance.