@@ -246,8 +246,10 @@ class CronController extends BackendController | |||
'conditions' => 'date_delete IS NULL' | |||
]) ; | |||
$configCredit = Producer::getConfig('credit', $producer['id']) ; | |||
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) { | |||
$order->saveCreditHistory( |