<?php

namespace RxConnexionBundle\Repository;

/**
 * InventoryPriceRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class InventoryPriceRepository extends \Doctrine\ORM\EntityRepository
{
    public function findAllAvailableForAccounting($inventory_id) {

        return $this->getEntityManager()->getRepository('RxConnexionBundle:InventoryPriceEntity')
            ->createQueryBuilder('iip')
            ->where('iip.inventory = :inventory_id')
            ->andWhere('iip.quantity != iip.quantityAccounted')
            ->setParameter('inventory_id', $inventory_id)
            ->getQuery()->getResult();
    }
}
