/** * List all the clients. * * @return \Symfony\Component\HttpFoundation\Response */ public function indexAction() { $gridCollection = new GridCollection(); $gridCollection->add('csbill.client.grid', 'active', 'check'); $gridCollection->add('csbill.client.grid.archived', 'archived', 'archive'); $gridCollection->add('csbill.client.grid.deleted', 'deleted', 'times'); $grid = $this->get('grid')->create($gridCollection); return $grid->getGridResponse(); }
/** * List all the available quotes. * * @return Response */ public function indexAction() { $gridCollection = new GridCollection(); $gridCollection->add('csbill.quote.grid.default_grid', 'active', 'check'); $gridCollection->add('csbill.quote.grid.archived_grid', 'archived', 'archive'); $grid = $this->get('grid')->create($gridCollection); /** @var QuoteRepository $quoteRepository */ $quoteRepository = $this->getRepository('CSBillQuoteBundle:Quote'); // Return the response of the grid to the template return $grid->getGridResponse(array('status_list' => array(Graph::STATUS_PENDING, Graph::STATUS_ACCEPTED, Graph::STATUS_CANCELLED, Graph::STATUS_DRAFT, Graph::STATUS_DECLINED), 'status_list_count' => array(Graph::STATUS_PENDING => $quoteRepository->getTotalQuotes(Graph::STATUS_PENDING), Graph::STATUS_ACCEPTED => $quoteRepository->getTotalQuotes(Graph::STATUS_ACCEPTED), Graph::STATUS_CANCELLED => $quoteRepository->getTotalQuotes(Graph::STATUS_CANCELLED), Graph::STATUS_DRAFT => $quoteRepository->getTotalQuotes(Graph::STATUS_DRAFT), Graph::STATUS_DECLINED => $quoteRepository->getTotalQuotes(Graph::STATUS_DECLINED)))); }
/** * List all the invoices. * * @return Response */ public function indexAction() { $gridCollection = new GridCollection(); $gridCollection->add('csbill.invoice.grid.default_grid', 'active', 'check'); $gridCollection->add('csbill.invoice.grid.archived_grid', 'archived', 'archive'); $gridCollection->add('csbill.invoice.grid.recurring_grid', 'recurring', 'refresh'); $grid = $this->get('grid')->create($gridCollection); /** @var \CSBill\InvoiceBundle\Repository\InvoiceRepository $invoiceRepository */ $invoiceRepository = $this->getRepository('CSBillInvoiceBundle:Invoice'); // Return the response of the grid to the template return $grid->getGridResponse(array('status_list' => array(Graph::STATUS_PENDING, Graph::STATUS_PAID, Graph::STATUS_CANCELLED, Graph::STATUS_DRAFT, Graph::STATUS_OVERDUE), 'status_list_count' => array(Graph::STATUS_PENDING => $invoiceRepository->getCountByStatus(Graph::STATUS_PENDING), Graph::STATUS_PAID => $invoiceRepository->getCountByStatus(Graph::STATUS_PAID), Graph::STATUS_CANCELLED => $invoiceRepository->getCountByStatus(Graph::STATUS_CANCELLED), Graph::STATUS_DRAFT => $invoiceRepository->getCountByStatus(Graph::STATUS_DRAFT), Graph::STATUS_OVERDUE => $invoiceRepository->getCountByStatus(Graph::STATUS_OVERDUE)), 'total_income' => $this->getRepository('CSBillPaymentBundle:Payment')->getTotalIncome(), 'total_outstanding' => $invoiceRepository->getTotalOutstanding())); }