|
@@ -273,11 +273,11 @@ class AccountingAccount extends CommonObject
|
|
|
$sql .= ", " . (empty($this->pcg_type) ? 'NULL' : "'" . $this->db->escape($this->pcg_type) . "'");
|
|
|
$sql .= ", " . (empty($this->pcg_subtype) ? 'NULL' : "'" . $this->db->escape($this->pcg_subtype) . "'");
|
|
|
$sql .= ", " . (empty($this->account_number) ? 'NULL' : "'" . $this->db->escape($this->account_number) . "'");
|
|
|
- $sql .= ", " . (empty($this->account_parent) ? '0' : "'" . $this->db->escape($this->account_parent) . "'");
|
|
|
- $sql .= ", " . (empty($this->label) ? 'NULL' : "'" . $this->db->escape($this->label) . "'");
|
|
|
- $sql .= ", " . (empty($this->account_category) ? 0 : $this->db->escape($this->account_category));
|
|
|
+ $sql .= ", " . (empty($this->account_parent) ? 0 : (int) $this->db->escape($this->account_parent));
|
|
|
+ $sql .= ", " . (empty($this->label) ? "''" : "'" . $this->db->escape($this->label) . "'");
|
|
|
+ $sql .= ", " . (empty($this->account_category) ? 0 : (int) $this->db->escape($this->account_category));
|
|
|
$sql .= ", " . $user->id;
|
|
|
- $sql .= ", " . (! isset($this->active) ? 'NULL' : $this->db->escape($this->active));
|
|
|
+ $sql .= ", " . (empty($this->active) ? 0 : (int) $this->active);
|
|
|
$sql .= ")";
|
|
|
|
|
|
$this->db->begin();
|