Преглед изворни кода

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

feature/export_comptable
Fab пре 4 година
родитељ
комит
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() ;

Loading…
Откажи
Сачувај