瀏覽代碼

Frontend : factures

feature/export_comptable
Guillaume 4 年之前
父節點
當前提交
c24703846e
共有 2 個文件被更改,包括 10 次插入0 次删除
  1. +8
    -0
      ShopBundle/Repository/DocumentRepository.php
  2. +2
    -0
      ShopBundle/Services/Order/OrderUtils.php

+ 8
- 0
ShopBundle/Repository/DocumentRepository.php 查看文件

@@ -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 查看文件

@@ -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;

Loading…
取消
儲存