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;
}
$now=dol_now();
$this->db->begin();
@ -226,7 +227,7 @@ class Facture extends CommonObject
$sql.= ", ".$conf->entity;
$sql.= ", '".$this->type."'";
$sql.= ", '".$socid."'";
$sql.= ", ".$this->db->idate(gmmktime());
$sql.= ", ".$this->db->idate($now);
$sql.= ", '".$totalht."'";
$sql.= ",".($this->remise_absolue>0?$this->remise_absolue:'NULL');
$sql.= ",".($this->remise_percent>0?$this->remise_percent:'NULL');
@ -300,7 +301,7 @@ class Facture extends CommonObject
$tva_tx = get_default_tva($mysoc,$soc,($prod->tva_tx?$prod->tva_tx:0));
$localtax1_tx=get_localtax($tva_tx,1,$soc);
$localtax2_tx=get_localtax($tva_tx,2,$soc);
$result_insert = $this->addline(
$this->id,
$_facrec->lignes[$i]->desc,
@ -1611,7 +1612,7 @@ class Facture extends CommonObject
$txtva=price2num($txtva);
$txlocaltax1=price2num($txlocaltax1);
$txlocaltax2=price2num($txlocaltax2);
if ($price_base_type=='HT')
{
$pu=$pu_ht;
@ -2814,6 +2815,8 @@ class Facture extends CommonObject
$ligne->subprice=100;
$ligne->price=100;
$ligne->tva_tx=19.6;
$ligne->localtax1_tx=0;
$ligne->localtax2_tx=0;
$ligne->remise_percent=10;
$ligne->total_ht=90;
$ligne->total_ttc=107.64; // 90 * 1.196
@ -2910,8 +2913,8 @@ class FactureLigne
var $total_ht;
//! Total TVA de la ligne toute quantite et incluant la remise ligne
var $total_tva;
var $total_localtax1; //Total Local tax 1 de la ligne
var $total_localtax2; //Total Local tax 2 de la ligne
var $total_localtax1=0; //Total Local tax 1 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
var $total_ttc;

View File

@ -87,7 +87,7 @@ class Notify
{
$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.= " WHERE n.fk_contact = c.rowid AND a.rowid = n.fk_action";
$sql.= " AND n.fk_soc = s.rowid";
@ -218,6 +218,7 @@ class Notify
else
{
$this->error=$mailfile->error;
//dol_syslog("Notify::send ".$this->error, LOG_ERR);
}
}
$i++;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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