|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($arrayProducers as $producer) { |
|
|
foreach ($arrayProducers as $producer) { |
|
|
|
|
|
|
|
|
$producerManager->setProducerContext($producer); |
|
|
|
|
|
$distributionManager->setProducerContext($producer); |
|
|
|
|
|
$orderManager->setProducerContext($producer); |
|
|
|
|
|
$creditHistoryManager->setProducerContext($producer); |
|
|
|
|
|
$userManager->setProducerContext($producer); |
|
|
|
|
|
|
|
|
$this->getLogic()->setProducerContext($producer); |
|
|
|
|
|
|
|
|
$countOrders = 0; |
|
|
$countOrders = 0; |
|
|
$mailOrdersSend = false; |
|
|
$mailOrdersSend = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($arrayOrders && is_array($arrayOrders)) { |
|
|
if ($arrayOrders && is_array($arrayOrders)) { |
|
|
foreach ($arrayOrders as $order) { |
|
|
foreach ($arrayOrders as $order) { |
|
|
|
|
|
$orderManager->initOrder($order); |
|
|
if ($order->auto_payment && $configCredit) { |
|
|
if ($order->auto_payment && $configCredit) { |
|
|
if ($orderManager->getOrderAmount($order, Order::AMOUNT_REMAINING) > 0) { |
|
|
if ($orderManager->getOrderAmount($order, Order::AMOUNT_REMAINING) > 0) { |
|
|
$creditHistoryManager->createCreditHistory( |
|
|
$creditHistoryManager->createCreditHistory( |