Просмотр исходного кода

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

feature/export_comptable
Fab 4 лет назад
Родитель
Сommit
3ae846f885
7 измененных файлов: 35 добавлений и 2 удалений
  1. +14
    -0
      ShopBundle/Model/CreditHistory.php
  2. +1
    -1
      ShopBundle/Model/Document.php
  3. +1
    -0
      ShopBundle/Model/ProductFamily.php
  4. +4
    -0
      ShopBundle/Repository/OrderShopRepository.php
  5. +7
    -0
      ShopBundle/Repository/ProductCategoryRepository.php
  6. +7
    -0
      ShopBundle/Repository/ProductFamilyRepository.php
  7. +1
    -1
      ShopBundle/Services/Order/OrderUtilsStockTrait.php

+ 14
- 0
ShopBundle/Model/CreditHistory.php Просмотреть файл

@@ -10,6 +10,7 @@ use Lc\ShopBundle\Context\OrderPaymentInterface;
use Lc\ShopBundle\Context\OrderRefundInterface;
use Lc\ShopBundle\Context\PayoffInterface;
use Lc\ShopBundle\Context\UserMerchantInterface;
use Gedmo\Mapping\Annotation as Gedmo;

/**
* @ORM\MappedSuperclass()
@@ -47,6 +48,19 @@ abstract class CreditHistory extends AbstractEntity implements PayoffInterface
*/
protected $orderRefund;

/**
* @Gedmo\Blameable(on="create")
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface")
* @ORM\JoinColumn(nullable=true)
*/
protected $createdBy;

/**
* @Gedmo\Blameable(on="update")
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface")
* @ORM\JoinColumn(nullable=true)
*/
protected $updatedBy;

public function getAmount(): ?float
{

+ 1
- 1
ShopBundle/Model/Document.php Просмотреть файл

@@ -47,7 +47,7 @@ abstract class Document extends AbstractDocumentEntity implements FilterMerchant

/**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\AddressInterface")
* @ORM\JoinColumn(nullable=false)
* @ORM\JoinColumn(nullable=true)
*/
protected $buyerAddress;


+ 1
- 0
ShopBundle/Model/ProductFamily.php Просмотреть файл

@@ -97,6 +97,7 @@ abstract class ProductFamily extends AbstractDocumentEntity implements ProductPr

/**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\ProductInterface", mappedBy="productFamily", orphanRemoval=true, cascade={"persist"})
* @ORM\OrderBy({"position" = "ASC"})
*/
protected $products;


+ 4
- 0
ShopBundle/Repository/OrderShopRepository.php Просмотреть файл

@@ -154,6 +154,10 @@ class OrderShopRepository extends BaseRepository implements DefaultRepositoryInt
$query->andWhere('e.user = :user')->setParameter('user', $params['user']);
}

if(isset($params['address'])) {
$query->andWhere('e.deliveryAddress = :address OR e.invoiceAddress = :address')->setParameter('address', $params['address']);
}

if (isset($params['mergeComplementaryOrderShops'])) {
$query->andWhere('e.mainOrderShop IS NULL');
$query->leftJoin('e.complementaryOrderShops', 'complementaryOrderShops');

+ 7
- 0
ShopBundle/Repository/ProductCategoryRepository.php Просмотреть файл

@@ -28,6 +28,13 @@ class ProductCategoryRepository extends BaseRepository implements DefaultReposit
->orderBy('e.position', 'ASC');
}

public function findOneBySlug($slug)
{
$query = $this->findByMerchantQuery() ;
$query->andWhere('e.slug = :slug')->setParameter('slug',$slug) ;
return $query->getQuery()->getOneOrNullResult() ;
}

public function findAllParents($withOffline = false)
{
$query = $this->findByMerchantQuery()

+ 7
- 0
ShopBundle/Repository/ProductFamilyRepository.php Просмотреть файл

@@ -36,6 +36,13 @@ class ProductFamilyRepository extends BaseRepository implements DefaultRepositor
return $query->getQuery()->getResult() ;
}

public function findOneBySlug($slug)
{
$query = $this->findByMerchantQuery() ;
$query->andWhere('e.slug = :slug')->setParameter('slug',$slug) ;
return $query->getQuery()->getOneOrNullResult() ;
}

public function getProductFamiliesByCategory($category){
$query = $this->findByMerchantQuery() ;
$query = $this->joinRelations($query) ;

+ 1
- 1
ShopBundle/Services/Order/OrderUtilsStockTrait.php Просмотреть файл

@@ -134,7 +134,7 @@ trait OrderUtilsStockTrait
&& $orderProduct->getProduct()->getProductFamily()->getId() == $productFamily->getId())) {

if($byWeight) {
$quantity += $orderProduct->getQuantityOrder() * ($orderProduct->getQuantityProduct() / $product->getUnitInherited()->getCoefficient()) ;
$quantity += $orderProduct->getQuantityOrder() * ($orderProduct->getQuantityProduct() / $orderProduct->getProduct()->getUnitInherited()->getCoefficient()) ;
}
else {
$quantity += $orderProduct->getQuantityOrder() ;

Загрузка…
Отмена
Сохранить