diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 2046b785b52fab250f486aac1ce97913beda9b63..ee5e01fd3a10e4999e405d9565540a626064f537 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -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; diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index aac03d10a47d11e8ffaa950fac0fe940b3c65f2d..41d497260db82b350048c571bdbbf88f89f64c62 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -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++; diff --git a/test/AdherentTest.php b/test/AdherentTest.php index 8b82eb0f73d60650e837fb1a56580e47df4a854e..3257a397d48710817f3b60440ae2a35a7059eb5a 100644 --- a/test/AdherentTest.php +++ b/test/AdherentTest.php @@ -36,6 +36,7 @@ if (empty($user->id)) $user->fetch(1); $user->getrights(); } +$conf->global->MAIN_DISABLE_ALL_MAILS=1; /** diff --git a/test/BuildDocTest.php b/test/BuildDocTest.php index 8d209d29e1356abd4cba6907ea96e7a1e011e491..0c0e787e37dc796c09dccf42f7e9a0605f529790 100644 --- a/test/BuildDocTest.php +++ b/test/BuildDocTest.php @@ -36,6 +36,7 @@ if (empty($user->id)) $user->fetch(1); $user->getrights(); } +$conf->global->MAIN_DISABLE_ALL_MAILS=1; /** diff --git a/test/CommandeTest.php b/test/CommandeTest.php index 4c0b6a48577fee42d52faa21ee06824402c88f9c..b3e6b0ce2992e8e79a25ca4c040affaf3d751d42 100644 --- a/test/CommandeTest.php +++ b/test/CommandeTest.php @@ -36,6 +36,7 @@ if (empty($user->id)) $user->fetch(1); $user->getrights(); } +$conf->global->MAIN_DISABLE_ALL_MAILS=1; /** diff --git a/test/CommonObjectTest.php b/test/CommonObjectTest.php index 27fb80e491fd8943d3bd5a3f7a99f824807df9e4..e3e9840603dd06ecfaa877402494f022a1774055 100644 --- a/test/CommonObjectTest.php +++ b/test/CommonObjectTest.php @@ -37,6 +37,7 @@ if (empty($user->id)) $user->fetch(1); $user->getrights(); } +$conf->global->MAIN_DISABLE_ALL_MAILS=1; /** diff --git a/test/CompanyBankAccountTest.php b/test/CompanyBankAccountTest.php index b0c2be044f3bf0eb923fb46e43b16317def4066d..bdec9452a56f7bee3c874885d0379caeb4bd9c07 100644 --- a/test/CompanyBankAccountTest.php +++ b/test/CompanyBankAccountTest.php @@ -36,6 +36,7 @@ if (empty($user->id)) $user->fetch(1); $user->getrights(); } +$conf->global->MAIN_DISABLE_ALL_MAILS=1; /** diff --git a/test/ContratTest.php b/test/ContratTest.php index a1da26ea4cc3ae265c88c213a5f7e35023a07ed7..61d1118262bd50ebefe0b5c7c9a6d293e7751326 100644 --- a/test/ContratTest.php +++ b/test/ContratTest.php @@ -36,6 +36,7 @@ if (empty($user->id)) $user->fetch(1); $user->getrights(); } +$conf->global->MAIN_DISABLE_ALL_MAILS=1; /** diff --git a/test/DateLibTest.php b/test/DateLibTest.php index d1db7c3311cc4b3ea2d8c6e45f1577c343f13612..592cf8af8d1a5d5f12f4b3b649cfe659ca5c1225 100644 --- a/test/DateLibTest.php +++ b/test/DateLibTest.php @@ -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"; diff --git a/test/FactureTest.php b/test/FactureTest.php index 87858e8e3f1f058e75005674cfd2b3015b8a60bb..3b79653de280cf1838545253ceb6575afbe49843 100644 --- a/test/FactureTest.php +++ b/test/FactureTest.php @@ -36,6 +36,7 @@ if (empty($user->id)) $user->fetch(1); $user->getrights(); } +$conf->global->MAIN_DISABLE_ALL_MAILS=1; /** diff --git a/test/MyTestSuite.php b/test/MyTestSuite.php index e667e777c378db2a2879a41905fcc97f20203fa2..13fb364ad87403a46a301c49d00ffd7630dd1a4a 100644 --- a/test/MyTestSuite.php +++ b/test/MyTestSuite.php @@ -37,6 +37,7 @@ if (empty($user->id)) $user->fetch(1); $user->getrights(); } +$conf->global->MAIN_DISABLE_ALL_MAILS=1; /** diff --git a/test/PropalTest.php b/test/PropalTest.php index 3bcaa2edd8bd5c6ec136d8547dc975af0e01375a..7beed32501ecb4f2de9407a494d6ebceb76447b9 100644 --- a/test/PropalTest.php +++ b/test/PropalTest.php @@ -36,6 +36,7 @@ if (empty($user->id)) $user->fetch(1); $user->getrights(); } +$conf->global->MAIN_DISABLE_ALL_MAILS=1; /** diff --git a/test/UserGroupTest.php b/test/UserGroupTest.php index 5ee3a241fd5d287ade3b778dac8c4de7129d7907..93791088d9d3b42d3fa50b5a9dd9cccd8770e12e 100644 --- a/test/UserGroupTest.php +++ b/test/UserGroupTest.php @@ -36,6 +36,7 @@ if (empty($user->id)) $user->fetch(1); $user->getrights(); } +$conf->global->MAIN_DISABLE_ALL_MAILS=1; /** diff --git a/test/UserTest.php b/test/UserTest.php index 91c2d4b03f457aa52678fc53bf084d5c027c0135..1ffd9c707db32b4157881beafb7a250035763453 100644 --- a/test/UserTest.php +++ b/test/UserTest.php @@ -36,6 +36,7 @@ if (empty($user->id)) $user->fetch(1); $user->getrights(); } +$conf->global->MAIN_DISABLE_ALL_MAILS=1; /**