Custom Script for Stock Entry

In the stock entry form when we select purpose as Subcontract then the system asks for Purchase Order Number.

I want to write a 2 custom scripts

  1. Purchaser Order help should show only Subcontract Purchase Orders.
  2. When user selects the Purchase Order from help then system should not ask for Supplier. Supplier detail should automatically get populated from Purchase Order.

I appreciate if anybody can help me in this regard?