|
|
@@ -1466,6 +1466,7 @@ class DistributionController extends BackendController |
|
|
|
|
|
|
|
if ($order && $order->distribution->id_producer == GlobalParam::getCurrentProducerId( |
|
|
|
) && $order->id_user) { |
|
|
|
|
|
|
|
$deliveryNote = null; |
|
|
|
$idDeliveryNote = $order->id_delivery_note; |
|
|
|
if ($idDeliveryNote) { |
|
|
@@ -1498,6 +1499,20 @@ class DistributionController extends BackendController |
|
|
|
if ($deliveryNote) { |
|
|
|
$order->id_delivery_note = $deliveryNote->id; |
|
|
|
$order->save(); |
|
|
|
|
|
|
|
// init invoice prices |
|
|
|
$user = User::searchOne([ |
|
|
|
'id' => $deliveryNote->id_user |
|
|
|
]); |
|
|
|
$userProducer = UserProducer::searchOne([ |
|
|
|
'id_user' => $deliveryNote->id_user, |
|
|
|
'id_producer' => GlobalParam::getCurrentProducerId() |
|
|
|
]); |
|
|
|
$order->initInvoicePrices([ |
|
|
|
'user' => $user, |
|
|
|
'user_producer' => $userProducer, |
|
|
|
'point_sale' => $order->pointSale |
|
|
|
]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |