Przeglądaj źródła

Correctif

refactoring
Guillaume Bourgeois 1 rok temu
rodzic
commit
bbc2e5c49f
2 zmienionych plików z 7 dodań i 6 usunięć
  1. +4
    -3
      common/logic/Order/ProductOrder/Service/ProductOrderBuilder.php
  2. +3
    -3
      common/logic/Product/Product/Service/ProductSolver.php

+ 4
- 3
common/logic/Order/ProductOrder/Service/ProductOrderBuilder.php Wyświetl plik

@@ -65,10 +65,11 @@ class ProductOrderBuilder extends AbstractBuilder

public function updateProductOrderInvoicePrice(ProductOrder $productOrder, array $params = []): void
{

$productOrder->invoice_price = $this->productSolver->getPrice($productOrder->product, [
'user' => isset($params['user']) ?? null,
'user_producer' => isset($params['user_producer']) ?? null,
'point_sale' => isset($params['point_sale']) ?? null,
'user' => (isset($params['user']) && $params['user']) ? $params['user'] : null,
'user_producer' => (isset($params['user_producer']) && $params['user_producer']) ? $params['user_producer'] : null,
'point_sale' => (isset($params['point_sale']) && $params['point_sale']) ? $params['point_sale'] : null,
'quantity' => $productOrder->quantity
]);
$this->saveUpdate($productOrder);

+ 3
- 3
common/logic/Product/Product/Service/ProductSolver.php Wyświetl plik

@@ -23,10 +23,10 @@ class ProductSolver extends AbstractService implements SolverInterface
{
$specificPriceArray = $product->productPrice;

$user = isset($params['user']) ? $params['user'] : null;
$userProducer = isset($params['user_producer']) ? $params['user_producer'] : null;
$pointSale = isset($params['point_sale']) ? $params['point_sale'] : null;
$user = (isset($params['user']) && $params['user']) ? $params['user'] : null;
$pointSale = (isset($params['point_sale']) && $params['point_sale']) ? $params['point_sale'] : null;
$quantity = (isset($params['quantity']) && $params['quantity']) ? $params['quantity'] : 1;
//$userProducer = (isset($params['user_producer']) && $params['user_producer']) ? $params['user_producer'] : null;

if ($specificPriceArray && ($user || $pointSale)) {
$specificPriceArray = $this->productPriceSolver->filterByPriorityMatch(

Ładowanie…
Anuluj
Zapisz