foreach ($model->ordersOnCreate as $key => $idOrder) { | foreach ($model->ordersOnCreate as $key => $idOrder) { | ||||
$order = $orderModule->findOneOrderById($idOrder); | $order = $orderModule->findOneOrderById($idOrder); | ||||
$orderModule->updateOrderInvoice($order, $model); | $orderModule->updateOrderInvoice($order, $model); | ||||
$orderModule->getBuilder()->updateOrderInvoicePrices($order, | |||||
[ | |||||
'user' => $model->user, | |||||
'user_producer' => $this->getUserProducerModule()->getRepository() | |||||
->findOneUserProducer($model->user), | |||||
'point_sale' => $order->pointSale | |||||
]); | |||||
} | } | ||||
} | } | ||||
} | } |
{ | { | ||||
if ($this->orderSolver->isOrderFromProducer($order)) { | if ($this->orderSolver->isOrderFromProducer($order)) { | ||||
$this->updateOrderDeliveryNote($order, $deliveryNote); | $this->updateOrderDeliveryNote($order, $deliveryNote); | ||||
$order = $this->orderRepository->findOneOrderById($order->id); | $order = $this->orderRepository->findOneOrderById($order->id); | ||||
$user = $this->userRepository->findOneUserById($deliveryNote->id_user); | $user = $this->userRepository->findOneUserById($deliveryNote->id_user); | ||||
$userProducer = $this->userProducerRepository->findOneUserProducer($user); | $userProducer = $this->userProducerRepository->findOneUserProducer($user); |