Merge branch 'develop' into new_branch_27_06_2019

This commit is contained in:
Laurent Destailleur 2019-06-28 13:39:27 +02:00 committed by GitHub
commit cd024da628
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1089 changed files with 30610 additions and 4972 deletions

View File

@ -1,4 +1,7 @@
# .scrutinizer.yml # .scrutinizer.yml
build:
- php-scrutinizer-run
imports: imports:
- javascript - javascript
- php - php

View File

@ -164,12 +164,6 @@ before_script:
echo echo
echo "Set timezone" echo "Set timezone"
echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
if [ "$TRAVIS_PHP_VERSION" = '5.4' ]; then
# Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0, 7.1, 7.2 and nightly!
echo
echo "Enabling Memcached for PHP <= 5.4"
echo 'extension = memcached.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
fi
phpenv rehash phpenv rehash
echo echo
@ -350,6 +344,9 @@ script:
php upgrade.php 9.0.0 10.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade9001000.log php upgrade.php 9.0.0 10.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade9001000.log
php upgrade2.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-2.log php upgrade2.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-2.log
php step5.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-3.log php step5.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-3.log
php upgrade.php 10.0.0 11.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade9001000.log
php upgrade2.php 10.0.0 11.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-2.log
php step5.php 10.0.0 11.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-3.log
# Enable modules not enabled into original dump # Enable modules not enabled into original dump
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKETSUP,MAIN_MODULE_ACCOUNTING > $TRAVIS_BUILD_DIR/enablemodule.log php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKETSUP,MAIN_MODULE_ACCOUNTING > $TRAVIS_BUILD_DIR/enablemodule.log
echo $? echo $?

View File

