//$langs->setDefaultLang('en_US'); // To change default language of $langs $langs->load("main"); // To load language file for default language @set_time_limit(0); // Load user and its permissions $result = $user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user. if (!$result > 0) { dol_print_error('', $user->error); exit; } $user->getrights(); print "***** " . $script_file . " (" . $version . ") *****\n"; if (!isset($argv[1])) { // Check parameters print "Usage: " . $script_file . " id_thirdparty ...\n"; exit; } print '--- start' . "\n"; print 'Argument id_thirdparty=' . $argv[1] . "\n"; // Start of transaction $db->begin(); require_once DOL_DOCUMENT_ROOT . "/contrat/class/contrat.class.php"; // Create invoice object $obj = new Contrat($db); $obj->socid = $argv[1]; $listofcontractsforcompany = $obj->getListOfContracts('all'); print_r($listofcontractsforcompany); // -------------------- END OF YOUR CODE -------------------- $db->close(); return $error;