FIX : better fix for #3805
This commit is contained in:
parent
b0419557b1
commit
019575d9ed
@ -3677,11 +3677,8 @@ class Facture extends CommonInvoice
|
|||||||
*/
|
*/
|
||||||
function is_last_in_cycle()
|
function is_last_in_cycle()
|
||||||
{
|
{
|
||||||
if (empty($this->situation_cycle_ref)) {
|
if (!empty($this->situation_cycle_ref)) {
|
||||||
// No point in testing anything if we're not inside a cycle
|
// No point in testing anything if we're not inside a cycle
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = 'SELECT max(situation_counter) FROM ' . MAIN_DB_PREFIX . 'facture WHERE situation_cycle_ref = ' . $this->situation_cycle_ref;
|
$sql = 'SELECT max(situation_counter) FROM ' . MAIN_DB_PREFIX . 'facture WHERE situation_cycle_ref = ' . $this->situation_cycle_ref;
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|
||||||
@ -3694,6 +3691,9 @@ class Facture extends CommonInvoice
|
|||||||
dol_syslog(get_class($this) . "::select Error " . $this->error, LOG_ERR);
|
dol_syslog(get_class($this) . "::select Error " . $this->error, LOG_ERR);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user