Fix: Missing migration field

Fix: Date must be quoted
This commit is contained in:
Laurent Destailleur 2012-04-15 18:41:38 +02:00
parent 58f9cc2f7b
commit 9a70541084
3 changed files with 49 additions and 21 deletions

View File

@ -329,10 +329,10 @@ class CommandeFournisseur extends Commande
}
$sql = 'UPDATE '.MAIN_DB_PREFIX."commande_fournisseur";
$sql.= " SET ref='".$num."'";
$sql.= ", fk_statut = 1";
$sql.= ", date_valid=".$this->db->idate(mktime());
$sql.= ", fk_user_valid = ".$user->id;
$sql.= " SET ref='".$num."',";
$sql.= " fk_statut = 1,";
$sql.= " date_valid='".$this->db->idate(dol_now())."',";
$sql.= " fk_user_valid = ".$user->id;
$sql.= " WHERE rowid = ".$this->id;
$sql.= " AND fk_statut = 0";
@ -668,10 +668,10 @@ class CommandeFournisseur extends Commande
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur";
$sql.= " SET ref='".$num."'";
$sql.= ", fk_statut = 2";
$sql.= ", date_approve=".$this->db->idate(mktime());
$sql.= ", fk_user_approve = ".$user->id;
$sql.= " SET ref='".$this->db->escape($num)."',";
$sql.= " fk_statut = 2,";
$sql.= " date_approve='".$this->db->idate(dol_now())."',";
$sql.= " fk_user_approve = ".$user->id;
$sql.= " WHERE rowid = ".$this->id;
$sql.= " AND fk_statut = 1";

View File

@ -24,4 +24,8 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 2
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 274, 27, '5.5','0','VAT reduced rate (France hors DOM-TOM)',0);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 275, 27, '0','0','VAT Rate 0 ou non applicable',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 276, 27, '2.1','0','VAT super-reduced rate',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 277, 27, '7','0','VAT reduced rate',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 277, 27, '7','0','VAT reduced rate',1);
ALTER TABLE llx_commande_fournisseur CHANGE COLUMN date_cloture date_approve datetime;
ALTER TABLE llx_commande_fournisseur CHANGE COLUMN fk_user_cloture fk_user_approve integer;

View File

@ -117,7 +117,7 @@ class CommandeFournisseurTest extends PHPUnit_Framework_TestCase
/**
* testCommandeFournisseurCreate
*
*
* @return void
*/
public function testCommandeFournisseurCreate()
@ -139,10 +139,10 @@ class CommandeFournisseurTest extends PHPUnit_Framework_TestCase
/**
* testCommandeFournisseurFetch
*
*
* @param int $id Id of supplier order
* @return void
*
*
* @depends testCommandeFournisseurCreate
* The depends says test is run only if previous is ok
*/
@ -161,13 +161,13 @@ class CommandeFournisseurTest extends PHPUnit_Framework_TestCase
$this->assertLessThan($result, 0);
return $localobject;
}
/**
* testCommandeFournisseurValid
*
*
* @param Object $localobject Supplier order
* @return void
*
*
* @depends testCommandeFournisseurFetch
* The depends says test is run only if previous is ok
*/
@ -186,12 +186,36 @@ class CommandeFournisseurTest extends PHPUnit_Framework_TestCase
return $localobject;
}
/**
* testCommandeFournisseurApprove
*
* @param Object $localobject Supplier order
* @return void
*
* @depends testCommandeFournisseurValid
* The depends says test is run only if previous is ok
*/
public function testCommandeFournisseurApprove($localobject)
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
$user=$this->savuser;
$langs=$this->savlangs;
$db=$this->savdb;
$result=$localobject->approve($user);
print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertLessThan($result, 0);
return $localobject;
}
/**
* testCommandeFournisseurCancel
*
*
* @param Object $localobject Supplier order
* @return void
*
*
* @depends testCommandeFournisseurValid
* The depends says test is run only if previous is ok
*/
@ -212,10 +236,10 @@ class CommandeFournisseurTest extends PHPUnit_Framework_TestCase
/**
* testCommandeFournisseurOther
*
*
* @param Object $localobject Supplier order
* @return void
*
*
* @depends testCommandeFournisseurCancel
* The depends says test is run only if previous is ok
*/
@ -242,10 +266,10 @@ class CommandeFournisseurTest extends PHPUnit_Framework_TestCase
/**
* testCommandeFournisseurDelete
*
*
* @param int $id Id of order
* @return void
*
*
* @depends testCommandeFournisseurOther
* The depends says test is run only if previous is ok
*/