Debug v21

This commit is contained in:
Laurent Destailleur (aka Eldy) 2025-01-08 21:31:07 +01:00
parent 79ae59ee2a
commit 5fef2d7287
2 changed files with 11 additions and 6 deletions

View File

@ -193,7 +193,7 @@ if (!empty($_SESSION['ipaddress'])) { // To avoid to make action twice
$companylangs->setDefaultLang($mysoc->default_lang);
$companylangs->loadLangs(array('main', 'members', 'bills', 'paypal', 'paybox', 'stripe'));
$from = getDolGlobalString('MAILING_EMAIL_FROM', getDolGlobalString("MAIN_MAIL_EMAIL_FROM"));
$from = getDolGlobalString("MAIN_MAIL_EMAIL_FROM");
$sendto = $sendemail;
$urlback = $_SERVER["REQUEST_URI"];

View File

@ -187,7 +187,7 @@ if ($ws) {
$now = dol_now();
dol_syslog("Callback url when a payment was done. query_string=".(empty($_SERVER["QUERY_STRING"]) ? '' : dol_escape_htmltag($_SERVER["QUERY_STRING"]))." script_uri=".(empty($_SERVER["SCRIPT_URI"]) ? '' : dol_escape_htmltag($_SERVER["SCRIPT_URI"])), LOG_DEBUG, 0, '_payment');
dol_syslog("Callback url when a payment was done. doactionsthenredirect=".$doactionsthenredirect." query_string=".(empty($_SERVER["QUERY_STRING"]) ? '' : dol_escape_htmltag($_SERVER["QUERY_STRING"]))." script_uri=".(empty($_SERVER["SCRIPT_URI"]) ? '' : dol_escape_htmltag($_SERVER["SCRIPT_URI"])), LOG_DEBUG, 0, '_payment');
dol_syslog("_SERVER[SERVER_NAME] = ".(empty($_SERVER["SERVER_NAME"]) ? '' : dol_escape_htmltag($_SERVER["SERVER_NAME"])), LOG_DEBUG, 0, '_payment');
dol_syslog("_SERVER[SERVER_ADDR] = ".(empty($_SERVER["SERVER_ADDR"]) ? '' : dol_escape_htmltag($_SERVER["SERVER_ADDR"])), LOG_DEBUG, 0, '_payment');
@ -1022,6 +1022,8 @@ if ($ispaymentok) {
$object = new Commande($db);
$result = $object->fetch((int) $tmptag['ORD']);
if ($result) {
dol_syslog("We have loaded the order id=".$object->id." to use to create the invoice", LOG_DEBUG, 0, '_payment');
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
$paymentTypeId = 0;
@ -1050,6 +1052,8 @@ if ($ispaymentok) {
}
}
dol_syslog("The payment type id to use is paymentTypeId=".$paymentTypeId." and FinalPaymentAmt=".$FinalPaymentAmt, LOG_DEBUG, 0, '_payment');
// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
if (isModEnabled('invoice')) {
if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) {
@ -1851,8 +1855,8 @@ if ($ispaymentok) {
}
} else {
$msg = 'Failed to create invoice form contract ' . $tmptag['CON'];
if (!empty($cols)) {
$msg .= ' and col '. $cols .'.';
if (!empty($tmptag['COL'])) {
$msg .= ' and col '. $tmptag['COL'] .'.';
}
$postactionmessages[] = $msg;
$ispostactionok = -1;
@ -1867,7 +1871,7 @@ if ($ispaymentok) {
}
} else {
$msg = 'Contract paid ' . $tmptag['CON'] . ' was not found';
if (!empty($cols)) {
if (!empty($tmptag['COL'])) {
$msg .= ' for col '.$tmptag['COL'] .'.';
}
$postactionmessages[] = $msg;
@ -1953,7 +1957,7 @@ if ($ispaymentok) {
$companylangs->loadLangs(array('main', 'members', 'bills', 'paypal', 'paybox', 'stripe'));
$sendto = $sendemail;
$from = getDolGlobalString('MAILING_EMAIL_FROM') ? $conf->global->MAILING_EMAIL_FROM : getDolGlobalString("MAIN_MAIL_EMAIL_FROM");
$from = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
@ -2018,6 +2022,7 @@ if ($ispaymentok) {
$content .= "ErrorSeverityCode = ".$ErrorSeverityCode."<br>\n";
}
dol_syslog("Content of email: ".$content, LOG_DEBUG, 0, '_payment');
$ishtml = dol_textishtml($content); // May contain urls
$trackid = '';