Merge branch 'develop' into 10.0_intracommreport

This commit is contained in:
Alexandre SPANGARO 2019-06-26 15:11:43 +02:00
commit 9da91c06ed
146 changed files with 1598 additions and 1934 deletions

View File

@ -3,6 +3,20 @@ English Dolibarr ChangeLog
-------------------------------------------------------------- --------------------------------------------------------------
***** ChangeLog for 11.0.0 compared to 10.0.0 *****
For Users:
For Developers:
WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* Properties ->libelle_incoterms were renamed into ->label_incoterms
***** ChangeLog for 10.0.0 compared to 9.0.0 ***** ***** ChangeLog for 10.0.0 compared to 9.0.0 *****
For Users: For Users:
NEW: Module "Ticket" is available as a stable module. NEW: Module "Ticket" is available as a stable module.
@ -58,7 +72,7 @@ NEW: Can generate invoices from the timespent entered on a project
NEW: Can update product supplier price ref NEW: Can update product supplier price ref
NEW: Can upload files from the edit page of expense report NEW: Can upload files from the edit page of expense report
NEW: Color for hover and for checked line is on by default NEW: Color for hover and for checked line is on by default
NEW: Column of parent company is available in list of third parties NEW: Column of p...arent company is available in list of third parties
NEW: conditionnal add member button by statut NEW: conditionnal add member button by statut
NEW: constant KEEP_DISCOUNT_LINES_FROM_ORIGIN NEW: constant KEEP_DISCOUNT_LINES_FROM_ORIGIN
NEW: Contact related items tab NEW: Contact related items tab
@ -182,6 +196,55 @@ Following changes may create regressions for some external modules, but were nec
called $dolibarr_main_instance_unique_id is now generated at each installation. It will be used by some future features. called $dolibarr_main_instance_unique_id is now generated at each installation. It will be used by some future features.
***** ChangeLog for 9.0.4 compared to 9.0.3 *****
FIX: #5249
FIX: #11025
FIX: #11032
FIX: #11097
FIX: #11169
FIX: #11202
FIX: #11244
FIX: #11296
FIX: #11316
FIX: #11335
FIX: Add missing end date of subscription in export
FIX: A user may read holiday and expense report without permissions
FIX: better syntax
FIX: condition
FIX: confirmation of mass email sending + option MAILING_NO_USING_PHPMAIL
FIX: crabe pdf: bad detailed VAT for situation invoices, in situations S2 and above
FIX: default value for duration of validity can be set from generic
FIX: do not include tpl from disabled modules
FIX: Error management when MAILING_NO_USING_PHPMAIL is set
FIX: Even with permission, can't validate leave once validator defined.
FIX: extrafield list search: SQL error when field is multiselect
FIX: if last char of customercode is accent making the truncate of first
FIX: Import of chart of account
FIX: in edit mode, dictionary inputs do not escape the string inside the 'value' attribute, causing errors if there are any double quotes
FIX: invalid link on user.fk_user
FIX: invoice class: bad SQL request if product type not set
FIX: javascript error when ckeditor module not enabled
FIX: mail presend: can overwrite a file previously uploaded (Issue #11056)
FIX: mass send mail
FIX: missing compatibility with multicompany transverse mode
FIX: missing llx_const encrypt
FIX: modulebuilder: hardcoded llx_
FIX: Not showing Contract and Project columns on ficheinter list
FIX: only profid1 to 4 were editable for pdf option to show. Not 5 and 6.
FIX: productaccount buylist with pages
FIX: remove isolated transaction commit
FIX: security (a user can read leave or holiday of other without perm.
FIX: situation invoices: bad detailed VAT in situations following the first one
FIX: situation invoices: block progress percentage change for discount lines
FIX: syntax error
FIX: the id was not loaded in fetch of accounting system
FIX: try to use WHERE EXISTS instead of DISTINCT
FIX: use dol_sanitizeFileName() function to remove double spaces in filenames, as well as done on document.php when we want to download pdf
FIX: Use of cron with multicompany
FIX: var name
FIX: we need to fetch fourn invoice with ref in current entity
FIX: Wrong stock movement on supplier credit notes
FIX: Import of record in ledger
***** ChangeLog for 9.0.3 compared to 9.0.2 ***** ***** ChangeLog for 9.0.3 compared to 9.0.2 *****
FIX: #11013 FIX: #11013

View File

@ -52,7 +52,7 @@ License: GPL-3+
details. details.
. .
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
. .
On Debian systems, the full text of the GNU General Public On Debian systems, the full text of the GNU General Public
License version 3 can be found in the file License version 3 can be found in the file
@ -98,7 +98,7 @@ License: GPL-2+
GNU General Public License for more details. GNU General Public License for more details.
. .
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
. .
On Debian systems, the complete text of the GNU General Public License On Debian systems, the complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-2 file. can be found in /usr/share/common-licenses/GPL-2 file.
@ -192,7 +192,7 @@ License: GPL-2+
details. details.
. .
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
. .
On Debian systems, the full text of the GNU General Public On Debian systems, the full text of the GNU General Public
License version 2 can be found in the file License version 2 can be found in the file
@ -212,7 +212,7 @@ License: LGPL-2.1+
Lesser General Public License for more details. Lesser General Public License for more details.
. .
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
. .
On Debian systems, the full text of the GNU Lesser General Public On Debian systems, the full text of the GNU Lesser General Public
License version 2.1 can be found in the file License version 2.1 can be found in the file
@ -236,7 +236,7 @@ License: GPL-2+ or MIT
details. details.
. .
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
. .
On Debian systems, the full text of the GNU General Public On Debian systems, the full text of the GNU General Public
License version 2 can be found in the file License version 2 can be found in the file
@ -291,7 +291,7 @@ License: GPL-2+
details. details.
. .
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
. .
On Debian systems, the full text of the GNU General Public On Debian systems, the full text of the GNU General Public
License version 2 can be found in the file License version 2 can be found in the file
@ -311,7 +311,7 @@ License: LGPL-2.1+
Lesser General Public License for more details. Lesser General Public License for more details.
. .
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
. .
On Debian systems, the full text of the GNU Lesser General Public On Debian systems, the full text of the GNU Lesser General Public
License version 2.1 can be found in the file License version 2.1 can be found in the file
@ -358,7 +358,7 @@ License: LGPL-2.1+
Lesser General Public License for more details. Lesser General Public License for more details.
. .
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
. .
On Debian systems, the full text of the GNU Lesser General Public On Debian systems, the full text of the GNU Lesser General Public
License version 2.1 can be found in the file License version 2.1 can be found in the file
@ -378,7 +378,7 @@ License: LGPL-3.0+
See the GNU Lesser General Public License for more details. See the GNU Lesser General Public License for more details.
. .
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with TCPDF. If not, see <http://www.gnu.org/licenses/>. along with TCPDF. If not, see <https://www.gnu.org/licenses/>.
. .
On Debian systems, the complete text of the GNU Lesser General On Debian systems, the complete text of the GNU Lesser General
Public License version 3 can be found in "/usr/share/common-licenses/LGPL-3". Public License version 3 can be found in "/usr/share/common-licenses/LGPL-3".

View File

@ -13,7 +13,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/** /**
@ -106,6 +106,7 @@ if (empty($includecustom)) {
} }
print "Release : ".$release."\n"; print "Release : ".$release."\n";
print "Working on files into : ".DOL_DOCUMENT_ROOT."\n";
print "Include custom in signature : ".$includecustom."\n"; print "Include custom in signature : ".$includecustom."\n";
print "Include constants in signature : "; print "Include constants in signature : ";
foreach ($includeconstants as $countrycode => $tmp) { foreach ($includeconstants as $countrycode => $tmp) {

View File

@ -13,7 +13,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/** /**

View File

@ -13,7 +13,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/** /**

View File

@ -13,7 +13,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/** /**

View File

@ -13,7 +13,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/** /**

View File

@ -13,7 +13,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/** /**

View File

@ -13,7 +13,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
* ATTENTION DE PAS EXECUTER CE SCRIPT SUR UNE INSTALLATION DE PRODUCTION * ATTENTION DE PAS EXECUTER CE SCRIPT SUR UNE INSTALLATION DE PRODUCTION
*/ */

View File

@ -14,7 +14,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
* ATTENTION DE PAS EXECUTER CE SCRIPT SUR UNE INSTALLATION DE PRODUCTION * ATTENTION DE PAS EXECUTER CE SCRIPT SUR UNE INSTALLATION DE PRODUCTION
*/ */

View File

@ -14,7 +14,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
* ATTENTION DE PAS EXECUTER CE SCRIPT SUR UNE INSTALLATION DE PRODUCTION * ATTENTION DE PAS EXECUTER CE SCRIPT SUR UNE INSTALLATION DE PRODUCTION
*/ */

View File

@ -14,7 +14,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
* ATTENTION DE PAS EXECUTER CE SCRIPT SUR UNE INSTALLATION DE PRODUCTION * ATTENTION DE PAS EXECUTER CE SCRIPT SUR UNE INSTALLATION DE PRODUCTION
*/ */

View File

@ -14,7 +14,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
* ATTENTION DE PAS EXECUTER CE SCRIPT SUR UNE INSTALLATION DE PRODUCTION * ATTENTION DE PAS EXECUTER CE SCRIPT SUR UNE INSTALLATION DE PRODUCTION
*/ */

View File

@ -14,7 +14,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
* WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE * WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE
*/ */

View File

@ -14,7 +14,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
* WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE * WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE
*/ */

View File

@ -14,7 +14,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
* WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE * WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE
*/ */

View File

@ -13,7 +13,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
* THIS SCRIPT DELETE ALL MAIN TABLE CONTENT * THIS SCRIPT DELETE ALL MAIN TABLE CONTENT
* WARNING, DO NOT USE ON A PRODUCTION INSTANCE * WARNING, DO NOT USE ON A PRODUCTION INSTANCE

View File

@ -13,7 +13,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* or see http://www.gnu.org/ * or see http://www.gnu.org/
* *
* Get a distant dump file and load it into a mysql database * Get a distant dump file and load it into a mysql database

View File

@ -13,7 +13,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* or see http://www.gnu.org/ * or see http://www.gnu.org/
* *
* Get a distant dump file and load it into a mysql database * Get a distant dump file and load it into a mysql database

View File

@ -1,8 +1,8 @@
* Page with licence compatibility * Page with licence compatibility
http://www.gnu.org/licenses/quick-guide-gplv3.fr.html https://www.gnu.org/licenses/quick-guide-gplv3.fr.html
* FAQ on GPL licence * FAQ on GPL licence
http://www.fsf.org/licensing/licenses/gpl-faq.html https://www.fsf.org/licensing/licenses/gpl-faq.html
* Questions/Answers on Fork for using Dolibarr as a SaaS * Questions/Answers on Fork for using Dolibarr as a SaaS
http://stackoverflow.com/questions/539291/rebranding-a-gpld-app-as-saas https://stackoverflow.com/questions/539291/rebranding-a-gpld-app-as-saas

View File

@ -12,7 +12,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/** /**

View File

@ -13,7 +13,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/** /**

View File

@ -15,7 +15,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
$sapi_type = php_sapi_name(); $sapi_type = php_sapi_name();

View File

@ -14,7 +14,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
* ----- * -----
* *

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011-2019 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com> * Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>

View File

@ -12,7 +12,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, seehttp://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/** /**

View File

@ -104,7 +104,7 @@ $formaccounting = new FormAccounting($db);
$formother = new FormOther($db); $formother = new FormOther($db);
$form = new Form($db); $form = new Form($db);
if (! in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && ! isset($_POST['begin']) && ! isset($_GET['begin']) && ! isset($_POST['formfilteraction']) && GETPOST('page', 'int') == '' && ! GETPOST('noreset', 'int')) if (! in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && ! isset($_POST['begin']) && ! isset($_GET['begin']) && ! isset($_POST['formfilteraction']) && GETPOST('page', 'int') == '' && ! GETPOST('noreset', 'int') && $user->rights->accounting->mouvements->export)
{ {
if (empty($search_date_start) && empty($search_date_end) && ! GETPOSTISSET('restore_lastsearch_values')) if (empty($search_date_start) && empty($search_date_end) && ! GETPOSTISSET('restore_lastsearch_values'))
{ {
@ -300,7 +300,7 @@ if (! empty($search_lettering_code)) {
} }
if ($action == 'delbookkeeping') { if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) {
$import_key = GETPOST('importkey', 'alpha'); $import_key = GETPOST('importkey', 'alpha');
@ -315,7 +315,7 @@ if ($action == 'delbookkeeping') {
exit; exit;
} }
} }
if ($action == 'delbookkeepingyearconfirm') { if ($action == 'delbookkeepingyearconfirm' && $user->rights->accounting->mouvements->supprimer_tous) {
$delyear = GETPOST('delyear', 'int'); $delyear = GETPOST('delyear', 'int');
if ($delyear==-1) { if ($delyear==-1) {
@ -346,7 +346,7 @@ if ($action == 'delbookkeepingyearconfirm') {
setEventMessages("NoRecordDeleted", null, 'warnings'); setEventMessages("NoRecordDeleted", null, 'warnings');
} }
} }
if ($action == 'delmouvconfirm') { if ($action == 'delmouvconfirm' && $user->rights->accounting->mouvements->supprimer) {
$mvt_num = GETPOST('mvt_num', 'int'); $mvt_num = GETPOST('mvt_num', 'int');
@ -366,7 +366,8 @@ if ($action == 'delmouvconfirm') {
} }
// Export into a file with format defined into setup (FEC, CSV, ...) // Export into a file with format defined into setup (FEC, CSV, ...)
if ($action == 'export_file') { if ($action == 'export_file' && $user->rights->accounting->mouvements->export) {
$result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', $conf->global->ACCOUNTING_REEXPORT); $result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', $conf->global->ACCOUNTING_REEXPORT);
if ($result < 0) if ($result < 0)
@ -514,11 +515,11 @@ if (! empty($conf->global->ACCOUNTING_REEXPORT)) {
} }
$newcardbutton.= '<span class="valignmiddle marginrightonly">'.$langs->trans("IncludeDocsAlreadyExported").'</span>'; $newcardbutton.= '<span class="valignmiddle marginrightonly">'.$langs->trans("IncludeDocsAlreadyExported").'</span>';
$newcardbutton.= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$conf->global->ACCOUNTING_EXPORT_MODELCSV].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file'.($param?'&'.$param:'')); $newcardbutton.= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$conf->global->ACCOUNTING_EXPORT_MODELCSV].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file'.($param?'&'.$param:''), $user->rights->accounting->mouvements->export);
$newcardbutton.= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param); $newcardbutton.= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param);
$newcardbutton.= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', './card.php?action=create'); $newcardbutton.= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', './card.php?action=create', '', $user->rights->accounting->mouvements->creer);
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit); print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit);
@ -818,12 +819,17 @@ if ($num > 0)
// Action column // Action column
print '<td class="nowraponall center">'; print '<td class="nowraponall center">';
if(empty($line->date_export)) { if (empty($line->date_export)) {
print '<a href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num=' . urlencode($line->piece_num) . $param . '&page=' . $page . ($sortfield ? '&sortfield='.$sortfield : '') . ($sortorder ? '&sortorder='.$sortorder : '') . '">' . img_edit() . '</a>&nbsp;'; if ($user->rights->accounting->mouvements->creer) {
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=delmouv&mvt_num=' . urlencode($line->piece_num) . $param . '&page=' . $page . ($sortfield ? '&sortfield='.$sortfield : '') . ($sortorder ? '&sortorder='.$sortorder : '') . '">' . img_delete() . '</a>'; print '<a href="' . DOL_URL_ROOT . '/accountancy/bookkeeping/card.php?piece_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield=' . $sortfield : '') . ($sortorder ? '&sortorder=' . $sortorder : '') . '">' . img_edit() . '</a>';
}
if ($user->rights->accounting->mouvements->supprimer) {
print '&nbsp;<a href="' . $_SERVER['PHP_SELF'] . '?action=delmouv&mvt_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield=' . $sortfield : '') . ($sortorder ? '&sortorder=' . $sortorder : '') . '">' . img_delete() . '</a>';
}
} }
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['nbfield']++;
print "</tr>\n"; print "</tr>\n";
@ -855,10 +861,11 @@ print "</table>";
print '</div>'; print '</div>';
// TODO Replace this with mass delete action // TODO Replace this with mass delete action
print '<div class="tabsAction tabsActionNoBottom">' . "\n"; if ($user->rights->accounting->mouvements->supprimer_tous) {
print '<a class="butActionDelete" name="button_delmvt" href="'.$_SERVER["PHP_SELF"].'?action=delbookkeepingyear'.($param?'&'.$param:'').'">' . $langs->trans("DeleteMvt") . '</a>'; print '<div class="tabsAction tabsActionNoBottom">' . "\n";
print '</div>'; print '<a class="butActionDelete" name="button_delmvt" href="' . $_SERVER["PHP_SELF"] . '?action=delbookkeepingyear' . ($param ? '&' . $param : '') . '">' . $langs->trans("DeleteMvt") . '</a>';
print '</div>';
}
print '</form>'; print '</form>';

View File

@ -8,8 +8,8 @@
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2017-2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2017-2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Eric Seigne <eric.seigne@cap-rel.fr> * Copyright (C) 2018 Eric Seigne <eric.seigne@cap-rel.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -502,7 +502,7 @@ if (empty($reshook))
// Check parameters // Check parameters
if (empty($morphy) || $morphy == "-1") { if (empty($morphy) || $morphy == "-1") {
$error++; $error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Nature")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("MemberNature")), null, 'errors');
} }
// Tests if the login already exists // Tests if the login already exists
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
@ -941,7 +941,7 @@ else
// Morphy // Morphy
$morphys["phy"] = $langs->trans("Physical"); $morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Moral"); $morphys["mor"] = $langs->trans("Moral");
print '<tr><td class="fieldrequired">'.$langs->trans("Nature")."</td><td>\n"; print '<tr><td class="fieldrequired">'.$langs->trans("MemberNature")."</td><td>\n";
print $form->selectarray("morphy", $morphys, GETPOST('morphy', 'alpha')?GETPOST('morphy', 'alpha'):$object->morphy, 1); print $form->selectarray("morphy", $morphys, GETPOST('morphy', 'alpha')?GETPOST('morphy', 'alpha'):$object->morphy, 1);
print "</td>\n"; print "</td>\n";
@ -1059,11 +1059,17 @@ else
// Other attributes // Other attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
//Hooks here
print '<tbody>'; $reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook))
{
print $object->showOptionals($extrafields, 'edit');
}
print '<tbody>';
print "</table>\n"; print "</table>\n";
dol_fiche_end();
dol_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" name="button" class="button" value="'.$langs->trans("AddMember").'">'; print '<input type="submit" name="button" class="button" value="'.$langs->trans("AddMember").'">';
@ -1182,7 +1188,7 @@ else
// Morphy // Morphy
$morphys["phy"] = $langs->trans("Physical"); $morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Morale"); $morphys["mor"] = $langs->trans("Morale");
print '<tr><td><span class="fieldrequired">'.$langs->trans("Nature").'</span></td><td>'; print '<tr><td><span class="fieldrequired">'.$langs->trans("MemberNature").'</span></td><td>';
print $form->selectarray("morphy", $morphys, (GETPOSTISSET("morphy")?GETPOST("morphy", 'alpha'):$object->morphy)); print $form->selectarray("morphy", $morphys, (GETPOSTISSET("morphy")?GETPOST("morphy", 'alpha'):$object->morphy));
print "</td></tr>"; print "</td></tr>";
@ -1357,9 +1363,15 @@ else
// Other attributes // Other attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
//Hooks here
$reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook))
{
print $object->showOptionals($extrafields, 'edit');
}
print '</table>'; print '</table>';
dol_fiche_end(); dol_fiche_end();
print '<div class="center">'; print '<div class="center">';
@ -1613,7 +1625,7 @@ else
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n"; print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";
// Morphy // Morphy
print '<tr><td>'.$langs->trans("Nature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>'; print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
print '</tr>'; print '</tr>';
// Gender // Gender

View File

@ -2124,28 +2124,28 @@ class Adherent extends CommonObject
$link.=$linkclose.'>'; $link.=$linkclose.'>';
$linkend='</a>'; $linkend='</a>';
//if ($withpictoimg == -1) $result.='<div class="nowrap">';
$result.=$link; $result.=$link;
if ($withpictoimg) $result.='<div class="inline-block nopadding valignmiddle">';
if ($withpictoimg) if ($withpictoimg)
{ {
$paddafterimage=''; $paddafterimage='';
if (abs($withpictoimg) == 1) $paddafterimage='style="margin-right: 3px;"'; if (abs($withpictoimg) == 1) $paddafterimage='style="margin-right: 3px;"';
// Only picto // Only picto
if ($withpictoimg > 0) $picto='<div class="inline-block nopadding valignmiddle'.($morecss?' userimg'.$morecss:'').'">'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).'</div>'; if ($withpictoimg > 0) $picto='<span class="nopadding'.($morecss?' userimg'.$morecss:'').'">'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).'</span>';
// Picto must be a photo // Picto must be a photo
else $picto='<div class="inline-block nopadding valignmiddle'.($morecss?' userimg'.$morecss:'').'"'.($paddafterimage?' '.$paddafterimage:'').'>'.Form::showphoto('memberphoto', $this, 0, 0, 0, 'userphoto'.($withpictoimg==-3?'small':''), 'mini', 0, 1).'</div>'; else $picto='<span class="nopadding'.($morecss?' userimg'.$morecss:'').'"'.($paddafterimage?' '.$paddafterimage:'').'>'.Form::showphoto('memberphoto', $this, 0, 0, 0, 'userphoto'.($withpictoimg==-3?'small':''), 'mini', 0, 1).'</span>';
$result.=$picto; $result.=$picto;
} }
if ($withpictoimg > -2 && $withpictoimg != 2) if ($withpictoimg > -2 && $withpictoimg != 2)
{ {
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='<div class="inline-block nopadding valignmiddle'.((! isset($this->statut) || $this->statut)?'':' strikefordisabled').($morecss?' usertext'.$morecss:'').'">'; if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='<span class="nopadding valignmiddle'.((! isset($this->statut) || $this->statut)?'':' strikefordisabled').($morecss?' usertext'.$morecss:'').'">';
if ($mode == 'login') $result.=dol_trunc($this->login, $maxlen); if ($mode == 'login') $result.=dol_trunc($this->login, $maxlen);
elseif ($mode == 'ref') $result.=$this->id; elseif ($mode == 'ref') $result.=$this->id;
else $result.=$this->getFullName($langs, '', ($mode == 'firstname' ? 2 : -1), $maxlen); else $result.=$this->getFullName($langs, '', ($mode == 'firstname' ? 2 : -1), $maxlen);
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='</div>'; if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='</span>';
} }
if ($withpictoimg) $result.='</div>';
$result.=$linkend; $result.=$linkend;
//if ($withpictoimg == -1) $result.='</div>';
return $result; return $result;
} }

View File

@ -304,7 +304,7 @@ class Members extends DolibarrApi
// Remove the subscriptions because they are handled as a subresource. // Remove the subscriptions because they are handled as a subresource.
unset($object->subscriptions); unset($object->subscriptions);
unset($object->fk_incoterms); unset($object->fk_incoterms);
unset($object->libelle_incoterms); unset($object->label_incoterms);
unset($object->location_incoterms); unset($object->location_incoterms);
unset($object->fk_delivery_address); unset($object->fk_delivery_address);
unset($object->shipping_method_id); unset($object->shipping_method_id);

View File

@ -307,7 +307,7 @@ class MembersTypes extends DolibarrApi
unset($object->note_public); unset($object->note_public);
unset($object->note_private); unset($object->note_private);
unset($object->fk_incoterms); unset($object->fk_incoterms);
unset($object->libelle_incoterms); unset($object->label_incoterms);
unset($object->location_incoterms); unset($object->location_incoterms);
unset($object->name); unset($object->name);
unset($object->lastname); unset($object->lastname);

View File

@ -127,7 +127,7 @@ if ($id > 0)
print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">'.$membert->getNomUrl(1)."</td></tr>\n"; print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">'.$membert->getNomUrl(1)."</td></tr>\n";
// Morphy // Morphy
print '<tr><td class="titlefield">'.$langs->trans("Nature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>'; print '<tr><td class="titlefield">'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
/*print '<td rowspan="'.$rowspan.'" class="center" valign="middle" width="25%">'; /*print '<td rowspan="'.$rowspan.'" class="center" valign="middle" width="25%">';
print $form->showphoto('memberphoto',$object); print $form->showphoto('memberphoto',$object);
print '</td>';*/ print '</td>';*/

View File

@ -92,7 +92,7 @@ if ($id)
print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n"; print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";
// Morphy // Morphy
print '<tr><td class="titlefield">'.$langs->trans("Nature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>'; print '<tr><td class="titlefield">'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
/*print '<td rowspan="'.$rowspan.'" class="center" valign="middle" width="25%">'; /*print '<td rowspan="'.$rowspan.'" class="center" valign="middle" width="25%">';
print $form->showphoto('memberphoto',$member); print $form->showphoto('memberphoto',$member);
print '</td>';*/ print '</td>';*/

View File

@ -490,7 +490,7 @@ if ($rowid > 0)
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n"; print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";
// Morphy // Morphy
print '<tr><td>'.$langs->trans("Nature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>'; print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
print '</tr>'; print '</tr>';
// Company // Company
@ -667,7 +667,7 @@ if ($rowid > 0)
*/ */
if ($action != 'addsubscription' && $action != 'create_thirdparty') if ($action != 'addsubscription' && $action != 'create_thirdparty')
{ {
$sql = "SELECT d.rowid, d.firstname, d.lastname, d.societe,"; $sql = "SELECT d.rowid, d.firstname, d.lastname, d.societe, d.fk_adherent_type as type,";
$sql.= " c.rowid as crowid, c.subscription,"; $sql.= " c.rowid as crowid, c.subscription,";
$sql.= " c.datec, c.fk_type as cfk_type,"; $sql.= " c.datec, c.fk_type as cfk_type,";
$sql.= " c.dateadh as dateh,"; $sql.= " c.dateadh as dateh,";
@ -705,26 +705,30 @@ if ($rowid > 0)
print "</tr>\n"; print "</tr>\n";
$accountstatic=new Account($db); $accountstatic=new Account($db);
$adh = new Adherent($db);
$adht = new AdherentType($db); $adht = new AdherentType($db);
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$adh->id = $objp->rowid;
$adh->typeid = $objp->type;
$subscriptionstatic->ref=$objp->crowid; $subscriptionstatic->ref=$objp->crowid;
$subscriptionstatic->id=$objp->crowid; $subscriptionstatic->id=$objp->crowid;
if ($objp->cfk_type > 0) $typeid = ($objp->cfk_type > 0 ? $objp->cfk_type : $adh->typeid);
if ($typeid > 0)
{ {
$adht->fetch($objp->cfk_type); $adht->fetch($typeid);
} }
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$subscriptionstatic->getNomUrl(1).'</td>'; print '<td>'.$subscriptionstatic->getNomUrl(1).'</td>';
print '<td class="center">'.dol_print_date($db->jdate($objp->datec), 'dayhour')."</td>\n"; print '<td class="center">'.dol_print_date($db->jdate($objp->datec), 'dayhour')."</td>\n";
print '<td class="center">'; print '<td class="center">';
if ($objp->cfk_type > 0) if ($typeid > 0) {
{
print $adht->getNomUrl(1); print $adht->getNomUrl(1);
} }
print '</td>'; print '</td>';

View File

@ -313,8 +313,9 @@ if ($rowid && $action != 'edit')
print '<tr>'; print '<tr>';
print '<td class="titlefield">'.$langs->trans("Type").'</td>'; print '<td class="titlefield">'.$langs->trans("Type").'</td>';
print '<td class="valeur">'; print '<td class="valeur">';
if (! empty($object->fk_type) ) { if ($object->fk_type > 0 || $adh->typeid > 0) {
$adht->fetch($object->fk_type); $typeid = ($object->fk_type > 0 ? $object->fk_type : $adh->typeid);
$adht->fetch($typeid);
print $adht->getNomUrl(1); print $adht->getNomUrl(1);
} else { } else {
print $langs->trans("NoType"); print $langs->trans("NoType");
@ -345,7 +346,7 @@ if ($rowid && $action != 'edit')
// Amount // Amount
print '<tr><td>'.$langs->trans("Amount").'</td><td class="valeur">'.price($object->amount).'</td></tr>'; print '<tr><td>'.$langs->trans("Amount").'</td><td class="valeur">'.price($object->amount).'</td></tr>';
// Amount // Label
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur">'.$object->note.'</td></tr>'; print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur">'.$object->note.'</td></tr>';
// Bank line // Bank line

View File

@ -142,7 +142,7 @@ $accountstatic=new Account($db);
$now=dol_now(); $now=dol_now();
// List of subscriptions // List of subscriptions
$sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, d.photo,"; $sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, d.photo, d.statut,";
$sql.= " c.rowid as crowid, c.fk_type, c.subscription,"; $sql.= " c.rowid as crowid, c.fk_type, c.subscription,";
$sql.= " c.dateadh, c.datef, c.datec as date_creation, c.tms as date_update,"; $sql.= " c.dateadh, c.datef, c.datec as date_creation, c.tms as date_update,";
$sql.= " c.fk_bank as bank, c.note,"; $sql.= " c.fk_bank as bank, c.note,";
@ -225,7 +225,7 @@ $param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if ($statut != '') $param.="&statut=".urlencode($statut); if ($statut != '') $param.="&statut=".urlencode($statut);
if ($search_type) $param.="&search_type=".urlencode($search_type); if ($search_type) $param.="&search_type=".urlencode($search_type);
if ($date_select) $param.="&date_select=".urlencode($date_select); if ($date_select) $param.="&date_select=".urlencode($date_select);
if ($search_lastname) $param.="&search_lastname=".urlencode($search_lastname); if ($search_lastname) $param.="&search_lastname=".urlencode($search_lastname);
if ($search_login) $param.="&search_login=".urlencode($search_login); if ($search_login) $param.="&search_login=".urlencode($search_login);
@ -298,33 +298,33 @@ if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID))
if (! empty($arrayfields['d.ref']['checked'])) if (! empty($arrayfields['d.ref']['checked']))
{ {
print '<td class="liste_titre left">'; print '<td class="liste_titre left">';
print '<input class="flat" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'" size="4"></td>'; print '<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'"></td>';
} }
// Type // Type
if (! empty($arrayfields['d.fk_type']['checked'])) if (! empty($arrayfields['d.fk_type']['checked']))
{ {
print '<td class="liste_titre left">'; print '<td class="liste_titre left">';
print '<input class="flat" type="text" name="search_type" value="'.dol_escape_htmltag($search_type).'" size="7">'; print '<input class="flat maxwidth50" type="text" name="search_type" value="'.dol_escape_htmltag($search_type).'">';
print'</td>'; print'</td>';
} }
if (! empty($arrayfields['d.lastname']['checked'])) if (! empty($arrayfields['d.lastname']['checked']))
{ {
print '<td class="liste_titre left">'; print '<td class="liste_titre left">';
print '<input class="flat" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).'" size="7"></td>'; print '<input class="flat maxwidth75" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).'"></td>';
} }
if (! empty($arrayfields['d.firstname']['checked'])) if (! empty($arrayfields['d.firstname']['checked']))
{ {
print '<td class="liste_titre left">'; print '<td class="liste_titre left">';
print '<input class="flat" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).'" size="12"></td>'; print '<input class="flat maxwidth75" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).'"></td>';
} }
if (! empty($arrayfields['d.login']['checked'])) if (! empty($arrayfields['d.login']['checked']))
{ {
print '<td class="liste_titre left">'; print '<td class="liste_titre left">';
print '<input class="flat" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'" size="7"></td>'; print '<input class="flat maxwidth75" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'"></td>';
} }
if (! empty($arrayfields['t.libelle']['checked'])) if (! empty($arrayfields['t.libelle']['checked']))
@ -409,23 +409,23 @@ if (! empty($arrayfields['d.login']['checked']))
} }
if (! empty($arrayfields['t.libelle']['checked'])) if (! empty($arrayfields['t.libelle']['checked']))
{ {
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "c.note", $param, "", 'align="left"', $sortfield, $sortorder); print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "c.note", $param, "", '', $sortfield, $sortorder);
} }
if (! empty($arrayfields['d.bank']['checked'])) if (! empty($arrayfields['d.bank']['checked']))
{ {
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "b.fk_account", $pram, "", "", $sortfield, $sortorder); print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "b.fk_account", $param, "", "", $sortfield, $sortorder);
} }
if (! empty($arrayfields['c.dateadh']['checked'])) if (! empty($arrayfields['c.dateadh']['checked']))
{ {
print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "c.dateadh", $param, "", 'align="center"', $sortfield, $sortorder); print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "c.dateadh", $param, "", '', $sortfield, $sortorder, 'center nowraponall ');
} }
if (! empty($arrayfields['c.datef']['checked'])) if (! empty($arrayfields['c.datef']['checked']))
{ {
print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "c.datef", $param, "", 'align="center"', $sortfield, $sortorder); print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "c.datef", $param, "", '', $sortfield, $sortorder, 'center nowraponall ');
} }
if (! empty($arrayfields['d.amount']['checked'])) if (! empty($arrayfields['d.amount']['checked']))
{ {
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "c.subscription", $param, "", 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "c.subscription", $param, "", '', $sortfield, $sortorder, 'right ');
} }
// Extra fields // Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
@ -457,9 +457,11 @@ while ($i < min($num, $limit))
$adherent->statut=$obj->statut; $adherent->statut=$obj->statut;
$adherent->login=$obj->login; $adherent->login=$obj->login;
$adherent->photo=$obj->photo; $adherent->photo=$obj->photo;
$adherent->typeid=$obj->type;
$typeid = ($obj->fk_type > 0 ? $obj->fk_type : $adherent->typeid);
$adht = new AdherentType($db); $adht = new AdherentType($db);
$adht->fetch($obj->fk_type); $adht->fetch($typeid);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
@ -473,7 +475,10 @@ while ($i < min($num, $limit))
if (! empty($arrayfields['d.fk_type']['checked'])) if (! empty($arrayfields['d.fk_type']['checked']))
{ {
print '<td>'; print '<td>';
if ( ! empty($obj->fk_type) ) print $adht->getNomUrl(1); if ($typeid > 0)
{
print $adht->getNomUrl(1);
}
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }

View File

@ -258,7 +258,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<th>'.$langs->trans("Ref").'</th>'; print '<th>'.$langs->trans("Ref").'</th>';
print '<th>'.$langs->trans("Label").'</th>'; print '<th>'.$langs->trans("Label").'</th>';
print '<th class="center">'.$langs->trans("Nature").'</th>'; print '<th class="center">'.$langs->trans("MemberNature").'</th>';
print '<th class="center">'.$langs->trans("SubscriptionRequired").'</th>'; print '<th class="center">'.$langs->trans("SubscriptionRequired").'</th>';
print '<th class="center">'.$langs->trans("VoteAllowed").'</th>'; print '<th class="center">'.$langs->trans("VoteAllowed").'</th>';
print '<th class="center">'.$langs->trans("Status").'</th>'; print '<th class="center">'.$langs->trans("Status").'</th>';
@ -338,12 +338,12 @@ if ($action == 'create')
print '<tr><td>'.$langs->trans("Status").'</td><td>'; print '<tr><td>'.$langs->trans("Status").'</td><td>';
print $form->selectarray('statut', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), 1); print $form->selectarray('statut', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), 1);
print '</td></tr>'; print '</td></tr>';
// Morphy // Morphy
$morphys[""] = $langs->trans("Physical & Morale"); $morphys[""] = $langs->trans("MorPhy");
$morphys["phy"] = $langs->trans("Physical"); $morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Morale"); $morphys["mor"] = $langs->trans("Morale");
print '<tr><td><span>'.$langs->trans("Nature").'</span></td><td>'; print '<tr><td><span>'.$langs->trans("MemberNature").'</span></td><td>';
print $form->selectarray("morphy", $morphys, isset($_POST["morphy"])?$_POST["morphy"]:$object->morphy); print $form->selectarray("morphy", $morphys, isset($_POST["morphy"])?$_POST["morphy"]:$object->morphy);
print "</td></tr>"; print "</td></tr>";
@ -427,9 +427,9 @@ if ($rowid > 0)
print img_picto($langs->trans('TypeStatusInactive'), 'statut5').' '.$langs->trans("ActivityCeased"); print img_picto($langs->trans('TypeStatusInactive'), 'statut5').' '.$langs->trans("ActivityCeased");
} }
print '</tr>'; print '</tr>';
// Morphy // Morphy
print '<tr><td>'.$langs->trans("Nature").'</td><td class="valeur" >'.$object->getmorphylib($object->morphy).'</td>'; print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$object->getmorphylib($object->morphy).'</td>';
print '</tr>'; print '</tr>';
print '<tr><td class="titlefield">'.$langs->trans("SubscriptionRequired").'</td><td>'; print '<tr><td class="titlefield">'.$langs->trans("SubscriptionRequired").'</td><td>';
@ -630,7 +630,7 @@ if ($rowid > 0)
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre("NameSlashCompany", $_SERVER["PHP_SELF"], "d.lastname", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("NameSlashCompany", $_SERVER["PHP_SELF"], "d.lastname", $param, "", "", $sortfield, $sortorder);
print_liste_field_titre("Login", $_SERVER["PHP_SELF"], "d.login", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("Login", $_SERVER["PHP_SELF"], "d.login", $param, "", "", $sortfield, $sortorder);
print_liste_field_titre("Nature", $_SERVER["PHP_SELF"], "d.morphy", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("MemberNature", $_SERVER["PHP_SELF"], "d.morphy", $param, "", "", $sortfield, $sortorder);
print_liste_field_titre("EMail", $_SERVER["PHP_SELF"], "d.email", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("EMail", $_SERVER["PHP_SELF"], "d.email", $param, "", "", $sortfield, $sortorder);
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "d.statut,d.datefin", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "d.statut,d.datefin", $param, "", "", $sortfield, $sortorder);
print_liste_field_titre("EndSubscription", $_SERVER["PHP_SELF"], "d.datefin", $param, "", 'align="center"', $sortfield, $sortorder); print_liste_field_titre("EndSubscription", $_SERVER["PHP_SELF"], "d.datefin", $param, "", 'align="center"', $sortfield, $sortorder);
@ -771,12 +771,12 @@ if ($rowid > 0)
print '<tr><td>'.$langs->trans("Status").'</td><td>'; print '<tr><td>'.$langs->trans("Status").'</td><td>';
print $form->selectarray('statut', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), $object->statut); print $form->selectarray('statut', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), $object->statut);
print '</td></tr>'; print '</td></tr>';
// Morphy // Morphy
$morphys[""] = $langs->trans("Physical & Morale"); $morphys[""] = $langs->trans("MorPhy");
$morphys["phy"] = $langs->trans("Physical"); $morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Morale"); $morphys["mor"] = $langs->trans("Morale");
print '<tr><td><span>'.$langs->trans("Nature").'</span></td><td>'; print '<tr><td><span>'.$langs->trans("MemberNature").'</span></td><td>';
print $form->selectarray("morphy", $morphys, isset($_POST["morphy"])?$_POST["morphy"]:$object->morphy); print $form->selectarray("morphy", $morphys, isset($_POST["morphy"])?$_POST["morphy"]:$object->morphy);
print "</td></tr>"; print "</td></tr>";

View File

@ -365,7 +365,7 @@ print '<br>';
// Select barcode numbering module // Select barcode numbering module
if ($conf->produit->enabled) if ($conf->product->enabled)
{ {
print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("Product").")", '', ''); print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("Product").")", '', '');

View File

@ -106,8 +106,6 @@ class DolibarrApi
// Remove linkedObjects. We should already have linkedObjectIds that avoid huge responses // Remove linkedObjects. We should already have linkedObjectIds that avoid huge responses
unset($object->linkedObjects); unset($object->linkedObjects);
unset($object->lignes); // we don't want lignes, we want only ->lines
unset($object->fields); unset($object->fields);
unset($object->oldline); unset($object->oldline);
@ -188,7 +186,7 @@ class DolibarrApi
unset($object->lines[$i]->note_public); unset($object->lines[$i]->note_public);
unset($object->lines[$i]->note_private); unset($object->lines[$i]->note_private);
unset($object->lines[$i]->fk_incoterms); unset($object->lines[$i]->fk_incoterms);
unset($object->lines[$i]->libelle_incoterms); unset($object->lines[$i]->label_incoterms);
unset($object->lines[$i]->location_incoterms); unset($object->lines[$i]->location_incoterms);
unset($object->lines[$i]->name); unset($object->lines[$i]->name);
unset($object->lines[$i]->lastname); unset($object->lines[$i]->lastname);

View File

@ -449,6 +449,7 @@ class Setup extends DolibarrApi
/** /**
* Get the list of currencies. * Get the list of currencies.
* *
* @param int $multicurrency Multicurrency rates (0: no multicurrency, 1: last rate, 2: all rates) {@min 0} {@max 2}
* @param string $sortfield Sort field * @param string $sortfield Sort field
* @param string $sortorder Sort order * @param string $sortorder Sort order
* @param int $limit Number of items per page * @param int $limit Number of items per page
@ -461,13 +462,22 @@ class Setup extends DolibarrApi
* *
* @throws RestException * @throws RestException
*/ */
public function getListOfCurrencies($sortfield = "code_iso", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '') public function getListOfCurrencies($multicurrency = 0, $sortfield = "code_iso", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{ {
$list = array(); $list = array();
//TODO link with multicurrency module
$sql = "SELECT t.code_iso, t.label, t.unicode"; $sql = "SELECT t.code_iso, t.label, t.unicode";
if (!empty($multicurrency)) $sql.= " , cr.date_sync, cr.rate ";
$sql.= " FROM ".MAIN_DB_PREFIX."c_currencies as t"; $sql.= " FROM ".MAIN_DB_PREFIX."c_currencies as t";
if (!empty($multicurrency)) {
$sql.= " JOIN ".MAIN_DB_PREFIX."multicurrency as m ON m.code=t.code_iso";
$sql.= " JOIN ".MAIN_DB_PREFIX."multicurrency_rate as cr ON (m.rowid = cr.fk_multicurrency)";
}
$sql.= " WHERE t.active = ".$active; $sql.= " WHERE t.active = ".$active;
if (!empty($multicurrency)) {
$sql.= " AND m.entity IN (".getEntity('multicurrency').")";
if (!empty($multicurrency) && $multicurrency != 2) $sql.= " AND cr.date_sync = (SELECT MAX(cr2.date_sync) FROM ".MAIN_DB_PREFIX."multicurrency_rate AS cr2 WHERE cr2.fk_multicurrency = m.rowid)";
}
// Add sql filters // Add sql filters
if ($sqlfilters) if ($sqlfilters)
{ {

View File

@ -398,7 +398,7 @@ class BlockedLog
'name','lastname','firstname','region','region_id','region_code','state','state_id','state_code','country','country_id','country_code', 'name','lastname','firstname','region','region_id','region_code','state','state_id','state_code','country','country_id','country_code',
'total_ht','total_tva','total_ttc','total_localtax1','total_localtax2', 'total_ht','total_tva','total_ttc','total_localtax1','total_localtax2',
'barcode_type','barcode_type_code','barcode_type_label','barcode_type_coder','mode_reglement_id','cond_reglement_id','mode_reglement','cond_reglement','shipping_method_id', 'barcode_type','barcode_type_code','barcode_type_label','barcode_type_coder','mode_reglement_id','cond_reglement_id','mode_reglement','cond_reglement','shipping_method_id',
'fk_incoterms','libelle_incoterms','location_incoterms','lines') 'fk_incoterms','label_incoterms','location_incoterms','lines')
); );
} }

