fixes in jv test and purchase invoice test
commonified some purchase code, added test case for auto inventory accounting for purchase invoice
Merge branch 'master' of github.com:webnotes/erpnext

Conflicts:
	accounts/doctype/purchase_invoice/purchase_invoice.py
	stock/doctype/purchase_receipt/purchase_receipt.py
fixed test case of purchase invoice for auto inventory accounting