findProducers(); foreach($producersArray as $producer) { echo '> '.$producer->name."\n"; \Yii::$app->logic->setProducerContext($producer); $pointSaleArray = $pointSaleModule->getRepository()->findPointSales(); $creditFunctioningProducer = $producerModule->getConfig('credit_functioning'); $isOnlinePaymentActiveAndTypeOrder = $producerModule->isOnlinePaymentActiveAndTypeOrder($producer, false); foreach($pointSaleArray as $pointSale) { if($pointSale->payment_method_credit && !$pointSale->credit_functioning) { $pointSale->credit_functioning = $creditFunctioningProducer; if($pointSale->credit_functioning == Producer::CREDIT_FUNCTIONING_OPTIONAL) { $pointSale->payment_method_onsite = true; } $pointSale->save(); echo 'Point de vente "'.$pointSale->name. '" configuré sur "'.$pointSale->credit_functioning.'"'."\n"; } $return = $pointSaleModule->getBuilder()->initPaymentMethodsByCreditFunctioning($pointSale); if($return) { echo 'Point de vente "'.$pointSale->name. '" : modes de paiements adaptés'."\n"; } if($isOnlinePaymentActiveAndTypeOrder) { $pointSale->payment_method_online = true; $pointSale->save(); echo 'Point de vente "'.$pointSale->name. '" : paiement en ligne activé'."\n"; } } } } } ?>