posting invoice for purchase order

can someone provide me sample code to create invoice line plz?