commit
11ffe3b7b9
@ -144,12 +144,12 @@ if ($resql)
|
|||||||
//if (empty($newemail)) print "Warning: Customer ".$target." has no email. Notice disabled.\n";
|
//if (empty($newemail)) print "Warning: Customer ".$target." has no email. Notice disabled.\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define line content
|
// Define line content
|
||||||
$outputlangs=new Translate('',$conf);
|
$outputlangs=new Translate('',$conf);
|
||||||
$outputlangs->setDefaultLang(empty($obj->default_lang)?$langs->defaultlang:$obj->default_lang); // By default language of customer
|
$outputlangs->setDefaultLang(empty($obj->default_lang)?$langs->defaultlang:$obj->default_lang); // By default language of customer
|
||||||
$outputlangs->load("bills");
|
$outputlangs->load("bills");
|
||||||
$outputlangs->load("main");
|
$outputlangs->load("main");
|
||||||
|
|
||||||
if (dol_strlen($newemail))
|
if (dol_strlen($newemail))
|
||||||
{
|
{
|
||||||
$message .= $outputlangs->trans("Invoice")." ".$obj->facnumber." : ".price($obj->total_ttc,0,$outputlangs)."\n";
|
$message .= $outputlangs->trans("Invoice")." ".$obj->facnumber." : ".price($obj->total_ttc,0,$outputlangs)."\n";
|
||||||
@ -301,4 +301,4 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldtarget)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -74,8 +74,8 @@ print $script_file." launched with mode ".$mode." default lang=".$langs->default
|
|||||||
|
|
||||||
if ($mode != 'confirm') $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
if ($mode != 'confirm') $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||||
|
|
||||||
$sql = "SELECT f.facnumber, f.total_ttc, f.date_lim_reglement as due_date, s.nom as name, s.email, s.default_lang,";
|
$sql = "SELECT f.facnumber, f.total_ttc, f.date_lim_reglement as due_date, s.nom as name, s.email, s.default_lang,";
|
||||||
$sql.= " u.rowid as uid, u.lastname, u.firstname, u.email, u.lang";
|
$sql.= " u.rowid as uid, u.lastname, u.firstname, u.email, u.lang";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
|
||||||
$sql .= " , ".MAIN_DB_PREFIX."societe as s";
|
$sql .= " , ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql .= " , ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
$sql .= " , ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -130,8 +130,8 @@ if ($resql)
|
|||||||
// Define line content
|
// Define line content
|
||||||
$outputlangs=new Translate('',$conf);
|
$outputlangs=new Translate('',$conf);
|
||||||
$outputlangs->setDefaultLang(empty($obj->lang)?$langs->defaultlang:$obj->lang); // By default language of sale representative
|
$outputlangs->setDefaultLang(empty($obj->lang)?$langs->defaultlang:$obj->lang); // By default language of sale representative
|
||||||
$outputlangs->load("bills");
|
$outputlangs->load("bills");
|
||||||
$outputlangs->load("main");
|
$outputlangs->load("main");
|
||||||
|
|
||||||
if (dol_strlen($obj->email))
|
if (dol_strlen($obj->email))
|
||||||
{
|
{
|
||||||
@ -144,8 +144,8 @@ if ($resql)
|
|||||||
else print "disqualified (no email).";
|
else print "disqualified (no email).";
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
unset($outputlangs);
|
unset($outputlangs);
|
||||||
|
|
||||||
$total += $obj->total_ttc;
|
$total += $obj->total_ttc;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -276,4 +276,4 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldsalerepresenta
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -151,28 +151,28 @@ class ScriptsTest extends PHPUnit_Framework_TestCase
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testInvoices
|
* testInvoices
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function testInvoices()
|
public function testInvoices()
|
||||||
{
|
{
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$conf=$this->savconf;
|
$conf=$this->savconf;
|
||||||
$user=$this->savuser;
|
$user=$this->savuser;
|
||||||
$langs=$this->savlangs;
|
$langs=$this->savlangs;
|
||||||
$db=$this->savdb;
|
$db=$this->savdb;
|
||||||
|
|
||||||
$script=dirname(__FILE__).'/../../scripts/invoices/email_unpaid_invoices_to_customers.php test thirdparties';
|
$script=dirname(__FILE__).'/../../scripts/invoices/email_unpaid_invoices_to_customers.php test thirdparties';
|
||||||
$result=exec($script, $output, $returnvar);
|
$result=exec($script, $output, $returnvar);
|
||||||
|
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
print __METHOD__." output=".join("\n",$output)."\n";
|
print __METHOD__." output=".join("\n",$output)."\n";
|
||||||
print __METHOD__." returnvar=".$returnvar."\n";
|
print __METHOD__." returnvar=".$returnvar."\n";
|
||||||
$this->assertEquals($returnvar,0);
|
$this->assertEquals($returnvar,0);
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
Loading…
Reference in New Issue
Block a user