|
|
@@ -336,6 +336,24 @@ class Distribution extends ActiveRecordCommon |
|
|
|
foreach($order->productOrder as $productOrder) { |
|
|
|
if($productOrder->id_product == $product->id) { |
|
|
|
$productOrder->price = $product->price ; |
|
|
|
|
|
|
|
$user = false; |
|
|
|
$userProducer = false; |
|
|
|
if(isset($order->user) && $order->user) { |
|
|
|
$user = $order->user; |
|
|
|
$userProducer = UserProducer::searchOne([ |
|
|
|
'id_user' => $user->id, |
|
|
|
'id_producer' => $order->distribution->id_producer |
|
|
|
]) ; |
|
|
|
} |
|
|
|
|
|
|
|
$productOrder->price = $productOrder->product->getPrice([ |
|
|
|
'user' => $user, |
|
|
|
'user_producer' => $userProducer, |
|
|
|
'point_sale' => $order->pointSale, |
|
|
|
'quantity' => $productOrder->quantity |
|
|
|
]); |
|
|
|
|
|
|
|
$productOrder->save() ; |
|
|
|
} |
|
|
|
} |