diff --git a/include/class_phpcompta_sql.php b/include/class_phpcompta_sql.php index da335b369..fbe4e222f 100644 --- a/include/class_phpcompta_sql.php +++ b/include/class_phpcompta_sql.php @@ -90,7 +90,8 @@ class phpcompta_sql $this->load(); } public function save() { - if ( $this->p_id == -1 ) + $pk=$this->primary_key; + if ( $this->$pk== -1 ) $this->insert(); else $this->update();