@ -2,6 +2,21 @@
English Dolibarr ChangeLog 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.
@ -57,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
@ -484,6 +499,41 @@ Following changes may create regressions for some external modules, but were nec
* Remove the no more used and deprecated dol_print_graph function * Remove the no more used and deprecated dol_print_graph function
***** ChangeLog for 8.0.6 compared to 8.0.5 *****
FIX: #11244
FIX: #11316
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: 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: mail presend: can overwrite a file previously uploaded
FIX: mail presend: can overwrite a file previously uploaded (Issue #11056)
FIX: mass send mail
FIX: missing compatibility with multicompany transverse mode
FIX: modulebuilder: hardcoded llx_
FIX: Not showing Contract and Project columns on ficheinter list
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: try to use WHERE EXISTS instead 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: var name
FIX: we need to fetch fourn invoice with ref in current entity
FIX: Wrong stock movement on supplier credit notes
***** ChangeLog for 8.0.5 compared to 8.0.4 ***** ***** ChangeLog for 8.0.5 compared to 8.0.4 *****
FIX: #10381 FIX: #10381
FIX: #10460 compatibility with MariaDB 10.4 FIX: #10460 compatibility with MariaDB 10.4

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/>.
*/ */
/** /**

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

@ -37,6 +37,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("accountancy")); $langs->loadLangs(array("accountancy"));
$socid = GETPOST('socid', 'int');
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$search_mvt_num = GETPOST('search_mvt_num', 'int'); $search_mvt_num = GETPOST('search_mvt_num', 'int');
$search_doc_type = GETPOST("search_doc_type", 'alpha'); $search_doc_type = GETPOST("search_doc_type", 'alpha');
@ -97,14 +99,15 @@ $pagenext = $page + 1;
if ($sortorder == "") $sortorder = "ASC"; if ($sortorder == "") $sortorder = "ASC";
if ($sortfield == "") $sortfield = "t.piece_num,t.rowid"; if ($sortfield == "") $sortfield = "t.piece_num,t.rowid";
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$object = new BookKeeping($db); $object = new BookKeeping($db);
$hookmanager->initHooks(array('bookkeepinglist'));
$formaccounting = new FormAccounting($db); $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'))
{ {
@ -160,147 +163,153 @@ if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.let
if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; } if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; }
if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; $parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers if (empty($reshook))
{ {
$search_mvt_num = ''; include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
$search_doc_type = '';
$search_doc_ref = ''; if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
$search_doc_date = ''; {
$search_accountancy_code = ''; $search_mvt_num = '';
$search_accountancy_code_start = ''; $search_doc_type = '';
$search_accountancy_code_end = ''; $search_doc_ref = '';
$search_accountancy_aux_code = ''; $search_doc_date = '';
$search_accountancy_aux_code_start = ''; $search_accountancy_code = '';
$search_accountancy_aux_code_end = ''; $search_accountancy_code_start = '';
$search_mvt_label = ''; $search_accountancy_code_end = '';
$search_direction = ''; $search_accountancy_aux_code = '';
$search_ledger_code = ''; $search_accountancy_aux_code_start = '';
$search_date_start = ''; $search_accountancy_aux_code_end = '';
$search_date_end = ''; $search_mvt_label = '';
$search_date_creation_start = ''; $search_direction = '';
$search_date_creation_end = ''; $search_ledger_code = '';
$search_date_modification_start = ''; $search_date_start = '';
$search_date_modification_end = ''; $search_date_end = '';
$search_date_export_start = ''; $search_date_creation_start = '';
$search_date_export_end = ''; $search_date_creation_end = '';
$search_debit = ''; $search_date_modification_start = '';
$search_credit = ''; $search_date_modification_end = '';
$search_lettering_code = ''; $search_date_export_start = '';
$search_date_export_end = '';
$search_debit = '';
$search_credit = '';
$search_lettering_code = '';
}
// Must be after the remove filter action, before the export.
$param = '';
$filter = array ();
if (! empty($search_date_start)) {
$filter['t.doc_date>='] = $search_date_start;
$tmp=dol_getdate($search_date_start);
$param .= '&search_date_startmonth=' . $tmp['mon'] . '&search_date_startday=' . $tmp['mday'] . '&search_date_startyear=' . $tmp['year'];
}
if (! empty($search_date_end)) {
$filter['t.doc_date<='] = $search_date_end;
$tmp=dol_getdate($search_date_end);
$param .= '&search_date_endmonth=' . $tmp['mon'] . '&search_date_endday=' . $tmp['mday'] . '&search_date_endyear=' . $tmp['year'];
}
if (! empty($search_doc_date)) {
$filter['t.doc_date'] = $search_doc_date;
$tmp=dol_getdate($search_doc_date);
$param .= '&doc_datemonth=' . $tmp['mon'] . '&doc_dateday=' . $tmp['mday'] . '&doc_dateyear=' . $tmp['year'];
}
if (! empty($search_doc_type)) {
$filter['t.doc_type'] = $search_doc_type;
$param .= '&search_doc_type=' . urlencode($search_doc_type);
}
if (! empty($search_doc_ref)) {
$filter['t.doc_ref'] = $search_doc_ref;
$param .= '&search_doc_ref=' . urlencode($search_doc_ref);
}
if (! empty($search_accountancy_code)) {
$filter['t.numero_compte'] = $search_accountancy_code;
$param .= '&search_accountancy_code=' . urlencode($search_accountancy_code);
}
if (! empty($search_accountancy_code_start)) {
$filter['t.numero_compte>='] = $search_accountancy_code_start;
$param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start);
}
if (! empty($search_accountancy_code_end)) {
$filter['t.numero_compte<='] = $search_accountancy_code_end;
$param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end);
}
if (! empty($search_accountancy_aux_code)) {
$filter['t.subledger_account'] = $search_accountancy_aux_code;
$param .= '&search_accountancy_aux_code=' . urlencode($search_accountancy_aux_code);
}
if (! empty($search_accountancy_aux_code_start)) {
$filter['t.subledger_account>='] = $search_accountancy_aux_code_start;
$param .= '&search_accountancy_aux_code_start=' . urlencode($search_accountancy_aux_code_start);
}
if (! empty($search_accountancy_aux_code_end)) {
$filter['t.subledger_account<='] = $search_accountancy_aux_code_end;
$param .= '&search_accountancy_aux_code_end=' . urlencode($search_accountancy_aux_code_end);
}
if (! empty($search_mvt_label)) {
$filter['t.label_operation'] = $search_mvt_label;
$param .= '&search_mvt_label=' . urlencode($search_mvt_label);
}
if (! empty($search_direction)) {
$filter['t.sens'] = $search_direction;
$param .= '&search_direction=' . urlencode($search_direction);
}
if (! empty($search_ledger_code)) {
$filter['t.code_journal'] = $search_ledger_code;
$param .= '&search_ledger_code=' . urlencode($search_ledger_code);
}
if (! empty($search_mvt_num)) {
$filter['t.piece_num'] = $search_mvt_num;
$param .= '&search_mvt_num=' . urlencode($search_mvt_num);
}
if (! empty($search_date_creation_start)) {
$filter['t.date_creation>='] = $search_date_creation_start;
$tmp=dol_getdate($search_date_creation_start);
$param .= '&date_creation_startmonth=' . $tmp['mon'] . '&date_creation_startday=' . $tmp['mday'] . '&date_creation_startyear=' . $tmp['year'];
}
if (! empty($search_date_creation_end)) {
$filter['t.date_creation<='] = $search_date_creation_end;
$tmp=dol_getdate($search_date_creation_end);
$param .= '&date_creation_endmonth=' . $tmp['mon'] . '&date_creation_endday=' . $tmp['mday'] . '&date_creation_endyear=' . $tmp['year'];
}
if (! empty($search_date_modification_start)) {
$filter['t.tms>='] = $search_date_modification_start;
$tmp=dol_getdate($search_date_modification_start);
$param .= '&date_modification_startmonth=' . $tmp['mon'] . '&date_modification_startday=' . $tmp['mday'] . '&date_modification_startyear=' . $tmp['year'];
}
if (! empty($search_date_modification_end)) {
$filter['t.tms<='] = $search_date_modification_end;
$tmp=dol_getdate($search_date_modification_end);
$param .= '&date_modification_endmonth=' . $tmp['mon'] . '&date_modification_endday=' . $tmp['mday'] . '&date_modification_endyear=' . $tmp['year'];
}
if (! empty($search_date_export_start)) {
$filter['t.date_export>='] = $search_date_export_start;
$tmp=dol_getdate($search_date_export_start);
$param .= '&date_export_startmonth=' . $tmp['mon'] . '&date_export_startday=' . $tmp['mday'] . '&date_export_startyear=' . $tmp['year'];
}
if (! empty($search_date_export_end)) {
$filter['t.date_export<='] = $search_date_export_end;
$tmp=dol_getdate($search_date_export_end);
$param .= '&date_export_endmonth=' . $tmp['mon'] . '&date_export_endday=' . $tmp['mday'] . '&date_export_endyear=' . $tmp['year'];
}
if (! empty($search_debit)) {
$filter['t.debit'] = $search_debit;
$param .= '&search_debit=' . urlencode($search_debit);
}
if (! empty($search_credit)) {
$filter['t.credit'] = $search_credit;
$param .= '&search_credit=' . urlencode($search_credit);
}
if (! empty($search_lettering_code)) {
$filter['t.lettering_code'] = $search_lettering_code;
$param .= '&search_lettering_code=' . urlencode($search_lettering_code);
}
} }
// Must be after the remove filter action, before the export. if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) {
$param = '';
$filter = array ();
if (! empty($search_date_start)) {
$filter['t.doc_date>='] = $search_date_start;
$tmp=dol_getdate($search_date_start);
$param .= '&search_date_startmonth=' . $tmp['mon'] . '&search_date_startday=' . $tmp['mday'] . '&search_date_startyear=' . $tmp['year'];
}
if (! empty($search_date_end)) {
$filter['t.doc_date<='] = $search_date_end;
$tmp=dol_getdate($search_date_end);
$param .= '&search_date_endmonth=' . $tmp['mon'] . '&search_date_endday=' . $tmp['mday'] . '&search_date_endyear=' . $tmp['year'];
}
if (! empty($search_doc_date)) {
$filter['t.doc_date'] = $search_doc_date;
$tmp=dol_getdate($search_doc_date);
$param .= '&doc_datemonth=' . $tmp['mon'] . '&doc_dateday=' . $tmp['mday'] . '&doc_dateyear=' . $tmp['year'];
}
if (! empty($search_doc_type)) {
$filter['t.doc_type'] = $search_doc_type;
$param .= '&search_doc_type=' . urlencode($search_doc_type);
}
if (! empty($search_doc_ref)) {
$filter['t.doc_ref'] = $search_doc_ref;
$param .= '&search_doc_ref=' . urlencode($search_doc_ref);
}
if (! empty($search_accountancy_code)) {
$filter['t.numero_compte'] = $search_accountancy_code;
$param .= '&search_accountancy_code=' . urlencode($search_accountancy_code);
}
if (! empty($search_accountancy_code_start)) {
$filter['t.numero_compte>='] = $search_accountancy_code_start;
$param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start);
}
if (! empty($search_accountancy_code_end)) {
$filter['t.numero_compte<='] = $search_accountancy_code_end;
$param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end);
}
if (! empty($search_accountancy_aux_code)) {
$filter['t.subledger_account'] = $search_accountancy_aux_code;
$param .= '&search_accountancy_aux_code=' . urlencode($search_accountancy_aux_code);
}
if (! empty($search_accountancy_aux_code_start)) {
$filter['t.subledger_account>='] = $search_accountancy_aux_code_start;
$param .= '&search_accountancy_aux_code_start=' . urlencode($search_accountancy_aux_code_start);
}
if (! empty($search_accountancy_aux_code_end)) {
$filter['t.subledger_account<='] = $search_accountancy_aux_code_end;
$param .= '&search_accountancy_aux_code_end=' . urlencode($search_accountancy_aux_code_end);
}
if (! empty($search_mvt_label)) {
$filter['t.label_operation'] = $search_mvt_label;
$param .= '&search_mvt_label=' . urlencode($search_mvt_label);
}
if (! empty($search_direction)) {
$filter['t.sens'] = $search_direction;
$param .= '&search_direction=' . urlencode($search_direction);
}
if (! empty($search_ledger_code)) {
$filter['t.code_journal'] = $search_ledger_code;
$param .= '&search_ledger_code=' . urlencode($search_ledger_code);
}
if (! empty($search_mvt_num)) {
$filter['t.piece_num'] = $search_mvt_num;
$param .= '&search_mvt_num=' . urlencode($search_mvt_num);
}
if (! empty($search_date_creation_start)) {
$filter['t.date_creation>='] = $search_date_creation_start;
$tmp=dol_getdate($search_date_creation_start);
$param .= '&date_creation_startmonth=' . $tmp['mon'] . '&date_creation_startday=' . $tmp['mday'] . '&date_creation_startyear=' . $tmp['year'];
}
if (! empty($search_date_creation_end)) {
$filter['t.date_creation<='] = $search_date_creation_end;
$tmp=dol_getdate($search_date_creation_end);
$param .= '&date_creation_endmonth=' . $tmp['mon'] . '&date_creation_endday=' . $tmp['mday'] . '&date_creation_endyear=' . $tmp['year'];
}
if (! empty($search_date_modification_start)) {
$filter['t.tms>='] = $search_date_modification_start;
$tmp=dol_getdate($search_date_modification_start);
$param .= '&date_modification_startmonth=' . $tmp['mon'] . '&date_modification_startday=' . $tmp['mday'] . '&date_modification_startyear=' . $tmp['year'];
}
if (! empty($search_date_modification_end)) {
$filter['t.tms<='] = $search_date_modification_end;
$tmp=dol_getdate($search_date_modification_end);
$param .= '&date_modification_endmonth=' . $tmp['mon'] . '&date_modification_endday=' . $tmp['mday'] . '&date_modification_endyear=' . $tmp['year'];
}
if (! empty($search_date_export_start)) {
$filter['t.date_export>='] = $search_date_export_start;
$tmp=dol_getdate($search_date_export_start);
$param .= '&date_export_startmonth=' . $tmp['mon'] . '&date_export_startday=' . $tmp['mday'] . '&date_export_startyear=' . $tmp['year'];
}
if (! empty($search_date_export_end)) {
$filter['t.date_export<='] = $search_date_export_end;
$tmp=dol_getdate($search_date_export_end);
$param .= '&date_export_endmonth=' . $tmp['mon'] . '&date_export_endday=' . $tmp['mday'] . '&date_export_endyear=' . $tmp['year'];
}
if (! empty($search_debit)) {
$filter['t.debit'] = $search_debit;
$param .= '&search_debit=' . urlencode($search_debit);
}
if (! empty($search_credit)) {
$filter['t.credit'] = $search_credit;
$param .= '&search_credit=' . urlencode($search_credit);
}
if (! empty($search_lettering_code)) {
$filter['t.lettering_code'] = $search_lettering_code;
$param .= '&search_lettering_code=' . urlencode($search_lettering_code);
}
if ($action == 'delbookkeeping') {
$import_key = GETPOST('importkey', 'alpha'); $import_key = GETPOST('importkey', 'alpha');
@ -315,7 +324,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 +355,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 +375,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 +524,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);
@ -526,6 +536,11 @@ $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
else $moreforfilter = $hookmanager->resPrint;
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
print '<table class="tagtable liste" width="100%">'; print '<table class="tagtable liste" width="100%">';
@ -634,6 +649,13 @@ if (! empty($arrayfields['t.code_journal']['checked']))
{ {
print '<td class="liste_titre center"><input type="text" name="search_ledger_code" size="3" value="' . $search_ledger_code . '"></td>'; print '<td class="liste_titre center"><input type="text" name="search_ledger_code" size="3" value="' . $search_ledger_code . '"></td>';
} }
// Fields from hook
$parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation // Date creation
if (! empty($arrayfields['t.date_creation']['checked'])) if (! empty($arrayfields['t.date_creation']['checked']))
{ {
@ -694,6 +716,10 @@ if (! empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arr
if (! empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, '', $sortfield, $sortorder, 'right '); if (! empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, '', $sortfield, $sortorder, 'right ');
if (! empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center ');
// Hook fields
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (! empty($arrayfields['t.date_creation']['checked'])) print_liste_field_titre($arrayfields['t.date_creation']['label'], $_SERVER['PHP_SELF'], "t.date_creation", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['t.date_creation']['checked'])) print_liste_field_titre($arrayfields['t.date_creation']['label'], $_SERVER['PHP_SELF'], "t.date_creation", "", $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['t.date_export']['checked'])) print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['t.date_export']['checked'])) print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center ');
@ -795,6 +821,11 @@ if ($num > 0)
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
// Fields from hook
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Creation operation date // Creation operation date
if (! empty($arrayfields['t.date_creation']['checked'])) if (! empty($arrayfields['t.date_creation']['checked']))
{ {
@ -818,12 +849,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";
@ -847,18 +883,24 @@ if ($num > 0)
elseif ($totalarray['totalcreditfield'] == $i) print '<td class="right">'.price($totalarray['totalcredit']).'</td>'; elseif ($totalarray['totalcreditfield'] == $i) print '<td class="right">'.price($totalarray['totalcredit']).'</td>';
else print '<td></td>'; else print '<td></td>';
} }
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
$reshook=$hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</tr>'; print '</tr>';
} }
} }
print "</table>"; 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

@ -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").'">';
@ -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">';

View File

@ -11,6 +11,7 @@
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018-2019 Thibault FOUCART <support@ptibogxiv.net> * Copyright (C) 2018-2019 Thibault FOUCART <support@ptibogxiv.net>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
* *
* 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
@ -2123,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;
} }
@ -2460,8 +2461,8 @@ class Adherent extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/** /**
* Initialise tableau info (tableau des attributs LDAP) * Initialise tableau info (tableau des attributs LDAP)
* *
* @return array Tableau info des attributs * @return array Tableau info des attributs

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

@ -1,8 +1,9 @@
<?php <?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
* *
* 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
@ -29,6 +30,11 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('membersindex'));
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("companies","members")); $langs->loadLangs(array("companies","members"));
@ -435,6 +441,9 @@ print "</div>";
print '</div></div></div>'; print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardMembers', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page // End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -81,7 +81,6 @@ $mesg = $px1->isGraphKo();
if (! $mesg) if (! $mesg)
{ {
$px1->SetData($data); $px1->SetData($data);
$px1->SetPrecisionY(0);
$i=$startyear; $i=$startyear;
while ($i <= $endyear) while ($i <= $endyear)
{ {
@ -96,7 +95,6 @@ if (! $mesg)
$px1->SetYLabel($langs->trans("NbOfSubscriptions")); $px1->SetYLabel($langs->trans("NbOfSubscriptions"));
$px1->SetShading(3); $px1->SetShading(3);
$px1->SetHorizTickIncrement(1); $px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->mode='depth'; $px1->mode='depth';
$px1->SetTitle($langs->trans("NbOfSubscriptions")); $px1->SetTitle($langs->trans("NbOfSubscriptions"));
@ -116,7 +114,6 @@ $mesg = $px2->isGraphKo();
if (! $mesg) if (! $mesg)
{ {
$px2->SetData($data); $px2->SetData($data);
$px2->SetPrecisionY(0);
$i=$startyear; $i=$startyear;
while ($i <= $endyear) while ($i <= $endyear)
{ {
@ -131,7 +128,6 @@ if (! $mesg)
$px2->SetYLabel($langs->trans("AmountOfSubscriptions")); $px2->SetYLabel($langs->trans("AmountOfSubscriptions"));
$px2->SetShading(3); $px2->SetShading(3);
$px2->SetHorizTickIncrement(1); $px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->mode='depth'; $px2->mode='depth';
$px2->SetTitle($langs->trans("AmountOfSubscriptions")); $px2->SetTitle($langs->trans("AmountOfSubscriptions"));

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, d.statut, d.fk_adherent_type as type,"; $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,";

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

@ -75,13 +75,27 @@ if ( ($action == 'update' && ! GETPOST("cancel", 'alpha'))
activateModulesRequiredByCountry($mysoc->country_code); activateModulesRequiredByCountry($mysoc->country_code);
} }
$db->begin(); $tmparray=getState(GETPOST('state_id', 'int'), 'all', $db, $langs, 0);
if (! empty($tmparray['id']))
{
$mysoc->state_id =$tmparray['id'];
$mysoc->state_code =$tmparray['code'];
$mysoc->state_label=$tmparray['label'];
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", GETPOST("nom", 'nohtml'), 'chaine', 0, '', $conf->entity); $s=$mysoc->state_id.':'.$mysoc->state_code.':'.$mysoc->state_label;
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_STATE", $s, 'chaine', 0, '', $conf->entity);
}
else
{
dolibarr_del_const($db, "MAIN_INFO_SOCIETE_STATE", $conf->entity);
}
$db->begin();
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", GETPOST("nom", 'nohtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS", GETPOST("MAIN_INFO_SOCIETE_ADDRESS", 'nohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS", GETPOST("MAIN_INFO_SOCIETE_ADDRESS", 'nohtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN", GETPOST("MAIN_INFO_SOCIETE_TOWN", 'nohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN", GETPOST("MAIN_INFO_SOCIETE_TOWN", 'nohtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP", GETPOST("MAIN_INFO_SOCIETE_ZIP", 'alpha'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP", GETPOST("MAIN_INFO_SOCIETE_ZIP", 'alpha'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_STATE", GETPOST("state_id", 'alpha'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_REGION", GETPOST("region_code", 'alpha'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_REGION", GETPOST("region_code", 'alpha'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_MONNAIE", GETPOST("currency", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MONNAIE", GETPOST("currency", 'aZ09'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TEL", GETPOST("tel", 'alpha'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TEL", GETPOST("tel", 'alpha'), 'chaine', 0, '', $conf->entity);
@ -375,7 +389,13 @@ if ($action == 'edit' || $action == 'updateedit')
print '<tr class="oddeven"><td><label for="state_id">'.$langs->trans("State").'</label></td><td class="maxwidthonsmartphone">'; print '<tr class="oddeven"><td><label for="state_id">'.$langs->trans("State").'</label></td><td class="maxwidthonsmartphone">';
$formcompany->select_departement($conf->global->MAIN_INFO_SOCIETE_STATE, $mysoc->country_code, 'state_id'); $state_id=0;
if (! empty($conf->global->MAIN_INFO_SOCIETE_STATE))
{
$tmp=explode(':', $conf->global->MAIN_INFO_SOCIETE_STATE);
$state_id=$tmp[0];
}
$formcompany->select_departement($state_id, $mysoc->country_code, 'state_id');
print '</td></tr>'."\n"; print '</td></tr>'."\n";
@ -764,8 +784,12 @@ else
if (! empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT)) print '<tr class="oddeven"><td>'.$langs->trans("Region-State").'</td><td>'; if (! empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT)) print '<tr class="oddeven"><td>'.$langs->trans("Region-State").'</td><td>';
else print '<tr class="oddeven"><td>'.$langs->trans("State").'</td><td>'; else print '<tr class="oddeven"><td>'.$langs->trans("State").'</td><td>';
if (! empty($conf->global->MAIN_INFO_SOCIETE_STATE)) print getState($conf->global->MAIN_INFO_SOCIETE_STATE, $conf->global->MAIN_SHOW_STATE_CODE, 0, $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT); if (! empty($conf->global->MAIN_INFO_SOCIETE_STATE))
else print '&nbsp;'; {
$tmp=explode(':', $conf->global->MAIN_INFO_SOCIETE_STATE);
$state_id=$tmp[0];
print getState($state_id, $conf->global->MAIN_SHOW_STATE_CODE, 0, $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT);
}
print '</td></tr>'; print '</td></tr>';

View File

@ -27,6 +27,7 @@
*/ */
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("admin", "stocks")); $langs->loadLangs(array("admin", "stocks"));
@ -77,6 +78,10 @@ llxHeader('', $langs->trans("StockSetup"));
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>'; $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("StockSetup"), $linkback, 'title_setup'); print load_fiche_titre($langs->trans("StockSetup"), $linkback, 'title_setup');
$head = stock_admin_prepare_head();
dol_fiche_head($head, 'general', $langs->trans("StockSetup"), -1, 'stock');
$form=new Form($db); $form=new Form($db);

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

