Procházet zdrojové kódy

Merge branch 'develop' of https://gitea.laclic.fr/Laclic/LcShopBundle into develop

feature/export_comptable
Fab před 4 roky
rodič
revize
e1ea6e8d79
2 změnil soubory, kde provedl 16 přidání a 2 odebrání
  1. +10
    -1
      ShopBundle/Repository/OrderShopRepository.php
  2. +6
    -1
      ShopBundle/Services/OrderUtils.php

+ 10
- 1
ShopBundle/Repository/OrderShopRepository.php Zobrazit soubor

@@ -85,6 +85,10 @@ class OrderShopRepository extends BaseRepository implements DefaultRepositoryInt
{
$query = $this->findByMerchantQuery() ;

if(isset($params['count']) && $params['count']) {
$query->select('count(e.id)') ;
}

if(isset($params['dateStart']) || isset($params['dateEnd'])) {
$params['dateField'] = isset($params['dateField']) ? $params['dateField'] : 'validationDate' ;
}
@@ -120,6 +124,11 @@ class OrderShopRepository extends BaseRepository implements DefaultRepositoryInt
$query->addOrderBy('deliverySlotPointSale.day', 'ASC') ;
$query->addOrderBy('deliverySlotPointSale.timeStart', 'ASC') ;

return $query->getQuery()->getResult() ;
if(isset($params['count']) && $params['count']) {
return $query->getQuery()->getSingleScalarResult();
}
else {
return $query->getQuery()->getResult() ;
}
}
}

+ 6
- 1
ShopBundle/Services/OrderUtils.php Zobrazit soubor

@@ -375,7 +375,12 @@ class OrderUtils
$orderPayment->setAmount($amount) ;
$orderPayment->setReference($reference) ;
$orderPayment->setComment($comment) ;
$orderPayment->setPaidAt($paidAt) ;
if($paidAt) {
$orderPayment->setPaidAt($paidAt) ;
}
else {
$orderPayment->setPaidAt(new \DateTime('now')) ;
}

$this->em->persist($orderPayment) ;
$this->em->flush() ;

Načítá se…
Zrušit
Uložit