From 536ab9520745218532e7bdb901750a1eb3c26a17 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 5 Apr 2020 00:29:34 +0200 Subject: [PATCH 1/2] FIX: The "test smtp connectivity" failed on page to setup mass emailing Conflicts: htdocs/admin/mails.php --- htdocs/admin/mails.php | 5 +++-- htdocs/admin/mails_emailing.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index dd67b138da5..d41cb687446 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -99,6 +99,7 @@ $trigger_name=''; // Disable triggers $paramname='id'; $mode='emailfortest'; $trackid=(($action == 'testhtml')?"testhtml":"test"); +$sendcontext=''; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; if ($action == 'presend' && GETPOST('trackid', 'alphanohtml') == 'test') $action='test'; @@ -791,8 +792,8 @@ else print load_fiche_titre($langs->trans("DoTestServerAvailability")); include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mail = new CMailFile('', '', '', ''); - $result=$mail->check_server_port($server, $port); + $mail = new CMailFile('', '', '', '', array(), array(), array(), '', '', 0, '', '', '', '', $trackid, $sendcontext); + $result = $mail->check_server_port($server, $port); if ($result) print '
'.$langs->trans("ServerAvailableOnIPOrPort", $server, $port).'
'; else { diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index 12076a00579..5a15be94bc4 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -536,8 +536,9 @@ else print load_fiche_titre($langs->trans("DoTestServerAvailability")); include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mail = new CMailFile('', '', '', ''); - $result=$mail->check_server_port($server, $port); + $mail = new CMailFile('', '', '', '', array(), array(), array(), '', '', 0, '', '', '', '', $trackid, $sendcontext); + + $result = $mail->check_server_port($server, $port); if ($result) print '
'.$langs->trans("ServerAvailableOnIPOrPort", $server, $port).'
'; else { From f6735ce8f20577241ba6f64065d506e0398fb9c1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 Apr 2020 14:28:52 +0200 Subject: [PATCH 2/2] Update repair.sql script --- htdocs/install/mysql/migration/repair.sql | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 73cb1e6592d..64e81e30329 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -337,9 +337,14 @@ UPDATE llx_c_lead_status set code = 'WON' where code = 'WIN'; -- To replace amount on all invoice and lines when forgetting to apply a 20% vat -- update llx_facturedet set tva_tx = 20 where tva_tx = 0; -- update llx_facturedet set total_ht = round(total_ttc / 1.2, 5) where total_ht = total_ttc; --- update llx_facturedet set total_tva = total_ttc - total_ht where total_vat = 0; -- update llx_facture set total = round(total_ttc / 1.2, 5) where total_ht = total_ttc; --- update llx_facture set tva = total_ttc - total where tva = 0; + +-- To fix bad total of price excluding tax, vat and price tax including tax. +-- select * from llx_facture where tva <> (total_ttc - total - localtax1 - localtax2 - revenuestamp); +-- update llx_facture set tva = (total_ttc - total - localtax1 - localtax2 - revenuestamp) where tva <> (total_ttc - total - localtax1 - localtax2 - revenuestamp); +-- select * from llx_facturedet where total_tva <> (total_ttc - total_ht - total_localtax1 - total_localtax2); +-- update llx_facturedet set total_tva = (total_ttc - total_ht - total_localtax1 - total_localtax2) where total_tva <> (total_ttc - total_ht - total_localtax1 - total_localtax2); + -- To insert elements into a category -- Search idcategory: select rowid from llx_categorie where type=0 and ref like '%xxx%'