Laurent Destailleur 8 anni fa
parent
commit
4a085a8cc0

+ 2 - 3
htdocs/compta/bank/class/account.class.php

@@ -569,7 +569,7 @@ class Account extends CommonObject
         $sql.= ", '".$this->db->escape($this->label)."'";
         $sql.= ", ".$conf->entity;
         $sql.= ", '".$this->db->escape($this->account_number)."'";
-		$sql.= ", '".$this->db->escape($this->fk_accountancy_journal)."'";
+		$sql.= ", ".($this->fk_accountancy_journal > 0 ? $this->db->escape($this->fk_accountancy_journal) : "null");
 		$sql.= ", '".$this->db->escape($this->bank)."'";
         $sql.= ", '".$this->code_banque."'";
         $sql.= ", '".$this->code_guichet."'";
@@ -702,8 +702,7 @@ class Account extends CommonObject
         $sql.= ",rappro = ".$this->rappro;
         $sql.= ",url = ".($this->url?"'".$this->url."'":"null");
         $sql.= ",account_number = '".$this->db->escape($this->account_number)."'";
-		$sql.= ",fk_accountancy_journal = '".$this->db->escape($this->fk_accountancy_journal)."'";
-
+		$sql.= ",fk_accountancy_journal = ".($this->fk_accountancy_journal > 0 ? $this->db->escape($this->fk_accountancy_journal) : "null");
 		$sql.= ",bank  = '".$this->db->escape($this->bank)."'";
         $sql.= ",code_banque='".$this->db->escape($this->code_banque)."'";
         $sql.= ",code_guichet='".$this->db->escape($this->code_guichet)."'";

+ 2 - 0
test/phpunit/WebservicesInvoicesTest.php

@@ -39,6 +39,8 @@ if (empty($user->id))
 }
 $conf->global->MAIN_DISABLE_ALL_MAILS=1;
 
+$conf->global->MAIN_UMASK='0666';
+
 
 /**
  * Class for PHPUnit tests

+ 2 - 0
test/phpunit/WebservicesOrdersTest.php

@@ -38,6 +38,8 @@ if (empty($user->id)) {
 }
 $conf->global->MAIN_DISABLE_ALL_MAILS=1;
 
+$conf->global->MAIN_UMASK='0666';
+
 
 /**
  * Class for PHPUnit tests

+ 2 - 0
test/phpunit/WebservicesOtherTest.php

@@ -38,6 +38,8 @@ if (empty($user->id)) {
 }
 $conf->global->MAIN_DISABLE_ALL_MAILS=1;
 
+$conf->global->MAIN_UMASK='0666';
+
 
 /**
  * Class for PHPUnit tests

+ 2 - 0
test/phpunit/WebservicesProductsTest.php

@@ -40,6 +40,8 @@ if (empty($user->id)) {
 }
 $conf->global->MAIN_DISABLE_ALL_MAILS=1;
 
+$conf->global->MAIN_UMASK='0666';
+
 if (empty($conf->service->enabled))
 {
 	print "Error: Module service must be enabled.\n";

+ 2 - 0
test/phpunit/WebservicesThirdpartyTest.php

@@ -38,6 +38,8 @@ if (empty($user->id)) {
 }
 $conf->global->MAIN_DISABLE_ALL_MAILS=1;
 
+$conf->global->MAIN_UMASK='0666';
+
 
 /**
  * Class for PHPUnit tests

+ 2 - 0
test/phpunit/WebservicesUserTest.php

@@ -38,6 +38,8 @@ if (empty($user->id)) {
 }
 $conf->global->MAIN_DISABLE_ALL_MAILS=1;
 
+$conf->global->MAIN_UMASK='0666';
+
 
 /**
  * Class for PHPUnit tests