From 0139a840aeca4d979d0b4d66bc9eb2a7df063f83 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 21 Jun 2020 20:49:34 +0200 Subject: [PATCH 01/10] Fix setup --- htdocs/takepos/admin/receipt.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php index d7ae3ce7653..62e083110f1 100644 --- a/htdocs/takepos/admin/receipt.php +++ b/htdocs/takepos/admin/receipt.php @@ -112,7 +112,7 @@ else print "\n"; // Receipt printer module -if ($conf->receiptprinter->enabled) { +if ($conf->global->MAIN_FEATURES_LEVEL >= 1) { print ''; print $langs->trans('DolibarrReceiptPrinter'); print ''; From 8ccaa0794e5120839b36d64bd2486dcf73f130fb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 21 Jun 2020 22:58:08 +0200 Subject: [PATCH 02/10] Update doc --- build/exe/doliwamp/doliwamp.iss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index 9705cc198da..7b1e5b91be0 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -104,7 +104,7 @@ Source: "build\exe\doliwamp\UsedPort.exe"; DestDir: "{app}\"; Flags: ignoreversi ; Value OK: apache 2.2.6, php 5.2.5 (5.2.11, 5.3.0 and 5.3.1 fails if php_exif, php_pgsql, php_zip is on), mysql 5.0.45 ; Value OK: apache 2.2.11, php 5.3.0 (if no php_exif, php_pgsql, php_zip), mysql 5.0.45 ; Value OK: apache 2.4.9, php 5.5.12, mysql 5.0.45 instead of 5.6.17 (wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-32b.exe) -; Value To test: apache 2.4.41, php 7.3.12, mysql 5.0.45 instead of 5.6.17 (wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-32b.exe) +; Value To test: apache 2.4.41, php 7.3.12, mariadb10.4.10 (wampserver3.2.0_x64.exe) Source: "C:\Program Files\Wamp\apps\phpmyadmin4.1.14\*.*"; DestDir: "{app}\apps\phpmyadmin4.1.14"; Flags: ignoreversion recursesubdirs; Excludes: "config.inc.php,wampserver.conf,*.log,*_log,darkblue_orange" ;Source: "C:\Program Files\Wamp\bin\apache\apache2.4.9\*.*"; DestDir: "{app}\bin\apache\apache2.4.9"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,httpd.conf,wampserver.conf,*.log,*_log" Source: "C:\wamp64\bin\apache\apache2.4.41\*.*"; DestDir: "{app}\bin\apache\apache2.4.41"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,httpd.conf,wampserver.conf,*.log,*_log" From 119bf45177af3c73b3757e34c992158dc532e3f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Jun 2020 00:41:21 +0200 Subject: [PATCH 03/10] Fix error in packaging --- build/exe/doliwamp/doliwamp.iss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index 7b1e5b91be0..1b79648279c 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -41,7 +41,7 @@ Compression=lzma SolidCompression=yes WizardImageFile=build\exe\doliwamp\doliwamp.bmp WizardSmallImageFile=build\exe\doliwamp\doliwampsmall.bmp -SetupIconFile=doc\images\dolibarr.ico +SetupIconFile=doc\images\dolibarr_favicon.ico ;To say the installer must be ran as admin PrivilegesRequired=admin DisableProgramGroupPage=yes From 1ce5b78a6b8e7dd81776e46aae55decf9ac5c34e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Jun 2020 01:02:17 +0200 Subject: [PATCH 04/10] Fix error message not reported --- htdocs/core/boxes/box_external_rss.php | 6 ++++-- htdocs/core/class/rssparser.class.php | 8 +++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/htdocs/core/boxes/box_external_rss.php b/htdocs/core/boxes/box_external_rss.php index 93ac43d6c22..7672c47880d 100644 --- a/htdocs/core/boxes/box_external_rss.php +++ b/htdocs/core/boxes/box_external_rss.php @@ -101,7 +101,9 @@ class box_external_rss extends ModeleBoxes if ($result < 0 || !empty($rssparser->error)) { // Show warning - $title .= " ".img_error($langs->trans("FailedToRefreshDataInfoNotUpToDate", ($rssparser->getLastFetchDate() ?dol_print_date($rssparser->getLastFetchDate(), "dayhourtext") : $langs->trans("Unknown")))); + $errormessage = $langs->trans("FailedToRefreshDataInfoNotUpToDate", ($rssparser->getLastFetchDate() ? dol_print_date($rssparser->getLastFetchDate(), "dayhourtext") : $langs->trans("Unknown"))); + if ($rssparser->error) $errormessage .= " - ".$rssparser->error; + $title .= " ".img_error($errormessage); $this->info_box_head = array('text' => $title, 'limit' => 0); } else @@ -109,7 +111,7 @@ class box_external_rss extends ModeleBoxes $this->info_box_head = array( 'text' => $title, 'sublink' => $link, - 'subtext'=>$langs->trans("LastRefreshDate").': '.($rssparser->getLastFetchDate() ?dol_print_date($rssparser->getLastFetchDate(), "dayhourtext") : $langs->trans("Unknown")), + 'subtext'=>$langs->trans("LastRefreshDate").': '.($rssparser->getLastFetchDate() ? dol_print_date($rssparser->getLastFetchDate(), "dayhourtext") : $langs->trans("Unknown")), 'subpicto'=>'globe', 'target'=>'_blank', ); diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index dd02bf365c1..4ad70ac1f78 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -261,9 +261,15 @@ class RssParser } else { + if (! function_exists('xml_parser_create')) { + $this->error = 'Function xml_parser_create are not supported by your PHP'; + return -1; + } + $xmlparser = xml_parser_create(''); if (!is_resource($xmlparser)) { - $this->error = "ErrorFailedToCreateParser"; return -1; + $this->error = "ErrorFailedToCreateParser"; + return -1; } xml_set_object($xmlparser, $this); From 984e3d112df884049844cb9aa212882d71261f39 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Jun 2020 01:10:41 +0200 Subject: [PATCH 05/10] Fix packager --- build/rpm/dolibarr_fedora.spec | 2 +- build/rpm/dolibarr_generic.spec | 2 +- build/rpm/dolibarr_mandriva.spec | 2 +- build/rpm/dolibarr_opensuse.spec | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 110eae0a3a2..115edcef397 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -90,7 +90,7 @@ cui hai bisogno ed essere facile da usare. %{__install} -m 644 build/rpm/install.forced.php.fedora $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/install.forced.php %{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/pixmaps -%{__install} -m 644 doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png +%{__install} -m 644 doc/images/appicon_64.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png %{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/applications #desktop-file-install --delete-original --dir=$RPM_BUILD_ROOT%{_datadir}/applications build/rpm/%{name}.desktop %{__install} -m 644 build/rpm/dolibarr.desktop $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index ba5c426ea3f..64293ff6580 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -150,7 +150,7 @@ cui hai bisogno ed essere facile da usare. %endif %{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/pixmaps -%{__install} -m 644 doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png +%{__install} -m 644 doc/images/appicon_64.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png %{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/applications %{__install} -m 644 build/rpm/dolibarr.desktop $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop %if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion} || 0%{?suse_version} diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index 073ef0389ce..28b58a4da96 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -89,7 +89,7 @@ cui hai bisogno ed essere facile da usare. %{__install} -m 644 build/rpm/install.forced.php.mandriva $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/install.forced.php %{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/pixmaps -%{__install} -m 644 doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png +%{__install} -m 644 doc/images/appicon_64.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png %{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/applications #desktop-file-install --delete-original --dir=$RPM_BUILD_ROOT%{_datadir}/applications build/rpm/%{name}.desktop %{__install} -m 644 build/rpm/dolibarr.desktop $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index be61853e165..8b4ccf37808 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -90,7 +90,7 @@ cui hai bisogno ed essere facile da usare. %{__install} -m 644 build/rpm/install.forced.php.opensuse $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/install.forced.php %{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/pixmaps -%{__install} -m 644 doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png +%{__install} -m 644 doc/images/appicon_64.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png %{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/applications #desktop-file-install --delete-original --dir=$RPM_BUILD_ROOT%{_datadir}/applications build/rpm/%{name}.desktop %{__install} -m 644 build/rpm/dolibarr.desktop $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop From cdd4ed5b3d1eb9fbdf4a2058b783fdb459240ad9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Jun 2020 01:20:45 +0200 Subject: [PATCH 06/10] Update doc --- ChangeLog | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index b6e6d62f9d6..2527864a862 100644 --- a/ChangeLog +++ b/ChangeLog @@ -230,6 +230,16 @@ Following changes may create regressions for some external modules, but were nec - remove input field in form '';' - add parameter $pagenavastextinput to value 1 when calling print_barre_liste() +WARNING FOR DOLIWAMP USERS ONLY: + +Only people that installed Dolibarr using the all-in-one autoinstaller for Windows called "DoliWAMP" are concerned by the following warnings: + +* DoliWAMP autoinstaller for Windows is not more available on 32bits systems. Use standard package if you need to use such architecture. +* It is not possible to migrate from an installation done with the old DoliWAMP autoinstaller for Windows by using this new one. You must make a backup + of your database, make a fresh installation using the new installer and reload. +* Don't forget that DoliWAMP is a good solution to make a quick test of Dolibarr on your local computer but was never recommanded as a production + solution on a local desktop since a desktop computer has not a backup and security policy as good as on a server (when there is one). + DoliWAMP remains a solution for fast test or demo purposes. ***** ChangeLog for 11.0.4 compared to 11.0.3 ***** From 058a0d4fa77d35b3c4571208b508bd51c47fc0a9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Jun 2020 04:27:16 +0200 Subject: [PATCH 07/10] Fix look and feel v12 --- htdocs/adherents/card.php | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index e52243a65be..15472558125 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -996,7 +996,8 @@ else print ''; // EMail - print ''.img_picto('', 'object_email').' '.($conf->global->ADHERENT_MAIL_REQUIRED ? '' : '').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED ? '' : '').''; + print ''.($conf->global->ADHERENT_MAIL_REQUIRED ? '' : '').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED ? '' : '').''; + print ''.img_picto('', 'object_email').' '; // Address print ''.$langs->trans("Address").''; @@ -1033,13 +1034,16 @@ else } // Pro phone - print ''.img_picto('', 'object_phoning').' '.$langs->trans("PhonePro").''; + print ''.$langs->trans("PhonePro").''; + print ''.img_picto('', 'object_phoning').' '; // Personal phone - print ''.img_picto('', 'object_phoning').' '.$langs->trans("PhonePerso").''; + print ''.$langs->trans("PhonePerso").''; + print ''.img_picto('', 'object_phoning').' '; // Mobile phone - print ''.img_picto('', 'object_phoning_mobile').' '.$langs->trans("PhoneMobile").''; + print ''.$langs->trans("PhoneMobile").''; + print ''.img_picto('', 'object_phoning_mobile').' '; if (!empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { @@ -1249,7 +1253,8 @@ else print ''; // EMail - print ''.img_picto('', 'object_email').' '.($conf->global->ADHERENT_MAIL_REQUIRED ? '' : '').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED ? '' : '').'email).'">'; + print ''.($conf->global->ADHERENT_MAIL_REQUIRED ? '' : '').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED ? '' : '').''; + print ''.img_picto('', 'object_email').' email).'">'; // Address print ''.$langs->trans("Address").''; @@ -1279,13 +1284,16 @@ else } // Pro phone - print ''.img_picto('', 'object_phoning').' '.$langs->trans("PhonePro").'phone).'">'; + print ''.$langs->trans("PhonePro").''; + print ''.img_picto('', 'object_phoning').' phone).'">'; // Personal phone - print ''.img_picto('', 'object_phoning').' '.$langs->trans("PhonePerso").'phone_perso).'">'; + print ''.$langs->trans("PhonePerso").''; + print ''.img_picto('', 'object_phoning').' phone_perso).'">'; // Mobile phone - print ''.img_picto('', 'object_phoning_mobile').' '.$langs->trans("PhoneMobile").'phone_mobile).'">'; + print ''.img_picto('', 'object_phoning_mobile').' '.$langs->trans("PhoneMobile").''; + print ''.img_picto('', 'object_phoning_mobile').' phone_mobile).'">'; if (!empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { From a8c91069b2fbb595c050dd63db020f5305b8458c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Jun 2020 15:24:42 +0200 Subject: [PATCH 08/10] Fix doliwamp installer --- build/exe/doliwamp/Languages/MyEnglish.isl | 1 + build/exe/doliwamp/doliwamp.iss | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/build/exe/doliwamp/Languages/MyEnglish.isl b/build/exe/doliwamp/Languages/MyEnglish.isl index 371e724d6d0..7ad94c4ca86 100644 --- a/build/exe/doliwamp/Languages/MyEnglish.isl +++ b/build/exe/doliwamp/Languages/MyEnglish.isl @@ -32,6 +32,7 @@ PortAlreadyInUse=Port %1 seems to be already in use. You should cancel to go bac FirefoxDetected=Firefox has been detected on your computer. Would you like to use it as the default browser for Dolibarr ? ChromeDetected=Chrome has been detected on your computer. Would you like to use it as the default browser for Dolibarr ? +MicrosoftEdgeDetected=Microsoft Edge has been detected on your computer. Would you like to use it as the default browser for Dolibarr ? ChooseDefaultBrowser=Please choose your default browser (iexplore.exe, firefox.exe, chrome.exe, MicrosoftEdge.exe...). If you are not sure, just click Open : LaunchNow=Launch Dolibarr now diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index 1b79648279c..4a6dca3af01 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -519,7 +519,7 @@ begin // check that we don't try an upgrade (mysql upgrade no supported) //---------------------------------------------- - if FileExists (pathWithSlashes+'/bin/mysql/mysql5.0.45'+phpVersion+'/bin/mysqld-nt.exe') then + if FileExists (pathWithSlashes+'/bin/mysql/mysql5.0.45/bin/mysqld-nt.exe') then begin MsgBox('An existing installation using an old version of Mysql exists. Sorry, upgrade with this installer is not possible.', mbInformation, MB_OK); Abort(); @@ -588,15 +588,26 @@ begin end; end; + if browser = 'iexplore.exe' then + begin + if FileExists (winPath+'/SystemApps/Microsoft.MicrosoftEdge_8wekyb3d8bbwe/MicrosoftEdge.exe') then + begin + if MsgBox(CustomMessage('MicrosoftEdgeDetected'),mbConfirmation,MB_YESNO) = IDYES then + begin + browser := winPath+'/SystemApps/Microsoft.MicrosoftEdge_8wekyb3d8bbwe/MicrosoftEdge.exe'; + end; + end; + end; + if browser = 'iexplore.exe' then begin if FileExists (pfPath+'/Internet Explorer/iexplore.exe') then begin - GetOpenFileName(CustomMessage('ChooseDefaultBrowser'), browser, pfPath+'/Internet Explorer','exe files (*.exe)|*.exe|All files (*.*)|*.*' ,'exe'); + GetOpenFileName(CustomMessage('ChooseDefaultBrowser'), browser, pfPath+'/Internet Explorer', 'exe files (*.exe)|*.exe|All files (*.*)|*.*' ,'exe'); end else begin - GetOpenFileName(CustomMessage('ChooseDefaultBrowser'), browser, winPath,'exe files (*.exe)|*.exe|All files (*.*)|*.*' ,'exe'); + GetOpenFileName(CustomMessage('ChooseDefaultBrowser'), browser, winPath, 'exe files (*.exe)|*.exe|All files (*.*)|*.*' ,'exe'); end; end; From 566c1aaf845abd9de7963bb039f55e1fedd5c081 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Jun 2020 22:54:33 +0200 Subject: [PATCH 09/10] Fix for credit transfer module --- htdocs/compta/facture/prelevement.php | 193 +++++++++++++----- htdocs/core/lib/fourn.lib.php | 22 ++ htdocs/core/lib/invoice.lib.php | 1 - htdocs/fourn/facture/card.php | 16 +- htdocs/fourn/facture/contact.php | 2 +- .../install/mysql/tables/llx_actioncomm.sql | 5 +- htdocs/langs/en_US/banks.lang | 4 +- htdocs/langs/en_US/withdrawals.lang | 3 + 8 files changed, 182 insertions(+), 64 deletions(-) diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index bc3762b41ea..2b181e52078 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -29,11 +29,14 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; if (!$user->rights->facture->lire) accessforbidden(); @@ -44,14 +47,18 @@ $id = (GETPOST('id', 'int') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // $ref = GETPOST('ref', 'alpha'); $socid = GETPOST('socid', 'int'); $action = GETPOST('action', 'alpha'); - $type = GETPOST('type', 'aZ09'); +$mode = GETPOST('mode', 'aZ09'); $fieldid = (!empty($ref) ? 'ref' : 'rowid'); if ($user->socid) $socid = $user->socid; $result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid); -$object = new Facture($db); +if ($mode == 'bank-transfer') { + $object = new FactureFournisseur($db); +} else { + $object = new Facture($db); +} // Load object if ($id > 0 || !empty($ref)) @@ -124,13 +131,20 @@ if (empty($reshook)) * View */ +$form = new Form($db); + $now = dol_now(); -$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('StandingOrders'); -$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; +if ($mode == 'bank-transfer') { + $title = $langs->trans('InvoiceSupplier')." - ".$langs->trans('CreditTransfer'); + $helpurl = ""; +} else { + $title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('StandingOrders'); + $helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; +} + llxHeader('', $title, $helpurl); -$form = new Form($db); /* *************************************************************************** */ /* */ @@ -156,18 +170,33 @@ if ($object->id > 0) if ($object->paye) $resteapayer = 0; $resteapayeraffiche = $resteapayer; - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $filterabsolutediscount = "fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice - $filtercreditnote = "fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice - } else { - $filterabsolutediscount = "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')"; - $filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')"; - } + if ($mode == 'bank-transfer') { + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { // Never use this + $filterabsolutediscount = "fk_invoice_supplier_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice + $filtercreditnote = "fk_invoice_supplier_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice + } else { + $filterabsolutediscount = "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')"; + $filtercreditnote = "fk_invoice_supplier_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS PAID)%')"; + } - $absolute_discount = $object->thirdparty->getAvailableDiscounts('', $filterabsolutediscount); - $absolute_creditnote = $object->thirdparty->getAvailableDiscounts('', $filtercreditnote); - $absolute_discount = price2num($absolute_discount, 'MT'); - $absolute_creditnote = price2num($absolute_creditnote, 'MT'); + $absolute_discount = $object->thirdparty->getAvailableDiscounts('', $filterabsolutediscount, 0, 1); + $absolute_creditnote = $object->thirdparty->getAvailableDiscounts('', $filtercreditnote, 0, 1); + $absolute_discount = price2num($absolute_discount, 'MT'); + $absolute_creditnote = price2num($absolute_creditnote, 'MT'); + } else { + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $filterabsolutediscount = "fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice + $filtercreditnote = "fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice + } else { + $filterabsolutediscount = "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')"; + $filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')"; + } + + $absolute_discount = $object->thirdparty->getAvailableDiscounts('', $filterabsolutediscount); + $absolute_creditnote = $object->thirdparty->getAvailableDiscounts('', $filtercreditnote); + $absolute_discount = price2num($absolute_discount, 'MT'); + $absolute_creditnote = price2num($absolute_creditnote, 'MT'); + } $author = new User($db); if ($object->user_author) @@ -175,20 +204,37 @@ if ($object->id > 0) $author->fetch($object->user_author); } - $head = facture_prepare_head($object); + if ($mode == 'bank-transfer') { + $head = facturefourn_prepare_head($object); + } else { + $head = facture_prepare_head($object); + } - dol_fiche_head($head, 'standingorders', $langs->trans('InvoiceCustomer'), -1, 'bill'); + dol_fiche_head($head, 'standingorders', $title, -1, 'bill'); // Invoice content - - $linkback = ''.$langs->trans("BackToList").''; + if ($mode == 'bank-transfer') { + $linkback = ''.$langs->trans("BackToList").''; + } else { + $linkback = ''.$langs->trans("BackToList").''; + } $morehtmlref = '
'; // Ref customer - $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + if ($mode == 'bank-transfer') { + $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); + $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); + } else { + $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + } // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + if ($mode == 'bank-transfer') { + if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; + } else { + if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; + } // Project if (!empty($conf->projet->enabled)) { @@ -239,15 +285,26 @@ if ($object->id > 0) // Type print ''.$langs->trans('Type').''; print $object->getLibType(); - if ($object->type == Facture::TYPE_REPLACEMENT) + if ($object->module_source) { + print ' ('.$langs->trans("POS").' '.$object->module_source.' - '.$langs->trans("Terminal").' '.$object->pos_source.')'; + } + if ($object->type == $object::TYPE_REPLACEMENT) { - $facreplaced = new Facture($db); + if ($mode == 'bank-transfer') { + $facreplaced = new FactureFournisseur($db); + } else { + $facreplaced = new Facture($db); + } $facreplaced->fetch($object->fk_facture_source); print ' ('.$langs->transnoentities("ReplaceInvoice", $facreplaced->getNomUrl(1)).')'; } - if ($object->type == Facture::TYPE_CREDIT_NOTE) + if ($object->type == $object::TYPE_CREDIT_NOTE) { - $facusing = new Facture($db); + if ($mode == 'bank-transfer') { + $facusing = new FactureFournisseur($db); + } else { + $facusing = new Facture($db); + } $facusing->fetch($object->fk_facture_source); print ' ('.$langs->transnoentities("CorrectInvoice", $facusing->getNomUrl(1)).')'; } @@ -261,7 +318,11 @@ if ($object->id > 0) { if ($i == 0) print ' '; else print ','; - $facavoir = new Facture($db); + if ($mode == 'bank-transfer') { + $facavoir = new FactureFournisseur($db); + } else { + $facavoir = new Facture($db); + } $facavoir->fetch($id); print $facavoir->getNomUrl(1); } @@ -280,24 +341,39 @@ if ($object->id > 0) // Discounts print ''.$langs->trans('Discounts').''; - $thirdparty = $object->thirdparty; - $discount_type = 0; + if ($mode == 'bank-transfer') { + //$societe = new Fournisseur($db); + //$result = $societe->fetch($object->socid); + $thirdparty = $object->thirdparty; + $discount_type = 1; + } else { + $thirdparty = $object->thirdparty; + $discount_type = 0; + } $backtopage = urlencode($_SERVER["PHP_SELF"].'?facid='.$object->id); $cannotApplyDiscount = 1; include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php'; print ''; + // Label + if ($mode == 'bank-transfer') { + print ''; + print ''.$form->editfieldkey("Label", 'label', $object->label, $object, 0).''; + print ''.$form->editfieldval("Label", 'label', $object->label, $object, 0).''; + print ''; + } + // Date invoice print ''; print ''; - if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editinvoicedate' && !empty($object->brouillon) && $user->rights->facture->creer) print ''; + if ($object->type != $object::TYPE_CREDIT_NOTE && $action != 'editinvoicedate' && !empty($object->brouillon) && $user->rights->facture->creer) print ''; print '
'; print $langs->trans('DateInvoice'); print 'id.'">'.img_edit($langs->trans('SetDate'), 1).'id.'">'.img_edit($langs->trans('SetDate'), 1).'
'; print ''; - if ($object->type != Facture::TYPE_CREDIT_NOTE) + if ($object->type != $object::TYPE_CREDIT_NOTE) { if ($action == 'editinvoicedate') { @@ -305,12 +381,12 @@ if ($object->id > 0) } else { - print dol_print_date($object->date, 'daytext'); + print dol_print_date($object->date, 'day'); } } else { - print dol_print_date($object->date, 'daytext'); + print dol_print_date($object->date, 'day'); } print ''; print ''; @@ -320,10 +396,10 @@ if ($object->id > 0) print ''; - if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editconditions' && !empty($object->brouillon) && $user->rights->facture->creer) print ''; + if ($object->type != $object::TYPE_CREDIT_NOTE && $action != 'editconditions' && !empty($object->brouillon) && $user->rights->facture->creer) print ''; print '
'; print $langs->trans('PaymentConditionsShort'); print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).'id.'">'.img_edit($langs->trans('SetConditions'), 1).'
'; print ''; - if ($object->type != Facture::TYPE_CREDIT_NOTE) + if ($object->type != $object::TYPE_CREDIT_NOTE) { if ($action == 'editconditions') { @@ -345,18 +421,23 @@ if ($object->id > 0) print ''; - if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && !empty($object->brouillon) && $user->rights->facture->creer) print ''; + if ($object->type != $object::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && !empty($object->brouillon) && $user->rights->facture->creer) print ''; print '
'; print $langs->trans('DateMaxPayment'); print 'id.'">'.img_edit($langs->trans('SetDate'), 1).'id.'">'.img_edit($langs->trans('SetDate'), 1).'
'; print ''; - if ($object->type != Facture::TYPE_CREDIT_NOTE) + if ($object->type != $object::TYPE_CREDIT_NOTE) { + $duedate = $object->date_lim_reglement; + if ($mode == 'bank-transfer') { + $duedate = $object->date_echeance; + } + if ($action == 'editpaymentterm') { - $form->form_date($_SERVER['PHP_SELF'].'?id='.$object->id, $object->date_lim_reglement, 'paymentterm'); + $form->form_date($_SERVER['PHP_SELF'].'?id='.$object->id, $duedate, 'paymentterm'); } else { - print dol_print_date($object->date_lim_reglement, 'daytext'); + print dol_print_date($duedate, 'day'); if ($object->hasDelay()) { print img_warning($langs->trans('Late')); } @@ -559,8 +640,13 @@ if ($object->id > 0) print "\n
\n"; + $buttonlabel = $langs->trans("MakeWithdrawRequest"); + if ($mode == 'bank-transfer') { + $buttonlabel = $langs->trans("MakeBankTransferOrder"); + } + // Add a transfer request - if ($object->statut > Facture::STATUS_DRAFT && $object->paye == 0 && $num == 0) + if ($object->statut > $object::STATUS_DRAFT && $object->paye == 0 && $num == 0) { if ($resteapayer > 0) { @@ -572,36 +658,39 @@ if ($object->id > 0) print ''; print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; } else { - print ''.$langs->trans("MakeWithdrawRequest").''; + print ''.$buttonlabel.''; } } else { - print ''.$langs->trans("MakeWithdrawRequest").''; + print ''.$buttonlabel.''; } } else { if ($num == 0) { - if ($object->statut > Facture::STATUS_DRAFT) print ''.$langs->trans("MakeWithdrawRequest").''; - else print ''.$langs->trans("MakeWithdrawRequest").''; + if ($object->statut > $object::STATUS_DRAFT) print ''.$buttonlabel.''; + else print ''.$buttonlabel.''; } - else print ''.$langs->trans("MakeWithdrawRequest").''; + else print ''.$buttonlabel.''; } print "

