Bläddra i källkod

Merge branch 'develop'

master
Guillaume 3 år sedan
förälder
incheckning
3f16746f72
4 ändrade filer med 19 tillägg och 5 borttagningar
  1. +3
    -3
      Repository/Order/OrderShopRepositoryQuery.php
  2. +7
    -1
      Repository/Order/OrderShopStore.php
  3. +1
    -1
      Solver/Config/UnitSolver.php
  4. +8
    -0
      Solver/Order/OrderShopSolver.php

+ 3
- 3
Repository/Order/OrderShopRepositoryQuery.php Visa fil

@@ -152,11 +152,11 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery
->setParameter('year', $year);
}

public function filterByDistributions(array $distributions): self
public function filterByDistributions(array $distributionArray): self
{
return $this
->andWhere('.distribution IN(:distributions)')
->setParameter('distributions', $distributions);
->andWhere('.distribution IN (:distributions)')
->setParameter('distributions', $distributionArray);
}

public function filterByProducts(array $products): self

+ 7
- 1
Repository/Order/OrderShopStore.php Visa fil

@@ -89,7 +89,7 @@ class OrderShopStore extends AbstractStore

public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
{
$query->orderBy('id', 'DESC');
//$query->orderBy('id', 'DESC');
return $query;
}

@@ -392,6 +392,10 @@ class OrderShopStore extends AbstractStore
$query->filterByDistribution($params['distribution']);
}

if (isset($params['distributions'])) {
$query->filterByDistributions($params['distributions']);
}

if (isset($params['isCart'])) {
$query->filterByStatus(OrderStatusModel::$statusAliasAsCart);
}
@@ -428,6 +432,7 @@ class OrderShopStore extends AbstractStore
if (isset($params['excludeComplementaryOrderShops']) || isset($params['mergeComplementaryOrderShops'])) {
$query->filterIsNullMainOrderShop();
}

if (isset($params['joinProductFamily'])) {
$query->joinProductFamily(true);
}
@@ -442,6 +447,7 @@ class OrderShopStore extends AbstractStore
if (isset($params['groupBy'])) {
$query->groupBy($params['groupBy']);
}

return $query;
}


+ 1
- 1
Solver/Config/UnitSolver.php Visa fil

@@ -13,7 +13,7 @@ class UnitSolver
if($quantity) {
return ($quantityProduct / $unit->getCoefficient()) * $quantity;
}else{
$quantity = 0;
return 0;
}
}


+ 8
- 0
Solver/Order/OrderShopSolver.php Visa fil

@@ -345,6 +345,14 @@ class OrderShopSolver
return false;
}

public function isDone(OrderShopInterface $orderShop): bool
{
if ($orderShop->getOrderStatus() && $orderShop->getOrderStatus()->getAlias() == OrderStatusModel::ALIAS_DONE ) {
return true;
}
return false;
}

// getProductQuantityMaxAddCart
public function getProductQuantityMaxAddCart(OrderShopInterface $orderShop, ProductInterface $product)
{

Laddar…
Avbryt
Spara