Bläddra i källkod

Merge branch 'develop'

master
Guillaume 2 år sedan
förälder
incheckning
035adbd084
7 ändrade filer med 24 tillägg och 27 borttagningar
  1. +1
    -0
      Builder/Order/OrderShopBuilder.php
  2. +8
    -7
      Controller/AdminControllerTrait.php
  3. +2
    -2
      EventSubscriber/Address/DuplicateAddressEventSubscriber.php
  4. +0
    -16
      Repository/Product/ProductFamilyStore.php
  5. +1
    -1
      Solver/Order/OrderShopSolver.php
  6. +2
    -1
      Solver/Price/OrderShopPriceSolver.php
  7. +10
    -0
      Solver/Product/ProductFamilySolver.php

+ 1
- 0
Builder/Order/OrderShopBuilder.php Visa fil

@@ -252,6 +252,7 @@ class OrderShopBuilder
}
foreach ($orderShop->getOrderProducts() as $orderProduct) {
if ($this->orderProductSolver->compare($orderProduct, $orderProductAdd)) {

$orderProduct->setQuantityOrder(
$orderProduct->getQuantityOrder() + $orderProductAdd->getQuantityOrder()
);

+ 8
- 7
Controller/AdminControllerTrait.php Visa fil

@@ -128,9 +128,9 @@ trait AdminControllerTrait

if ($duplicateOtherMerchantForm->isSubmitted() && $duplicateOtherMerchantForm->isValid()) {
$newEntity = $entityComponent->duplicateEntity($context->getEntity()->getInstance());
$entityManager->create($newEntity);
$merchant = $duplicateOtherMerchantForm->get('merchants')->getData();

$merchant = $duplicateOtherMerchantForm->get('merchants')->getData();
//
if($this->isInstanceOf(ProductFamilyInterface::class)) {
$sectionStore = $this->getSectionContainer()->getStore()->setMerchant($merchant);

@@ -158,12 +158,13 @@ trait AdminControllerTrait
}

$newEntity->initProductCategories();
}
}
else {
$newEntity->setMerchant($merchant);
}

$entityManager->update($newEntity);
//
//
$entityManager->create($newEntity, false);
$entityManager->flush();

$url = $this->get(AdminUrlGenerator::class)
@@ -230,10 +231,10 @@ trait AdminControllerTrait

if ($duplicateOtherSectionForm->isSubmitted() && $duplicateOtherSectionForm->isValid()) {
$newEntity = $entityComponent->duplicateEntity($context->getEntity()->getInstance());
$em->create($newEntity);
$em->create($newEntity, false);
$section = $duplicateOtherSectionForm->get('sections')->getData();
$newEntity->setSection($section);
$em->update($newEntity);
$em->update($newEntity, false);
$em->flush();

$url = $this->get(AdminUrlGenerator::class)

+ 2
- 2
EventSubscriber/Address/DuplicateAddressEventSubscriber.php Visa fil

@@ -45,7 +45,7 @@ class DuplicateAddressEventSubscriber implements EventSubscriberInterface
if(method_exists($entity, $methodGet) && method_exists($entity, $methodSet)){
$newAddress = clone $entity->$methodGet();
$entity->$methodSet($newAddress);
$this->em->persist($newAddress);
$this->em->create($newAddress, false);
}
}

@@ -53,4 +53,4 @@ class DuplicateAddressEventSubscriber implements EventSubscriberInterface
}


}
}

+ 0
- 16
Repository/Product/ProductFamilyStore.php Visa fil

@@ -52,22 +52,6 @@ class ProductFamilyStore extends AbstractStore
return $query;
}

public function isReductionCatalogDisplayed(ProductFamilyInterface $productFamily): bool
{
$reductionCatalog = $this->reductionCatalogStore->setMerchant($this->merchant)
->getByProductFamily($productFamily);

return $this->hasReductionCatalog($productFamily) && $reductionCatalog->isDisplayed();
}

public function hasReductionCatalog(ProductFamilyInterface $productFamily): bool
{
$reductionCatalog = $this->reductionCatalogStore->setMerchant($this->merchant)
->getByProductFamily($productFamily);

return (bool)$reductionCatalog;
}

public function getByParentCategory(
ProductCategoryInterface $parentCategory,
$user = null,

+ 1
- 1
Solver/Order/OrderShopSolver.php Visa fil

@@ -100,7 +100,7 @@ class OrderShopSolver
OrderShopInterface $orderShop,
ProductInterface $product,
$byWeight = false
): int {
): float {
$quantity = 0;
$productFamily = $product->getProductFamily();
$behaviorCountStock = $productFamily->getBehaviorCountStock();

+ 2
- 1
Solver/Price/OrderShopPriceSolver.php Visa fil

@@ -145,7 +145,8 @@ class OrderShopPriceSolver
{
$total = 0;
foreach ($orderProducts as $orderProduct) {
$total += $this->orderProductPriceResolver->getTotalWithTaxAndReduction($orderProduct, false);
//TODO : ici c'est pas possibble d'arrondir sinon ça fou une merde du tonnerre de de dieu !!!!
$total += $this->orderProductPriceResolver->getTotalWithTaxAndReduction($orderProduct);
}

return $this->round($total);

+ 10
- 0
Solver/Product/ProductFamilySolver.php Visa fil

@@ -506,5 +506,15 @@ class ProductFamilySolver

return $title;
}

public function isReductionCatalogDisplayed(ProductFamilyInterface $productFamily): bool
{
return $this->hasReductionCatalog($productFamily) && $productFamily->getReductionCatalog()->isDisplayed();
}

public function hasReductionCatalog(ProductFamilyInterface $productFamily): bool
{
return (bool)$productFamily->getReductionCatalog();
}
}


Laddar…
Avbryt
Spara