Browse Source

[Administration] Distribution > édition commande : correctif réinitialisation prix facturés #1330

master
Guillaume Bourgeois 1 year ago
parent
commit
7607a9ba8a
2 changed files with 18 additions and 1 deletions
  1. +1
    -1
      backend/controllers/DistributionController.php
  2. +17
    -0
      common/logic/Order/Order/Service/OrderSolver.php

+ 1
- 1
backend/controllers/DistributionController.php View File

} }
foreach ($order->productOrder as $productOrder) { foreach ($order->productOrder as $productOrder) {
$invoicePrice = $productManager->getPrice($productOrder->product, [ $invoicePrice = $productManager->getPrice($productOrder->product, [
'user' => $order->user ?: null,
'user' => $orderManager->getUserForInvoicing($order),
'point_sale' => $order->pointSale, 'point_sale' => $order->pointSale,
'user_producer' => $userProducer, 'user_producer' => $userProducer,
'quantity' => $productOrder->quantity 'quantity' => $productOrder->quantity

+ 17
- 0
common/logic/Order/Order/Service/OrderSolver.php View File



return $str; 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…
Cancel
Save