/**
  * @param \Orm\Zed\Invoice\Persistence\PavInvoiceQuery $invoiceQuery
  *
  * @return $this|\Orm\Zed\Invoice\Persistence\PavInvoiceQuery
  */
 protected function joinInvoiceRelations(PavInvoiceQuery $invoiceQuery)
 {
     return $invoiceQuery->joinBillingAddress('billingAddress', Criteria::LEFT_JOIN)->joinShippingAddress('shippingAddress', Criteria::LEFT_JOIN)->joinInvoiceItem(null, Criteria::LEFT_JOIN)->joinInvoiceDiscount(null, Criteria::LEFT_JOIN)->joinInvoiceExpense(null, Criteria::LEFT_JOIN);
 }
 /**
  * @param int $idInvoice
  *
  * @return \Orm\Zed\Invoice\Persistence\PavInvoiceQuery
  */
 public function queryInvoiceById($idInvoice)
 {
     $invoiceQuery = new PavInvoiceQuery();
     return $invoiceQuery->filterByPrimaryKey($idInvoice);
 }