Fix: Fix on PHPUnit tests

This commit is contained in:
Laurent Destailleur 2010-07-14 23:10:56 +00:00
parent 4b246bfb68
commit fb4173673a
14 changed files with 23 additions and 7 deletions

View File

@ -165,6 +165,7 @@ class Facture extends CommonObject
return -2; return -2;
} }
$now=dol_now();
$this->db->begin(); $this->db->begin();
@ -226,7 +227,7 @@ class Facture extends CommonObject
$sql.= ", ".$conf->entity; $sql.= ", ".$conf->entity;
$sql.= ", '".$this->type."'"; $sql.= ", '".$this->type."'";
$sql.= ", '".$socid."'"; $sql.= ", '".$socid."'";
$sql.= ", ".$this->db->idate(gmmktime()); $sql.= ", ".$this->db->idate($now);
$sql.= ", '".$totalht."'"; $sql.= ", '".$totalht."'";
$sql.= ",".($this->remise_absolue>0?$this->remise_absolue:'NULL'); $sql.= ",".($this->remise_absolue>0?$this->remise_absolue:'NULL');
$sql.= ",".($this->remise_percent>0?$this->remise_percent:'NULL'); $sql.= ",".($this->remise_percent>0?$this->remise_percent:'NULL');
@ -2814,6 +2815,8 @@ class Facture extends CommonObject
$ligne->subprice=100; $ligne->subprice=100;
$ligne->price=100; $ligne->price=100;
$ligne->tva_tx=19.6; $ligne->tva_tx=19.6;
$ligne->localtax1_tx=0;
$ligne->localtax2_tx=0;
$ligne->remise_percent=10; $ligne->remise_percent=10;
$ligne->total_ht=90; $ligne->total_ht=90;
$ligne->total_ttc=107.64; // 90 * 1.196 $ligne->total_ttc=107.64; // 90 * 1.196
@ -2910,8 +2913,8 @@ class FactureLigne
var $total_ht; var $total_ht;
//! Total TVA de la ligne toute quantite et incluant la remise ligne //! Total TVA de la ligne toute quantite et incluant la remise ligne
var $total_tva; var $total_tva;
var $total_localtax1; //Total Local tax 1 de la ligne var $total_localtax1=0; //Total Local tax 1 de la ligne
var $total_localtax2; //Total Local tax 2 de la ligne var $total_localtax2=0; //Total Local tax 2 de la ligne
//! Total TTC de la ligne toute quantite et incluant la remise ligne //! Total TTC de la ligne toute quantite et incluant la remise ligne
var $total_ttc; var $total_ttc;

View File

@ -87,7 +87,7 @@ class Notify
{ {
$num=-1; $num=-1;
$sql = "SELECT n.rowid, c.email, c.rowid, c.name, c.firstname, a.titre, s.nom"; $sql = "SELECT n.rowid, c.email, c.rowid, c.name, c.firstname, a.code, a.titre, s.nom";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c, ".MAIN_DB_PREFIX."action_def as a, ".MAIN_DB_PREFIX."notify_def as n, ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c, ".MAIN_DB_PREFIX."action_def as a, ".MAIN_DB_PREFIX."notify_def as n, ".MAIN_DB_PREFIX."societe as s";
$sql.= " WHERE n.fk_contact = c.rowid AND a.rowid = n.fk_action"; $sql.= " WHERE n.fk_contact = c.rowid AND a.rowid = n.fk_action";
$sql.= " AND n.fk_soc = s.rowid"; $sql.= " AND n.fk_soc = s.rowid";
@ -218,6 +218,7 @@ class Notify
else else
{ {
$this->error=$mailfile->error; $this->error=$mailfile->error;
//dol_syslog("Notify::send ".$this->error, LOG_ERR);
} }
} }
$i++; $i++;

View File

@ -36,6 +36,7 @@ if (empty($user->id))
$user->fetch(1); $user->fetch(1);
$user->getrights(); $user->getrights();
} }
$conf->global->MAIN_DISABLE_ALL_MAILS=1;
/** /**

View File

@ -36,6 +36,7 @@ if (empty($user->id))
$user->fetch(1); $user->fetch(1);
$user->getrights(); $user->getrights();
} }
$conf->global->MAIN_DISABLE_ALL_MAILS=1;
/** /**

View File

@ -36,6 +36,7 @@ if (empty($user->id))
$user->fetch(1); $user->fetch(1);
$user->getrights(); $user->getrights();
} }
$conf->global->MAIN_DISABLE_ALL_MAILS=1;
/** /**

View File

@ -37,6 +37,7 @@ if (empty($user->id))
$user->fetch(1); $user->fetch(1);
$user->getrights(); $user->getrights();
} }
$conf->global->MAIN_DISABLE_ALL_MAILS=1;
/** /**

View File

@ -36,6 +36,7 @@ if (empty($user->id))
$user->fetch(1); $user->fetch(1);
$user->getrights(); $user->getrights();
} }
$conf->global->MAIN_DISABLE_ALL_MAILS=1;
/** /**

View File

@ -36,6 +36,7 @@ if (empty($user->id))
$user->fetch(1); $user->fetch(1);
$user->getrights(); $user->getrights();
} }
$conf->global->MAIN_DISABLE_ALL_MAILS=1;
/** /**

View File

@ -36,6 +36,7 @@ if (empty($user->id))
$user->fetch(1); $user->fetch(1);
$user->getrights(); $user->getrights();
} }
$conf->global->MAIN_DISABLE_ALL_MAILS=1;
/** /**
@ -134,7 +135,7 @@ class DateLibTest extends PHPUnit_Framework_TestCase
$result=ConvertSecondToTime(0,'all',86400); $result=ConvertSecondToTime(0,'all',86400);
print __METHOD__." result=".$result."\n"; print __METHOD__." result=".$result."\n";
$this->assertEquals('00:00',$result); $this->assertEquals('0',$result);
$result=ConvertSecondToTime(86400,'all',86400); $result=ConvertSecondToTime(86400,'all',86400);
print __METHOD__." result=".$result."\n"; print __METHOD__." result=".$result."\n";

View File

@ -36,6 +36,7 @@ if (empty($user->id))
$user->fetch(1); $user->fetch(1);
$user->getrights(); $user->getrights();
} }
$conf->global->MAIN_DISABLE_ALL_MAILS=1;
/** /**

View File

@ -37,6 +37,7 @@ if (empty($user->id))
$user->fetch(1); $user->fetch(1);
$user->getrights(); $user->getrights();
} }
$conf->global->MAIN_DISABLE_ALL_MAILS=1;
/** /**

View File

@ -36,6 +36,7 @@ if (empty($user->id))
$user->fetch(1); $user->fetch(1);
$user->getrights(); $user->getrights();
} }
$conf->global->MAIN_DISABLE_ALL_MAILS=1;
/** /**

View File

@ -36,6 +36,7 @@ if (empty($user->id))
$user->fetch(1); $user->fetch(1);
$user->getrights(); $user->getrights();
} }
$conf->global->MAIN_DISABLE_ALL_MAILS=1;
/** /**

View File

@ -36,6 +36,7 @@ if (empty($user->id))
$user->fetch(1); $user->fetch(1);
$user->getrights(); $user->getrights();
} }
$conf->global->MAIN_DISABLE_ALL_MAILS=1;
/** /**