View File

@ -290,7 +290,7 @@ class Categories extends DolibarrApi
unset($object->total_tva); unset($object->total_tva);
unset($object->lines); unset($object->lines);
unset($object->fk_incoterms); unset($object->fk_incoterms);
unset($object->libelle_incoterms); unset($object->label_incoterms);
unset($object->location_incoterms); unset($object->location_incoterms);
unset($object->civility_id); unset($object->civility_id);
unset($object->name); unset($object->name);

View File

@ -356,7 +356,7 @@ class AgendaEvents extends DolibarrApi
unset($object->total_localtax2); unset($object->total_localtax2);
unset($object->total_ttc); unset($object->total_ttc);
unset($object->fk_incoterms); unset($object->fk_incoterms);
unset($object->libelle_incoterms); unset($object->label_incoterms);
unset($object->location_incoterms); unset($object->location_incoterms);
unset($object->name); unset($object->name);
unset($object->lastname); unset($object->lastname);

View File

@ -1688,7 +1688,7 @@ if ($action == 'create')
if (!empty($conf->incoterm->enabled)) if (!empty($conf->incoterm->enabled))
{ {
print '<tr>'; print '<tr>';
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $soc->libelle_incoterms, 1).'</label></td>'; print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $soc->label_incoterms, 1).'</label></td>';
print '<td class="maxwidthonsmartphone">'; print '<td class="maxwidthonsmartphone">';
print $form->select_incoterms((!empty($soc->fk_incoterms) ? $soc->fk_incoterms : ''), (!empty($soc->location_incoterms)?$soc->location_incoterms:'')); print $form->select_incoterms((!empty($soc->fk_incoterms) ? $soc->fk_incoterms : ''), (!empty($soc->location_incoterms)?$soc->location_incoterms:''));
print '</td></tr>'; print '</td></tr>';
@ -2305,7 +2305,7 @@ $formquestion = array_merge($formquestion, array(
print '<td>'; print '<td>';
if ($action != 'editincoterm') if ($action != 'editincoterm')
{ {
print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1); print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
} }
else else
{ {

View File

@ -1383,7 +1383,7 @@ class Propal extends CommonObject
$sql.= ", p.fk_incoterms, p.location_incoterms"; $sql.= ", p.fk_incoterms, p.location_incoterms";
$sql.= ", p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva, p.multicurrency_total_ttc"; $sql.= ", p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva, p.multicurrency_total_ttc";
$sql.= ", p.tms as date_modification"; $sql.= ", p.tms as date_modification";
$sql.= ", i.libelle as libelle_incoterms"; $sql.= ", i.libelle as label_incoterms";
$sql.= ", c.label as statut_label"; $sql.= ", c.label as statut_label";
$sql.= ", ca.code as availability_code, ca.label as availability"; $sql.= ", ca.code as availability_code, ca.label as availability";
$sql.= ", dr.code as demand_reason_code, dr.label as demand_reason"; $sql.= ", dr.code as demand_reason_code, dr.label as demand_reason";
@ -1471,7 +1471,7 @@ class Propal extends CommonObject
//Incoterms //Incoterms
$this->fk_incoterms = $obj->fk_incoterms; $this->fk_incoterms = $obj->fk_incoterms;
$this->location_incoterms = $obj->location_incoterms; $this->location_incoterms = $obj->location_incoterms;
$this->libelle_incoterms = $obj->libelle_incoterms; $this->label_incoterms = $obj->label_incoterms;
// Multicurrency // Multicurrency
$this->fk_multicurrency = $obj->fk_multicurrency; $this->fk_multicurrency = $obj->fk_multicurrency;

View File

@ -1737,7 +1737,7 @@ if ($action == 'create' && $user->rights->commande->creer)
if (!empty($conf->incoterm->enabled)) if (!empty($conf->incoterm->enabled))
{ {
print '<tr>'; print '<tr>';
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $objectsrc->libelle_incoterms, 1).'</label></td>'; print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $objectsrc->label_incoterms, 1).'</label></td>';
print '<td class="maxwidthonsmartphone">'; print '<td class="maxwidthonsmartphone">';
$incoterm_id = GETPOST('incoterm_id'); $incoterm_id = GETPOST('incoterm_id');
$incoterm_location = GETPOST('location_incoterms'); $incoterm_location = GETPOST('location_incoterms');
@ -2361,7 +2361,7 @@ if ($action == 'create' && $user->rights->commande->creer)
print '<td>'; print '<td>';
if ($action != 'editincoterm') if ($action != 'editincoterm')
{ {
print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1); print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
} }
else else
{ {

View File

@ -1676,7 +1676,7 @@ class Commande extends CommonOrder
$sql.= ', c.fk_incoterms, c.location_incoterms'; $sql.= ', c.fk_incoterms, c.location_incoterms';
$sql.= ", c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva, c.multicurrency_total_ttc"; $sql.= ", c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva, c.multicurrency_total_ttc";
$sql.= ", c.module_source, c.pos_source"; $sql.= ", c.module_source, c.pos_source";
$sql.= ", i.libelle as libelle_incoterms"; $sql.= ", i.libelle as label_incoterms";
$sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; $sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle';
$sql.= ', cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle, cr.libelle_facture as cond_reglement_libelle_doc'; $sql.= ', cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle, cr.libelle_facture as cond_reglement_libelle_doc';
$sql.= ', ca.code as availability_code, ca.label as availability_label'; $sql.= ', ca.code as availability_code, ca.label as availability_label';
@ -1758,7 +1758,7 @@ class Commande extends CommonOrder
//Incoterms //Incoterms
$this->fk_incoterms = $obj->fk_incoterms; $this->fk_incoterms = $obj->fk_incoterms;
$this->location_incoterms = $obj->location_incoterms; $this->location_incoterms = $obj->location_incoterms;
$this->libelle_incoterms = $obj->libelle_incoterms; $this->label_incoterms = $obj->label_incoterms;
// Multicurrency // Multicurrency
$this->fk_multicurrency = $obj->fk_multicurrency; $this->fk_multicurrency = $obj->fk_multicurrency;

View File

@ -3171,7 +3171,7 @@ if ($action == 'create')
if (!empty($conf->incoterm->enabled)) if (!empty($conf->incoterm->enabled))
{ {
print '<tr>'; print '<tr>';
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $objectsrc->libelle_incoterms, 1).'</label></td>'; print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $objectsrc->label_incoterms, 1).'</label></td>';
print '<td colspan="2" class="maxwidthonsmartphone">'; print '<td colspan="2" class="maxwidthonsmartphone">';
$incoterm_id = GETPOST('incoterm_id'); $incoterm_id = GETPOST('incoterm_id');
$incoterm_location = GETPOST('location_incoterms'); $incoterm_location = GETPOST('location_incoterms');
@ -4007,7 +4007,7 @@ elseif ($id > 0 || ! empty($ref))
print '<td>'; print '<td>';
if ($action != 'editincoterm') if ($action != 'editincoterm')
{ {
print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1); print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
} }
else else
{ {

View File

@ -1335,7 +1335,7 @@ class Facture extends CommonInvoice
$sql.= ', c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc'; $sql.= ', c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc';
$sql.= ', f.fk_incoterms, f.location_incoterms'; $sql.= ', f.fk_incoterms, f.location_incoterms';
$sql.= ', f.module_source, f.pos_source'; $sql.= ', f.module_source, f.pos_source';
$sql.= ", i.libelle as libelle_incoterms"; $sql.= ", i.libelle as label_incoterms";
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as c ON f.fk_cond_reglement = c.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as c ON f.fk_cond_reglement = c.rowid';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON f.fk_mode_reglement = p.id'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON f.fk_mode_reglement = p.id';
@ -1410,7 +1410,7 @@ class Facture extends CommonInvoice
//Incoterms //Incoterms
$this->fk_incoterms = $obj->fk_incoterms; $this->fk_incoterms = $obj->fk_incoterms;
$this->location_incoterms = $obj->location_incoterms; $this->location_incoterms = $obj->location_incoterms;
$this->libelle_incoterms = $obj->libelle_incoterms; $this->label_incoterms = $obj->label_incoterms;
$this->module_source = $obj->module_source; $this->module_source = $obj->module_source;
$this->pos_source = $obj->pos_source; $this->pos_source = $obj->pos_source;
@ -4141,7 +4141,7 @@ class Facture extends CommonInvoice
/** /**
* Create a document onto disk according to template module. * Create a document onto disk according to template module.
* *
* @param string $modele Generator to use. Caller must set it to obj->modelpdf or GETPOST('modelpdf') for example. * @param string $modele Generator to use. Caller must set it to obj->modelpdf or GETPOST('modelpdf','alpha') for example.
* @param Translate $outputlangs objet lang a utiliser pour traduction * @param Translate $outputlangs objet lang a utiliser pour traduction
* @param int $hidedetails Hide details of lines * @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description * @param int $hidedesc Hide description

View File

@ -1920,7 +1920,7 @@ class Contrat extends CommonObject
*/ */
public function getNomUrl($withpicto = 0, $maxlength = 0, $notooltip = 0, $save_lastsearch_value = -1) public function getNomUrl($withpicto = 0, $maxlength = 0, $notooltip = 0, $save_lastsearch_value = -1)
{ {
global $conf, $langs, $user; global $conf, $langs, $user, $hookmanager;
$result=''; $result='';
@ -1973,6 +1973,16 @@ class Contrat extends CommonObject
if ($withpicto != 2) $result.= ($this->ref?$this->ref:$this->id); if ($withpicto != 2) $result.= ($this->ref?$this->ref:$this->id);
$result .= $linkend; $result .= $linkend;
global $action;
$hookmanager->initHooks(array('contractdao'));
$parameters=array('id'=>$this->id, 'getnomurl'=>$result);
$reshook=$hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook > 0) {
$result = $hookmanager->resPrint;
} else {
$result .= $hookmanager->resPrint;
}
return $result; return $result;
} }

View File

@ -592,7 +592,7 @@ if (! empty($arrayfields['c.tms']['checked'])){
print_liste_field_titre($arrayfields['c.tms']['label'], $_SERVER["PHP_SELF"], "c.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap '); print_liste_field_titre($arrayfields['c.tms']['label'], $_SERVER["PHP_SELF"], "c.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
} }
if (! empty($arrayfields['lower_planned_end_date']['checked'])) { if (! empty($arrayfields['lower_planned_end_date']['checked'])) {
print_liste_field_titre($arrayfields['lower_planned_end_date']['label'], $_SERVER["PHP_SELF"], "lower_planned_end_date", "", $param, '', $sortfield, $sortorder, 'center nowrap '); print_liste_field_titre($arrayfields['lower_planned_end_date']['label'], $_SERVER["PHP_SELF"], "lower_planned_end_date", "", $param, '', $sortfield, $sortorder, 'center ');
} }
if (! empty($arrayfields['status']['checked'])) { if (! empty($arrayfields['status']['checked'])) {
print_liste_field_titre($staticcontratligne->LibStatut(0, 3), '', '', '', '', 'width="16"'); print_liste_field_titre($staticcontratligne->LibStatut(0, 3), '', '', '', '', 'width="16"');

File diff suppressed because it is too large Load Diff

View File

@ -391,7 +391,7 @@ abstract class CommonObject
* @var string * @var string
* @see SetIncoterms() * @see SetIncoterms()
*/ */
public $libelle_incoterms; public $label_incoterms;
/** /**
* @var string * @var string
@ -3762,7 +3762,7 @@ abstract class CommonObject
{ {
// phpcs:enable // phpcs:enable
$out = ''; $out = '';
$this->libelle_incoterms = ''; $this->label_incoterms = '';
if (!empty($this->fk_incoterms)) if (!empty($this->fk_incoterms))
{ {
$sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'c_incoterms WHERE rowid = '.(int) $this->fk_incoterms; $sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'c_incoterms WHERE rowid = '.(int) $this->fk_incoterms;
@ -3835,7 +3835,7 @@ abstract class CommonObject
if ($res) if ($res)
{ {
$obj = $this->db->fetch_object($res); $obj = $this->db->fetch_object($res);
$this->libelle_incoterms = $obj->libelle; $this->label_incoterms = $obj->libelle;
} }
return 1; return 1;
} }
@ -4450,7 +4450,7 @@ abstract class CommonObject
* Common function for all objects extending CommonObject for generating documents * Common function for all objects extending CommonObject for generating documents
* *
* @param string $modelspath Relative folder where generators are placed * @param string $modelspath Relative folder where generators are placed
* @param string $modele Generator to use. Caller must set it to obj->modelpdf or GETPOST('modelpdf') for example. * @param string $modele Generator to use. Caller must set it to obj->modelpdf or GETPOST('modelpdf','alpha') for example.
* @param Translate $outputlangs Output language to use * @param Translate $outputlangs Output language to use
* @param int $hidedetails 1 to hide details. 0 by default * @param int $hidedetails 1 to hide details. 0 by default
* @param int $hidedesc 1 to hide product description. 0 by default * @param int $hidedesc 1 to hide product description. 0 by default
@ -4465,6 +4465,8 @@ abstract class CommonObject
$srctemplatepath=''; $srctemplatepath='';
dol_syslog("commonGenerateDocument modele=".$modele." outputlangs->defaultlang=".(is_object($outputlangs)?$outputlangs->defaultlang:'null'));
// Increase limit for PDF build // Increase limit for PDF build
$err=error_reporting(); $err=error_reporting();
error_reporting(0); error_reporting(0);
@ -4505,7 +4507,7 @@ abstract class CommonObject
// If generator was found // If generator was found
if ($filefound) if ($filefound)
{ {
global $db; // Required to solve a conception default in commonstickergenerator.class.php making an include of code using $db global $db; // Required to solve a conception default making an include of code using $db instead of $this->db just after.
require_once $file; require_once $file;
@ -6379,6 +6381,7 @@ abstract class CommonObject
$out .= '<!-- showOptionalsInput --> '; $out .= '<!-- showOptionalsInput --> ';
$out .= "\n"; $out .= "\n";
$extrafields_collapse_num = '';
$e = 0; $e = 0;
foreach($extrafields->attributes[$this->table_element]['label'] as $key=>$label) foreach($extrafields->attributes[$this->table_element]['label'] as $key=>$label)
{ {
@ -6438,6 +6441,20 @@ abstract class CommonObject
if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate')
{ {
$extrafields_collapse_num = '';
$extrafield_param = $extrafields->attributes[$this->table_element]['param'][$key];
if (!empty($extrafield_param) && is_array($extrafield_param)) {
$extrafield_param_list = array_keys($extrafield_param['options']);
if (count($extrafield_param_list)>0) {
$extrafield_collapse_display_value = intval($extrafield_param_list[0]);
if ($extrafield_collapse_display_value==1 || $extrafield_collapse_display_value==2) {
$extrafields_collapse_num = $extrafields->attributes[$this->table_element]['pos'][$key];
}
}
}
$out .= $extrafields->showSeparator($key, $this); $out .= $extrafields->showSeparator($key, $this);
} }
else else
@ -6457,7 +6474,7 @@ abstract class CommonObject
$html_id = !empty($this->id) ? 'extrarow-'.$this->element.'_'.$key.'_'.$this->id : ''; $html_id = !empty($this->id) ? 'extrarow-'.$this->element.'_'.$key.'_'.$this->id : '';
$out .= '<tr id="'.$html_id.'" '.$csstyle.' class="'.$class.$this->element.'_extras_'.$key.'" '.$domData.' >'; $out .= '<tr id="'.$html_id.'" '.$csstyle.' class="'.$class.$this->element.'_extras_'.$key.' trextrafields_collapse'.$extrafields_collapse_num.'" '.$domData.' >';
if (! empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0) if (! empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0)
{ {
@ -6519,7 +6536,7 @@ abstract class CommonObject
jQuery(document).ready(function() { jQuery(document).ready(function() {
function showOptions(child_list, parent_list) function showOptions(child_list, parent_list)
{ {
var val = $("select[name=\"options_"+parent_list+"\"]").val(); var val = $("select[name=\""+parent_list+"\"]").val();
var parentVal = parent_list + ":" + val; var parentVal = parent_list + ":" + val;
if(val > 0) { if(val > 0) {
$("select[name=\""+child_list+"\"] option[parent]").hide(); $("select[name=\""+child_list+"\"] option[parent]").hide();

View File

@ -672,6 +672,7 @@ class Conf
if (isset($this->commande)) $this->order=$this->commande; if (isset($this->commande)) $this->order=$this->commande;
if (isset($this->contrat)) $this->contract=$this->contrat; if (isset($this->contrat)) $this->contract=$this->contrat;
if (isset($this->categorie)) $this->category=$this->categorie; if (isset($this->categorie)) $this->category=$this->categorie;
if (isset($this->project)) $this->project=$this->projet;
// Object $mc // Object $mc
if (! defined('NOREQUIREMC') && ! empty($this->multicompany->enabled)) if (! defined('NOREQUIREMC') && ! empty($this->multicompany->enabled))

View File

@ -227,6 +227,15 @@ class DiscountAbsolute
return -1; return -1;
} }
$userid = $user->id;
if (! ($userid > 0)) // For example when record is saved into an anonymous context with a not loaded object $user.
{
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$tmpinvoice = new Facture($this->db);
$tmpinvoice->fetch($this->fk_facture_source);
$userid = $tmpinvoice->fk_user_author; // We use the author of invoice
}
// Insert request // Insert request
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise_except"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise_except";
$sql.= " (entity, datec, fk_soc, discount_type, fk_user, description,"; $sql.= " (entity, datec, fk_soc, discount_type, fk_user, description,";
@ -234,7 +243,7 @@ class DiscountAbsolute
$sql.= " multicurrency_amount_ht, multicurrency_amount_tva, multicurrency_amount_ttc,"; $sql.= " multicurrency_amount_ht, multicurrency_amount_tva, multicurrency_amount_ttc,";
$sql.= " fk_facture_source, fk_invoice_supplier_source"; $sql.= " fk_facture_source, fk_invoice_supplier_source";
$sql.= ")"; $sql.= ")";
$sql.= " VALUES (".$conf->entity.", '".$this->db->idate($this->datec!=''?$this->datec:dol_now())."', ".$this->fk_soc.", ".(empty($this->discount_type)?0:intval($this->discount_type)).", ".$user->id.", '".$this->db->escape($this->description)."',"; $sql.= " VALUES (".$conf->entity.", '".$this->db->idate($this->datec!=''?$this->datec:dol_now())."', ".$this->fk_soc.", ".(empty($this->discount_type)?0:intval($this->discount_type)).", ".$userid.", '".$this->db->escape($this->description)."',";
$sql.= " ".$this->amount_ht.", ".$this->amount_tva.", ".$this->amount_ttc.", ".$this->tva_tx.","; $sql.= " ".$this->amount_ht.", ".$this->amount_tva.", ".$this->amount_ttc.", ".$this->tva_tx.",";
$sql.= " ".$this->multicurrency_amount_ht.", ".$this->multicurrency_amount_tva.", ".$this->multicurrency_amount_ttc.", "; $sql.= " ".$this->multicurrency_amount_ht.", ".$this->multicurrency_amount_tva.", ".$this->multicurrency_amount_ttc.", ";
$sql.= " ".($this->fk_facture_source ? "'".$this->db->escape($this->fk_facture_source)."'":"null").","; $sql.= " ".($this->fk_facture_source ? "'".$this->db->escape($this->fk_facture_source)."'":"null").",";

View File

@ -1956,9 +1956,43 @@ class ExtraFields
{ {
global $langs; global $langs;
$out = '<tr class="trextrafieldseparator trextrafieldseparator'.$key.'"><td colspan="2"><strong>'; $out = '<tr id="trextrafieldseparator'.$key.'" class="trextrafieldseparator trextrafieldseparator'.$key.'"><td colspan="2"><strong>';
$out.= $langs->trans($this->attributes[$object->table_element]['label'][$key]); $out.= $langs->trans($this->attributes[$object->table_element]['label'][$key]);
$out.= '</strong></td></tr>'; $out.= '</strong></td></tr>';
$extrafield_param = $this->attributes[$object->table_element]['param'][$key];
if (!empty($extrafield_param) && is_array($extrafield_param)) {
$extrafield_param_list = array_keys($extrafield_param['options']);
if (count($extrafield_param_list) > 0) {
$extrafield_collapse_display_value = intval($extrafield_param_list[0]);
if ($extrafield_collapse_display_value == 1 || $extrafield_collapse_display_value == 2) {
$collapse_display = ($extrafield_collapse_display_value == 2 ? false : true);
$extrafields_collapse_num = $this->attributes[$object->table_element]['pos'][$key];
$out .= '<script type="text/javascript">';
$out .= 'jQuery(document).ready(function(){';
if ($collapse_display === false) {
$out .= ' jQuery("#trextrafieldseparator' . $key . ' td").prepend("<span class=\"cursorpointer fa fa-plus-square\"></span>&nbsp;");';
$out .= ' jQuery(".trextrafields_collapse' . $extrafields_collapse_num . '").hide();';
} else {
$out .= ' jQuery("#trextrafieldseparator' . $key . ' td").prepend("<span class=\"cursorpointer fa fa-minus-square\"></span>&nbsp;");';
}
$out .= ' jQuery("#trextrafieldseparator' . $key . '").click(function(){';
$out .= ' jQuery(".trextrafields_collapse' . $extrafields_collapse_num . '").toggle("slow", function(){';
$out .= ' if (jQuery(".trextrafields_collapse' . $extrafields_collapse_num . '").is(":hidden")) {';
$out .= ' jQuery("#trextrafieldseparator' . $key . ' td span").addClass("fa-plus-square").removeClass("fa-minus-square");';
$out .= ' } else {';
$out .= ' jQuery("#trextrafieldseparator' . $key . ' td span").addClass("fa-minus-square").removeClass("fa-plus-square");';
$out .= ' }';
$out .= ' });';
$out .= ' });';
$out .= '});';
$out .= '</script>';
}
}
}
return $out; return $out;
} }

View File

@ -936,7 +936,6 @@ class FormMail extends Form
$defaultmessage=preg_replace("/^(<br>)+/", "", $defaultmessage); $defaultmessage=preg_replace("/^(<br>)+/", "", $defaultmessage);
$defaultmessage=preg_replace("/^\n+/", "", $defaultmessage); $defaultmessage=preg_replace("/^\n+/", "", $defaultmessage);
} }
$out.= '<tr>'; $out.= '<tr>';
$out.= '<td valign="top">'; $out.= '<td valign="top">';
$out.=$form->textwithpicto($langs->trans('MailText'), $helpforsubstitution, 1, 'help', '', 0, 2, 'substittooltipfrombody'); $out.=$form->textwithpicto($langs->trans('MailText'), $helpforsubstitution, 1, 'help', '', 0, 2, 'substittooltipfrombody');
@ -1155,6 +1154,12 @@ class FormMail extends Form
return -1; return -1;
} }
$languagetosearch = (is_object($outputlangs) ? $outputlangs->defaultlang : '');
// Define $languagetosearchmain to fall back on main language (for example to get 'es_ES' for 'es_MX')
$tmparray = explode('_', $languagetosearch);
$languagetosearchmain = $tmparray[0].'_'.strtoupper($tmparray[0]);
if ($languagetosearchmain == $languagetosearch) $languagetosearchmain = '';
$sql = "SELECT rowid, label, topic, joinfiles, content, content_lines, lang"; $sql = "SELECT rowid, label, topic, joinfiles, content, content_lines, lang";
$sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates'; $sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates';
$sql.= " WHERE (type_template='".$db->escape($type_template)."' OR type_template='all')"; $sql.= " WHERE (type_template='".$db->escape($type_template)."' OR type_template='all')";
@ -1162,10 +1167,10 @@ class FormMail extends Form
$sql.= " AND (private = 0 OR fk_user = ".$user->id.")"; // Get all public or private owned $sql.= " AND (private = 0 OR fk_user = ".$user->id.")"; // Get all public or private owned
if ($active >= 0) $sql.=" AND active = ".$active; if ($active >= 0) $sql.=" AND active = ".$active;
if ($label) $sql.=" AND label ='".$db->escape($label)."'"; if ($label) $sql.=" AND label ='".$db->escape($label)."'";
if (! ($id > 0) && is_object($outputlangs)) $sql.= " AND (lang = '".$db->escape($outputlangs->defaultlang)."' OR lang IS NULL OR lang = '')"; if (! ($id > 0) && $languagetosearch) $sql.= " AND (lang = '".$db->escape($languagetosearch)."'".($languagetosearchmain ? " OR lang = '".$db->escape($languagetosearchmain)."'" : "")." OR lang IS NULL OR lang = '')";
if ($id > 0) $sql.= " AND rowid=".$id; if ($id > 0) $sql.= " AND rowid=".$id;
if ($id == -1) $sql.= " AND position=0"; if ($id == -1) $sql.= " AND position=0";
if (is_object($outputlangs)) $sql.= $db->order("position,lang,label", "ASC,DESC,ASC"); // We want line with lang set first, then with lang null or '' if ($languagetosearch) $sql.= $db->order("position,lang,label", "ASC,DESC,ASC"); // We want line with lang set first, then with lang null or ''
else $sql.= $db->order("position,lang,label", "ASC,ASC,ASC"); // If no language provided, we give priority to lang not defined else $sql.= $db->order("position,lang,label", "ASC,ASC,ASC"); // If no language provided, we give priority to lang not defined
$sql.= $db->plimit(1); $sql.= $db->plimit(1);
//print $sql; //print $sql;

View File

@ -50,33 +50,36 @@ class Utils
* Purge files into directory of data files. * Purge files into directory of data files.
* CAN BE A CRON TASK * CAN BE A CRON TASK
* *
* @param string $choice Choice of purge mode ('tempfiles', '' or 'tempfilesold' to purge temp older than 24h, 'allfiles', 'logfile') * @param string $choice Choice of purge mode ('tempfiles', '' or 'tempfilesold' to purge temp older than $nbsecondsold seconds, 'allfiles', 'logfile')
* @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) * @param int $nbsecondsold Nb of seconds old to accept deletion of a directory if $choice is 'tempfilesold'
* @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK)
*/ */
public function purgeFiles($choice = 'tempfilesold') public function purgeFiles($choice = 'tempfilesold', $nbsecondsold = 86400)
{ {
global $conf, $langs, $dolibarr_main_data_root; global $conf, $langs, $dolibarr_main_data_root;
$langs->load("admin"); $langs->load("admin");
dol_syslog("Utils::purgeFiles choice=".$choice, LOG_DEBUG);
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$filesarray=array(); $filesarray=array();
if (empty($choice)) $choice='tempfilesold'; if (empty($choice)) $choice='tempfilesold';
dol_syslog("Utils::purgeFiles choice=".$choice, LOG_DEBUG);
if ($choice=='tempfiles' || $choice=='tempfilesold') if ($choice=='tempfiles' || $choice=='tempfilesold')
{ {
// Delete temporary files // Delete temporary files
if ($dolibarr_main_data_root) if ($dolibarr_main_data_root)
{ {
$filesarray=dol_dir_list($dolibarr_main_data_root, "directories", 1, '^temp$', '', 'name', SORT_ASC, 2, 0, '', 1); // Do not follow symlinks $filesarray=dol_dir_list($dolibarr_main_data_root, "directories", 1, '^temp$', '', 'name', SORT_ASC, 2, 0, '', 1); // Do not follow symlinks
if ($choice == 'tempfilesold')
if ($choice == 'tempfilesold')
{ {
$now = dol_now(); $now = dol_now();
foreach($filesarray as $key => $val) foreach($filesarray as $key => $val)
{ {
if ($val['date'] > ($now - (24 * 3600))) unset($filesarray[$key]); // Discard files not older than 24h if ($val['date'] > ($now - ($nbsecondsold))) unset($filesarray[$key]); // Discard temp dir not older than $nbsecondsold
} }
} }
} }
@ -119,13 +122,14 @@ class Utils
$counterror=0; $counterror=0;
if (count($filesarray)) if (count($filesarray))
{ {
foreach($filesarray as $key => $value) foreach($filesarray as $key => $value)
{ {
//print "x ".$filesarray[$key]['fullname']."-".$filesarray[$key]['type']."<br>\n"; //print "x ".$filesarray[$key]['fullname']."-".$filesarray[$key]['type']."<br>\n";
if ($filesarray[$key]['type'] == 'dir') if ($filesarray[$key]['type'] == 'dir')
{ {
$startcount=0; $startcount=0;
$tmpcountdeleted=0; $tmpcountdeleted=0;
$result=dol_delete_dir_recursive($filesarray[$key]['fullname'], $startcount, 1, 0, $tmpcountdeleted); $result=dol_delete_dir_recursive($filesarray[$key]['fullname'], $startcount, 1, 0, $tmpcountdeleted);
$count+=$result; $count+=$result;
$countdeleted+=$tmpcountdeleted; $countdeleted+=$tmpcountdeleted;
@ -165,6 +169,13 @@ class Utils
} }
else $this->output=$langs->trans("PurgeNothingToDelete").($choice == 'tempfilesold' ? ' (older than 24h)':''); else $this->output=$langs->trans("PurgeNothingToDelete").($choice == 'tempfilesold' ? ' (older than 24h)':'');
// Recreate temp dir that are not automatically recreated by core code for performance purpose, we need them
if (! empty($conf->api->enabled))
{
dol_mkdir($conf->api->dir_temp);
}
dol_mkdir($conf->user->dir_temp);
//return $count; //return $count;
return 0; // This function can be called by cron so must return 0 if OK return 0; // This function can be called by cron so must return 0 if OK
} }

View File

@ -36,25 +36,31 @@
/** /**
* Return array with format properties of default PDF format * Return array with format properties of default PDF format
* *
* @param Translate $outputlangs Output lang to use to autodetect output format if setup not done * @param Translate $outputlangs Output lang to use to autodetect output format if we need 'auto' detection
* @param string $mode 'setup' = Use setup, 'auto' = Force autodetection whatever is setup
* @return array Array('width'=>w,'height'=>h,'unit'=>u); * @return array Array('width'=>w,'height'=>h,'unit'=>u);
*/ */
function pdf_getFormat(Translate $outputlangs = null) function pdf_getFormat(Translate $outputlangs = null, $mode = 'setup')
{ {
global $conf,$db; global $conf, $db, $langs;
dol_syslog("pdf_getFormat Get paper format with mode=".$mode." MAIN_PDF_FORMAT=".(empty($conf->global->MAIN_PDF_FORMAT)?'null':$conf->global->MAIN_PDF_FORMAT)." outputlangs->defaultlang=".(is_object($outputlangs) ? $outputlangs->defaultlang : 'null')." and langs->defaultlang=".(is_object($langs) ? $langs->defaultlang : 'null'));
// Default value if setup was not done and/or entry into c_paper_format not defined // Default value if setup was not done and/or entry into c_paper_format not defined
$width=210; $height=297; $unit='mm'; $width=210; $height=297; $unit='mm';
if (empty($conf->global->MAIN_PDF_FORMAT)) if ($mode == 'auto' || empty($conf->global->MAIN_PDF_FORMAT) || $conf->global->MAIN_PDF_FORMAT == 'auto')
{ {
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$pdfformat=dol_getDefaultFormat($outputlangs); $pdfformat=dol_getDefaultFormat($outputlangs);
} }
else $pdfformat=$conf->global->MAIN_PDF_FORMAT; else
{
$pdfformat=$conf->global->MAIN_PDF_FORMAT;
}
$sql="SELECT code, label, width, height, unit FROM ".MAIN_DB_PREFIX."c_paper_format"; $sql="SELECT code, label, width, height, unit FROM ".MAIN_DB_PREFIX."c_paper_format";
$sql.=" WHERE code = '".$pdfformat."'"; $sql.=" WHERE code = '".$db->escape($pdfformat)."'";
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
{ {

View File

@ -127,7 +127,7 @@ function product_prepare_head($object)
$h++; $h++;
} }
} }
// Tab to link resources // Tab to link resources
if (!empty($conf->resource->enabled)) if (!empty($conf->resource->enabled))
{ {
@ -173,7 +173,7 @@ function product_prepare_head($object)
if (! empty($conf->service->enabled) && ($object->type==Product::TYPE_SERVICE)) $upload_dir = $conf->service->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref); if (! empty($conf->service->enabled) && ($object->type==Product::TYPE_SERVICE)) $upload_dir = $conf->service->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) {
if (! empty($conf->product->enabled) && ($object->type==Product::TYPE_PRODUCT)) $upload_dir = $conf->produit->multidir_output[$object->entity].'/'.get_exdir($object->id, 2, 0, 0, $object, 'product').$object->id.'/photos'; if (! empty($conf->product->enabled) && ($object->type==Product::TYPE_PRODUCT)) $upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir($object->id, 2, 0, 0, $object, 'product').$object->id.'/photos';
if (! empty($conf->service->enabled) && ($object->type==Product::TYPE_SERVICE)) $upload_dir = $conf->service->multidir_output[$object->entity].'/'.get_exdir($object->id, 2, 0, 0, $object, 'product').$object->id.'/photos'; if (! empty($conf->service->enabled) && ($object->type==Product::TYPE_SERVICE)) $upload_dir = $conf->service->multidir_output[$object->entity].'/'.get_exdir($object->id, 2, 0, 0, $object, 'product').$object->id.'/photos';
$nbFiles += count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbFiles += count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
} }

View File

@ -371,12 +371,13 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
$numlines=count($lines); $numlines=count($lines);
// We declare counter as global because we want to edit them into recursive call // We declare counter as global because we want to edit them into recursive call
global $total_projectlinesa_spent,$total_projectlinesa_planned,$total_projectlinesa_spent_if_planned,$total_projectlinesa_tobill,$total_projectlinesa_billed; global $total_projectlinesa_spent,$total_projectlinesa_planned,$total_projectlinesa_spent_if_planned,$total_projectlinesa_declared_if_planned,$total_projectlinesa_tobill,$total_projectlinesa_billed;
if ($level == 0) if ($level == 0)
{ {
$total_projectlinesa_spent=0; $total_projectlinesa_spent=0;
$total_projectlinesa_planned=0; $total_projectlinesa_planned=0;
$total_projectlinesa_spent_if_planned=0; $total_projectlinesa_spent_if_planned=0;
$total_projectlinesa_declared_if_planned=0;
$total_projectlinesa_tobill=0; $total_projectlinesa_tobill=0;
$total_projectlinesa_billed=0; $total_projectlinesa_billed=0;
} }
@ -624,6 +625,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
$total_projectlinesa_spent += $lines[$i]->duration; $total_projectlinesa_spent += $lines[$i]->duration;
$total_projectlinesa_planned += $lines[$i]->planned_workload; $total_projectlinesa_planned += $lines[$i]->planned_workload;
if ($lines[$i]->planned_workload) $total_projectlinesa_spent_if_planned += $lines[$i]->duration; if ($lines[$i]->planned_workload) $total_projectlinesa_spent_if_planned += $lines[$i]->duration;
if ($lines[$i]->planned_workload) $total_projectlinesa_declared_if_planned += $lines[$i]->planned_workload * $lines[$i]->progress / 100;
} }
} }
else else
@ -652,7 +654,9 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
print '<td class="nowrap liste_total right">'; print '<td class="nowrap liste_total right">';
if ($total_projectlinesa_planned) print round(100 * $total_projectlinesa_spent / $total_projectlinesa_planned, 2).' %'; if ($total_projectlinesa_planned) print round(100 * $total_projectlinesa_spent / $total_projectlinesa_planned, 2).' %';
print '</td>'; print '</td>';
print '<td></td>'; print '<td class="nowrap liste_total right">';
if ($total_projectlinesa_planned) print round(100 * $total_projectlinesa_declared_if_planned / $total_projectlinesa_planned, 2).' %';
print '</td>';
if ($showbilltime) if ($showbilltime)
{ {
print '<td class="nowrap liste_total right">'; print '<td class="nowrap liste_total right">';

View File

@ -1297,7 +1297,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
// For the moment, we manage this with hard coded exception // For the moment, we manage this with hard coded exception
//print "Remove box ".$file.'<br>'; //print "Remove box ".$file.'<br>';
if ($file == 'box_graph_product_distribution.php') { if ($file == 'box_graph_product_distribution.php') {
if (! empty($conf->produit->enabled) || ! empty($conf->service->enabled)) { if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) {
dol_syslog("We discard disabling of module ".$file." because another module still active require it."); dol_syslog("We discard disabling of module ".$file." because another module still active require it.");
continue; continue;
} }

View File

@ -23,7 +23,7 @@
/** /**
* \file htdocs/core/modules/bom/mod_bom_advanced.php * \file htdocs/core/modules/bom/mod_bom_advanced.php
* \ingroup bom * \ingroup bom
* \brief Fichier contenant la classe du modele de numerotation de reference de bom advanced * \brief File containing class for numbering model of bom advanced
*/ */
require_once DOL_DOCUMENT_ROOT .'/core/modules/bom/modules_bom.php'; require_once DOL_DOCUMENT_ROOT .'/core/modules/bom/modules_bom.php';
@ -52,7 +52,7 @@ class mod_bom_advanced extends ModeleNumRefboms
/** /**
* Renvoi la description du modele de numerotation * Returns the description of the numbering model
* *
* @return string Texte descripif * @return string Texte descripif
*/ */

View File

@ -46,7 +46,7 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts
/** /**
* Renvoi la description du modele de numerotation * Returns the description of the numbering model
* *
* @return string Texte descripif * @return string Texte descripif
*/ */

View File

@ -27,7 +27,7 @@
/** /**
* \file htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php * \file htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
* \ingroup commande * \ingroup commande
* \brief Fichier de la classe permettant de generer les commandes au modele Eratosthène * \brief File of the class allowing to generate the orders to the Eratosthene model
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php';
@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
/** /**
* Classe to generate PDF orders with template Eratosthene * Class to generate PDF orders with template Eratosthene
*/ */
class pdf_eratosthene extends ModelePDFCommandes class pdf_eratosthene extends ModelePDFCommandes
{ {

View File

@ -52,7 +52,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes
/** /**
* Renvoi la description du modele de numerotation * Returns the description of the numbering model
* *
* @return string Texte descripif * @return string Texte descripif
*/ */

View File

@ -55,7 +55,7 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport
/** /**
* Renvoi la description du modele de numerotation * Returns the description of the numbering model
* *
* @return string Texte descripif * @return string Texte descripif
*/ */

View File

@ -62,7 +62,7 @@ class mod_facture_mars extends ModeleNumRefFactures
} }
/** /**
* Renvoi la description du modele de numerotation * Returns the description of the numbering model
* *
* @return string Texte descripif * @return string Texte descripif
*/ */

View File

@ -46,7 +46,7 @@ class mod_facture_mercure extends ModeleNumRefFactures
/** /**
* Renvoi la description du modele de numerotation * Returns the description of the numbering model
* *
* @return string Texte descripif * @return string Texte descripif
*/ */

View File

@ -72,7 +72,7 @@ class mod_facture_terre extends ModeleNumRefFactures
} }
/** /**
* Renvoi la description du modele de numerotation * Returns the description of the numbering model
* *
* @return string Texte descripif * @return string Texte descripif
*/ */

View File

@ -57,7 +57,7 @@ class mod_arctic extends ModeleNumRefFicheinter
/** /**
* Renvoi la description du modele de numerotation * Returns the description of the numbering model
* *
* @return string Texte descripif * @return string Texte descripif
*/ */

View File

@ -669,18 +669,30 @@ class ImportCsv extends ModeleImports
if (! preg_match('/^'.preg_quote($alias).'\./', $key)) continue; // Not a field of current table if (! preg_match('/^'.preg_quote($alias).'\./', $key)) continue; // Not a field of current table
if ($val == 'user->id') if ($val == 'user->id')
{ {
$listfields[] = preg_replace('/^'.preg_quote($alias).'\./', '', $key); $listfields[] = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $key);
$listvalues[] = $user->id; $listvalues[] = $user->id;
} }
elseif (preg_match('/^lastrowid-/', $val)) elseif (preg_match('/^lastrowid-/', $val))
{ {
$tmp=explode('-', $val); $tmp=explode('-', $val);
$lastinsertid=(isset($last_insert_id_array[$tmp[1]]))?$last_insert_id_array[$tmp[1]]:0; $lastinsertid=(isset($last_insert_id_array[$tmp[1]]))?$last_insert_id_array[$tmp[1]]:0;
$keyfield = preg_replace('/^'.preg_quote($alias).'\./', '', $key); $keyfield = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $key);
$listfields[] = $keyfield; $listfields[] = $keyfield;
$listvalues[] = $lastinsertid; $listvalues[] = $lastinsertid;
//print $key."-".$val."-".$listfields."-".$listvalues."<br>";exit; //print $key."-".$val."-".$listfields."-".$listvalues."<br>";exit;
} }
elseif (preg_match('/^const-/', $val))
{
$tmp=explode('-', $val, 2);
$listfields[] = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $key);
$listvalues[] = "'".$tmp[1]."'";
}
else
{
$this->errors[$error]['lib']='Bad value of profile setup '.$val.' for array_import_fieldshidden';
$this->errors[$error]['type']='Import profile setup';
$error++;
}
} }
} }
//print 'listfields='.$listfields.'<br>listvalues='.$listvalues.'<br>'; //print 'listfields='.$listfields.'<br>listvalues='.$listvalues.'<br>';

View File

@ -688,21 +688,33 @@ class ImportXlsx extends ModeleImports
// Loop on each hidden fields to add them into listfields/listvalues // Loop on each hidden fields to add them into listfields/listvalues
foreach($objimport->array_import_fieldshidden[0] as $key => $val) foreach($objimport->array_import_fieldshidden[0] as $key => $val)
{ {
if (! preg_match('/^'.preg_quote($alias).'\./', $key)) continue; // Not a field of current table if (! preg_match('/^'.preg_quote($alias, '/').'\./', $key)) continue; // Not a field of current table
if ($val == 'user->id') if ($val == 'user->id')
{ {
$listfields[] = preg_replace('/^'.preg_quote($alias).'\./', '', $key); $listfields[] = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $key);
$listvalues[] = $user->id; $listvalues[] = $user->id;
} }
elseif (preg_match('/^lastrowid-/', $val)) elseif (preg_match('/^lastrowid-/', $val))
{ {
$tmp=explode('-', $val); $tmp=explode('-', $val);
$lastinsertid=(isset($last_insert_id_array[$tmp[1]]))?$last_insert_id_array[$tmp[1]]:0; $lastinsertid=(isset($last_insert_id_array[$tmp[1]]))?$last_insert_id_array[$tmp[1]]:0;
$keyfield = preg_replace('/^'.preg_quote($alias).'\./', '', $key); $keyfield = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $key);
$listfields[] = $keyfield; $listfields[] = $keyfield;
$listvalues[] = $lastinsertid; $listvalues[] = $lastinsertid;
//print $key."-".$val."-".$listfields."-".$listvalues."<br>";exit; //print $key."-".$val."-".$listfields."-".$listvalues."<br>";exit;
} }
elseif (preg_match('/^const-/', $val))
{
$tmp=explode('-', $val, 2);
$listfields[] = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $key);
$listvalues[] = "'".$tmp[1]."'";
}
else
{
$this->errors[$error]['lib']='Bad value of profile setup '.$val.' for array_import_fieldshidden';
$this->errors[$error]['type']='Import profile setup';
$error++;
}
} }
} }
//print 'listfields='.$listfields.'<br>listvalues='.$listvalues.'<br>'; //print 'listfields='.$listfields.'<br>listvalues='.$listvalues.'<br>';

