Ver código fonte

Frontend : factures

feature/export_comptable
Guillaume 4 anos atrás
pai
commit
c24703846e
2 arquivos alterados com 10 adições e 0 exclusões
  1. +8
    -0
      ShopBundle/Repository/DocumentRepository.php
  2. +2
    -0
      ShopBundle/Services/Order/OrderUtils.php

+ 8
- 0
ShopBundle/Repository/DocumentRepository.php Ver arquivo

@@ -20,4 +20,12 @@ class DocumentRepository extends BaseRepository implements DefaultRepositoryInte
{
return DocumentInterface::class;
}

public function findLastInvoice()
{
$query = $this->findByMerchantQuery();
$query->orderBy('e.createdAt', 'DESC');
$query->setMaxResults(1);
return $query->getQuery()->getOneOrNullResult();
}
}

+ 2
- 0
ShopBundle/Services/Order/OrderUtils.php Ver arquivo

@@ -46,6 +46,7 @@ class OrderUtils
protected $orderShopRepo;
protected $reductionCreditRepo ;
protected $orderReductionCreditRepo ;
protected $documentRepo ;
protected $priceUtils;
protected $productFamilyUtils;
protected $documentUtils;
@@ -63,6 +64,7 @@ class OrderUtils
$this->orderShopRepo = $this->em->getRepository($this->em->getClassMetadata(OrderShopInterface::class)->getName());
$this->reductionCreditRepo = $this->em->getRepository($this->em->getClassMetadata(ReductionCreditInterface::class)->getName());
$this->orderReductionCreditRepo = $this->em->getRepository($this->em->getClassMetadata(OrderReductionCreditInterface::class)->getName());
$this->documentRepo = $this->em->getRepository($this->em->getClassMetadata(DocumentInterface::class)->getName());
$this->priceUtils = $priceUtils;
$this->productFamilyUtils = $productFamilyUtils;
$this->documentUtils = $documentUtils;

Carregando…
Cancelar
Salvar