Ejemplo n.º 1
0
 public static function normalizeBankAccounts()
 {
     $limit = 400;
     \org\sopen\dev\DebugLogger::openLogFileAppend(CSopen::instance()->getConfigPath() . '/logs/sepa-integrate.log');
     try {
         $dFilter = new Addressbook_Model_ContactFilter(array(array('field' => 'query', 'operator' => 'contains', 'value' => '')), 'AND');
         /*$dFilter = new Addressbook_Model_ContactFilter(array(array(
         			'field' => 'contact_id',
         			'operator' => 'in',
         			'value' => array('100222', '100223')				)), 'AND');
         		*/
         $contactIds = Addressbook_Controller_Contact::getInstance()->search($dFilter, null, false, true);
         \org\sopen\dev\DebugLogger::log('Count adress ids: ' . count($contactIds));
         $count = 0;
         foreach ($contactIds as $contactId) {
             /*if($count++ > $limit){
             			break;
             		}*/
             $contact = Addressbook_Controller_Contact::getInstance()->get($contactId);
             self::doSepa($contact);
             //$bankAccountCollection = Billing_Controller_Debitor::getInstance()->getBankAccountCollectionForDebitor($debitor);
         }
     } catch (Exception $e) {
         \org\sopen\dev\DebugLogger::log('global error: ' . $e->__toString());
     }
 }