Fix: Missing migration field
Fix: Date must be quoted
This commit is contained in:
parent
58f9cc2f7b
commit
9a70541084
@ -329,10 +329,10 @@ class CommandeFournisseur extends Commande
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."commande_fournisseur";
|
$sql = 'UPDATE '.MAIN_DB_PREFIX."commande_fournisseur";
|
||||||
$sql.= " SET ref='".$num."'";
|
$sql.= " SET ref='".$num."',";
|
||||||
$sql.= ", fk_statut = 1";
|
$sql.= " fk_statut = 1,";
|
||||||
$sql.= ", date_valid=".$this->db->idate(mktime());
|
$sql.= " date_valid='".$this->db->idate(dol_now())."',";
|
||||||
$sql.= ", fk_user_valid = ".$user->id;
|
$sql.= " fk_user_valid = ".$user->id;
|
||||||
$sql.= " WHERE rowid = ".$this->id;
|
$sql.= " WHERE rowid = ".$this->id;
|
||||||
$sql.= " AND fk_statut = 0";
|
$sql.= " AND fk_statut = 0";
|
||||||
|
|
||||||
@ -668,10 +668,10 @@ class CommandeFournisseur extends Commande
|
|||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur";
|
||||||
$sql.= " SET ref='".$num."'";
|
$sql.= " SET ref='".$this->db->escape($num)."',";
|
||||||
$sql.= ", fk_statut = 2";
|
$sql.= " fk_statut = 2,";
|
||||||
$sql.= ", date_approve=".$this->db->idate(mktime());
|
$sql.= " date_approve='".$this->db->idate(dol_now())."',";
|
||||||
$sql.= ", fk_user_approve = ".$user->id;
|
$sql.= " fk_user_approve = ".$user->id;
|
||||||
$sql.= " WHERE rowid = ".$this->id;
|
$sql.= " WHERE rowid = ".$this->id;
|
||||||
$sql.= " AND fk_statut = 1";
|
$sql.= " AND fk_statut = 1";
|
||||||
|
|
||||||
|
|||||||
@ -25,3 +25,7 @@ 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 ( 275, 27, '0','0','VAT Rate 0 ou non applicable',1);
|
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 ( 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;
|
||||||
|
|||||||
@ -186,6 +186,30 @@ class CommandeFournisseurTest extends PHPUnit_Framework_TestCase
|
|||||||
return $localobject;
|
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
|
* testCommandeFournisseurCancel
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user