Skip to content

Commit

Permalink
Fix unit test on accounting
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jan 20, 2019
1 parent 24cb6ec commit f7c11ec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -312,8 +312,8 @@ script:

- |
echo "Upgrading Dolibarr"
# Ensure we catch errors
set +e
# Ensure we catch errors. Set this to +e if you want to go to the end to see log files.
set -e
cd htdocs/install
php upgrade.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360.log
php upgrade2.php 3.5.0 3.6.0 > $TRAVIS_BUILD_DIR/upgrade350360-2.log
Expand Down
8 changes: 4 additions & 4 deletions htdocs/accountancy/class/accountingaccount.class.php
Expand Up @@ -273,11 +273,11 @@ function create($user, $notrigger = 0)
$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();
Expand Down
2 changes: 2 additions & 0 deletions htdocs/install/mysql/migration/8.0.0-9.0.0.sql
Expand Up @@ -255,3 +255,5 @@ CREATE TABLE llx_pos_cash_fence(
import_key VARCHAR(14)
) ENGINE=innodb;

-- VMYSQL4.3 ALTER TABLE llx_accounting_account MODIFY COLUMN account_number varchar(32) NOT NULL;
-- VPGSQL8.2 ALTER TABLE llx_accounting_account ALTER COLUMN account_number SET NOT NULL;

0 comments on commit f7c11ec

Please sign in to comment.