corr. typo
This commit is contained in:
parent
6ea0919ebb
commit
95b5d8790d
@ -998,11 +998,11 @@ class FactureRec extends CommonInvoice
|
||||
*
|
||||
* WARNING: This method change temporarly context $conf->entity to be in correct context for each recurring invoice found.
|
||||
*
|
||||
* @param int $restictoninvoiceid 0=All qualified template invoices found. > 0 = restrict action on invoice ID
|
||||
* @param int $restrictioninvoiceid 0=All qualified template invoices found. > 0 = restrict action on invoice ID
|
||||
* @param int $forcevalidation 1=Force validation of invoice whatever is template auto_validate flag.
|
||||
* @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK)
|
||||
*/
|
||||
function createRecurringInvoices($restictoninvoiceid=0, $forcevalidation=0)
|
||||
function createRecurringInvoices($restrictioninvoiceid=0, $forcevalidation=0)
|
||||
{
|
||||
global $conf, $langs, $db, $user;
|
||||
|
||||
@ -1017,7 +1017,7 @@ class FactureRec extends CommonInvoice
|
||||
$tmparray=dol_getdate($now);
|
||||
$today = dol_mktime(23,59,59,$tmparray['mon'],$tmparray['mday'],$tmparray['year']); // Today is last second of current day
|
||||
|
||||
dol_syslog("createRecurringInvoices restictoninvoiceid=".$restictoninvoiceid." forcevalidation=".$forcevalidation);
|
||||
dol_syslog("createRecurringInvoices restrictioninvoiceid=".$restrictioninvoiceid." forcevalidation=".$forcevalidation);
|
||||
|
||||
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'facture_rec';
|
||||
$sql.= ' WHERE frequency > 0'; // A recurring invoice is an invoice with a frequency
|
||||
@ -1025,8 +1025,8 @@ class FactureRec extends CommonInvoice
|
||||
$sql.= ' AND (nb_gen_done < nb_gen_max OR nb_gen_max = 0)';
|
||||
$sql.= ' AND suspended = 0';
|
||||
$sql.= ' AND entity = '.$conf->entity; // MUST STAY = $conf->entity here
|
||||
if ($restictoninvoiceid > 0)
|
||||
$sql.=' AND rowid = '.$restictoninvoiceid;
|
||||
if ($restrictioninvoiceid > 0)
|
||||
$sql.=' AND rowid = '.$restrictioninvoiceid;
|
||||
$sql.= $db->order('entity', 'ASC');
|
||||
//print $sql;exit;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user