Update contratligne.class.php for Postgres active_line and close_line (#37477)
* Update contratligne.class.php for Postgres * Update contratligne.class.php close_line for postgres
This commit is contained in:
parent
502bc82815
commit
b1e693a1ac
1 changed files with 6 additions and 6 deletions
|
|
@ -937,9 +937,9 @@ class ContratLigne extends CommonObjectLine
|
|||
if ($resql) {
|
||||
if ($date_end >= 0) {
|
||||
// Update column llx_contrat.denormalized_lower_panned_end_date with next expiration date of an open contract
|
||||
$sqltoupdatecontract = "UPDATE ".MAIN_DB_PREFIX."contrat as c";
|
||||
$sqltoupdatecontract .= " SET c.denormalized_lower_planned_end_date = (SELECT MIN(date_fin_validite) FROM ".MAIN_DB_PREFIX."contratdet as cd WHERE cd.fk_contrat = ".((int) $this->fk_contrat)." AND cd.statut = ".ContratLigne::STATUS_OPEN.")";
|
||||
$sqltoupdatecontract .= " WHERE c.rowid = ".((int) $this->fk_contrat);
|
||||
$sqltoupdatecontract = "UPDATE ".MAIN_DB_PREFIX."contrat";
|
||||
$sqltoupdatecontract .= " SET denormalized_lower_planned_end_date = (SELECT MIN(date_fin_validite) FROM ".MAIN_DB_PREFIX."contratdet as cd WHERE cd.fk_contrat = ".((int) $this->fk_contrat)." AND cd.statut = ".ContratLigne::STATUS_OPEN.")";
|
||||
$sqltoupdatecontract .= " WHERE rowid = ".((int) $this->fk_contrat);
|
||||
$resqltoupdatecontract = $this->db->query($sqltoupdatecontract);
|
||||
if (!$resqltoupdatecontract) {
|
||||
$this->error = $this->db->lasterror();
|
||||
|
|
@ -1002,9 +1002,9 @@ class ContratLigne extends CommonObjectLine
|
|||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
// Update column llx_contrat.denormalized_lower_panned_end_date with next expiration date of an open contract
|
||||
$sqltoupdatecontract = "UPDATE ".MAIN_DB_PREFIX."contrat as c";
|
||||
$sqltoupdatecontract .= " SET c.denormalized_lower_planned_end_date = (SELECT MIN(date_fin_validite) FROM ".MAIN_DB_PREFIX."contratdet as cd WHERE cd.fk_contrat = ".((int) $this->fk_contrat)." AND cd.statut = ".ContratLigne::STATUS_OPEN.")";
|
||||
$sqltoupdatecontract .= " WHERE c.rowid = ".((int) $this->fk_contrat);
|
||||
$sqltoupdatecontract = "UPDATE ".MAIN_DB_PREFIX."contrat";
|
||||
$sqltoupdatecontract .= " SET denormalized_lower_planned_end_date = (SELECT MIN(date_fin_validite) FROM ".MAIN_DB_PREFIX."contratdet as cd WHERE cd.fk_contrat = ".((int) $this->fk_contrat)." AND cd.statut = ".ContratLigne::STATUS_OPEN.")";
|
||||
$sqltoupdatecontract .= " WHERE rowid = ".((int) $this->fk_contrat);
|
||||
$resqltoupdatecontract = $this->db->query($sqltoupdatecontract);
|
||||
if (!$resqltoupdatecontract) {
|
||||
$this->error = $this->db->lasterror();
|
||||
|
|
|
|||
Loading…
Reference in a new issue