@@ -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); |
@@ -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( |