This commit is contained in:
Laurent Destailleur 2020-06-17 18:29:29 +02:00
parent 2f687a3c40
commit 32eaa9137c
2 changed files with 7 additions and 7 deletions

View File

@ -41,7 +41,7 @@ $action = GETPOST('action', 'aZ09');
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
$id = GETPOST('id', 'int'); // id of record $id = GETPOST('id', 'int'); // id of record
$mode = GETPOST('mode', 'aZ09'); // '' or 'tmp' $mode = GETPOST('mode', 'aZ09'); // '' or '_tmp'
$piece_num = GETPOST("piece_num", 'int'); // id of transaction (several lines share the same transaction id) $piece_num = GETPOST("piece_num", 'int'); // id of transaction (several lines share the same transaction id)
// Security check // Security check

View File

@ -1127,7 +1127,7 @@ class BookKeeping extends CommonObject
* *
* @param User $user User that modifies * @param User $user User that modifies
* @param bool $notrigger false=launch triggers after, true=disable triggers * @param bool $notrigger false=launch triggers after, true=disable triggers
* @param string $mode Mode * @param string $mode Mode ('' or _tmp')
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
public function update(User $user, $notrigger = false, $mode = '') public function update(User $user, $notrigger = false, $mode = '')
@ -1254,12 +1254,12 @@ class BookKeeping extends CommonObject
} }
/** /**
* Update movement * Update accounting movement
* *
* @param string $piece_num Piece num * @param string $piece_num Piece num
* @param string $field Field * @param string $field Field
* @param string $value Value * @param string $value Value
* @param string $mode Mode * @param string $mode Mode ('' or _tmp')
* @return number <0 if KO, >0 if OK * @return number <0 if KO, >0 if OK
*/ */
public function updateByMvt($piece_num = '', $field = '', $value = '', $mode = '') public function updateByMvt($piece_num = '', $field = '', $value = '', $mode = '')
@ -1268,9 +1268,9 @@ class BookKeeping extends CommonObject
$this->db->begin(); $this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element.$mode." as ab"; $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element.$mode;
$sql .= ' SET ab.'.$field.'='.(is_numeric($value) ? $value : "'".$this->db->escape($value)."'"); $sql .= ' SET '.$field.'='.(is_numeric($value) ? $value : "'".$this->db->escape($value)."'");
$sql .= ' WHERE ab.piece_num='.$piece_num; $sql .= " WHERE piece_num = '".$this->db->escape($piece_num)."'";
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (!$resql) { if (!$resql) {