@ -4,6 +4,7 @@
* Copyright (C) 2017 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2017 Neil Orley <neil.orley@oeris.fr> * Copyright (C) 2017 Neil Orley <neil.orley@oeris.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2019 Thibault FOUCART <support@ptibogxiv.net>
* *
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -448,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
@ -460,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)
{ {
@ -706,6 +717,127 @@ class Setup extends DolibarrApi
return $list; return $list;
} }
/**
* Get the list of shipping methods.
*
* @param int $limit Number of items per page
* @param int $page Page number {@min 0}
* @param int $active Shipping methodsm is active or not {@min 0} {@max 1}
* @param string $sqlfilters SQL criteria to filter. Syntax example "(t.code:=:'CHQ')"
*
* @url GET dictionary/shipping_methods
*
* @return array List of shipping methods
*
* @throws 400 RestException
* @throws 200 OK
*/
public function getShippingModes($limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
$sql = "SELECT rowid as id, code, libelle as label, description, tracking, module";
$sql.= " FROM ".MAIN_DB_PREFIX."c_shipment_mode as t";
$sql.= " WHERE t.entity IN (".getEntity('c_shipment_mode').")";
$sql.= " AND t.active = ".$active;
// Add sql filters
if ($sqlfilters)
{
if (! DolibarrApi::_checkFilters($sqlfilters))
{
throw new RestException(400, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
}
//$sql.= $this->db->order($sortfield, $sortorder);
if ($limit) {
if ($page < 0) {
$page = 0;
}
$offset = $limit * $page;
$sql .= $this->db->plimit($limit, $offset);
}
$result = $this->db->query($sql);
if ($result) {
$num = $this->db->num_rows($result);
$min = min($num, ($limit <= 0 ? $num : $limit));
for ($i = 0; $i < $min; $i++) {
$list[] = $this->db->fetch_object($result);
}
} else {
throw new RestException(400, $this->db->lasterror());
}
return $list;
}
/**
* Get the list of measuring units.
*
* @param string $sortfield Sort field
* @param string $sortorder Sort order
* @param int $limit Number of items per page
* @param int $page Page number (starting from zero)
* @param int $active Payment term is active or not {@min 0} {@max 1}
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
* @return List of events types
*
* @url GET dictionary/units
*
* @throws RestException
*/
public function getListOfMeasuringUnits($sortfield = "rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
//TODO link with multicurrency module
$sql = "SELECT t.rowid, t.code, t.label,t.short_label, t.active, t.scale, t.unit_type";
$sql.= " FROM ".MAIN_DB_PREFIX."c_units as t";
$sql.= " WHERE t.active = ".$active;
// Add sql filters
if ($sqlfilters)
{
if (! DolibarrApi::_checkFilters($sqlfilters))
{
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
}
$sql.= $this->db->order($sortfield, $sortorder);
if ($limit) {
if ($page < 0) {
$page = 0;
}
$offset = $limit * $page;
$sql .= $this->db->plimit($limit, $offset);
}
$result = $this->db->query($sql);
if ($result) {
$num = $this->db->num_rows($result);
$min = min($num, ($limit <= 0 ? $num : $limit));
for ($i = 0; $i < $min; $i++) {
$list[] = $this->db->fetch_object($result);
}
} else {
throw new RestException(503, 'Error when retrieving list of measuring units: '.$this->db->lasterror());
}
return $list;
}
/** /**
* Get the list of tickets categories. * Get the list of tickets categories.

View File

@ -39,6 +39,7 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
/** /**
* Empty header * Empty header
* *
* @ignore
* @return void * @return void
*/ */
function llxHeader() function llxHeader()
@ -48,9 +49,11 @@ function llxHeader()
print '<title>Asterisk redirection from Dolibarr...</title>'."\n"; print '<title>Asterisk redirection from Dolibarr...</title>'."\n";
print '</head>'."\n"; print '</head>'."\n";
} }
/** /**
* Empty footer * Empty footer
* *
* @ignore
* @return void * @return void
*/ */
function llxFooter() function llxFooter()

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

@ -3,6 +3,7 @@
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
* *
* 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
@ -37,6 +38,11 @@ if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn
if (! $user->rights->societe->lire) accessforbidden(); if (! $user->rights->societe->lire) accessforbidden();
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('commercialindex'));
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("commercial", "propal")); $langs->loadLangs(array("commercial", "propal"));
@ -897,6 +903,9 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
print '</div></div></div>'; print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardCommercials', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page // End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
* *
* 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
@ -27,6 +28,11 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT .'/comm/mailing/class/mailing.class.php'; require_once DOL_DOCUMENT_ROOT .'/comm/mailing/class/mailing.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('mailingindex'));
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('commercial', 'orders')); $langs->loadLangs(array('commercial', 'orders'));
@ -207,6 +213,9 @@ if ($langs->file_exists("html/spam.html", 0)) {
print '<br>'; print '<br>';
} }
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardEmailings', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page // End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

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

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
* *
* 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
@ -27,6 +28,11 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT .'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT .'/comm/propal/class/propal.class.php';
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('proposalindex'));
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('propal', 'companies')); $langs->loadLangs(array('propal', 'companies'));
@ -540,6 +546,9 @@ if (! empty($conf->propal->enabled))
//print '</td></tr></table>'; //print '</td></tr></table>';
print '</div></div></div>'; print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardPropals', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page // End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -162,6 +162,8 @@ $arrayfields=array(
'p.total_ht'=>array('label'=>"AmountHT", 'checked'=>1), 'p.total_ht'=>array('label'=>"AmountHT", 'checked'=>1),
'p.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0), 'p.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0),
'p.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0), 'p.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0),
'p.total_ht_invoiced'=>array('label'=>$langs->trans("AmountInvoicedHT"), 'checked'=>0, 'enabled'=>$conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT),
'p.total_invoiced'=>array('label'=>$langs->trans("AmountInvoicedTTC"), 'checked'=>0, 'enabled'=>$conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT),
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10), 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10),
'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>1), 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>1),
'p.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), 'p.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
@ -644,6 +646,18 @@ if ($resql)
print '<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).'">'; print '<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).'">';
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['p.total_ht_invoiced']['checked']))
{
// Amount invoiced
print '<td class="liste_titre right">';
print '</td>';
}
if (! empty($arrayfields['p.total_invoiced']['checked']))
{
// Amount invoiced
print '<td class="liste_titre right">';
print '</td>';
}
if (! empty($arrayfields['u.login']['checked'])) if (! empty($arrayfields['u.login']['checked']))
{ {
// Author // Author
@ -709,6 +723,8 @@ if ($resql)
if (! empty($arrayfields['p.total_ht']['checked'])) print_liste_field_titre($arrayfields['p.total_ht']['label'], $_SERVER["PHP_SELF"], 'p.total_ht', '', $param, 'class="right"', $sortfield, $sortorder); if (! empty($arrayfields['p.total_ht']['checked'])) print_liste_field_titre($arrayfields['p.total_ht']['label'], $_SERVER["PHP_SELF"], 'p.total_ht', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['p.total_vat']['checked'])) print_liste_field_titre($arrayfields['p.total_vat']['label'], $_SERVER["PHP_SELF"], 'p.tva', '', $param, 'class="right"', $sortfield, $sortorder); if (! empty($arrayfields['p.total_vat']['checked'])) print_liste_field_titre($arrayfields['p.total_vat']['label'], $_SERVER["PHP_SELF"], 'p.tva', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['p.total_ttc']['checked'])) print_liste_field_titre($arrayfields['p.total_ttc']['label'], $_SERVER["PHP_SELF"], 'p.total', '', $param, 'class="right"', $sortfield, $sortorder); if (! empty($arrayfields['p.total_ttc']['checked'])) print_liste_field_titre($arrayfields['p.total_ttc']['label'], $_SERVER["PHP_SELF"], 'p.total', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['p.total_ht_invoiced']['checked'])) print_liste_field_titre($arrayfields['p.total_ht_invoiced']['label'], $_SERVER["PHP_SELF"], '', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['p.total_invoiced']['checked'])) print_liste_field_titre($arrayfields['p.total_invoiced']['label'], $_SERVER["PHP_SELF"], '', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['sale_representative']['checked'])) print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", "$param", '', $sortfield, $sortorder); if (! empty($arrayfields['sale_representative']['checked'])) print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", "$param", '', $sortfield, $sortorder);
// Extra fields // Extra fields
@ -933,6 +949,48 @@ if ($resql)
if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield']; if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield'];
$totalarray['totalttc'] += $obj->total_ttc; $totalarray['totalttc'] += $obj->total_ttc;
} }
// Amount invoiced
if(! empty($arrayfields['p.total_ht_invoiced']['checked'])) {
$totalInvoiced = 0;
$p = new Propal($db);
$TInvoiceData = $p->InvoiceArrayList($obj->rowid);
if(! empty($TInvoiceData)) {
foreach($TInvoiceData as $invoiceData) {
$invoice = new Facture($db);
$invoice->fetch($invoiceData->facid);
if(! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS) && $invoice->type == Facture::TYPE_DEPOSIT) continue;
$totalInvoiced += $invoice->total_ht;
}
}
print '<td class="right">'.price($totalInvoiced)."</td>\n";
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalhtinvoicedfield']=$totalarray['nbfield'];
$totalarray['totalhtinvoiced'] += $totalInvoiced;
}
// Amount invoiced
if(! empty($arrayfields['p.total_invoiced']['checked'])) {
$totalInvoiced = 0;
$p = new Propal($db);
$TInvoiceData = $p->InvoiceArrayList($obj->rowid);
if(! empty($TInvoiceData)) {
foreach($TInvoiceData as $invoiceData) {
$invoice = new Facture($db);
$invoice->fetch($invoiceData->facid);
if(! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS) && $invoice->type == Facture::TYPE_DEPOSIT) continue;
$totalInvoiced += $invoice->total_ttc;
}
}
print '<td class="right">'.price($totalInvoiced)."</td>\n";
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalinvoicedfield']=$totalarray['nbfield'];
$totalarray['totalinvoiced'] += $totalInvoiced;
}
$userstatic->id=$obj->fk_user_author; $userstatic->id=$obj->fk_user_author;
$userstatic->login=$obj->login; $userstatic->login=$obj->login;
@ -1059,6 +1117,8 @@ if ($resql)
elseif ($totalarray['totalhtfield'] == $i) print '<td class="right">'.price($totalarray['totalht']).'</td>'; elseif ($totalarray['totalhtfield'] == $i) print '<td class="right">'.price($totalarray['totalht']).'</td>';
elseif ($totalarray['totalvatfield'] == $i) print '<td class="right">'.price($totalarray['totalvat']).'</td>'; elseif ($totalarray['totalvatfield'] == $i) print '<td class="right">'.price($totalarray['totalvat']).'</td>';
elseif ($totalarray['totalttcfield'] == $i) print '<td class="right">'.price($totalarray['totalttc']).'</td>'; elseif ($totalarray['totalttcfield'] == $i) print '<td class="right">'.price($totalarray['totalttc']).'</td>';
elseif ($totalarray['totalhtinvoicedfield'] == $i) print '<td class="right">'.price($totalarray['totalhtinvoiced']).'</td>';
elseif ($totalarray['totalinvoicedfield'] == $i) print '<td class="right">'.price($totalarray['totalinvoiced']).'</td>';
elseif ($totalarray['totalizable']) { elseif ($totalarray['totalizable']) {
$printed = false; $printed = false;
foreach ($totalarray['totalizable'] as $totalizable) { foreach ($totalarray['totalizable'] as $totalizable) {

View File

@ -110,7 +110,6 @@ $mesg = $px1->isGraphKo();
if (! $mesg) if (! $mesg)
{ {
$px1->SetData($data); $px1->SetData($data);
$px1->SetPrecisionY(0);
$i=$startyear;$legend=array(); $i=$startyear;$legend=array();
while ($i <= $endyear) while ($i <= $endyear)
{ {
@ -125,7 +124,6 @@ if (! $mesg)
$px1->SetYLabel($langs->trans("NbOfProposals")); $px1->SetYLabel($langs->trans("NbOfProposals"));
$px1->SetShading(3); $px1->SetShading(3);
$px1->SetHorizTickIncrement(1); $px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->mode='depth'; $px1->mode='depth';
$px1->SetTitle($langs->trans("NumberOfProposalsByMonth")); $px1->SetTitle($langs->trans("NumberOfProposalsByMonth"));
@ -152,7 +150,6 @@ $mesg = $px2->isGraphKo();
if (! $mesg) if (! $mesg)
{ {
$px2->SetData($data); $px2->SetData($data);
$px2->SetPrecisionY(0);
$i=$startyear;$legend=array(); $i=$startyear;$legend=array();
while ($i <= $endyear) while ($i <= $endyear)
{ {
@ -167,7 +164,6 @@ if (! $mesg)
$px2->SetYLabel($langs->trans("AmountOfProposals")); $px2->SetYLabel($langs->trans("AmountOfProposals"));
$px2->SetShading(3); $px2->SetShading(3);
$px2->SetHorizTickIncrement(1); $px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->mode='depth'; $px2->mode='depth';
$px2->SetTitle($langs->trans("AmountOfProposalsByMonthHT")); $px2->SetTitle($langs->trans("AmountOfProposalsByMonthHT"));
@ -209,7 +205,6 @@ if (! $mesg)
$px3->SetHeight($HEIGHT); $px3->SetHeight($HEIGHT);
$px3->SetShading(3); $px3->SetShading(3);
$px3->SetHorizTickIncrement(1); $px3->SetHorizTickIncrement(1);
$px3->SetPrecisionY(0);
$px3->mode='depth'; $px3->mode='depth';
$px3->SetTitle($langs->trans("AmountAverage")); $px3->SetTitle($langs->trans("AmountAverage"));

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

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
* *
* 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
@ -31,6 +32,11 @@ require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php';
if (!$user->rights->commande->lire) accessforbidden(); if (!$user->rights->commande->lire) accessforbidden();
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('ordersindex'));
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('orders', 'bills')); $langs->loadLangs(array('orders', 'bills'));
@ -478,6 +484,8 @@ if (! empty($conf->commande->enabled))
print '</div></div></div>'; print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardOrders', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -119,7 +119,6 @@ $mesg = $px1->isGraphKo();
if (! $mesg) if (! $mesg)
{ {
$px1->SetData($data); $px1->SetData($data);
$px1->SetPrecisionY(0);
$i=$startyear;$legend=array(); $i=$startyear;$legend=array();
while ($i <= $endyear) while ($i <= $endyear)
{ {
@ -134,7 +133,6 @@ if (! $mesg)
$px1->SetYLabel($langs->trans("NbOfOrder")); $px1->SetYLabel($langs->trans("NbOfOrder"));
$px1->SetShading(3); $px1->SetShading(3);
$px1->SetHorizTickIncrement(1); $px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->mode='depth'; $px1->mode='depth';
$px1->SetTitle($langs->trans("NumberOfOrdersByMonth")); $px1->SetTitle($langs->trans("NumberOfOrdersByMonth"));
@ -178,7 +176,6 @@ if (! $mesg)
$px2->SetYLabel($langs->trans("AmountOfOrders")); $px2->SetYLabel($langs->trans("AmountOfOrders"));
$px2->SetShading(3); $px2->SetShading(3);
$px2->SetHorizTickIncrement(1); $px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->mode='depth'; $px2->mode='depth';
$px2->SetTitle($langs->trans("AmountOfOrdersByMonthHT")); $px2->SetTitle($langs->trans("AmountOfOrdersByMonthHT"));
@ -220,7 +217,6 @@ if (! $mesg)
$px3->SetHeight($HEIGHT); $px3->SetHeight($HEIGHT);
$px3->SetShading(3); $px3->SetShading(3);
$px3->SetHorizTickIncrement(1); $px3->SetHorizTickIncrement(1);
$px3->SetPrecisionY(0);
$px3->mode='depth'; $px3->mode='depth';
$px3->SetTitle($langs->trans("AmountAverage")); $px3->SetTitle($langs->trans("AmountAverage"));

View File

@ -384,7 +384,6 @@ else
$px1->setBgColor('onglet'); $px1->setBgColor('onglet');
$px1->setBgColorGrid(array(255,255,255)); $px1->setBgColorGrid(array(255,255,255));
$px1->SetHorizTickIncrement(1); $px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->draw($file, $fileurl); $px1->draw($file, $fileurl);
$show1 = $px1->show(); $show1 = $px1->show();
@ -471,7 +470,6 @@ else
$px2->setBgColor('onglet'); $px2->setBgColor('onglet');
$px2->setBgColorGrid(array(255,255,255)); $px2->setBgColorGrid(array(255,255,255));
$px2->SetHorizTickIncrement(1); $px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->draw($file, $fileurl); $px2->draw($file, $fileurl);
$show2 = $px2->show(); $show2 = $px2->show();

View File

@ -252,7 +252,6 @@ else
$px1->setBgColor('onglet'); $px1->setBgColor('onglet');
$px1->setBgColorGrid(array(255,255,255)); $px1->setBgColorGrid(array(255,255,255));
$px1->SetHorizTickIncrement(1); $px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->draw($file, $fileurl); $px1->draw($file, $fileurl);
$show1=$px1->show(); $show1=$px1->show();
@ -389,7 +388,6 @@ else
$px2->setBgColorGrid(array(255,255,255)); $px2->setBgColorGrid(array(255,255,255));
$px2->SetHideXGrid(true); $px2->SetHideXGrid(true);
//$px2->SetHorizTickIncrement(30.41); // 30.41 jours/mois en moyenne //$px2->SetHorizTickIncrement(30.41); // 30.41 jours/mois en moyenne
$px2->SetPrecisionY(0);
$px2->draw($file, $fileurl); $px2->draw($file, $fileurl);
$show2=$px2->show(); $show2=$px2->show();
@ -503,7 +501,6 @@ else
$px3->SetType(array('linesnopoint','linesnopoint','linesnopoint')); $px3->SetType(array('linesnopoint','linesnopoint','linesnopoint'));
$px3->setBgColor('onglet'); $px3->setBgColor('onglet');
$px3->setBgColorGrid(array(255,255,255)); $px3->setBgColorGrid(array(255,255,255));
$px3->SetPrecisionY(0);
$px3->draw($file, $fileurl); $px3->draw($file, $fileurl);
$show3=$px3->show(); $show3=$px3->show();
@ -633,7 +630,6 @@ else
$px4->setBgColor('onglet'); $px4->setBgColor('onglet');
$px4->setBgColorGrid(array(255,255,255)); $px4->setBgColorGrid(array(255,255,255));
$px4->SetHorizTickIncrement(1); $px4->SetHorizTickIncrement(1);
$px4->SetPrecisionY(0);
$px4->draw($file, $fileurl); $px4->draw($file, $fileurl);
$show4=$px4->show(); $show4=$px4->show();
@ -742,7 +738,6 @@ else
$px5->setBgColor('onglet'); $px5->setBgColor('onglet');
$px5->setBgColorGrid(array(255,255,255)); $px5->setBgColorGrid(array(255,255,255));
$px5->SetHorizTickIncrement(1); $px5->SetHorizTickIncrement(1);
$px5->SetPrecisionY(0);
$px5->draw($file, $fileurl); $px5->draw($file, $fileurl);
$show5=$px5->show(); $show5=$px5->show();

View File

@ -3,8 +3,9 @@
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
* *
* 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
@ -34,6 +35,12 @@ require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('specialexpensesindex'));
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('compta', 'bills')); $langs->loadLangs(array('compta', 'bills'));
@ -568,6 +575,9 @@ if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
print '</form>'; print '</form>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardSpecialBills', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page // End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -107,7 +107,6 @@ $mesg = $px1->isGraphKo();
if (! $mesg) if (! $mesg)
{ {
$px1->SetData($data); $px1->SetData($data);
$px1->SetPrecisionY(0);
$i=$startyear;$legend=array(); $i=$startyear;$legend=array();
while ($i <= $endyear) while ($i <= $endyear)
{ {
@ -121,7 +120,6 @@ if (! $mesg)
$px1->SetYLabel($langs->trans("Number")); $px1->SetYLabel($langs->trans("Number"));
$px1->SetShading(3); $px1->SetShading(3);
$px1->SetHorizTickIncrement(1); $px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->mode='depth'; $px1->mode='depth';
$px1->SetTitle($langs->trans("NumberByMonth")); $px1->SetTitle($langs->trans("NumberByMonth"));
@ -155,7 +153,6 @@ if (! $mesg)
$px2->SetYLabel($langs->trans("Amount")); $px2->SetYLabel($langs->trans("Amount"));
$px2->SetShading(3); $px2->SetShading(3);
$px2->SetHorizTickIncrement(1); $px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->mode='depth'; $px2->mode='depth';
$px2->SetTitle($langs->trans("AmountTotal")); $px2->SetTitle($langs->trans("AmountTotal"));
@ -197,7 +194,6 @@ if (! $mesg)
$px3->SetHeight($HEIGHT); $px3->SetHeight($HEIGHT);
$px3->SetShading(3); $px3->SetShading(3);
$px3->SetHorizTickIncrement(1); $px3->SetHorizTickIncrement(1);
$px3->SetPrecisionY(0);
$px3->mode='depth'; $px3->mode='depth';
$px3->SetTitle($langs->trans("AmountAverage")); $px3->SetTitle($langs->trans("AmountAverage"));

View File

@ -181,7 +181,8 @@ if (empty($reshook))
// Change status of invoice // Change status of invoice
elseif ($action == 'reopen' && $usercancreate) { elseif ($action == 'reopen' && $usercancreate) {
$result = $object->fetch($id); $result = $object->fetch($id);
if ($object->statut == 2 || ($object->statut == 3 && $object->close_code != 'replaced') || ($object->statut == 1 && $object->paye == 1)) { // ($object->statut == 1 && $object->paye == 1) should not happened but can be found when data are corrupted
if ($object->statut == Facture::STATUS_CLOSED || ($object->statut == Facture::STATUS_ABANDONED && ($object->close_code != 'replaced' || $object->getIdReplacingInvoice() == 0)) || ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 1)) { // ($object->statut == 1 && $object->paye == 1) should not happened but can be found when data are corrupted
$result = $object->set_unpaid($user); $result = $object->set_unpaid($user);
if ($result > 0) { if ($result > 0) {
header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $id); header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $id);
@ -1295,7 +1296,6 @@ if (empty($reshook))
$TTotalByTva[$line->tva_tx] += $line->total_ttc ; $TTotalByTva[$line->tva_tx] += $line->total_ttc ;
} }
$amount_to_diff = 0;
foreach ($TTotalByTva as $tva => &$total) foreach ($TTotalByTva as $tva => &$total)
{ {
$coef = $total / $srcobject->total_ttc; // Calc coef $coef = $total / $srcobject->total_ttc; // Calc coef
@ -2973,21 +2973,24 @@ if ($action == 'create')
} }
else else
{ {
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">'; if (! empty($conf->global->INVOICE_USE_SITUATION))
$tmp='<input type="radio" name="type" id="radio_situation" value="0" disabled> '; {
$text = '<label>'.$tmp.$langs->trans("InvoiceFirstSituationAsk") . '</label> '; print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
$text.= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; $tmp='<input type="radio" name="type" id="radio_situation" value="0" disabled> ';
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3); $text = '<label>'.$tmp.$langs->trans("InvoiceFirstSituationAsk") . '</label> ';
print $desc; $text.= '('.$langs->trans("YouMustCreateInvoiceFromThird").') ';
print '</div></div>'; $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3);
print $desc;
print '</div></div>';
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">'; print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
$tmp='<input type="radio" name="type" id="radio_situation" value="0" disabled> '; $tmp='<input type="radio" name="type" id="radio_situation" value="0" disabled> ';
$text = '<label>'.$tmp.$langs->trans("InvoiceSituationAsk") . '</label> '; $text = '<label>'.$tmp.$langs->trans("InvoiceSituationAsk") . '</label> ';
$text.= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; $text.= '('.$langs->trans("YouMustCreateInvoiceFromThird").') ';
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3); $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3);
print $desc; print $desc;
print '</div></div>'; print '</div></div>';
}
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">'; print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
$tmp='<input type="radio" name="type" id="radio_replacement" value="0" disabled> '; $tmp='<input type="radio" name="type" id="radio_replacement" value="0" disabled> ';
@ -3172,7 +3175,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');
@ -4008,7 +4011,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
{ {
@ -4651,7 +4654,7 @@ elseif ($id > 0 || ! empty($ref))
&& ($object->statut == 2 || $object->statut == 3 || ($object->statut == 1 && $object->paye == 1)) // Condition ($object->statut == 1 && $object->paye == 1) should not happened but can be found due to corrupted data && ($object->statut == 2 || $object->statut == 3 || ($object->statut == 1 && $object->paye == 1)) // Condition ($object->statut == 1 && $object->paye == 1) should not happened but can be found due to corrupted data
&& ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || $usercanreopen)) // A paid invoice (partially or completely) && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || $usercanreopen)) // A paid invoice (partially or completely)
{ {
if (! $objectidnext && $object->close_code != 'replaced') // Not replaced by another invoice if ($object->close_code != 'replaced' || (! $objectidnext)) // Not replaced by another invoice or replaced but the replacement invoice has been deleted
{ {
print '<div class="inline-block divButAction"><a class="butAction'.($conf->use_javascript_ajax?' reposition':'').'" href="' . $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&amp;action=reopen">' . $langs->trans('ReOpen') . '</a></div>'; print '<div class="inline-block divButAction"><a class="butAction'.($conf->use_javascript_ajax?' reposition':'').'" href="' . $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&amp;action=reopen">' . $langs->trans('ReOpen') . '</a></div>';
} 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

@ -1298,6 +1298,7 @@ if ($resql)
$filedir=$diroutputmassaction; $filedir=$diroutputmassaction;
$genallowed=$user->rights->facture->lire; $genallowed=$user->rights->facture->lire;
$delallowed=$user->rights->facture->creer; $delallowed=$user->rights->facture->creer;
$title = '';
print $formfile->showdocuments('massfilesarea_invoices', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); print $formfile->showdocuments('massfilesarea_invoices', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
} }

View File

@ -103,7 +103,6 @@ $mesg = $px1->isGraphKo();
if (! $mesg) if (! $mesg)
{ {
$px1->SetData($data); $px1->SetData($data);
$px1->SetPrecisionY(0);
$i=$startyear;$legend=array(); $i=$startyear;$legend=array();
while ($i <= $endyear) while ($i <= $endyear)
{ {
@ -117,7 +116,6 @@ if (! $mesg)
$px1->SetYLabel($langs->trans("NumberOfBills")); $px1->SetYLabel($langs->trans("NumberOfBills"));
$px1->SetShading(3); $px1->SetShading(3);
$px1->SetHorizTickIncrement(1); $px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->mode='depth'; $px1->mode='depth';
$px1->SetTitle($langs->trans("NumberOfBillsByMonth")); $px1->SetTitle($langs->trans("NumberOfBillsByMonth"));
@ -152,7 +150,6 @@ if (! $mesg)
$px2->SetYLabel($langs->trans("AmountOfBills")); $px2->SetYLabel($langs->trans("AmountOfBills"));
$px2->SetShading(3); $px2->SetShading(3);
$px2->SetHorizTickIncrement(1); $px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->mode='depth'; $px2->mode='depth';
$px2->SetTitle($langs->trans("AmountOfBillsByMonthHT")); $px2->SetTitle($langs->trans("AmountOfBillsByMonthHT"));
@ -194,7 +191,6 @@ if (! $mesg)
$px3->SetHeight($HEIGHT); $px3->SetHeight($HEIGHT);
$px3->SetShading(3); $px3->SetShading(3);
$px3->SetHorizTickIncrement(1); $px3->SetHorizTickIncrement(1);
$px3->SetPrecisionY(0);
$px3->mode='depth'; $px3->mode='depth';
$px3->SetTitle($langs->trans("AmountAverage")); $px3->SetTitle($langs->trans("AmountAverage"));

View File

@ -2,10 +2,11 @@
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2015 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015-2016 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2015-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
* *
* 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
@ -63,6 +64,7 @@ if ($user->societe_id > 0)
$max=3; $max=3;
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('invoiceindex')); $hookmanager->initHooks(array('invoiceindex'));
/* /*
@ -1080,6 +1082,9 @@ if ($resql)
print '</div></div></div>'; print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardAccountancy', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page // End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -83,7 +83,6 @@ $mesg = $px1->isGraphKo();
if (! $mesg) if (! $mesg)
{ {
$px1->SetData($data); $px1->SetData($data);
$px1->SetPrecisionY(0);
$i=$startyear;$legend=array(); $i=$startyear;$legend=array();
while ($i <= $endyear) while ($i <= $endyear)
{ {
@ -97,7 +96,6 @@ if (! $mesg)
$px1->SetYLabel($langs->trans("Number")); $px1->SetYLabel($langs->trans("Number"));
$px1->SetShading(3); $px1->SetShading(3);
$px1->SetHorizTickIncrement(1); $px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->mode='depth'; $px1->mode='depth';
$px1->SetTitle($langs->trans("NumberByMonth")); $px1->SetTitle($langs->trans("NumberByMonth"));
@ -131,7 +129,6 @@ if (! $mesg)
$px2->SetYLabel($langs->trans("Amount")); $px2->SetYLabel($langs->trans("Amount"));
$px2->SetShading(3); $px2->SetShading(3);
$px2->SetHorizTickIncrement(1); $px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->mode='depth'; $px2->mode='depth';
$px2->SetTitle($langs->trans("AmountTotal")); $px2->SetTitle($langs->trans("AmountTotal"));
@ -163,7 +160,6 @@ if (! $mesg)
$px3->SetHeight($HEIGHT); $px3->SetHeight($HEIGHT);
$px3->SetShading(3); $px3->SetShading(3);
$px3->SetHorizTickIncrement(1); $px3->SetHorizTickIncrement(1);
$px3->SetPrecisionY(0);
$px3->mode='depth'; $px3->mode='depth';
$px3->SetTitle($langs->trans("AmountAverage")); $px3->SetTitle($langs->trans("AmountAverage"));

View File

@ -9,6 +9,7 @@
* Copyright (C) 2013 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2013 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
* *
* 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
@ -520,7 +521,7 @@ class Contact extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/** /**
* Initialise tableau info (tableau des attributs LDAP) * Initialise tableau info (tableau des attributs LDAP)
* *

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

@ -3,6 +3,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
* *
* 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
@ -28,6 +29,11 @@ require "../main.inc.php";
require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"; require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php";
require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php"; require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('contractindex'));
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('products', 'companies', 'contracts')); $langs->loadLangs(array('products', 'companies', 'contracts'));
@ -609,6 +615,8 @@ else
//print '</td></tr></table>'; //print '</td></tr></table>';
print '</div></div></div>'; print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardContracts', $parameters, $object); // Note that $action and $object may have been modified by hook
llxFooter(); llxFooter();

View File

@ -27,7 +27,7 @@ $maxsizestring=255;
$maxsizeint=10; $maxsizeint=10;
$mesg=array(); $mesg=array();
$extrasize=GETPOST('size', 'int'); $extrasize=GETPOST('size', 'intcomma');
$type=GETPOST('type', 'alpha'); $type=GETPOST('type', 'alpha');
$param=GETPOST('param', 'alpha'); $param=GETPOST('param', 'alpha');

View File

@ -143,7 +143,6 @@ class box_graph_invoices_permonth extends ModeleBoxes
$px1->SetData($data1); $px1->SetData($data1);
unset($data1); unset($data1);
$px1->SetPrecisionY(0);
$i=$startyear;$legend=array(); $i=$startyear;$legend=array();
while ($i <= $endyear) while ($i <= $endyear)
{ {
@ -157,7 +156,6 @@ class box_graph_invoices_permonth extends ModeleBoxes
$px1->SetYLabel($langs->trans("NumberOfBills")); $px1->SetYLabel($langs->trans("NumberOfBills"));
$px1->SetShading(3); $px1->SetShading(3);
$px1->SetHorizTickIncrement(1); $px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->SetCssPrefix("cssboxes"); $px1->SetCssPrefix("cssboxes");
$px1->mode='depth'; $px1->mode='depth';
$px1->SetTitle($langs->trans("NumberOfBillsByMonth")); $px1->SetTitle($langs->trans("NumberOfBillsByMonth"));
@ -183,7 +181,6 @@ class box_graph_invoices_permonth extends ModeleBoxes
$px2->SetData($data2); $px2->SetData($data2);
unset($data2); unset($data2);
$px2->SetPrecisionY(0);
$i=$startyear;$legend=array(); $i=$startyear;$legend=array();
while ($i <= $endyear) while ($i <= $endyear)
{ {
@ -197,7 +194,6 @@ class box_graph_invoices_permonth extends ModeleBoxes
$px2->SetYLabel($langs->trans("AmountOfBillsHT")); $px2->SetYLabel($langs->trans("AmountOfBillsHT"));
$px2->SetShading(3); $px2->SetShading(3);
$px2->SetHorizTickIncrement(1); $px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->SetCssPrefix("cssboxes"); $px2->SetCssPrefix("cssboxes");
$px2->mode='depth'; $px2->mode='depth';
$px2->SetTitle($langs->trans("AmountOfBillsByMonthHT")); $px2->SetTitle($langs->trans("AmountOfBillsByMonthHT"));

View File

@ -140,7 +140,6 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
$px1->SetData($data1); $px1->SetData($data1);
unset($data1); unset($data1);
$px1->SetPrecisionY(0);
$i=$startyear;$legend=array(); $i=$startyear;$legend=array();
while ($i <= $endyear) while ($i <= $endyear)
{ {
@ -154,7 +153,6 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
$px1->SetYLabel($langs->trans("NumberOfBills")); $px1->SetYLabel($langs->trans("NumberOfBills"));
$px1->SetShading(3); $px1->SetShading(3);
$px1->SetHorizTickIncrement(1); $px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->SetCssPrefix("cssboxes"); $px1->SetCssPrefix("cssboxes");
$px1->mode='depth'; $px1->mode='depth';
$px1->SetTitle($langs->trans("NumberOfBillsByMonth")); $px1->SetTitle($langs->trans("NumberOfBillsByMonth"));
@ -180,7 +178,6 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
$px2->SetData($data2); $px2->SetData($data2);
unset($data2); unset($data2);
$px2->SetPrecisionY(0);
$i=$startyear;$legend=array(); $i=$startyear;$legend=array();
while ($i <= $endyear) while ($i <= $endyear)
{ {
@ -194,7 +191,6 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
$px2->SetYLabel($langs->trans("AmountOfBillsHT")); $px2->SetYLabel($langs->trans("AmountOfBillsHT"));
$px2->SetShading(3); $px2->SetShading(3);
$px2->SetHorizTickIncrement(1); $px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->SetCssPrefix("cssboxes"); $px2->SetCssPrefix("cssboxes");
$px2->mode='depth'; $px2->mode='depth';
$px2->SetTitle($langs->trans("AmountOfBillsByMonthHT")); $px2->SetTitle($langs->trans("AmountOfBillsByMonthHT"));

View File

@ -141,7 +141,6 @@ class box_graph_orders_permonth extends ModeleBoxes
{ {
$px1->SetData($data1); $px1->SetData($data1);
unset($data1); unset($data1);
$px1->SetPrecisionY(0);
$i=$startyear;$legend=array(); $i=$startyear;$legend=array();
while ($i <= $endyear) while ($i <= $endyear)
{ {
@ -155,7 +154,6 @@ class box_graph_orders_permonth extends ModeleBoxes
$px1->SetYLabel($langs->trans("NumberOfOrders")); $px1->SetYLabel($langs->trans("NumberOfOrders"));
$px1->SetShading(3); $px1->SetShading(3);
$px1->SetHorizTickIncrement(1); $px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->SetCssPrefix("cssboxes"); $px1->SetCssPrefix("cssboxes");
$px1->mode='depth'; $px1->mode='depth';
$px1->SetTitle($langs->trans("NumberOfOrdersByMonth")); $px1->SetTitle($langs->trans("NumberOfOrdersByMonth"));
@ -179,7 +177,6 @@ class box_graph_orders_permonth extends ModeleBoxes
{ {
$px2->SetData($data2); $px2->SetData($data2);
unset($data2); unset($data2);
$px2->SetPrecisionY(0);
$i=$startyear;$legend=array(); $i=$startyear;$legend=array();
while ($i <= $endyear) while ($i <= $endyear)
{ {
@ -193,7 +190,6 @@ class box_graph_orders_permonth extends ModeleBoxes
$px2->SetYLabel($langs->trans("AmountOfOrdersHT")); $px2->SetYLabel($langs->trans("AmountOfOrdersHT"));
$px2->SetShading(3); $px2->SetShading(3);
$px2->SetHorizTickIncrement(1); $px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->SetCssPrefix("cssboxes"); $px2->SetCssPrefix("cssboxes");
$px2->mode='depth'; $px2->mode='depth';
$px2->SetTitle($langs->trans("AmountOfOrdersByMonthHT")); $px2->SetTitle($langs->trans("AmountOfOrdersByMonthHT"));

View File

@ -140,7 +140,6 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
{ {
$px1->SetData($data1); $px1->SetData($data1);
unset($data1); unset($data1);
$px1->SetPrecisionY(0);
$i=$startyear;$legend=array(); $i=$startyear;$legend=array();
while ($i <= $endyear) while ($i <= $endyear)
{ {
@ -154,7 +153,6 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
$px1->SetYLabel($langs->trans("NumberOfOrders")); $px1->SetYLabel($langs->trans("NumberOfOrders"));
$px1->SetShading(3); $px1->SetShading(3);
$px1->SetHorizTickIncrement(1); $px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->SetCssPrefix("cssboxes"); $px1->SetCssPrefix("cssboxes");
$px1->mode='depth'; $px1->mode='depth';
$px1->SetTitle($langs->trans("NumberOfOrdersByMonth")); $px1->SetTitle($langs->trans("NumberOfOrdersByMonth"));
@ -178,7 +176,6 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
{ {
$px2->SetData($data2); $px2->SetData($data2);
unset($data2); unset($data2);
$px2->SetPrecisionY(0);
$i=$startyear;$legend=array(); $i=$startyear;$legend=array();
while ($i <= $endyear) while ($i <= $endyear)
{ {
@ -192,7 +189,6 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
$px2->SetYLabel($langs->trans("AmountOfOrdersHT")); $px2->SetYLabel($langs->trans("AmountOfOrdersHT"));
$px2->SetShading(3); $px2->SetShading(3);
$px2->SetHorizTickIncrement(1); $px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->SetCssPrefix("cssboxes"); $px2->SetCssPrefix("cssboxes");
$px2->mode='depth'; $px2->mode='depth';
$px2->SetTitle($langs->trans("AmountOfOrdersByMonthHT")); $px2->SetTitle($langs->trans("AmountOfOrdersByMonthHT"));

View File

@ -171,7 +171,6 @@ class box_graph_product_distribution extends ModeleBoxes
unset($data1); unset($data1);
if ($nocolor) $px1->SetDataColor(array(array(220,220,220))); if ($nocolor) $px1->SetDataColor(array(array(220,220,220)));
$px1->SetPrecisionY(0);
$px1->SetLegend($legend); $px1->SetLegend($legend);
$px1->setShowLegend(0); $px1->setShowLegend(0);
$px1->setShowPointValue($showpointvalue); $px1->setShowPointValue($showpointvalue);
@ -182,7 +181,6 @@ class box_graph_product_distribution extends ModeleBoxes
//$px1->SetYLabel($langs->trans("NumberOfBills")); //$px1->SetYLabel($langs->trans("NumberOfBills"));
$px1->SetShading(3); $px1->SetShading(3);
$px1->SetHorizTickIncrement(1); $px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->SetCssPrefix("cssboxes"); $px1->SetCssPrefix("cssboxes");
//$px1->mode='depth'; //$px1->mode='depth';
$px1->SetType(array('pie')); $px1->SetType(array('pie'));
@ -231,7 +229,6 @@ class box_graph_product_distribution extends ModeleBoxes
unset($data2); unset($data2);
if ($nocolor) $px2->SetDataColor(array(array(220,220,220))); if ($nocolor) $px2->SetDataColor(array(array(220,220,220)));
$px2->SetPrecisionY(0);
$px2->SetLegend($legend); $px2->SetLegend($legend);
$px2->setShowLegend(0); $px2->setShowLegend(0);
$px2->setShowPointValue($showpointvalue); $px2->setShowPointValue($showpointvalue);
@ -242,7 +239,6 @@ class box_graph_product_distribution extends ModeleBoxes
//$px2->SetYLabel($langs->trans("AmountOfBillsHT")); //$px2->SetYLabel($langs->trans("AmountOfBillsHT"));
$px2->SetShading(3); $px2->SetShading(3);
$px2->SetHorizTickIncrement(1); $px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->SetCssPrefix("cssboxes"); $px2->SetCssPrefix("cssboxes");
//$px2->mode='depth'; //$px2->mode='depth';
$px2->SetType(array('pie')); $px2->SetType(array('pie'));
@ -292,7 +288,6 @@ class box_graph_product_distribution extends ModeleBoxes
unset($data3); unset($data3);
if ($nocolor) $px3->SetDataColor(array(array(220,220,220))); if ($nocolor) $px3->SetDataColor(array(array(220,220,220)));
$px3->SetPrecisionY(0);
$px3->SetLegend($legend); $px3->SetLegend($legend);
$px3->setShowLegend(0); $px3->setShowLegend(0);
$px3->setShowPointValue($showpointvalue); $px3->setShowPointValue($showpointvalue);
@ -303,7 +298,6 @@ class box_graph_product_distribution extends ModeleBoxes
//$px3->SetYLabel($langs->trans("AmountOfBillsHT")); //$px3->SetYLabel($langs->trans("AmountOfBillsHT"));
$px3->SetShading(3); $px3->SetShading(3);
$px3->SetHorizTickIncrement(1); $px3->SetHorizTickIncrement(1);
$px3->SetPrecisionY(0);
$px3->SetCssPrefix("cssboxes"); $px3->SetCssPrefix("cssboxes");
//$px3->mode='depth'; //$px3->mode='depth';
$px3->SetType(array('pie')); $px3->SetType(array('pie'));

View File

@ -141,7 +141,6 @@ class box_graph_propales_permonth extends ModeleBoxes
$px1->SetType($datatype1); $px1->SetType($datatype1);
$px1->SetData($data1); $px1->SetData($data1);
unset($data1); unset($data1);
$px1->SetPrecisionY(0);
$i=$startyear;$legend=array(); $i=$startyear;$legend=array();
while ($i <= $endyear) while ($i <= $endyear)
{ {
@ -155,7 +154,6 @@ class box_graph_propales_permonth extends ModeleBoxes
$px1->SetYLabel($langs->trans("NumberOfProposals")); $px1->SetYLabel($langs->trans("NumberOfProposals"));
$px1->SetShading(3); $px1->SetShading(3);
$px1->SetHorizTickIncrement(1); $px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->SetCssPrefix("cssboxes"); $px1->SetCssPrefix("cssboxes");
$px1->mode='depth'; $px1->mode='depth';
$px1->SetTitle($langs->trans("NumberOfProposalsByMonth")); $px1->SetTitle($langs->trans("NumberOfProposalsByMonth"));
@ -182,7 +180,6 @@ class box_graph_propales_permonth extends ModeleBoxes
$px2->SetType($datatype2); $px2->SetType($datatype2);
$px2->SetData($data2); $px2->SetData($data2);
unset($data2); unset($data2);
$px2->SetPrecisionY(0);
$i=$startyear;$legend=array(); $i=$startyear;$legend=array();
while ($i <= $endyear) while ($i <= $endyear)
{ {
@ -196,7 +193,6 @@ class box_graph_propales_permonth extends ModeleBoxes
$px2->SetYLabel($langs->trans("AmountOfProposalsHT")); $px2->SetYLabel($langs->trans("AmountOfProposalsHT"));
$px2->SetShading(3); $px2->SetShading(3);
$px2->SetHorizTickIncrement(1); $px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->SetCssPrefix("cssboxes"); $px2->SetCssPrefix("cssboxes");
$px2->mode='depth'; $px2->mode='depth';
$px2->SetTitle($langs->trans("AmountOfProposalsByMonthHT")); $px2->SetTitle($langs->trans("AmountOfProposalsByMonthHT"));

View File

@ -47,8 +47,8 @@ class Ccountry // extends CommonObject
*/ */
public $errors = array(); public $errors = array();
//var $element='ccountry'; //!< Id that identify managed objects public $element='ccountry'; //!< Id that identify managed objects
//var $table_element='ccountry'; //!< Name of table without prefix where object is stored public $table_element='c_country'; //!< Name of table without prefix where object is stored
/** /**
* @var int ID * @var int ID
@ -65,7 +65,9 @@ class Ccountry // extends CommonObject
public $active; public $active;
public $fields=array(
'label' => array('type'=>'varchar(250)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>15, 'notnull'=>-1, 'showoncombobox'=>'1')
);
/** /**

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)
{ {

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

@ -61,8 +61,6 @@ class DolGraph
public $MinValue=0; public $MinValue=0;
public $SetShading=0; public $SetShading=0;
public $PrecisionY=-1;
public $horizTickIncrement=-1; public $horizTickIncrement=-1;
public $SetNumXTicks=-1; public $SetNumXTicks=-1;
public $labelInterval=-1; public $labelInterval=-1;
@ -116,7 +114,6 @@ class DolGraph
if (! $isgdinstalled) if (! $isgdinstalled)
{ {
$this->error="Error: PHP GD module is not available. It is required to build graphics."; $this->error="Error: PHP GD module is not available. It is required to build graphics.";
return -1;
} }
} }
@ -142,11 +139,11 @@ class DolGraph
* *
* @param float $which_prec Precision * @param float $which_prec Precision
* @return boolean * @return boolean
* @deprecated
*/ */
public function SetPrecisionY($which_prec) public function SetPrecisionY($which_prec)
{ {
// phpcs:enable // phpcs:enable
$this->PrecisionY = $which_prec;
return true; return true;
} }

View File

@ -1645,7 +1645,10 @@ class ExtraFields
elseif ($type == 'double') elseif ($type == 'double')
{ {
if (!empty($value)) { if (!empty($value)) {
$value=price($value); //$value=price($value);
$sizeparts = explode(",", $size);
$number_decimals = $sizeparts[1];
$value=price($value, 0, $langs, 0, 0, $number_decimals, '');
} }
} }
elseif ($type == 'boolean') elseif ($type == 'boolean')
@ -1956,9 +1959,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

@ -5234,10 +5234,12 @@ class Form
* @param int $fullday When a checkbox with this html name is on, hour and day are set with 00:00 or 23:59 * @param int $fullday When a checkbox with this html name is on, hour and day are set with 00:00 or 23:59
* @param string $addplusone Add a link "+1 hour". Value must be name of another selectDate field. * @param string $addplusone Add a link "+1 hour". Value must be name of another selectDate field.
* @param datetime $adddateof Add a link "Date of invoice" using the following date. * @param datetime $adddateof Add a link "Date of invoice" using the following date.
* @param string $openinghours Specify hour strat and hour end for the select ex 8,20
* @param int $stepminutes Specify step for minutes between 1 and 30
* @return string Html for selectDate * @return string Html for selectDate
* @see form_date(), select_month(), select_year(), select_dayofweek() * @see form_date(), select_month(), select_year(), select_dayofweek()
*/ */
public function selectDate($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $disabled = 0, $fullday = '', $addplusone = '', $adddateof = '') public function selectDate($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $disabled = 0, $fullday = '', $addplusone = '', $adddateof = '', $openinghours = '', $stepminutes = 1)
{ {
global $conf,$langs; global $conf,$langs;
@ -5248,6 +5250,7 @@ class Form
if ($m == '') $m=0; if ($m == '') $m=0;
$emptydate=0; $emptydate=0;
$emptyhours=0; $emptyhours=0;
if ($stepminutes<=0 || $stepminutes>30) $stepminutes = 1;
if ($empty == 1) { $emptydate=1; $emptyhours=1; } if ($empty == 1) { $emptydate=1; $emptyhours=1; }
if ($empty == 2) { $emptydate=0; $emptyhours=1; } if ($empty == 2) { $emptydate=0; $emptyhours=1; }
$orig_set_time=$set_time; $orig_set_time=$set_time;
@ -5468,10 +5471,18 @@ class Form
if ($h) if ($h)
{ {
$hourstart = 0;
$hourend = 24;
if ($openinghours != '') {
$openinghours = explode(',', $openinghours);
$hourstart = $openinghours[0];
$hourend = $openinghours[1];
if ($hourend<$hourstart) $hourend = $hourstart;
}
// Show hour // Show hour
$retstring.='<select'.($disabled?' disabled':'').' class="flat valignmiddle maxwidth50 '.($fullday?$fullday.'hour':'').'" id="'.$prefix.'hour" name="'.$prefix.'hour">'; $retstring.='<select'.($disabled?' disabled':'').' class="flat valignmiddle maxwidth50 '.($fullday?$fullday.'hour':'').'" id="'.$prefix.'hour" name="'.$prefix.'hour">';
if ($emptyhours) $retstring.='<option value="-1">&nbsp;</option>'; if ($emptyhours) $retstring.='<option value="-1">&nbsp;</option>';
for ($hour = 0; $hour < 24; $hour++) for ($hour = $hourstart; $hour < $hourend; $hour++)
{ {
if (strlen($hour) < 2) $hour = "0" . $hour; if (strlen($hour) < 2) $hour = "0" . $hour;
$retstring.='<option value="'.$hour.'"'.(($hour == $shour)?' selected':'').'>'.$hour.(empty($conf->dol_optimize_smallscreen)?'':'H').'</option>'; $retstring.='<option value="'.$hour.'"'.(($hour == $shour)?' selected':'').'>'.$hour.(empty($conf->dol_optimize_smallscreen)?'':'H').'</option>';
@ -5485,7 +5496,7 @@ class Form
// Show minutes // Show minutes
$retstring.='<select'.($disabled?' disabled':'').' class="flat valignmiddle maxwidth50 '.($fullday?$fullday.'min':'').'" id="'.$prefix.'min" name="'.$prefix.'min">'; $retstring.='<select'.($disabled?' disabled':'').' class="flat valignmiddle maxwidth50 '.($fullday?$fullday.'min':'').'" id="'.$prefix.'min" name="'.$prefix.'min">';
if ($emptyhours) $retstring.='<option value="-1">&nbsp;</option>'; if ($emptyhours) $retstring.='<option value="-1">&nbsp;</option>';
for ($min = 0; $min < 60 ; $min++) for ($min = 0; $min < 60 ; $min+=$stepminutes)
{ {
if (strlen($min) < 2) $min = "0" . $min; if (strlen($min) < 2) $min = "0" . $min;
$retstring.='<option value="'.$min.'"'.(($min == $smin)?' selected':'').'>'.$min.(empty($conf->dol_optimize_smallscreen)?'':'').'</option>'; $retstring.='<option value="'.$min.'"'.(($min == $smin)?' selected':'').'>'.$min.(empty($conf->dol_optimize_smallscreen)?'':'').'</option>';

View File

@ -211,13 +211,13 @@ class FormCompany
* The key of the list is the code (there can be several entries for a given code but in this case, the country field differs). * The key of the list is the code (there can be several entries for a given code but in this case, the country field differs).
* Thus the links with the departments are done on a department independently of its name. * Thus the links with the departments are done on a department independently of its name.
* *
* @param string $selected Code state preselected (mus be state id) * @param int $selected Code state preselected (mus be state id)
* @param integer $country_codeid Country code or id: 0=list for all countries, otherwise country code or country rowid to show * @param integer $country_codeid Country code or id: 0=list for all countries, otherwise country code or country rowid to show
* @param string $htmlname Id of department. If '', we want only the string with <option> * @param string $htmlname Id of department. If '', we want only the string with <option>
* @return string String with HTML select * @return string String with HTML select
* @see select_country() * @see select_country()
*/ */
public function select_state($selected = '', $country_codeid = 0, $htmlname = 'state_id') public function select_state($selected = 0, $country_codeid = 0, $htmlname = 'state_id')
{ {
// phpcs:enable // phpcs:enable
global $conf,$langs,$user; global $conf,$langs,$user;

View File

@ -28,7 +28,7 @@
/** /**
* Check if a value is empty with some options * Check if a value is empty with some options
* *
* @author Michael - https://www.php.net/manual/fr/function.empty.php#90767 * @author Michael - https://www.php.net/manual/fr/function.empty.php#90767
* @param mixed $var Value to test * @param mixed $var Value to test
* @param int|null $allow_false Setting this to true will make the function consider a boolean value of false as NOT empty. This parameter is false by default. * @param int|null $allow_false Setting this to true will make the function consider a boolean value of false as NOT empty. This parameter is false by default.
* @param int|null $allow_ws Setting this to true will make the function consider a string with nothing but white space as NOT empty. This parameter is false by default. * @param int|null $allow_ws Setting this to true will make the function consider a string with nothing but white space as NOT empty. This parameter is false by default.

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

@ -78,3 +78,36 @@ function stock_prepare_head($object)
return $head; return $head;
} }
/**
* Return array head with list of tabs to view object informations.
*
* @return array head array with tabs
*/
function stock_admin_prepare_head()
{
global $langs, $conf, $user;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/admin/stock.php';
$head[$h][1] = $langs->trans("Miscellaneous");
$head[$h][2] = 'general';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
complete_head_from_modules($conf, $langs, null, $head, $h, 'stock_admin');
$head[$h][0] = DOL_URL_ROOT.'/product/admin/stock_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields");
$head[$h][2] = 'attributes';
$h++;
complete_head_from_modules($conf, $langs, null, $head, $h, 'stock_admin', 'remove');
return $head;
}

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

@ -1307,6 +1307,14 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetTextColor(0, 0, 60); $pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date, "day", false, $outputlangs, true), '', 'R'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date, "day", false, $outputlangs, true), '', 'R');
if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && ! empty($object->thirdparty->code_client))
{
$posy+=4;
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->thirdparty->code_client), '', 'R');
}
// Get contact // Get contact
if (!empty($conf->global->DOC_SHOW_FIRST_SALES_REP)) if (!empty($conf->global->DOC_SHOW_FIRST_SALES_REP))
{ {

View File

@ -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
*/ */

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