27 if (!defined(
'NOSESSION')) define(
'NOSESSION',
'1');
29 $sapi_type = php_sapi_name();
30 $script_file = basename(__FILE__);
34 if (substr($sapi_type, 0, 3) ==
'cgi') {
35 echo
"Error: You are using PHP for CGI. To execute ".$script_file.
" from command line, you must use PHP for CLI mode.\n";
39 require_once $path.
"../../htdocs/master.inc.php";
40 require_once DOL_DOCUMENT_ROOT.
"/compta/prelevement/class/bonprelevement.class.php";
41 require_once DOL_DOCUMENT_ROOT.
"/compta/facture/class/facture.class.php";
42 require_once DOL_DOCUMENT_ROOT.
"/societe/class/societe.class.php";
43 require_once DOL_DOCUMENT_ROOT.
"/compta/paiement/class/paiement.class.php";
46 $version = constant(
'DOL_VERSION');
55 dol_syslog($script_file.
" launched with arg ".join(
',', $argv));
59 $month = strftime(
"%m", $datetimeprev);
60 $year = strftime(
"%Y", $datetimeprev);
62 $user =
new user($db);
63 $user->fetch($conf->global->PRELEVEMENT_USER);
65 if (!isset($argv[1])) {
66 print "This script check invoices with a withdrawal request and\n";
67 print "then create payment and build a withdraw file.\n";
68 print "Usage: ".$script_file.
" simu|real\n";
74 $result = $withdrawreceipt->create($conf->global->PRELEVEMENT_CODE_BANQUE, $conf->global->PRELEVEMENT_CODE_GUICHET, $argv[1]);
dol_now($mode= 'auto')
Return date for now.
dol_getmypid()
Return getmypid() or random PID when function is disabled Some web hosts disable this php function fo...
Class to manage withdrawal receipts.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
print
Draft customers invoices.