Wrote test code for barinventoryitem controller.

Added needed constructor in barinventoryitem model.

Small changes in barinventoryitem controller.