Fix: pgsql compatibility
This commit is contained in:
parent
feb4fa7c72
commit
ae913053cb
@ -487,3 +487,6 @@ ALTER TABLE llx_user ADD civilite varchar(6) after entity;
|
|||||||
|
|
||||||
ALTER TABLE llx_element_element MODIFY sourcetype varchar(32) NOT NULL;
|
ALTER TABLE llx_element_element MODIFY sourcetype varchar(32) NOT NULL;
|
||||||
ALTER TABLE llx_element_element MODIFY targettype varchar(32) NOT NULL;
|
ALTER TABLE llx_element_element MODIFY targettype varchar(32) NOT NULL;
|
||||||
|
|
||||||
|
ALTER TABLE llx_societe_prices MODIFY tms timestamp NULL;
|
||||||
|
-- ALTER TABLE llx_societe_prices ALTER COLUMN tms DROP NOT NULL;
|
||||||
|
|||||||
@ -21,7 +21,7 @@ create table llx_societe_prices
|
|||||||
(
|
(
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
fk_soc integer DEFAULT 0,
|
fk_soc integer DEFAULT 0,
|
||||||
tms timestamp NOT NULL,
|
tms timestamp,
|
||||||
datec datetime,
|
datec datetime,
|
||||||
fk_user_author integer,
|
fk_user_author integer,
|
||||||
price_level tinyint DEFAULT 1
|
price_level tinyint DEFAULT 1
|
||||||
|
|||||||
@ -1329,15 +1329,17 @@ class Societe extends CommonObject
|
|||||||
{
|
{
|
||||||
if ($this->id)
|
if ($this->id)
|
||||||
{
|
{
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."societe ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."societe ";
|
||||||
$sql .= " SET price_level = '".$price_level."'";
|
$sql .= " SET price_level = '".$price_level."'";
|
||||||
$sql .= " WHERE rowid = " . $this->id .";";
|
$sql .= " WHERE rowid = " . $this->id;
|
||||||
|
|
||||||
$this->db->query($sql);
|
$this->db->query($sql);
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_prices ";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_prices ";
|
||||||
$sql .= " ( datec, fk_soc, price_level, fk_user_author )";
|
$sql .= " ( datec, fk_soc, price_level, fk_user_author )";
|
||||||
$sql .= " VALUES (".$this->db->idate(mktime()).",".$this->id.",'".$price_level."',".$user->id.")";
|
$sql .= " VALUES ('".$this->db->idate($now)."',".$this->id.",'".$price_level."',".$user->id.")";
|
||||||
|
|
||||||
if (! $this->db->query($sql) )
|
if (! $this->db->query($sql) )
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user