Fxi language
This commit is contained in:
parent
5a77828e62
commit
9f0107a6b8
@ -144,17 +144,23 @@ 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
|
||||||
|
$outputlangs=new Translate('',$conf);
|
||||||
|
$outputlangs->setDefaultLang(empty($obj->default_lang)?$langs->defaultlang:$obj->default_lang); // By default language of customer
|
||||||
|
|
||||||
if (dol_strlen($newemail))
|
if (dol_strlen($newemail))
|
||||||
{
|
{
|
||||||
$message .= $langs->trans("Invoice")." ".$obj->facnumber." : ".price($obj->total_ttc)."\n";
|
$message .= $outputlangs->trans("Invoice")." ".$obj->facnumber." : ".price($obj->total_ttc)."\n";
|
||||||
dol_syslog("email_unpaid_invoices_to_customers.php: ".$newemail." ".$message);
|
dol_syslog("email_unpaid_invoices_to_customers.php: ".$newemail." ".$message);
|
||||||
$foundtoprocess++;
|
$foundtoprocess++;
|
||||||
}
|
}
|
||||||
print "Unpaid invoice ".$obj->facnumber.", price ".price2num($obj->total_ttc).", due date ".dol_print_date($db->jdate($obj->due_date),'day')." customer id ".$obj->sid." ".$obj->name.", ".($obj->cid?"contact id ".$obj->cid." ".$obj->clastname." ".$obj->cfirstname.",":"")." email ".$newemail.": ";
|
print "Unpaid invoice ".$obj->facnumber.", price ".price2num($obj->total_ttc,0,$outputlangs).", due date ".dol_print_date($db->jdate($obj->due_date),'day')." customer id ".$obj->sid." ".$obj->name.", ".($obj->cid?"contact id ".$obj->cid." ".$obj->clastname." ".$obj->cfirstname.",":"")." email ".$newemail.": ";
|
||||||
if (dol_strlen($newemail)) print "qualified.";
|
if (dol_strlen($newemail)) print "qualified.";
|
||||||
else print "disqualified (no email).";
|
else print "disqualified (no email).";
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
|
unset($outputlangs);
|
||||||
|
|
||||||
$total += $obj->total_ttc;
|
$total += $obj->total_ttc;
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
@ -212,13 +218,13 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldtarget)
|
|||||||
$newlangs->load("main");
|
$newlangs->load("main");
|
||||||
$newlangs->load("bills");
|
$newlangs->load("bills");
|
||||||
|
|
||||||
$subject = "[".(empty($conf->global->MAIN_APPLICATION_TITLE)?'Dolibarr':$conf->global->MAIN_APPLICATION_TITLE)."] ".$newlangs->trans("ListOfYourUnpaidInvoices");
|
$subject = (empty($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_SUBJECT)?$newlangs->trans("ListOfYourUnpaidInvoices"):'['.$conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_SUBJECT.']');
|
||||||
$sendto = $oldemail;
|
$sendto = $oldemail;
|
||||||
$from = $conf->global->MAIN_MAIL_EMAIL_FROM;
|
$from = $conf->global->MAIN_MAIL_EMAIL_FROM;
|
||||||
$errorsto = $conf->global->MAIN_MAIL_ERRORS_TO;
|
$errorsto = $conf->global->MAIN_MAIL_ERRORS_TO;
|
||||||
$msgishtml = -1;
|
$msgishtml = -1;
|
||||||
|
|
||||||
print "- Send email for '".$oldtarget."' (".$oldemail."), total: ".$total."\n";
|
print "- Send email to '".$oldtarget."' (".$oldemail."), total: ".$total."\n";
|
||||||
dol_syslog("email_unpaid_invoices_to_customers.php: send mail to ".$oldemail);
|
dol_syslog("email_unpaid_invoices_to_customers.php: send mail to ".$oldemail);
|
||||||
|
|
||||||
$usehtml=0;
|
$usehtml=0;
|
||||||
@ -278,6 +284,7 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldtarget)
|
|||||||
$result=1;
|
$result=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unset($newlangs);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@ -74,7 +74,8 @@ print $script_file." launched with mode ".$mode.(is_numeric($duration_value)?" d
|
|||||||
|
|
||||||
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, u.rowid as uid, u.lastname, u.firstname, u.email, u.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 .= " 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";
|
||||||
@ -126,9 +127,13 @@ if ($resql)
|
|||||||
if (empty($obj->email)) print "Warning: Sal representative ".$salerepresentative." has no email. Notice disabled.\n";
|
if (empty($obj->email)) print "Warning: Sal representative ".$salerepresentative." has no email. Notice disabled.\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Define line content
|
||||||
|
$outputlangs=new Translate('',$conf);
|
||||||
|
$outputlangs->setDefaultLang(empty($obj->lang)?$langs->defaultlang:$obj->lang); // By default language of sale representative
|
||||||
|
|
||||||
if (dol_strlen($obj->email))
|
if (dol_strlen($obj->email))
|
||||||
{
|
{
|
||||||
$message .= $langs->trans("Invoice")." ".$obj->facnumber." : ".price($obj->total_ttc)." : ".$obj->name."\n";
|
$message .= $outputlangs->trans("Invoice")." ".$obj->facnumber." : ".price($obj->total_ttc,0,$outputlangs)." : ".$obj->name."\n";
|
||||||
dol_syslog("email_unpaid_invoices_to_representatives.php: ".$obj->email);
|
dol_syslog("email_unpaid_invoices_to_representatives.php: ".$obj->email);
|
||||||
$foundtoprocess++;
|
$foundtoprocess++;
|
||||||
}
|
}
|
||||||
@ -137,6 +142,8 @@ if ($resql)
|
|||||||
else print "disqualified (no email).";
|
else print "disqualified (no email).";
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
|
unset($outputlangs);
|
||||||
|
|
||||||
$total += $obj->total_ttc;
|
$total += $obj->total_ttc;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user