|
|
|
|
|
|
|
|
'conditions' => 'date_delete IS NULL' |
|
|
'conditions' => 'date_delete IS NULL' |
|
|
]) ; |
|
|
]) ; |
|
|
|
|
|
|
|
|
|
|
|
$configCredit = Producer::getConfig('credit', $producer['id']) ; |
|
|
|
|
|
|
|
|
foreach($arrayOrders as $order) { |
|
|
foreach($arrayOrders as $order) { |
|
|
if($order->payment_auto && Producer::getConfig('credit', $order->distribution->id_producer)) { |
|
|
|
|
|
|
|
|
if($order->payment_auto && $configCredit) { |
|
|
|
|
|
|
|
|
if ($order->getAmount(Order::AMOUNT_REMAINING) > 0) { |
|
|
if ($order->getAmount(Order::AMOUNT_REMAINING) > 0) { |
|
|
$order->saveCreditHistory( |
|
|
$order->saveCreditHistory( |