Преглед изворни кода

Merge branch 'hotfix/hotfix_1330'

master
Guillaume Bourgeois пре 1 година
родитељ
комит
12e1b42fef
2 измењених фајлова са 18 додато и 1 уклоњено
  1. +1
    -1
      backend/controllers/DistributionController.php
  2. +17
    -0
      common/logic/Order/Order/Service/OrderSolver.php

+ 1
- 1
backend/controllers/DistributionController.php Прегледај датотеку

@@ -563,7 +563,7 @@ class DistributionController extends BackendController
}
foreach ($order->productOrder as $productOrder) {
$invoicePrice = $productManager->getPrice($productOrder->product, [
'user' => $order->user ?: null,
'user' => $orderManager->getUserForInvoicing($order),
'point_sale' => $order->pointSale,
'user_producer' => $userProducer,
'quantity' => $productOrder->quantity

+ 17
- 0
common/logic/Order/Order/Service/OrderSolver.php Прегледај датотеку

@@ -476,4 +476,21 @@ class OrderSolver extends AbstractService implements SolverInterface

return $str;
}

public function getUserForInvoicing(Order $order): ?User
{
if($order->invoice && $order->invoice->user) {
return $order->invoice->user;
}

if($order->deliveryNote && $order->deliveryNote->user) {
return $order->deliveryNote->user;
}

if($order->user) {
return $order->user;
}

return null;
}
}

Loading…
Откажи
Сачувај