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 ***** 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 7b1e5b91be0..4a6dca3af01 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 @@ -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; 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 diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index df4d09af8cd..50ca013886b 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -889,7 +889,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { 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").''; @@ -922,13 +923,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // 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) { @@ -1122,7 +1126,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { 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").''; @@ -1151,13 +1156,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // 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) { diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index b3b11a95a36..7d9059fc9c1 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(); /* @@ -568,7 +569,7 @@ if ($object->id > 0) // Lien recap $boxstat .= '
'; $boxstat .= ''; - $boxstat .= '\n"; @@ -882,11 +882,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; @@ -905,7 +905,7 @@ if ($object->id > 0) print '
'; + $boxstat .= '
'; if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { @@ -652,7 +653,6 @@ if ($object->id > 0) print $boxstat; - $now = dol_now(); /* * Latest proposals @@ -665,7 +665,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; @@ -704,7 +704,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 ''; print ''; - print ''; + if ($mode == 'bank-transfer') { + print ''; + } else { + print ''; + } print ''; print ''; print ''; diff --git a/htdocs/core/boxes/box_external_rss.php b/htdocs/core/boxes/box_external_rss.php index 48268b28914..d5cc859eaa7 100644 --- a/htdocs/core/boxes/box_external_rss.php +++ b/htdocs/core/boxes/box_external_rss.php @@ -101,13 +101,15 @@ 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 { $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/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index f81e8e72a51..f645062dcab 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 { @@ -212,6 +217,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/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index 56c6bdd216b..21c5b2ad200 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -254,9 +254,15 @@ class RssParser libxml_use_internal_errors(false); $rss = simplexml_load_string($str, "SimpleXMLElement", LIBXML_NOCDATA); } 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); 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 31b201fce50..cf3d0df5c9f 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/card.php b/htdocs/fourn/card.php index c10b9dbf162..d404f52ea48 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -352,7 +352,7 @@ if ($object->id > 0) // Lien recap $boxstat .= '
'; $boxstat .= '
'; + print ''; @@ -921,15 +921,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 ''; + // Label + if ($mode == 'bank-transfer') { + print ''; + print ''; + print ''; + print ''; + } + // Date invoice print ''; print ''; @@ -314,10 +390,10 @@ if ($object->id > 0) 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/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 10cde50f478..ca611350b24 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)) @@ -122,13 +129,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); /* *************************************************************************** */ /* */ @@ -154,18 +168,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) @@ -173,20 +202,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)) { @@ -237,15 +283,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)).')'; } @@ -259,7 +316,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); } @@ -278,33 +339,48 @@ 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 '
'.$form->editfieldkey("Label", 'label', $object->label, $object, 0).''.$form->editfieldval("Label", 'label', $object->label, $object, 0).'
'; 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') { $form->form_date($_SERVER['PHP_SELF'].'?id='.$object->id, $object->date, 'invoicedate'); } 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 '
'; - 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') { @@ -335,16 +411,21 @@ 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')); } @@ -537,8 +618,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) { @@ -550,29 +636,34 @@ 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").''; - } else print ''.$langs->trans("MakeWithdrawRequest").''; + if ($object->statut > $object::STATUS_DRAFT) print ''.$buttonlabel.''; + else print ''.$buttonlabel.''; + } else { + print ''.$buttonlabel.''; + } } print "

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

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

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

'; + } /* * Withdrawals @@ -585,7 +676,11 @@ if ($object->id > 0) print '
'.$langs->trans("DateRequest").''.$langs->trans("User").''.$langs->trans("Amount").''.$langs->trans("WithdrawalReceipt").''.$langs->trans("BankTransferReceipt").''.$langs->trans("WithdrawalReceipt").' '.$langs->trans("DateProcess").' 
'; - $boxstat .= ''; - - // Due date - print ''; // Default terms of the settlement @@ -2520,6 +2512,14 @@ if ($action == 'create') print ""; print ''; + // Due date + print ''; + // Mode of payment $langs->load('bills'); print '
'; + $boxstat .= '
'; if ($conf->supplier_proposal->enabled) { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 3e5f0ddb8af..384359ae92f 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2490,14 +2490,6 @@ if ($action == 'create') // Date print '
'.$form->editfieldkey("DateInvoice", 'datef', $object->datep, $object, $form_permission, 'datepicker').''; print $form->editfieldval("Date", 'datef', $object->datep, $object, $form_permission, 'datepicker'); - 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 '
'.$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 '
'; diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index 5cd1043de8f..477086b3ca3 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -186,7 +186,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 diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index b749fe90722..a524e18ae33 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3632,6 +3632,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;