Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0

This commit is contained in:
Laurent Destailleur 2024-09-23 21:45:03 +02:00
commit 2f773e9326
2 changed files with 14 additions and 4 deletions

View File

@ -894,7 +894,7 @@ class CMailFile
}
} elseif ($this->sendmode == 'smtps') {
if (!is_object($this->smtps)) {
$this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport."<br>Constructor of object CMailFile was not initialized without errors.";
$this->error = "Failed to send mail with smtps lib to HOST=".ini_get('SMTP').", PORT=".$conf->global->$keyforsmtpport."<br>Constructor of object CMailFile was not initialized without errors.";
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
return false;
}
@ -1190,9 +1190,10 @@ class CMailFile
$res = true;
if (!empty($this->error) || !empty($this->errors) || !$result) {
if (!empty($failedRecipients)) {
$this->errors[] = 'Transport failed for the following addresses: "' . join('", "', $failedRecipients) . '".';
$this->error = 'Transport failed for the following addresses: "' . join('", "', $failedRecipients) . '".';
$this->errors[] = $this->error;
}
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
dol_syslog("CMailFile::sendfile: mail end error=". join(' ', $this->errors), LOG_ERR);
$res = false;
if (!empty($conf->global->MAIN_MAIL_DEBUG)) {

View File

@ -196,6 +196,13 @@ if ($action == 'order' && GETPOST('valid')) {
// TODO Get desc in language of thirdparty
}
// If we use multicurrency
if (isModEnabled('multicurrency') && !empty($productsupplier->fourn_multicurrency_code) && $productsupplier->fourn_multicurrency_code != $conf->currency) {
$line->multicurrency_code = $productsupplier->fourn_multicurrency_code;
$line->fk_multicurrency = $productsupplier->fourn_multicurrency_id;
$line->multicurrency_subprice = $productsupplier->fourn_multicurrency_unitprice;
}
$line->tva_tx = $productsupplier->vatrate_supplier;
$line->subprice = $productsupplier->fourn_pu;
$line->total_ht = $productsupplier->fourn_pu * $qty;
@ -264,7 +271,8 @@ if ($action == 'order' && GETPOST('valid')) {
null,
null,
0,
$line->fk_unit
$line->fk_unit,
$line->multicurrency_subprice ?? 0
);
}
if ($result < 0) {
@ -279,6 +287,7 @@ if ($action == 'order' && GETPOST('valid')) {
} else {
$order->socid = $suppliersid[$i];
$order->fetch_thirdparty();
$order->multicurrency_code = $order->thirdparty->multicurrency_code;
// Trick to know which orders have been generated using the replenishment feature
$order->source = $order::SOURCE_ID_REPLENISHMENT;