Browse Source

Merge branch 'develop'

master
Guillaume 3 years ago
parent
commit
3f16746f72
4 changed files with 19 additions and 5 deletions
  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 View File

->setParameter('year', $year); ->setParameter('year', $year);
} }


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


public function filterByProducts(array $products): self public function filterByProducts(array $products): self

+ 7
- 1
Repository/Order/OrderShopStore.php View File



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


$query->filterByDistribution($params['distribution']); $query->filterByDistribution($params['distribution']);
} }


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

if (isset($params['isCart'])) { if (isset($params['isCart'])) {
$query->filterByStatus(OrderStatusModel::$statusAliasAsCart); $query->filterByStatus(OrderStatusModel::$statusAliasAsCart);
} }
if (isset($params['excludeComplementaryOrderShops']) || isset($params['mergeComplementaryOrderShops'])) { if (isset($params['excludeComplementaryOrderShops']) || isset($params['mergeComplementaryOrderShops'])) {
$query->filterIsNullMainOrderShop(); $query->filterIsNullMainOrderShop();
} }

if (isset($params['joinProductFamily'])) { if (isset($params['joinProductFamily'])) {
$query->joinProductFamily(true); $query->joinProductFamily(true);
} }
if (isset($params['groupBy'])) { if (isset($params['groupBy'])) {
$query->groupBy($params['groupBy']); $query->groupBy($params['groupBy']);
} }

return $query; return $query;
} }



+ 1
- 1
Solver/Config/UnitSolver.php View File

if($quantity) { if($quantity) {
return ($quantityProduct / $unit->getCoefficient()) * $quantity; return ($quantityProduct / $unit->getCoefficient()) * $quantity;
}else{ }else{
$quantity = 0;
return 0;
} }
} }



+ 8
- 0
Solver/Order/OrderShopSolver.php View File

return false; return false;
} }


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

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

Loading…
Cancel
Save