diff --git a/scripts/contracts/email_expire_services_to_customers.php b/scripts/contracts/email_expire_services_to_customers.php index b503c0eaca281..63d9c1b8733a4 100755 --- a/scripts/contracts/email_expire_services_to_customers.php +++ b/scripts/contracts/email_expire_services_to_customers.php @@ -124,9 +124,16 @@ if (empty($obj->email)) print "Warning: Customer ".$customer." 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 + $outputlangs->load("bills"); + $outputlangs->load("main"); + $outputlangs->load("contracts"); + if (dol_strlen($oldemail)) { - $message .= $langs->trans("Contract")." ".$obj->ref.": ".$langs->trans("Service")." ".$obj->label." (".price($obj->total_ttc)."), ".$langs->trans("DateEndPlannedShort")." ".dol_print_date($db->jdate($obj->date_fin_validite),'day')."\n\n"; + $message .= $langs->trans("Contract")." ".$obj->ref.": ".$langs->trans("Service")." ".$obj->label." (".price($obj->total_ttc,0,$outputlangs,0,0,-1,$conf->currency)."), ".$langs->trans("DateEndPlannedShort")." ".dol_print_date($db->jdate($obj->date_fin_validite),'day')."\n\n"; dol_syslog("email_expire_services_to_customers.php: ".$obj->email); $foundtoprocess++; } @@ -222,7 +229,7 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldcustomer,$dura $allmessage.= "Note: This list contains only services to expire.".($usehtml?"
\n":"\n").($usehtml?"
\n":"\n"); } $allmessage.= $message.($usehtml?"
\n":"\n"); - $allmessage.= $langs->trans("Total")." = ".price($total).($usehtml?"
\n":"\n"); + $allmessage.= $langs->trans("Total")." = ".price($total,0,$userlang,0,0,-1,$conf->currency).($usehtml?"
\n":"\n"); if (! empty($conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_FOOTER)) { $allmessage.=$conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_FOOTER; diff --git a/scripts/contracts/email_expire_services_to_representatives.php b/scripts/contracts/email_expire_services_to_representatives.php index 1a352f138aa8c..ace84fa0582cf 100755 --- a/scripts/contracts/email_expire_services_to_representatives.php +++ b/scripts/contracts/email_expire_services_to_representatives.php @@ -125,9 +125,15 @@ if (empty($obj->email)) print "Warning: Sale 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 + $outputlangs->load("bills"); + $outputlangs->load("main"); + if (dol_strlen($obj->email)) { - $message .= $langs->trans("Contract")." ".$obj->ref.": ".$langs->trans("Service")." ".$obj->label." (".price($obj->total_ttc).") ".$obj->nom.", ".$langs->trans("DateEndPlannedShort")." ".dol_print_date($db->jdate($obj->date_fin_validite),'day')."\n\n"; + $message .= $langs->trans("Contract")." ".$obj->ref.": ".$langs->trans("Service")." ".$obj->label." (".price($obj->total_ttc,0,$outputlangs,0,0,-1,$conf->currency).") ".$obj->nom.", ".$langs->trans("DateEndPlannedShort")." ".dol_print_date($db->jdate($obj->date_fin_validite),'day')."\n\n"; dol_syslog("email_expire_services_to_representatives.php: ".$obj->email); $foundtoprocess++; } @@ -221,7 +227,7 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldsalerepresenta $allmessage.= "Note: This list contains only services of contracts for third parties you are linked to as a sale representative.".($usehtml?"
\n":"\n").($usehtml?"
\n":"\n"); } $allmessage.= $message.($usehtml?"
\n":"\n"); - $allmessage.= $langs->trans("Total")." = ".price($total).($usehtml?"
\n":"\n"); + $allmessage.= $langs->trans("Total")." = ".price($total,0,$userlang,0,0,-1,$conf->currency).($usehtml?"
\n":"\n"); if (! empty($conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_FOOTER)) { $allmessage.=$conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_FOOTER; diff --git a/scripts/invoices/email_unpaid_invoices_to_customers.php b/scripts/invoices/email_unpaid_invoices_to_customers.php index 0178d95d0b6b8..6b476ece1869e 100755 --- a/scripts/invoices/email_unpaid_invoices_to_customers.php +++ b/scripts/invoices/email_unpaid_invoices_to_customers.php @@ -152,7 +152,7 @@ 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,0,0,-1,$conf->currency)."\n"; dol_syslog("email_unpaid_invoices_to_customers.php: ".$newemail." ".$message); $foundtoprocess++; } @@ -249,7 +249,7 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldtarget) $allmessage.= "Note: This list contains only unpaid invoices.".($usehtml?"
\n":"\n"); } $allmessage.= $message.($usehtml?"
\n":"\n"); - $allmessage.= $langs->trans("Total")." = ".price($total).($usehtml?"
\n":"\n"); + $allmessage.= $langs->trans("Total")." = ".price($total,0,$userlang,0,0,-1,$conf->currency).($usehtml?"
\n":"\n"); if (! empty($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_FOOTER)) { $allmessage.=$conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_FOOTER; diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php index ef5935b7946dd..2eeb92d3c2e5b 100755 --- a/scripts/invoices/email_unpaid_invoices_to_representatives.php +++ b/scripts/invoices/email_unpaid_invoices_to_representatives.php @@ -135,7 +135,7 @@ if (dol_strlen($obj->email)) { - $message .= $outputlangs->trans("Invoice")." ".$obj->facnumber." : ".price($obj->total_ttc,0,$outputlangs)." : ".$obj->name."\n"; + $message .= $outputlangs->trans("Invoice")." ".$obj->facnumber." : ".price($obj->total_ttc,0,$outputlangs,0,0,-1,$conf->currency)." : ".$obj->name."\n"; dol_syslog("email_unpaid_invoices_to_representatives.php: ".$obj->email); $foundtoprocess++; } @@ -225,7 +225,7 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldsalerepresenta $allmessage.= $newlangs->transnoentities("NoteListOfYourUnpaidInvoices").($usehtml?"
\n":"\n"); } $allmessage.= $message.($usehtml?"
\n":"\n"); - $allmessage.= $langs->trans("Total")." = ".price($total).($usehtml?"
\n":"\n"); + $allmessage.= $langs->trans("Total")." = ".price($total,0,0,-1,$conf->currency).($usehtml?"
\n":"\n"); if (! empty($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_FOOTER)) { $allmessage.=$conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_FOOTER;