View File

@ -61,7 +61,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder
/** /**
* Renvoi la description du modele de numerotation * Returns the description of the numbering model
* *
* @return string Texte descripif * @return string Texte descripif
*/ */

View File

@ -56,7 +56,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder
/** /**
* Renvoi la description du modele de numerotation * Returns the description of the numbering model
* *
* @return string Texte descripif * @return string Texte descripif
*/ */

View File

@ -170,15 +170,23 @@ class modAccounting extends DolibarrModules
$this->rights = array(); // Permission array used by this module $this->rights = array(); // Permission array used by this module
$r = 0; $r = 0;
$this->rights[$r][0] = 50440; $this->rights[$r][0] = 50440;
$this->rights[$r][1] = 'Manage chart of accounts, setup of accountancy'; $this->rights[$r][1] = 'Manage chart of accounts, setup of accountancy';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'chartofaccount';
$this->rights[$r][5] = '';
$r++;
$this->rights[$r][0] = 50430;
$this->rights[$r][1] = 'Define and close a fiscal year';
$this->rights[$r][2] = 'r'; $this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'chartofaccount'; $this->rights[$r][4] = 'fiscalyear';
$this->rights[$r][5] = ''; $this->rights[$r][5] = '';
$r++; $r++;
$this->rights[$r][0] = 50401; $this->rights[$r][0] = 50401;
$this->rights[$r][1] = 'Bind products and invoices with accounting accounts'; $this->rights[$r][1] = 'Bind products and invoices with accounting accounts';
$this->rights[$r][2] = 'r'; $this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
@ -212,6 +220,30 @@ class modAccounting extends DolibarrModules
$this->rights[$r][5] = 'creer'; $this->rights[$r][5] = 'creer';
$r++; $r++;
$this->rights[$r][0] = 50414;
$this->rights[$r][1] = 'Delete operations in Ledger';
$this->rights[$r][2] = 'd';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'mouvements';
$this->rights[$r][5] = 'supprimer';
$r++;
$this->rights[$r][0] = 50415;
$this->rights[$r][1] = 'Delete all operations by year and journal in Ledger';
$this->rights[$r][2] = 'd';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'mouvements';
$this->rights[$r][5] = 'supprimer_tous';
$r++;
$this->rights[$r][0] = 50418;
$this->rights[$r][1] = 'Export operations of the Ledger';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'mouvements';
$this->rights[$r][5] = 'export';
$r++;
$this->rights[$r][0] = 50420; $this->rights[$r][0] = 50420;
$this->rights[$r][1] = 'Report and export reports (turnover, balance, journals, ledger)'; $this->rights[$r][1] = 'Report and export reports (turnover, balance, journals, ledger)';
$this->rights[$r][2] = 'r'; $this->rights[$r][2] = 'r';
@ -220,14 +252,6 @@ class modAccounting extends DolibarrModules
$this->rights[$r][5] = 'lire'; $this->rights[$r][5] = 'lire';
$r++; $r++;
$this->rights[$r][0] = 50430;
$this->rights[$r][1] = 'Define and close a fiscal year';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'fiscalyear';
$this->rights[$r][5] = '';
$r++;
// Menus // Menus
//------- //-------
@ -264,32 +288,36 @@ class modAccounting extends DolibarrModules
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon $this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
$this->import_tables_array[$r]=array('b'=>MAIN_DB_PREFIX.'accounting_bookkeeping'); // List of tables to insert into (insert done in same order) $this->import_tables_array[$r]=array('b'=>MAIN_DB_PREFIX.'accounting_bookkeeping'); // List of tables to insert into (insert done in same order)
$this->import_fields_array[$r]=array( $this->import_fields_array[$r]=array(
'b.doc_date'=>"Docdate", 'b.piece_num'=>"TransactionNumShort",
'b.piece_num'=>"TransactionNumShort", 'b.doc_date'=>"Docdate",
//'b.doc_type'=>'Doctype',
'b.doc_ref'=>'Piece',
'b.code_journal'=>'Codejournal', 'b.code_journal'=>'Codejournal',
'b.journal_label'=>'JournalLabel', //'b.journal_label'=>'JournalLabel',
'b.numero_compte'=>'AccountAccounting', 'b.numero_compte'=>'AccountAccounting',
'b.label_compte'=>'LabelAccount', //'b.label_compte'=>'LabelAccount',
'b.subledger_account'=>'SubledgerAccount', 'b.subledger_account'=>'SubledgerAccount',
'b.subledger_label'=>'SubledgerAccountLabel', 'b.subledger_label'=>'SubledgerAccountLabel',
'b.label_operation'=>'LabelOperation', 'b.label_operation'=>'LabelOperation',
'b.debit'=>"Debit", 'b.debit'=>"Debit",
'b.credit'=>"Credit" 'b.credit'=>"Credit"
); );
$this->import_fieldshidden_array[$r]=array('b.fk_user_author'=>'user->id'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) $this->import_fieldshidden_array[$r]=array('b.doc_type'=>'const-import_from_external', 'b.fk_doc'=>'const-0', 'b.fk_docdet'=>'const-0', 'b.fk_user_author'=>'user->id', 'b.date_creation'=>'const-'.dol_print_date(dol_now(), 'standard')); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
$this->import_regex_array[$r]=array('b.doc_date'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); $this->import_regex_array[$r]=array('b.doc_date'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
$this->import_examplevalues_array[$r]=array( $this->import_examplevalues_array[$r]=array(
'b.doc_date'=>'formatted as \'.dol_print_date(dol_now(),\'%Y-%m-%d\')', 'b.piece_num'=>'123 (!!! use next value not already used)',
'b.piece_num'=>'1', 'b.doc_date'=>dol_print_date(dol_now(), "%Y-%m-%d"),
//'b.doc_type'=>'import',
'b.doc_ref'=>'My document ABC',
'b.code_journal'=>"VTE", 'b.code_journal'=>"VTE",
'b.journal_label'=>"Journal des ventes", //'b.journal_label'=>"Sale journal",
'b.numero_compte'=>"707", 'b.numero_compte'=>"707",
'b.label_compte'=>'Ventes', //'b.label_compte'=>'Product account 707',
'b.subledger_account'=>'', 'b.subledger_account'=>'',
'b.subledger_label'=>'', 'b.subledger_label'=>'',
'b.label_operation'=>"Ventes services", 'b.label_operation'=>"Sale of ABC",
'b.debit'=>"0,00", 'b.debit'=>"0",
'b.credit'=>"100,00" 'b.credit'=>"100"
); );
// Chart of accounts // Chart of accounts

View File

@ -53,6 +53,7 @@ class modApi extends DolibarrModules
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other' // Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page // It is used to group modules in module setup page
$this->family = "interface"; $this->family = "interface";
$this->module_position = '24';
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i', '', get_class($this)); $this->name = preg_replace('/^mod/i', '', get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)

View File

@ -230,7 +230,7 @@ class modCategorie extends DolibarrModules
$this->export_code[$r]='category_'.$r; $this->export_code[$r]='category_'.$r;
$this->export_label[$r]='CatProdList'; $this->export_label[$r]='CatProdList';
$this->export_icon[$r]='category'; $this->export_icon[$r]='category';
$this->export_enabled[$r]='$conf->produit->enabled'; $this->export_enabled[$r]='$conf->product->enabled || $conf->service->enabled';
$this->export_permission[$r]=array(array("categorie","lire"),array("produit","lire")); $this->export_permission[$r]=array(array("categorie","lire"),array("produit","lire"));
$this->export_fields_array[$r]=array('u.rowid'=>"CategId",'u.label'=>"Label",'u.description'=>"Description",'p.rowid'=>'ProductId','p.ref'=>'Ref'); $this->export_fields_array[$r]=array('u.rowid'=>"CategId",'u.label'=>"Label",'u.description'=>"Description",'p.rowid'=>'ProductId','p.ref'=>'Ref');
$this->export_TypeFields_array[$r]=array('u.label'=>"Text",'u.description'=>"Text",'p.ref'=>'Text'); $this->export_TypeFields_array[$r]=array('u.label'=>"Text",'u.description'=>"Text",'p.ref'=>'Text');

View File

@ -41,6 +41,7 @@ class modWebServices extends DolibarrModules
$this->numero = 2600; $this->numero = 2600;
$this->family = "interface"; $this->family = "interface";
$this->module_position = '25';
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i', '', get_class($this)); $this->name = preg_replace('/^mod/i', '', get_class($this));
$this->description = "Enable the Dolibarr web services server"; $this->description = "Enable the Dolibarr web services server";

View File

@ -41,6 +41,7 @@ class modWebServicesClient extends DolibarrModules
$this->numero = 2660; $this->numero = 2660;
$this->family = "interface"; $this->family = "interface";
$this->module_position = '26';
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i', '', get_class($this)); $this->name = preg_replace('/^mod/i', '', get_class($this));
$this->description = "Enable the web service client to call external supplier web services"; $this->description = "Enable the web service client to call external supplier web services";

View File

@ -55,7 +55,7 @@ class mod_payment_ant extends ModeleNumRefPayments
/** /**
* Renvoi la description du modele de numerotation * Returns the description of the numbering model
* *
* @return string Texte descripif * @return string Texte descripif
*/ */

View File

@ -244,7 +244,7 @@ class doc_generic_product_odt extends ModelePDFProduct
// Load translation files required by the page // Load translation files required by the page
$outputlangs->loadLangs(array("main", "dict", "companies", "bills")); $outputlangs->loadLangs(array("main", "dict", "companies", "bills"));
if ($conf->produit->dir_output) if ($conf->product->dir_output)
{ {
// If $object is id instead of object // If $object is id instead of object
if (! is_object($object)) if (! is_object($object))
@ -262,7 +262,7 @@ class doc_generic_product_odt extends ModelePDFProduct
$supplierprices = $productFournisseur->list_product_fournisseur_price($object->id); $supplierprices = $productFournisseur->list_product_fournisseur_price($object->id);
$object->supplierprices = $supplierprices; $object->supplierprices = $supplierprices;
$dir = $conf->produit->dir_output; $dir = $conf->product->dir_output;
$objectref = dol_sanitizeFileName($object->ref); $objectref = dol_sanitizeFileName($object->ref);
if (! preg_match('/specimen/i', $objectref)) $dir.= "/" . $objectref; if (! preg_match('/specimen/i', $objectref)) $dir.= "/" . $objectref;
$file = $dir . "/" . $objectref . ".odt"; $file = $dir . "/" . $objectref . ".odt";
@ -302,9 +302,9 @@ class doc_generic_product_odt extends ModelePDFProduct
//print "newdir=".$dir; //print "newdir=".$dir;
//print "newfile=".$newfile; //print "newfile=".$newfile;
//print "file=".$file; //print "file=".$file;
//print "conf->produit->dir_temp=".$conf->produit->dir_temp; //print "conf->product->dir_temp=".$conf->product->dir_temp;
dol_mkdir($conf->produit->dir_temp); dol_mkdir($conf->product->dir_temp);
// If CUSTOMER contact defined on product, we use it // If CUSTOMER contact defined on product, we use it
@ -357,10 +357,10 @@ class doc_generic_product_odt extends ModelePDFProduct
// Open and load template // Open and load template
require_once ODTPHP_PATH.'odf.php'; require_once ODTPHP_PATH.'odf.php';
try { try {
$odfHandler = new odf( $odfHandler = new odf(
$srctemplatepath, $srctemplatepath,
array( array(
'PATH_TO_TMP' => $conf->produit->dir_temp, 'PATH_TO_TMP' => $conf->product->dir_temp,
'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy.
'DELIMITER_LEFT' => '{', 'DELIMITER_LEFT' => '{',
'DELIMITER_RIGHT' => '}' 'DELIMITER_RIGHT' => '}'

View File

@ -174,18 +174,18 @@ class pdf_standard extends ModelePDFProduct
$nblignes = count($object->lines); $nblignes = count($object->lines);
if ($conf->produit->dir_output) if ($conf->product->dir_output)
{ {
// Definition of $dir and $file // Definition of $dir and $file
if ($object->specimen) if ($object->specimen)
{ {
$dir = $conf->produit->dir_output; $dir = $conf->product->dir_output;
$file = $dir . "/SPECIMEN.pdf"; $file = $dir . "/SPECIMEN.pdf";
} }
else else
{ {
$objectref = dol_sanitizeFileName($object->ref); $objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->produit->dir_output . "/" . $objectref; $dir = $conf->product->dir_output . "/" . $objectref;
$file = $dir . "/" . $objectref . ".pdf"; $file = $dir . "/" . $objectref . ".pdf";
} }

View File

@ -55,7 +55,7 @@ class mod_project_universal extends ModeleNumRefProjects
/** /**
* Renvoi la description du modele de numerotation * Returns the description of the numbering model
* *
* @return string Texte descripif * @return string Texte descripif
*/ */

View File

@ -55,7 +55,7 @@ class mod_task_universal extends ModeleNumRefTask
/** /**
* Renvoi la description du modele de numerotation * Returns the description of the numbering model
* *
* @return string Texte descripif * @return string Texte descripif
*/ */

View File

@ -244,7 +244,7 @@ class doc_generic_stock_odt extends ModelePDFStock
// Load translation files required by the page // Load translation files required by the page
$outputlangs->loadLangs(array("main", "dict", "companies", "bills")); $outputlangs->loadLangs(array("main", "dict", "companies", "bills"));
if ($conf->produit->dir_output) if ($conf->product->dir_output)
{ {
// If $object is id instead of object // If $object is id instead of object
if (! is_object($object)) if (! is_object($object))
@ -262,7 +262,7 @@ class doc_generic_stock_odt extends ModelePDFStock
$supplierprices = $stockFournisseur->list_stock_fournisseur_price($object->id); $supplierprices = $stockFournisseur->list_stock_fournisseur_price($object->id);
$object->supplierprices = $supplierprices; $object->supplierprices = $supplierprices;
$dir = $conf->produit->dir_output; $dir = $conf->product->dir_output;
$objectref = dol_sanitizeFileName($object->ref); $objectref = dol_sanitizeFileName($object->ref);
if (! preg_match('/specimen/i', $objectref)) $dir.= "/" . $objectref; if (! preg_match('/specimen/i', $objectref)) $dir.= "/" . $objectref;
$file = $dir . "/" . $objectref . ".odt"; $file = $dir . "/" . $objectref . ".odt";
@ -302,9 +302,9 @@ class doc_generic_stock_odt extends ModelePDFStock
//print "newdir=".$dir; //print "newdir=".$dir;
//print "newfile=".$newfile; //print "newfile=".$newfile;
//print "file=".$file; //print "file=".$file;
//print "conf->produit->dir_temp=".$conf->produit->dir_temp; //print "conf->product->dir_temp=".$conf->product->dir_temp;
dol_mkdir($conf->produit->dir_temp); dol_mkdir($conf->product->dir_temp);
// If CUSTOMER contact defined on stock, we use it // If CUSTOMER contact defined on stock, we use it
@ -360,7 +360,7 @@ class doc_generic_stock_odt extends ModelePDFStock
$odfHandler = new odf( $odfHandler = new odf(
$srctemplatepath, $srctemplatepath,
array( array(
'PATH_TO_TMP' => $conf->produit->dir_temp, 'PATH_TO_TMP' => $conf->product->dir_temp,
'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy.
'DELIMITER_LEFT' => '{', 'DELIMITER_LEFT' => '{',
'DELIMITER_RIGHT' => '}' 'DELIMITER_RIGHT' => '}'

View File

@ -57,7 +57,7 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders
/** /**
* Renvoi la description du modele de numerotation * Returns the description of the numbering model
* *
* @return string Texte descripif * @return string Texte descripif
*/ */

View File

@ -55,7 +55,7 @@ class mod_supplier_payment_brodator extends ModeleNumRefSupplierPayments
/** /**
* Renvoi la description du modele de numerotation * Returns the description of the numbering model
* *
* @return string Texte descripif * @return string Texte descripif
*/ */

View File

@ -53,7 +53,7 @@ class mod_ticket_universal extends ModeleNumRefTicket
public $name='Universal'; public $name='Universal';
/** /**
* Renvoi la description du modele de numerotation * Returns the description of the numbering model
* *
* @return string Texte descripif * @return string Texte descripif
*/ */

View File

@ -107,7 +107,7 @@ $langs->load("modulebuilder");
else if (type == 'link') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").show();jQuery("#helppassword").hide();} else if (type == 'link') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").show();jQuery("#helppassword").hide();}
else if (type == 'separate') { else if (type == 'separate') {
langfile.val('').prop('disabled',true);size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); langfile.val('').prop('disabled',true);size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true);
jQuery("#value_choice").hide();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide(); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide();
} }
else { // type = string else { // type = string
size.val('').prop('disabled', true); size.val('').prop('disabled', true);

View File

@ -103,7 +103,7 @@ $langs->load("modulebuilder");
else if (type == 'checkbox') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide();} else if (type == 'checkbox') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide();}
else if (type == 'chkbxlst') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").show();jQuery("#helplink").hide();jQuery("#helppassword").hide();} else if (type == 'chkbxlst') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").show();jQuery("#helplink").hide();jQuery("#helppassword").hide();}
else if (type == 'link') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").show();jQuery("#helppassword").hide();} else if (type == 'link') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").show();jQuery("#helppassword").hide();}
else if (type == 'separate') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide();} else if (type == 'separate') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide();}
else { // type = string else { // type = string
size.val('').prop('disabled', true); size.val('').prop('disabled', true);
unique.removeAttr('disabled'); unique.removeAttr('disabled');
@ -173,7 +173,7 @@ if((($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) && is_ar
} }
} }
} }
elseif (($type== 'sellist') || ($type == 'chkbxlst') || ($type == 'link') || ($type == 'password')) elseif (($type== 'sellist') || ($type == 'chkbxlst') || ($type == 'link') || ($type == 'password') || ($type == 'separate'))
{ {
$paramlist=array_keys($param['options']); $paramlist=array_keys($param['options']);
$param_chain = $paramlist[0]; $param_chain = $paramlist[0];

View File

@ -48,8 +48,8 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
//var_dump($extrafields->attributes[$object->table_element]); //var_dump($extrafields->attributes[$object->table_element]);
if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]['label'])) if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]['label']))
{ {
$extrafields_collapse_num = '';
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label) foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label)
{ {
// Discard if extrafield is a hidden field on form // Discard if extrafield is a hidden field on form
@ -86,11 +86,25 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
} }
if ($extrafields->attributes[$object->table_element]['type'][$key] == 'separate') if ($extrafields->attributes[$object->table_element]['type'][$key] == 'separate')
{ {
$extrafields_collapse_num = '';
$extrafield_param = $extrafields->attributes[$object->table_element]['param'][$key];
if (!empty($extrafield_param) && is_array($extrafield_param)) {
$extrafield_param_list = array_keys($extrafield_param['options']);
if (count($extrafield_param_list)>0) {
$extrafield_collapse_display_value = intval($extrafield_param_list[0]);
if ($extrafield_collapse_display_value==1 || $extrafield_collapse_display_value==2) {
$extrafields_collapse_num = $extrafields->attributes[$object->table_element]['pos'][$key];
}
}
}
print $extrafields->showSeparator($key, $object); print $extrafields->showSeparator($key, $object);
} }
else else
{ {
print '<tr>'; print '<tr class="trextrafields_collapse'.$extrafields_collapse_num.'">';
print '<td class="titlefield">'; print '<td class="titlefield">';
print '<table width="100%" class="nobordernopadding">'; print '<table width="100%" class="nobordernopadding">';
print '<tr>'; print '<tr>';

View File

@ -76,17 +76,18 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
// Event/record is qualified // Event/record is qualified
$qualified = 0; $qualified = 0;
$amounts = 0; $amounts = 0;
if ($action==='BILL_VALIDATE' || $action==='BILL_DELETE' || $action === 'BILL_SENTBYMAIL' if ($action==='BILL_VALIDATE' || (($action==='BILL_DELETE' || $action === 'BILL_SENTBYMAIL') && $object->statut != 0)
|| $action==='BILL_SUPPLIER_VALIDATE' || $action==='BILL_SUPPLIER_DELETE' || $action === 'BILL_SUPPLIER_SENTBYMAIL' || $action==='BILL_SUPPLIER_VALIDATE' || (($action==='BILL_SUPPLIER_DELETE' || $action === 'BILL_SUPPLIER_SENTBYMAIL') && $object->statut != 0)
|| $action==='MEMBER_SUBSCRIPTION_CREATE' || $action==='MEMBER_SUBSCRIPTION_MODIFY' || $action==='MEMBER_SUBSCRIPTION_DELETE' || $action==='MEMBER_SUBSCRIPTION_CREATE' || $action==='MEMBER_SUBSCRIPTION_MODIFY' || $action==='MEMBER_SUBSCRIPTION_DELETE'
|| $action==='DON_VALIDATE' || $action==='DON_MODIFY' || $action==='DON_DELETE' || $action==='DON_VALIDATE' || (($action==='DON_MODIFY' || $action==='DON_DELETE') && $object->statut != 0)
|| $action==='CASHCONTROL_VALIDATE' || $action==='CASHCONTROL_VALIDATE'
|| (in_array($object->element, array('facture','suplier_invoice')) && $action === 'DOC_DOWNLOAD') || (in_array($object->element, array('facture','suplier_invoice')) && $action === 'DOC_PREVIEW') || (in_array($object->element, array('facture','supplier_invoice')) && $action === 'DOC_DOWNLOAD' && $object->statut != 0)
|| (in_array($object->element, array('facture','supplier_invoice')) && $action === 'DOC_PREVIEW' && $object->statut != 0)
) )
{ {
$qualified++; $qualified++;
if (in_array($action, array( if (in_array($action, array(
'MEMBER_SUBSCRIPTION_CREATE','MEMBER_SUBSCRIPTION_MODIFY','MEMBER_SUBSCRIPTION_DELETE', 'MEMBER_SUBSCRIPTION_CREATE','MEMBER_SUBSCRIPTION_MODIFY','MEMBER_SUBSCRIPTION_DELETE',
'DON_VALIDATE','DON_MODIFY','DON_DELETE'))) $amounts = (double) $object->amount; 'DON_VALIDATE','DON_MODIFY','DON_DELETE'))) $amounts = (double) $object->amount;
elseif ($action == 'CASHCONTROL_VALIDATE') elseif ($action == 'CASHCONTROL_VALIDATE')

View File

@ -1046,7 +1046,7 @@ if ($action == 'create')
if (!empty($conf->incoterm->enabled)) if (!empty($conf->incoterm->enabled))
{ {
print '<tr>'; print '<tr>';
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $object->libelle_incoterms, 1).'</label></td>'; print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $object->label_incoterms, 1).'</label></td>';
print '<td colspan="3" class="maxwidthonsmartphone">'; print '<td colspan="3" class="maxwidthonsmartphone">';
print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:'')); print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:''));
print '</td></tr>'; print '</td></tr>';
@ -1973,7 +1973,7 @@ elseif ($id || $ref)
print '<td colspan="3">'; print '<td colspan="3">';
if ($action != 'editincoterm') if ($action != 'editincoterm')
{ {
print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1); print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
} }
else else
{ {

View File

@ -536,7 +536,7 @@ class Expedition extends CommonObject
$sql.= ", e.fk_shipping_method, e.tracking_number"; $sql.= ", e.fk_shipping_method, e.tracking_number";
$sql.= ", e.note_private, e.note_public"; $sql.= ", e.note_private, e.note_public";
$sql.= ', e.fk_incoterms, e.location_incoterms'; $sql.= ', e.fk_incoterms, e.location_incoterms';
$sql.= ', i.libelle as libelle_incoterms'; $sql.= ', i.libelle as label_incoterms';
$sql.= ', s.libelle as shipping_method'; $sql.= ', s.libelle as shipping_method';
$sql.= ", el.fk_source as origin_id, el.sourcetype as origin"; $sql.= ", el.fk_source as origin_id, el.sourcetype as origin";
$sql.= " FROM ".MAIN_DB_PREFIX."expedition as e"; $sql.= " FROM ".MAIN_DB_PREFIX."expedition as e";
@ -601,7 +601,7 @@ class Expedition extends CommonObject
//Incoterms //Incoterms
$this->fk_incoterms = $obj->fk_incoterms; $this->fk_incoterms = $obj->fk_incoterms;
$this->location_incoterms = $obj->location_incoterms; $this->location_incoterms = $obj->location_incoterms;
$this->libelle_incoterms = $obj->libelle_incoterms; $this->label_incoterms = $obj->label_incoterms;
$this->db->free($result); $this->db->free($result);

View File

@ -529,7 +529,7 @@ if ($id > 0 || ! empty($ref))
print '<td colspan="3">'; print '<td colspan="3">';
if ($action != 'editincoterm') if ($action != 'editincoterm')
{ {
print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1); print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
} }
else else
{ {

View File

@ -5,7 +5,7 @@
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -154,7 +154,7 @@ class CommandeFournisseur extends CommonOrder
//Incoterms //Incoterms
public $fk_incoterms; public $fk_incoterms;
public $location_incoterms; public $location_incoterms;
public $libelle_incoterms; //Used into tooltip public $label_incoterms; //Used into tooltip
public $extraparams=array(); public $extraparams=array();
@ -267,7 +267,7 @@ class CommandeFournisseur extends CommonOrder
$sql.= " cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle, cr.libelle_facture as cond_reglement_libelle_doc,"; $sql.= " cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle, cr.libelle_facture as cond_reglement_libelle_doc,";
$sql.= " p.code as mode_reglement_code, p.libelle as mode_reglement_libelle"; $sql.= " p.code as mode_reglement_code, p.libelle as mode_reglement_libelle";
$sql.= ', c.fk_incoterms, c.location_incoterms'; $sql.= ', c.fk_incoterms, c.location_incoterms';
$sql.= ', i.libelle as libelle_incoterms'; $sql.= ', i.libelle as label_incoterms';
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c"; $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_payment_term as cr ON c.fk_cond_reglement = cr.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_payment_term as cr ON c.fk_cond_reglement = cr.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON c.fk_mode_reglement = p.id"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON c.fk_mode_reglement = p.id";
@ -335,7 +335,7 @@ class CommandeFournisseur extends CommonOrder
//Incoterms //Incoterms
$this->fk_incoterms = $obj->fk_incoterms; $this->fk_incoterms = $obj->fk_incoterms;
$this->location_incoterms = $obj->location_incoterms; $this->location_incoterms = $obj->location_incoterms;
$this->libelle_incoterms = $obj->libelle_incoterms; $this->label_incoterms = $obj->label_incoterms;
// Multicurrency // Multicurrency
$this->fk_multicurrency = $obj->fk_multicurrency; $this->fk_multicurrency = $obj->fk_multicurrency;

View File

@ -91,6 +91,9 @@ class FactureFournisseur extends CommonInvoice
*/ */
public $ref; public $ref;
public $label;
public $libelle; // @deprecated
public $product_ref; public $product_ref;
public $ref_supplier; public $ref_supplier;
public $socid; public $socid;
@ -112,7 +115,6 @@ class FactureFournisseur extends CommonInvoice
public $paye; public $paye;
public $author; public $author;
public $libelle;
/** /**
* Date creation record (datec) * Date creation record (datec)
@ -190,7 +192,7 @@ class FactureFournisseur extends CommonInvoice
public $fk_incoterms; public $fk_incoterms;
public $location_incoterms; public $location_incoterms;
public $libelle_incoterms; //Used into tooltip public $label_incoterms; //Used into tooltip
public $extraparams=array(); public $extraparams=array();
@ -341,7 +343,7 @@ class FactureFournisseur extends CommonInvoice
$sql.= ", '".$this->db->escape($this->ref_supplier)."'"; $sql.= ", '".$this->db->escape($this->ref_supplier)."'";
$sql.= ", ".$conf->entity; $sql.= ", ".$conf->entity;
$sql.= ", '".$this->db->escape($this->type)."'"; $sql.= ", '".$this->db->escape($this->type)."'";
$sql.= ", '".$this->db->escape($this->libelle)."'"; $sql.= ", '".$this->db->escape($this->label?$this->label:$this->libelle)."'";
$sql.= ", ".$this->socid; $sql.= ", ".$this->socid;
$sql.= ", '".$this->db->idate($now)."'"; $sql.= ", '".$this->db->idate($now)."'";
$sql.= ", '".$this->db->idate($this->date)."'"; $sql.= ", '".$this->db->idate($this->date)."'";
@ -482,7 +484,7 @@ class FactureFournisseur extends CommonInvoice
{ {
$idligne = $this->db->last_insert_id(MAIN_DB_PREFIX.'facture_fourn_det'); $idligne = $this->db->last_insert_id(MAIN_DB_PREFIX.'facture_fourn_det');
$this->updateline( $this->updateline(
$idligne, $idligne,
$line->description, $line->description,
$line->pu_ht, $line->pu_ht,
@ -509,8 +511,6 @@ class FactureFournisseur extends CommonInvoice
$result=$this->update_price(); $result=$this->update_price();
if ($result > 0) if ($result > 0)
{ {
$action='create';
// Actions on extra fields // Actions on extra fields
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{ {
@ -585,7 +585,7 @@ class FactureFournisseur extends CommonInvoice
$sql.= " t.datec,"; $sql.= " t.datec,";
$sql.= " t.datef,"; $sql.= " t.datef,";
$sql.= " t.tms,"; $sql.= " t.tms,";
$sql.= " t.libelle,"; $sql.= " t.libelle as label,";
$sql.= " t.paye,"; $sql.= " t.paye,";
$sql.= " t.amount,"; $sql.= " t.amount,";
$sql.= " t.remise,"; $sql.= " t.remise,";
@ -594,7 +594,6 @@ class FactureFournisseur extends CommonInvoice
$sql.= " t.tva,"; $sql.= " t.tva,";
$sql.= " t.localtax1,"; $sql.= " t.localtax1,";
$sql.= " t.localtax2,"; $sql.= " t.localtax2,";
//$sql.= " t.total,";
$sql.= " t.total_ht,"; $sql.= " t.total_ht,";
$sql.= " t.total_tva,"; $sql.= " t.total_tva,";
$sql.= " t.total_ttc,"; $sql.= " t.total_ttc,";
@ -616,7 +615,7 @@ class FactureFournisseur extends CommonInvoice
$sql.= " p.code as mode_reglement_code, p.libelle as mode_reglement_libelle,"; $sql.= " p.code as mode_reglement_code, p.libelle as mode_reglement_libelle,";
$sql.= ' s.nom as socnom, s.rowid as socid,'; $sql.= ' s.nom as socnom, s.rowid as socid,';
$sql.= ' t.fk_incoterms, t.location_incoterms,'; $sql.= ' t.fk_incoterms, t.location_incoterms,';
$sql.= " i.libelle as libelle_incoterms,"; $sql.= " i.libelle as label_incoterms,";
$sql.= ' t.fk_multicurrency, t.multicurrency_code, t.multicurrency_tx, t.multicurrency_total_ht, t.multicurrency_total_tva, t.multicurrency_total_ttc'; $sql.= ' t.fk_multicurrency, t.multicurrency_code, t.multicurrency_tx, t.multicurrency_total_ht, t.multicurrency_total_tva, t.multicurrency_total_ttc';
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as t'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as t';
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (t.fk_soc = s.rowid)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (t.fk_soc = s.rowid)";
@ -645,8 +644,8 @@ class FactureFournisseur extends CommonInvoice
$this->date = $this->db->jdate($obj->datef); $this->date = $this->db->jdate($obj->datef);
$this->datep = $this->db->jdate($obj->datef); $this->datep = $this->db->jdate($obj->datef);
$this->tms = $this->db->jdate($obj->tms); $this->tms = $this->db->jdate($obj->tms);
$this->libelle = $obj->libelle; $this->libelle = $obj->label; // deprecated
$this->label = $obj->libelle; $this->label = $obj->label;
$this->paye = $obj->paye; $this->paye = $obj->paye;
$this->amount = $obj->amount; $this->amount = $obj->amount;
$this->remise = $obj->remise; $this->remise = $obj->remise;
@ -655,7 +654,6 @@ class FactureFournisseur extends CommonInvoice
$this->tva = $obj->tva; $this->tva = $obj->tva;
$this->total_localtax1 = $obj->localtax1; $this->total_localtax1 = $obj->localtax1;
$this->total_localtax2 = $obj->localtax2; $this->total_localtax2 = $obj->localtax2;
//$this->total = $obj->total;
$this->total_ht = $obj->total_ht; $this->total_ht = $obj->total_ht;
$this->total_tva = $obj->total_tva; $this->total_tva = $obj->total_tva;
$this->total_ttc = $obj->total_ttc; $this->total_ttc = $obj->total_ttc;
@ -685,7 +683,7 @@ class FactureFournisseur extends CommonInvoice
//Incoterms //Incoterms
$this->fk_incoterms = $obj->fk_incoterms; $this->fk_incoterms = $obj->fk_incoterms;
$this->location_incoterms = $obj->location_incoterms; $this->location_incoterms = $obj->location_incoterms;
$this->libelle_incoterms = $obj->libelle_incoterms; $this->label_incoterms = $obj->label_incoterms;
// Multicurrency // Multicurrency
$this->fk_multicurrency = $obj->fk_multicurrency; $this->fk_multicurrency = $obj->fk_multicurrency;
@ -790,13 +788,13 @@ class FactureFournisseur extends CommonInvoice
$line->localtax2_type = $obj->localtax2_type; $line->localtax2_type = $obj->localtax2_type;
$line->qty = $obj->qty; $line->qty = $obj->qty;
$line->remise_percent = $obj->remise_percent; $line->remise_percent = $obj->remise_percent;
$line->tva = $obj->total_tva; $line->tva = $obj->total_tva; // deprecated
$line->total_ht = $obj->total_ht; $line->total_ht = $obj->total_ht;
$line->total_ttc = $obj->total_ttc;
$line->total_tva = $obj->total_tva; $line->total_tva = $obj->total_tva;
$line->total_localtax1 = $obj->total_localtax1; $line->total_localtax1 = $obj->total_localtax1;
$line->total_localtax2 = $obj->total_localtax2; $line->total_localtax2 = $obj->total_localtax2;
$line->fk_facture_fourn = $obj->fk_facture_fourn; $line->fk_facture_fourn = $obj->fk_facture_fourn;
$line->total_ttc = $obj->total_ttc;
$line->fk_product = $obj->fk_product; $line->fk_product = $obj->fk_product;
$line->product_type = $obj->product_type; $line->product_type = $obj->product_type;
$line->product_label = $obj->label; $line->product_label = $obj->label;
@ -849,7 +847,8 @@ class FactureFournisseur extends CommonInvoice
if (isset($this->entity)) $this->entity=trim($this->entity); if (isset($this->entity)) $this->entity=trim($this->entity);
if (isset($this->type)) $this->type=trim($this->type); if (isset($this->type)) $this->type=trim($this->type);
if (isset($this->fk_soc)) $this->fk_soc=trim($this->fk_soc); if (isset($this->fk_soc)) $this->fk_soc=trim($this->fk_soc);
if (isset($this->libelle)) $this->libelle=trim($this->libelle); if (isset($this->label)) $this->label=trim($this->label);
if (isset($this->libelle)) $this->libelle=trim($this->libelle); // deprecated
if (isset($this->paye)) $this->paye=trim($this->paye); if (isset($this->paye)) $this->paye=trim($this->paye);
if (isset($this->amount)) $this->amount=trim($this->amount); if (isset($this->amount)) $this->amount=trim($this->amount);
if (isset($this->remise)) $this->remise=trim($this->remise); if (isset($this->remise)) $this->remise=trim($this->remise);
@ -897,7 +896,6 @@ class FactureFournisseur extends CommonInvoice
$sql.= " tva=".(isset($this->tva)?$this->tva:"null").","; $sql.= " tva=".(isset($this->tva)?$this->tva:"null").",";
$sql.= " localtax1=".(isset($this->localtax1)?$this->localtax1:"null").","; $sql.= " localtax1=".(isset($this->localtax1)?$this->localtax1:"null").",";
$sql.= " localtax2=".(isset($this->localtax2)?$this->localtax2:"null").","; $sql.= " localtax2=".(isset($this->localtax2)?$this->localtax2:"null").",";
//$sql.= " total=".(isset($this->total)?$this->total:"null").",";
$sql.= " total_ht=".(isset($this->total_ht)?$this->total_ht:"null").","; $sql.= " total_ht=".(isset($this->total_ht)?$this->total_ht:"null").",";
$sql.= " total_tva=".(isset($this->total_tva)?$this->total_tva:"null").","; $sql.= " total_tva=".(isset($this->total_tva)?$this->total_tva:"null").",";
$sql.= " total_ttc=".(isset($this->total_ttc)?$this->total_ttc:"null").","; $sql.= " total_ttc=".(isset($this->total_ttc)?$this->total_ttc:"null").",";
@ -2280,8 +2278,8 @@ class FactureFournisseur extends CommonInvoice
$label .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref; $label .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
if (! empty($this->ref_supplier)) if (! empty($this->ref_supplier))
$label.= '<br><b>' . $langs->trans('RefSupplier') . ':</b> ' . $this->ref_supplier; $label.= '<br><b>' . $langs->trans('RefSupplier') . ':</b> ' . $this->ref_supplier;
if (! empty($this->libelle)) if (! empty($this->label))
$label.= '<br><b>' . $langs->trans('Label') . ':</b> ' . $this->libelle; $label.= '<br><b>' . $langs->trans('Label') . ':</b> ' . $this->label;
if (! empty($this->date)) if (! empty($this->date))
$label .= '<br><b>' . $langs->trans('Date') . ':</b> ' . dol_print_date($this->date, 'day'); $label .= '<br><b>' . $langs->trans('Date') . ':</b> ' . dol_print_date($this->date, 'day');
if (! empty($this->total_ht)) if (! empty($this->total_ht))
@ -2726,12 +2724,6 @@ class SupplierInvoiceLine extends CommonObjectLine
*/ */
public $ref_supplier; public $ref_supplier;
/**
* @deprecated
* @see $label
*/
public $libelle;
/** /**
* Product description * Product description
* @var string * @var string
@ -2746,6 +2738,10 @@ class SupplierInvoiceLine extends CommonObjectLine
*/ */
public $pu_ht; public $pu_ht;
/**
* Unit price excluded taxes
* @var float
*/
public $subprice; public $subprice;
/** /**
@ -2754,15 +2750,6 @@ class SupplierInvoiceLine extends CommonObjectLine
*/ */
public $pu_ttc; public $pu_ttc;
/**
* Total VAT amount
* @var float
* @deprecated Use $total_tva instead
* @see $total_tva
*/
public $tva;
public $total_tva;
/** /**
* Id of the corresponding supplier invoice * Id of the corresponding supplier invoice
@ -2805,6 +2792,7 @@ class SupplierInvoiceLine extends CommonObjectLine
public $remise_percent; public $remise_percent;
public $total_ht; public $total_ht;
public $total_ttc; public $total_ttc;
public $total_tva;
public $total_localtax1; public $total_localtax1;
public $total_localtax2; public $total_localtax2;
@ -2860,7 +2848,7 @@ class SupplierInvoiceLine extends CommonObjectLine
$sql = 'SELECT f.rowid, f.ref as ref_supplier, f.description, f.date_start, f.date_end, f.pu_ht, f.pu_ttc, f.qty, f.remise_percent, f.tva_tx'; $sql = 'SELECT f.rowid, f.ref as ref_supplier, f.description, f.date_start, f.date_end, f.pu_ht, f.pu_ttc, f.qty, f.remise_percent, f.tva_tx';
$sql.= ', f.localtax1_type, f.localtax2_type, f.localtax1_tx, f.localtax2_tx, f.total_localtax1, f.total_localtax2 '; $sql.= ', f.localtax1_type, f.localtax2_type, f.localtax1_tx, f.localtax2_tx, f.total_localtax1, f.total_localtax2 ';
$sql.= ', f.total_ht, f.tva as total_tva, f.total_ttc, f.fk_facture_fourn, f.fk_product, f.product_type, f.info_bits, f.rang, f.special_code, f.fk_parent_line, f.fk_unit'; $sql.= ', f.total_ht, f.tva as total_tva, f.total_ttc, f.fk_facture_fourn, f.fk_product, f.product_type, f.info_bits, f.rang, f.special_code, f.fk_parent_line, f.fk_unit';
$sql.= ', p.rowid as product_id, p.ref as product_ref, p.label as label, p.description as product_desc'; $sql.= ', p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.description as product_desc';
$sql.= ', f.multicurrency_subprice, f.multicurrency_total_ht, f.multicurrency_total_tva, multicurrency_total_ttc'; $sql.= ', f.multicurrency_subprice, f.multicurrency_total_ht, f.multicurrency_total_tva, multicurrency_total_ttc';
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_det as f'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_det as f';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON f.fk_product = p.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON f.fk_product = p.rowid';
@ -2901,7 +2889,7 @@ class SupplierInvoiceLine extends CommonObjectLine
$this->localtax2_type = $obj->localtax2_type; $this->localtax2_type = $obj->localtax2_type;
$this->qty = $obj->qty; $this->qty = $obj->qty;
$this->remise_percent = $obj->remise_percent; $this->remise_percent = $obj->remise_percent;
$this->tva = $obj->total_tva; $this->tva = $obj->total_tva; // deprecated
$this->total_ht = $obj->total_ht; $this->total_ht = $obj->total_ht;
$this->total_tva = $obj->total_tva; $this->total_tva = $obj->total_tva;
$this->total_localtax1 = $obj->total_localtax1; $this->total_localtax1 = $obj->total_localtax1;
@ -2909,7 +2897,7 @@ class SupplierInvoiceLine extends CommonObjectLine
$this->total_ttc = $obj->total_ttc; $this->total_ttc = $obj->total_ttc;
$this->fk_product = $obj->fk_product; $this->fk_product = $obj->fk_product;
$this->product_type = $obj->product_type; $this->product_type = $obj->product_type;
$this->product_label = $obj->label; $this->product_label = $obj->product_label;
$this->info_bits = $obj->info_bits; $this->info_bits = $obj->info_bits;
$this->tva_npr = ($obj->info_bits & 1 == 1) ? 1 : 0; $this->tva_npr = ($obj->info_bits & 1 == 1) ? 1 : 0;
$this->fk_parent_line = $obj->fk_parent_line; $this->fk_parent_line = $obj->fk_parent_line;
@ -3112,6 +3100,7 @@ class SupplierInvoiceLine extends CommonObjectLine
if (empty($this->localtax2_tx)) $this->localtax2_tx=0; if (empty($this->localtax2_tx)) $this->localtax2_tx=0;
if (empty($this->localtax1_type)) $this->localtax1_type='0'; if (empty($this->localtax1_type)) $this->localtax1_type='0';
if (empty($this->localtax2_type)) $this->localtax2_type='0'; if (empty($this->localtax2_type)) $this->localtax2_type='0';
if (empty($this->total_tva)) $this->total_tva=0;
if (empty($this->total_localtax1)) $this->total_localtax1=0; if (empty($this->total_localtax1)) $this->total_localtax1=0;
if (empty($this->total_localtax2)) $this->total_localtax2=0; if (empty($this->total_localtax2)) $this->total_localtax2=0;
if (empty($this->rang)) $this->rang=0; if (empty($this->rang)) $this->rang=0;

Some files were not shown because too many files have changed in this diff Show More