\n"; - print '
'.$langs->trans("DoStandingOrdersBeforePayments").'

'; - + if ($mode == 'bank-transfer') { + print '
'.$langs->trans("DoCreditTransferBeforePayments").'

'; + } else { + print '
'.$langs->trans("DoStandingOrdersBeforePayments").'

'; + } /* * Withdrawals @@ -614,7 +703,11 @@ if ($object->id > 0) print ''.$langs->trans("DateRequest").''; print ''.$langs->trans("User").''; print ''.$langs->trans("Amount").''; - print ''.$langs->trans("WithdrawalReceipt").''; + if ($mode == 'bank-transfer') { + print ''.$langs->trans("BankTransferReceipt").''; + } else { + print ''.$langs->trans("WithdrawalReceipt").''; + } print ' '; print ''.$langs->trans("DateProcess").''; print ' '; diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php index 3b41f2620b4..8d0e767c943 100644 --- a/htdocs/core/lib/fourn.lib.php +++ b/htdocs/core/lib/fourn.lib.php @@ -53,6 +53,28 @@ function facturefourn_prepare_head($object) $h++; } + //if ($fac->mode_reglement_code == 'PRE') + if (!empty($conf->paymentbybanktransfer->enabled)) + { + $nbStandingOrders = 0; + $sql = "SELECT COUNT(pfd.rowid) as nb"; + $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; + $sql .= " WHERE pfd.fk_facture_fourn = ".$object->id; + $sql .= " AND pfd.ext_payment_id IS NULL"; + $resql = $db->query($sql); + if ($resql) + { + $obj = $db->fetch_object($resql); + if ($obj) $nbStandingOrders = $obj->nb; + } + else dol_print_error($db); + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$object->id.'&mode=bank-transfer'; + $head[$h][1] = $langs->trans('BankTransfer'); + if ($nbStandingOrders > 0) $head[$h][1] .= ''.$nbStandingOrders.''; + $head[$h][2] = 'standingorders'; + $h++; + } + // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index f081fc94120..077176c6ff9 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -55,7 +55,6 @@ function facture_prepare_head($object) $h++; } - //if ($fac->mode_reglement_code == 'PRE') if (!empty($conf->prelevement->enabled)) { $nbStandingOrders = 0; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index a5f15e997de..2113d7ebb12 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2559,14 +2559,6 @@ else // Date print ''.$form->editfieldkey("DateInvoice", 'datef', $object->datep, $object, $form_permission, 'datepicker').''; print $form->editfieldval("Date", 'datef', $object->datep, $object, $form_permission, 'datepicker'); - print ''; - - // Due date - print ''.$form->editfieldkey("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission, 'datepicker').''; - print $form->editfieldval("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission, 'datepicker'); - if ($action != 'editdate_lim_reglement' && $object->hasDelay()) { - print img_warning($langs->trans('Late')); - } print ''; // Default terms of the settlement @@ -2591,6 +2583,14 @@ else print ""; print ''; + // Due date + print ''.$form->editfieldkey("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission, 'datepicker').''; + print $form->editfieldval("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission, 'datepicker'); + if ($action != 'editdate_lim_reglement' && $object->hasDelay()) { + print img_warning($langs->trans('Late')); + } + print ''; + // Mode of payment $langs->load('bills'); print ''; diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index ebe3573bd99..eca47acaef5 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -193,7 +193,7 @@ if ($id > 0 || !empty($ref)) print '
'; print '
'; - print ''; + print '
'; // Type print '
'.$langs->trans('Type').''; diff --git a/htdocs/install/mysql/tables/llx_actioncomm.sql b/htdocs/install/mysql/tables/llx_actioncomm.sql index 8c50964eb59..f335a93cfeb 100644 --- a/htdocs/install/mysql/tables/llx_actioncomm.sql +++ b/htdocs/install/mysql/tables/llx_actioncomm.sql @@ -17,7 +17,8 @@ -- along with this program. If not, see . -- -- --- Actions commerciales +-- Table of events and actions (past and to do). +-- This is also the table to track events on other Dolibarr objects. -- ======================================================================== create table llx_actioncomm @@ -40,7 +41,7 @@ create table llx_actioncomm fk_soc integer, fk_contact integer, fk_parent integer NOT NULL default 0, - fk_user_action integer, -- user id of owner of action (note that users assigned to event are stored into another table) + fk_user_action integer, -- user id of owner of action (note that users assigned to event are stored into table 'actioncomm_resources') fk_user_done integer, -- user id of user that has made action (deprecated) transparency integer, -- transparency (ical standard). used to say if user assigned to event are busy or not by event. This field may be deprecated if we want to store transparency for each assigned user, moved into table llx_actioncomm_resources. diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index 17ebc2ff7ed..7a36346733f 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -105,8 +105,8 @@ SupplierInvoicePayment=Vendor payment SubscriptionPayment=Subscription payment WithdrawalPayment=Debit payment order SocialContributionPayment=Social/fiscal tax payment -BankTransfer=Bank transfer -BankTransfers=Bank transfers +BankTransfer=Credit transfer +BankTransfers=Credit transfers MenuBankInternalTransfer=Internal transfer TransferDesc=Transfer from one account to another, Dolibarr will write two records (a debit in source account and a credit in target account). The same amount (except sign), label and date will be used for this transaction) TransferFrom=From diff --git a/htdocs/langs/en_US/withdrawals.lang b/htdocs/langs/en_US/withdrawals.lang index c80db907a84..bea89f1d5d0 100644 --- a/htdocs/langs/en_US/withdrawals.lang +++ b/htdocs/langs/en_US/withdrawals.lang @@ -40,6 +40,7 @@ CreditTransferStatistics=Credit transfer statistics Rejects=Rejects LastWithdrawalReceipt=Latest %s direct debit receipts MakeWithdrawRequest=Make a direct debit payment request +MakeBankTransferOrder=Make a credit transfer request WithdrawRequestsDone=%s direct debit payment requests recorded ThirdPartyBankCode=Third-party bank code NoInvoiceCouldBeWithdrawed=No invoice debited successfully. Check that invoices are on companies with a valid IBAN and that IBAN has a UMR (Unique Mandate Reference) with mode %s. @@ -93,6 +94,7 @@ WithdrawalFileNotCapable=Unable to generate withdrawal receipt file for your cou ShowWithdraw=Show Direct Debit Order IfInvoiceNeedOnWithdrawPaymentWontBeClosed=However, if invoice has at least one direct debit payment order not yet processed, it won't be set as paid to allow prior withdrawal management. DoStandingOrdersBeforePayments=This tab allows you to request a direct debit payment order. Once done, go into menu Bank->Direct Debit orders to manage the direct debit payment order. When payment order is closed, payment on invoice will be automatically recorded, and invoice closed if remainder to pay is null. +DoCreditTransferBeforePayments=This tab allows you to request a credit transfer order. Once done, go into menu Bank->Credit transfer orders to manage the credit transfer payment order. When payment order is closed, payment on invoice will be automatically recorded, and invoice closed if remainder to pay is null. WithdrawalFile=Withdrawal file SetToStatusSent=Set to status "File Sent" ThisWillAlsoAddPaymentOnInvoice=This will also record payments on invoices and will classify them as "Paid" if remain to pay is null @@ -103,6 +105,7 @@ RUMLong=Unique Mandate Reference RUMWillBeGenerated=If empty, a UMR (Unique Mandate Reference) will be generated once the bank account information is saved. WithdrawMode=Direct debit mode (FRST or RECUR) WithdrawRequestAmount=Amount of Direct debit request: +BankTransferAmount=Amount of Credit Transfer request: WithdrawRequestErrorNilAmount=Unable to create direct debit request for empty amount. SepaMandate=SEPA Direct Debit Mandate SepaMandateShort=SEPA Mandate From 4d2cbf700642ce9c08fcb38261e47303a30586c1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Jun 2020 11:27:40 +0200 Subject: [PATCH 10/10] Fix alert picto of expired services not visible Fix CSS --- htdocs/comm/card.php | 27 +++++++++++++------- htdocs/core/boxes/box_services_contracts.php | 10 ++++++-- htdocs/fourn/card.php | 2 +- htdocs/theme/eldy/global.inc.php | 5 ++++ 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 4ff16cd7c03..4a97dc0f98c 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -86,6 +86,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('thirdpartycomm', 'globalcard')); +$now = dol_now(); /* @@ -580,7 +581,7 @@ if ($object->id > 0) // Lien recap $boxstat .= '
'; $boxstat .= ''; - $boxstat .= '\n"; @@ -898,11 +898,11 @@ if ($object->id > 0) } /* - * Latest linked contracts + * Latest contracts */ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { - $sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup"; + $sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut as contract_status, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; $sql .= " WHERE c.fk_soc = s.rowid "; $sql .= " AND s.rowid = ".$object->id; @@ -921,7 +921,7 @@ if ($object->id > 0) print '
'; + $boxstat .= '
'; if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { @@ -664,7 +665,6 @@ if ($object->id > 0) print $boxstat; - $now = dol_now(); /* * Latest proposals @@ -677,7 +677,7 @@ if ($object->id > 0) $sql .= ", p.tva as total_tva"; $sql .= ", p.total as total_ttc"; $sql .= ", p.ref, p.ref_client, p.remise"; - $sql .= ", p.datep as dp, p.fin_validite as datelimite"; + $sql .= ", p.datep as dp, p.fin_validite as date_limit"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c"; $sql .= " WHERE p.fk_soc = s.rowid AND p.fk_statut = c.id"; $sql .= " AND s.rowid = ".$object->id; @@ -716,7 +716,7 @@ if ($object->id > 0) $propal_static->total_tva = $objp->total_tva; $propal_static->total_ttc = $objp->total_ttc; print $propal_static->getNomUrl(1); - if (($db->jdate($objp->datelimite) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1) { + if (($db->jdate($objp->date_limit) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == $propal_static::STATUS_VALIDATED) { print " ".img_warning(); } print ''.dol_print_date($db->jdate($objp->dp), 'day')."
'; print ''; - print '
'; + print ''; @@ -937,15 +937,24 @@ if ($object->id > 0) $contrat->ref = $objp->ref ? $objp->ref : $objp->id; $contrat->ref_customer = $objp->refcus; $contrat->ref_supplier = $objp->refsup; + $contrat->statut = $objp->contract_status; $contrat->fetch_lines(); + $late = ''; + foreach ($contrat->lines as $line) { + if ($contrat->statut == Contrat::STATUS_VALIDATED && $line->statut == ContratLigne::STATUS_OPEN) { + if (($line->date_fin_validite + $conf->contrat->services->expires->warning_delay) < $now) $late = img_warning($langs->trans("Late")); + } + } + print ''; print '\n"; print '\n"; - print '\n"; - print '\n"; + //print '\n"; + print '\n"; print ''; print '
'.$langs->trans("LastContracts", ($num <= $MAXLIST ? "" : $MAXLIST)).''; print ''; //print ''; print '
'.$langs->trans("LastContracts", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllContracts").''.$num.''.img_picto($langs->trans("Statistics"),'stats').'
'; print $contrat->getNomUrl(1, 12); + print $late; print "'.dol_trunc($objp->refsup, 12)."'.dol_print_date($db->jdate($objp->dc), 'day')."'.dol_print_date($db->jdate($objp->dcon), 'day')."'.dol_print_date($db->jdate($objp->dc), 'day')."'.dol_print_date($db->jdate($objp->dcon), 'day')." '; print $contrat->getLibStatut(4); diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index 7167097672b..9d96d11f64d 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -90,7 +90,7 @@ class box_services_contracts extends ModeleBoxes $sql = "SELECT s.nom as name, s.rowid as socid, s.email, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,"; $sql .= " c.rowid, c.ref, c.statut as contract_status, c.ref_customer, c.ref_supplier,"; - $sql .= " cd.rowid as cdid, cd.label, cd.description, cd.tms as datem, cd.statut, cd.product_type as type,"; + $sql .= " cd.rowid as cdid, cd.label, cd.description, cd.tms as datem, cd.statut, cd.product_type as type, cd.date_fin_validite as date_line,"; $sql .= " p.rowid as product_id, p.ref as product_ref, p.label as plabel, p.fk_product_type as ptype, p.entity, p.tobuy, p.tosell"; $sql .= " FROM (".MAIN_DB_PREFIX."societe as s"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."contrat as c ON s.rowid = c.fk_soc"; @@ -113,6 +113,8 @@ class box_services_contracts extends ModeleBoxes while ($i < $num) { + $late = ''; + $objp = $this->db->fetch_object($result); $datem = $this->db->jdate($objp->datem); @@ -124,11 +126,11 @@ class box_services_contracts extends ModeleBoxes $contractlinestatic->product_id = $objp->product_id; $contractlinestatic->product_ref = $objp->product_ref; - $contractstatic->statut = $objp->contract_status; $contractstatic->id = $objp->rowid; $contractstatic->ref = $objp->ref; $contractstatic->ref_customer = $objp->ref_customer; $contractstatic->ref_supplier = $objp->ref_supplier; + $contractstatic->statut = $objp->contract_status; $thirdpartytmp->name = $objp->name; $thirdpartytmp->id = $objp->socid; @@ -140,6 +142,9 @@ class box_services_contracts extends ModeleBoxes $thirdpartytmp->code_compta = $objp->code_compta; $thirdpartytmp->code_compta_fournisseur = $objp->code_compta_fournisseur; + $dateline = $this->db->jdate($objp->date_line); + if ($contractstatic->statut == Contrat::STATUS_VALIDATED && $objp->statut == ContratLigne::STATUS_OPEN && ($dateline + $conf->contrat->services->expires->warning_delay) < $now) $late = img_warning($langs->trans("Late")); + // Multilangs if (!empty($conf->global->MAIN_MULTILANGS) && $objp->product_id > 0) // if option multilang is on { @@ -214,6 +219,7 @@ class box_services_contracts extends ModeleBoxes $this->info_box_contents[$i][] = array( 'td' => '', 'text' => dol_print_date($datem, 'day'), + 'text2'=> $late, ); $this->info_box_contents[$i][] = array( diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 6470b7db313..b467fdbd366 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -358,7 +358,7 @@ if ($object->id > 0) // Lien recap $boxstat .= '
'; $boxstat .= ''; - $boxstat .= '
'; + $boxstat .= '
'; if ($conf->supplier_proposal->enabled) { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 9f15e97104c..a8bf76236fc 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3633,6 +3633,11 @@ ul.noborder li:nth-child(even):not(.liste_titre) { padding-bottom: 2px; width: 118px; } + +td.tdboxstats .boxstats { + box-shadow: 1px 1px 8px var(--colorboxstatsborder); +} + .tabBar .fichehalfright .boxstats { padding-top: 8px; padding-bottom: 4px;