diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000000..5ace4600a1f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/exakat.yml b/.github/workflows/exakat.yml index c2f8cc12765..528626e0308 100644 --- a/.github/workflows/exakat.yml +++ b/.github/workflows/exakat.yml @@ -5,11 +5,14 @@ on: schedule: - cron: "0 20 * * *" +permissions: + contents: read + jobs: exakat: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Exakat uses: docker://exakat/exakat-ga with: diff --git a/.travis.yml b/.travis.yml index 44d784ea091..a260c31e3f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -93,23 +93,26 @@ install: echo - | - echo "Installing Composer dependencies - PHP Unit, Parallel Lint, PHP CodeSniffer - for $TRAVIS_PHP_VERSION" + echo "Installing Composer dependencies - PHP Unit, Parallel Lint, PHP CodeSniffer, PHP Vardump check - for $TRAVIS_PHP_VERSION" if [ "$TRAVIS_PHP_VERSION" = '5.6' ]; then composer -n require phpunit/phpunit ^5 \ php-parallel-lint/php-parallel-lint ^1 \ php-parallel-lint/php-console-highlighter ^0 \ + php-parallel-lint/php-var-dump-check ~0.4 \ squizlabs/php_codesniffer ^3 fi if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ]; then composer -n require phpunit/phpunit ^6 \ php-parallel-lint/php-parallel-lint ^1 \ php-parallel-lint/php-console-highlighter ^0 \ + php-parallel-lint/php-var-dump-check ~0.4 \ squizlabs/php_codesniffer ^3 fi if [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ] || [ "$TRAVIS_PHP_VERSION" = '7.4.22' ]; then composer -n require phpunit/phpunit ^7 \ php-parallel-lint/php-parallel-lint ^1.2 \ php-parallel-lint/php-console-highlighter ^0 \ + php-parallel-lint/php-var-dump-check ~0.4 \ squizlabs/php_codesniffer ^3 fi # phpunit 9 is required for php 8 @@ -117,6 +120,7 @@ install: composer -n require --ignore-platform-reqs phpunit/phpunit ^7 \ php-parallel-lint/php-parallel-lint ^1.2 \ php-parallel-lint/php-console-highlighter ^0 \ + php-parallel-lint/php-var-dump-check ~0.4 \ squizlabs/php_codesniffer ^3 fi echo @@ -166,6 +170,10 @@ before_script: which phpcs phpcs --version | head - phpcs -i | head - + # Check PHP Vardump check version + echo "PHP Vardump check version" + which var_dump_check + var_dump_check --version # Check PHPUnit version echo "PHPUnit version" which phpunit @@ -297,6 +305,17 @@ script: set +e echo +- | + echo "Checking missing debug" + # Ensure we catch errors + set -e + # Exclusions are defined in the ruleset.xml file + if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4.22" ]; then + var-dump-check --extensions php --tracy --exclude htdocs/includes --exclude test/ --exclude htdocs/public/test/ --exclude htdocs/core/lib/functions.lib.php . + fi + set +e + echo + - | export INSTALL_FORCED_FILE=htdocs/install/install.forced.php echo "Setting up Dolibarr $INSTALL_FORCED_FILE to test installation" diff --git a/ChangeLog b/ChangeLog index 37957f61c1d..0b0e8695a7b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,7 @@ NEW: PHP 8.1 compatibility NEW: Support for recurring purchase invoices. NEW: #20292 Include German public holidays NEW: Can show ZATCA QRCode on PDFs +NEW: Can show Swiss QR Code on PDFs NEW: #17123 added ExtraFields for Stock Mouvement NEW: #20609 : new massaction to assign a sale representatives on a selection of thirdparties NEW: #20653 edit discount pourcentage for all lines in one shot @@ -197,7 +198,7 @@ Following changes may create regressions for some external modules, but were nec * Method fetch_all_resources(), fetch_all_used(), fetch_all_available() of DolResource has been removed (they were not used by core code). * Method fetch_all of DolResource has been renamed into fetchAll() to match naming conventions. * The hook 'upgrade' and 'doUpgrade2" has been renamed 'doUpgradeBefore' and 'doUpgradeAfterDB'. A new trigger 'doUpgradeAfterFiles' has been introduced. - +* The context hook 'suppliercard' when on the supplier tab of a thirdparty has been renamed into 'thirdpartysupplier' ***** ChangeLog for 15.0.2 compared to 15.0.1 ***** diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index b648bd7aff7..556ce9d0a7e 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -499,8 +499,9 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/cache.manifest`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.mysql`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.nova*`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.old`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.postgres`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.pgsql`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf*sav*`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mssql/README`; diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index 204988c5442..cbfecbbc19f 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -275,6 +275,13 @@ RESTLER: with $loaders = array_unique(static::$rogueLoaders, SORT_REGULAR); + +* Replace CommentParser.php line 423 + elseif (count($value) && is_numeric($value[0])) + + with + + elseif (count($value) && isset($value[0]) && is_numeric($value[0])) +With swagger 2 provided into /explorer: diff --git a/dev/resources/iso-normes/barcodes/QR code for invoices.txt b/dev/resources/iso-normes/qr-bar-codes/QR code for invoices.txt similarity index 72% rename from dev/resources/iso-normes/barcodes/QR code for invoices.txt rename to dev/resources/iso-normes/qr-bar-codes/QR code for invoices.txt index 639435238f9..b388ed0c599 100644 --- a/dev/resources/iso-normes/barcodes/QR code for invoices.txt +++ b/dev/resources/iso-normes/qr-bar-codes/QR code for invoices.txt @@ -20,3 +20,10 @@ https://www.pwc.com/m1/en/services/tax/me-tax-legal-news/2021/saudi-arabia-guide https://www.tecklenborgh.com/post/ksa-zatca-publishes-guide-on-how-to-develop-a-fatoora-compliant-qr-code Method to encode/decode ZATCA string is available in test/phpunit/BarcodeTest.php + + +* FOR QR-Bill in switzerland +---------------------------- +Syntax of QR Code https://www.swiss-qr-invoice.org/fr/ +Syntax of complentary field named "structured information of invoice S1": https://www.swiss-qr-invoice.org/downloads/qr-bill-s1-syntax-fr.pdf +To test/validate: https://www.swiss-qr-invoice.org/validator/ diff --git a/dev/resources/iso-normes/barcodes/barcode_EAN13.txt b/dev/resources/iso-normes/qr-bar-codes/barcode_EAN13.txt similarity index 100% rename from dev/resources/iso-normes/barcodes/barcode_EAN13.txt rename to dev/resources/iso-normes/qr-bar-codes/barcode_EAN13.txt diff --git a/dev/setup/git/hooks/pre-commit b/dev/setup/git/hooks/pre-commit index 51b7c5cf4e9..55295b4d656 100644 --- a/dev/setup/git/hooks/pre-commit +++ b/dev/setup/git/hooks/pre-commit @@ -7,7 +7,7 @@ # To run the fix manually: cd ~/git/dolibarr; phpcbf -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true "fileordir" PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"` -STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php` +STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep -v '/includes/'| grep \\\\.php` DIRPHPCS="" AUTOFIX=1 diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 48d8ab23d96..4d74237e2e4 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -350,6 +350,8 @@ if ($resql) { '; } + $newcardbutton = ''; + print '
'; if ($optioncss != '') { print ''; diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index f2137d84af9..02b95cfd043 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -168,10 +168,13 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount) { $object->labelshort = GETPOST('labelshort', 'alpha'); $result = $object->update($user); + if ($result > 0) { $urltogo = $backtopage ? $backtopage : ($_SERVER["PHP_SELF"] . "?id=" . $id); header("Location: " . $urltogo); exit(); + } elseif ($result == -2) { + setEventMessages($langs->trans("ErrorAccountNumberAlreadyExists", $object->account_number), null, 'errors'); } else { setEventMessages($object->error, null, 'errors'); } diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index 583b12368dc..895437ab58b 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -98,7 +98,6 @@ if (!empty($conf->loan->enabled)) { $list_account[] = 'ACCOUNTING_ACCOUNT_SUSPENSE'; if (!empty($conf->societe->enabled)) { $list_account[] = '---Deposits---'; - $list_account[] = 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'; } /* @@ -106,7 +105,7 @@ if (!empty($conf->societe->enabled)) { */ if ($action == 'update') { $error = 0; - + // Process $list_account_main foreach ($list_account_main as $constname) { $constvalue = GETPOST($constname, 'alpha'); @@ -114,7 +113,7 @@ if ($action == 'update') { $error++; } } - + // Process $list_account foreach ($list_account as $constname) { $reg = array(); if (preg_match('/---(.*)---/', $constname, $reg)) { // This is a separator @@ -128,6 +127,13 @@ if ($action == 'update') { } } + $constname = 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'; + $constvalue = GETPOST($constname, 'int'); + if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { + $error++; + } + + if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -135,7 +141,7 @@ if ($action == 'update') { } } -if ($action == 'setdisableauxiliaryaccountoncustomerdeposit') { +if ($action == 'setACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT') { $setDisableAuxiliaryAccountOnCustomerDeposit = GETPOST('value', 'int'); $res = dolibarr_set_const($db, "ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT", $setDisableAuxiliaryAccountOnCustomerDeposit, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { @@ -195,7 +201,8 @@ foreach ($list_account_main as $key) { print ''; // Value print ''; // Do not force class=right, or it align also the content of the select box - print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accountsmain'); + $key_value = getDolGlobalString($key); + print $formaccounting->select_account($key_value, $key, 1, '', 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accountsmain'); print ''; print ''; } @@ -246,15 +253,28 @@ foreach ($list_account as $key) { } } -if (!empty($conf->societe->enabled)) { + +// Customer deposit account +print ''; +// Param +print ''; +print img_picto('', 'bill', 'class="pictofixedwidth"') . $langs->trans('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'); +print ''; +// Value +print ''; // Do not force class=right, or it align also the content of the select box +print $formaccounting->select_account(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'), 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT', 1, '', 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accounts'); +print ''; +print ''; + +if (!empty($conf->societe->enabled) && getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT') && getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT') != '-1') { print ''; print '' . img_picto('', 'bill', 'class="pictofixedwidth"') . $langs->trans("UseAuxiliaryAccountOnCustomerDeposit") . ''; - if (!empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT)) { - print ''; + if (getDolGlobalInt('ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT')) { + print ''; print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -264,7 +284,7 @@ if (!empty($conf->societe->enabled)) { print "\n"; print "\n"; -print '
'; +print '
'; print '
'; diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index 430c7b6abae..d0a0ab671d4 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -1,11 +1,11 @@ - * Copyright (C) 2013-2017 Alexandre Spangaro - * Copyright (C) 2014 Florian Henry - * Copyright (C) 2014 Marcos García - * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2017-2018 Frédéric France +/* Copyright (C) 2013-2014 Olivier Geffroy + * Copyright (C) 2013-2022 Alexandre Spangaro + * Copyright (C) 2014 Florian Henry + * Copyright (C) 2014 Marcos García + * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2017-2018 Frédéric France * * 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 @@ -211,7 +211,7 @@ if ($num) { // Value print ''; - print ''; + print ''; print ''; } } @@ -239,7 +239,7 @@ if (!$conf->use_javascript_ajax) { } else { print ''; $listmodelcsv = $accountancyexport->getType(); - print $form->selectarray("ACCOUNTING_EXPORT_MODELCSV", $listmodelcsv, $conf->global->ACCOUNTING_EXPORT_MODELCSV, 0, 0, 0, '', 0, 0, 0, '', '', 1); + print $form->selectarray("ACCOUNTING_EXPORT_MODELCSV", $listmodelcsv, getDolGlobalString('ACCOUNTING_EXPORT_MODELCSV'), 0, 0, 0, '', 0, 0, 0, '', '', 1); print ''; } diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 309dc094e82..af569e08ae3 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -358,7 +358,7 @@ foreach ($list as $key) { print ''.$label.''; // Value print ''; - print ''; + print ''; print ''; print ''; @@ -409,12 +409,12 @@ foreach ($list_binding as $key) { // Value print ''; if ($key == 'ACCOUNTING_DATE_START_BINDING') { - print $form->selectDate(($conf->global->$key ? $db->idate($conf->global->$key) : -1), $key, 0, 0, 1); + print $form->selectDate((!empty($conf->global->$key) ? $db->idate($conf->global->$key) : -1), $key, 0, 0, 1); } elseif ($key == 'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER') { $array = array(0=>$langs->trans("PreviousMonth"), 1=>$langs->trans("CurrentMonth"), 2=>$langs->trans("Fiscalyear")); print $form->selectarray($key, $array, (isset($conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER) ? $conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER : 0)); } else { - print ''; + print ''; } print ''; diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index de6b8374c2a..39300579d5f 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017-2022 Alexandre Spangaro * * 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 @@ -76,6 +76,8 @@ if (empty($sortorder)) { $error = 0; +$search_country_id = GETPOST('search_country_id', 'int'); + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('admin')); diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index a275fc07ff4..7c8c0dca547 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -540,7 +540,7 @@ if ($action == 'create') { print ''; print ''; - // Date document creation + // Date document export print ''; print ''.$langs->trans("DateExport").''; print ''; @@ -548,7 +548,7 @@ if ($action == 'create') { print ''; print ''; - // Date document creation + // Date document validation print ''; print ''.$langs->trans("DateValidation").''; print ''; @@ -607,6 +607,7 @@ if ($action == 'create') { print '
'; $result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt + if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { @@ -640,16 +641,21 @@ if ($action == 'create') { print_liste_field_titre("Debit", "", "", "", "", 'class="right"'); print_liste_field_titre("Credit", "", "", "", "", 'class="right"'); if (empty($object->date_validation)) { - print_liste_field_titre("Action", "", "", "", "", 'width="60" class="center"'); + print_liste_field_titre("Action", "", "", "", "", 'width="60"', "", "", 'center '); } else { print_liste_field_titre(""); } print "\n"; - // Add an empty line - $line = new BookKeepingLine(); - $object->linesmvt[] = $line; + // Add an empty line if there is not yet + if (!empty($object->linesmvt[0])) { + $tmpline = $object->linesmvt[0]; + if (!empty($tmpline->numero_compte)) { + $line = new BookKeepingLine(); + $object->linesmvt[] = $line; + } + } foreach ($object->linesmvt as $line) { print ''; @@ -702,9 +708,7 @@ if ($action == 'create') { print ''; print ''; print ''; - print ''; - print ''; - print ''; + print ''; } } else { print ''; diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 2ee947bf720..4bc6d50de89 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -132,6 +132,7 @@ $search_not_reconciled = GETPOST('search_not_reconciled', 'alpha'); $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); +$optioncss = GETPOST('optioncss', 'alpha'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (empty($page) || $page < 0) { $page = 0; @@ -206,7 +207,7 @@ if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) { $accountancyexport = new AccountancyExport($db); $listofformat = $accountancyexport->getType(); -$formatexportset = $conf->global->ACCOUNTING_EXPORT_MODELCSV; +$formatexportset = getDolGlobalString('ACCOUNTING_EXPORT_MODELCSV'); if (empty($listofformat[$formatexportset])) { $formatexportset = 1; } @@ -913,6 +914,8 @@ if ($massactionbutton && $contextpage != 'poslist') { $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); } +$moreforfilter = ''; + $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook if (empty($reshook)) { diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 80b2efe7050..d638a7c0c84 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -2,7 +2,7 @@ /* Copyright (C) 2016 Neil Orley * Copyright (C) 2013-2016 Olivier Geffroy * Copyright (C) 2013-2020 Florian Henry - * Copyright (C) 2013-2021 Alexandre Spangaro + * Copyright (C) 2013-2022 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; $langs->loadLangs(array("accountancy", "compta")); $action = GETPOST('action', 'aZ09'); +$socid = GETPOST('socid', 'int'); $massaction = GETPOST('massaction', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); @@ -104,6 +105,7 @@ if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_ $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); +$optioncss = GETPOST('optioncss', 'alpha'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (empty($page) || $page < 0) { $page = 0; @@ -571,6 +573,7 @@ $num = count($object->lines); //} // Print form confirm +$formconfirm = ''; print $formconfirm; // List of mass actions available diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 8cccef2d342..710443c9bad 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -347,8 +347,8 @@ class AccountingAccount extends CommonObject /** * Update record * - * @param User $user Use making update - * @return int <0 if KO, >0 if OK + * @param User $user User making update + * @return int <0 if KO (-2 = duplicate), >0 if OK */ public function update($user) { @@ -378,6 +378,12 @@ class AccountingAccount extends CommonObject $this->db->commit(); return 1; } else { + if ($this->db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { + $this->error = $this->db->lasterror(); + $this->db->rollback(); + return -2; + } + $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -592,16 +598,9 @@ class AccountingAccount extends CommonObject if ($this->db->num_rows($resql)) { $obj = $this->db->fetch_object($resql); $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - if ($obj->fk_user_modif) { - $muser = new User($this->db); - $muser->fetch($obj->fk_user_modif); - $this->user_modification = $muser; - } + + $this->user_creation_id = $obj->fk_user_author; + $this->user_modification_id = $obj->fk_user_modif; $this->date_creation = $this->db->jdate($obj->datec); $this->date_modification = $this->db->jdate($obj->tms); } @@ -733,7 +732,7 @@ class AccountingAccount extends CommonObject * @param FactureLigne|SupplierInvoiceLine $factureDet Facture Det * @param array $accountingAccount Array of Account account * @param string $type Customer / Supplier - * @return array Accounting accounts suggested + * @return array|int Accounting accounts suggested or < 0 if technical error. */ public function getAccountingCodeToBind(Societe $buyer, Societe $seller, Product $product, $facture, $factureDet, $accountingAccount = array(), $type = '') { diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index d01ad89293f..992b885f272 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -606,9 +606,13 @@ class BookKeeping extends CommonObject if (empty($this->credit)) { $this->credit = 0; } + if (empty($this->montant)) { + $this->montant = 0; + } $this->debit = price2num($this->debit, 'MT'); $this->credit = price2num($this->credit, 'MT'); + $this->montant = price2num($this->montant, 'MT'); $now = dol_now(); @@ -1661,11 +1665,10 @@ class BookKeeping extends CommonObject $this->doc_date = $this->db->jdate($obj->doc_date); $this->doc_ref = $obj->doc_ref; $this->doc_type = $obj->doc_type; - $this->date_creation = $obj->date_creation; - $this->date_modification = $obj->date_modification; - $this->date_export = $obj->date_export; - $this->date_validation = $obj->date_validated; - $this->date_validation = $obj->date_validation; + $this->date_creation = $this->db->jdate($obj->date_creation); + $this->date_modification = $this->db->jdate($obj->date_modification); + $this->date_export = $this->db->jdate($obj->date_export); + $this->date_validation = $this->db->jdate($obj->date_validation); } else { $this->error = "Error ".$this->db->lasterror(); dol_syslog(__METHOD__.$this->error, LOG_ERR); diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 70e79e31063..0eca61c72c1 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -1,9 +1,9 @@ - * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2021 Alexandre Spangaro - * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry +/* Copyright (C) 2013 Olivier Geffroy + * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2013-2022 Alexandre Spangaro + * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2015 Jean-François Ferry * * 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 @@ -174,7 +174,9 @@ if ($action == 'validatehistory') { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON " . $alias_product_perentity . ".accountancy_code_sell_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON " . $alias_product_perentity . ".accountancy_code_sell_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_societe_perentity . ".accountancy_code_sell = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity; - $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0 AND l.product_type <= 2 AND f.entity = ".((int) $conf->entity); + $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0"; + $sql .= " AND l.product_type <= 2"; + $sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) { $sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'"; } diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index b9ea4fc0e54..b2a127e86a4 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -158,8 +158,8 @@ if (empty($reshook)) { // Mass actions $objectclass = 'AccountingAccount'; - $permissiontoread = $user->rights->accounting->read; - $permissiontodelete = $user->rights->accounting->delete; + $permissiontoread = $user->hasRight('accounting', 'read'); + $permissiontodelete = $user->hasRight('accounting', 'delete'); $uploaddir = $conf->accounting->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -469,7 +469,7 @@ if ($result) { print ''.$langs->trans("DescVentilTodoCustomer").'

'; - if ($msg) { + if (!empty($msg)) { print $msg.'
'; } diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 033f1164dc7..880af769183 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -150,8 +150,8 @@ if (empty($reshook)) { // Mass actions $objectclass = 'ExpenseReport'; $objectlabel = 'ExpenseReport'; - $permissiontoread = $user->rights->expensereport->read; - $permissiontodelete = $user->rights->expensereport->delete; + $permissiontoread = $user->hasRight('accounting', 'read'); + $permissiontodelete = $user->hasRight('accounting', 'delete'); $uploaddir = $conf->expensereport->dir_output; include DOL_DOCUMENT_ROOT . '/core/actions_massactions.inc.php'; } @@ -370,7 +370,7 @@ if ($result) { print ''.$langs->trans("DescVentilTodoExpenseReport").'

'; - if ($msg) { + if (!empty($msg)) { print $msg.'
'; } diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 781218be04a..27ffb681ae0 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -305,8 +305,16 @@ if ($result) { // get_url may return -1 which is not traversable if (is_array($links) && count($links) > 0) { + $is_sc = false; + foreach ($links as $v) { + if ($v['type'] == 'sc') { + $is_sc = true; + break; + } + } // Now loop on each link of record in bank (code similar to bankentries_list.php) foreach ($links as $key => $val) { + if ($links[$key]['type'] == 'user' && !$is_sc) continue; if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'member', 'payment_loan', 'payment_salary', 'payment_various'))) { // So we excluded 'company' and 'user' here. We want only payment lines diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index e46b508512d..449b13f1039 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2021 Florian Henry - * Copyright (C) 2013-2021 Alexandre Spangaro + * Copyright (C) 2013-2022 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -38,7 +38,7 @@ $validatemonth = GETPOST('validatemonth', 'int'); $validateyear = GETPOST('validateyear', 'int'); // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { @@ -75,7 +75,7 @@ $action = GETPOST('action', 'aZ09'); $chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { @@ -171,8 +171,10 @@ if ($action == 'validatehistory') { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON " . $alias_product_perentity . ".accountancy_code_buy = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON " . $alias_product_perentity . ".accountancy_code_buy_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON " . $alias_product_perentity . ".accountancy_code_buy_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_societe_perentity . ".accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity; - $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0 AND l.product_type <= 2 AND f.entity = ".((int) $conf->entity); + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_product_perentity . ".accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity; + $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0"; + $sql .= " AND l.product_type <= 2"; + $sql .= " AND f.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) { $sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'"; } @@ -373,10 +375,14 @@ $sql .= " AND ff.fk_statut > 0"; $sql .= " AND ffd.product_type <= 2"; $sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy $sql .= " AND aa.account_number IS NULL"; +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.")"; +} else { + $sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.",".FactureFournisseur::TYPE_DEPOSIT.")"; +} $sql .= " GROUP BY ffd.fk_code_ventilation,aa.account_number,aa.label"; -$sql .= ' ORDER BY aa.account_number'; -dol_syslog('htdocs/accountancy/supplier/index.php'); +dol_syslog('htdocs/accountancy/supplier/index.php', LOG_DEBUG); $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); @@ -474,11 +480,17 @@ $sql .= " AND ff.datef <= '".$db->idate($search_date_end)."'"; if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) { $sql .= " AND ff.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'"; } +$sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy $sql .= " AND ff.fk_statut > 0"; $sql .= " AND ffd.product_type <= 2"; -$sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.", ".FactureFournisseur::TYPE_REPLACEMENT.", ".FactureFournisseur::TYPE_CREDIT_NOTE.")"; +} else { + $sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.", ".FactureFournisseur::TYPE_REPLACEMENT.", ".FactureFournisseur::TYPE_CREDIT_NOTE.", ".FactureFournisseur::TYPE_DEPOSIT.")"; +} $sql .= " AND aa.account_number IS NOT NULL"; $sql .= " GROUP BY ffd.fk_code_ventilation,aa.account_number,aa.label"; +$sql .= ' ORDER BY aa.account_number'; dol_syslog('htdocs/accountancy/supplier/index.php'); $resql = $db->query($sql); @@ -494,13 +506,15 @@ if ($resql) { print length_accountg($row[0]); } print ''; - print ''; + + print ''; if ($row[0] == 'tobind') { print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.((int) $y), $langs->transnoentitiesnoconv("ToBind")); } else { print $row[1]; } print ''; + for ($i = 2; $i <= 13; $i++) { print ''; print price($row[$i]); @@ -523,7 +537,6 @@ print "\n"; print ''; - if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange. Why showing a report that should rely on result of this step ? print '
'; print '
'; @@ -560,9 +573,14 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) { $sql .= " AND ff.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'"; } + $sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy $sql .= " AND ff.fk_statut > 0"; $sql .= " AND ffd.product_type <= 2"; - $sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.", ".FactureFournisseur::TYPE_REPLACEMENT.", ".FactureFournisseur::TYPE_CREDIT_NOTE.")"; + } else { + $sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.", ".FactureFournisseur::TYPE_REPLACEMENT.", ".FactureFournisseur::TYPE_CREDIT_NOTE.", ".FactureFournisseur::TYPE_DEPOSIT.")"; + } dol_syslog('htdocs/accountancy/supplier/index.php'); $resql = $db->query($sql); diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 914c355c838..c142361155d 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -384,7 +384,7 @@ if ($result) { print ''; print ''; - print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); + print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); print ''.$langs->trans("DescVentilDoneSupplier").'
'; print '
'.$langs->trans("ChangeAccount").' '; diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 32e939f7bee..f274a5432dc 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -161,8 +161,8 @@ if (empty($reshook)) { // Mass actions $objectclass = 'AccountingAccount'; - $permissiontoread = $user->rights->accounting->read; - $permissiontodelete = $user->rights->accounting->delete; + $permissiontoread = $user->hasRight('accounting', 'read'); + $permissiontodelete = $user->hasRight('accounting', 'delete'); $uploaddir = $conf->accounting->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -477,7 +477,7 @@ if ($result) { print ''.$langs->trans("DescVentilTodoCustomer").'

'; - if ($msg) { + if (!empty($msg)) { print $msg.'
'; } diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index bae229bc77b..80092ea96a5 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -108,7 +108,7 @@ if ($action == 'set_default') { $res3 = dolibarr_set_const($db, 'ADHERENT_CREATE_EXTERNAL_USER_LOGIN', GETPOST('ADHERENT_CREATE_EXTERNAL_USER_LOGIN', 'alpha'), 'chaine', 0, '', $conf->entity); $res4 = dolibarr_set_const($db, 'ADHERENT_BANK_USE', GETPOST('ADHERENT_BANK_USE', 'alpha'), 'chaine', 0, '', $conf->entity); // Use vat for invoice creation - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { $res4 = dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); $res5 = dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { @@ -241,10 +241,10 @@ $arraychoices = array('0'=>$langs->trans("None")); if (!empty($conf->banque->enabled)) { $arraychoices['bankdirect'] = $langs->trans("MoreActionBankDirect"); } -if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) { +if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) { $arraychoices['invoiceonly'] = $langs->trans("MoreActionInvoiceOnly"); } -if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) { +if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) { $arraychoices['bankviainvoice'] = $langs->trans("MoreActionBankViaInvoice"); } print ''; @@ -256,7 +256,7 @@ print ''; print "\n"; // Use vat for invoice creation -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { print ''.$langs->trans("VATToUseForSubscriptions").''; if (!empty($conf->banque->enabled)) { print ''; diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index 0a6abcd4955..5aeb3a281cf 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -162,11 +162,11 @@ if ($object->id > 0) { $newcardbutton = ''; - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { $newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']).($object->id > 0 ? '?id='.$object->id : '').'&origin=member&originid='.$id); } - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { print '
'; $param = '&id='.$id; diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 88a63af0ae1..0096ba9a285 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -285,7 +285,7 @@ if (empty($reshook)) { $object->lastname = trim(GETPOST("lastname", 'alphanohtml')); $object->gender = trim(GETPOST("gender", 'alphanohtml')); $object->login = trim(GETPOST("login", 'alphanohtml')); - $object->pass = trim(GETPOST("pass", 'alpha')); + $object->pass = trim(GETPOST("pass", 'none')); // For password, we must use 'none' $object->societe = trim(GETPOST("societe", 'alphanohtml')); // deprecated $object->company = trim(GETPOST("societe", 'alphanohtml')); @@ -450,8 +450,8 @@ if (empty($reshook)) { $email = preg_replace('/\s+/', '', GETPOST("member_email", 'alpha')); $url = trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL)); $login = GETPOST("member_login", 'alphanohtml'); - $pass = GETPOST("password", 'alpha'); - $photo = GETPOST("photo", 'alpha'); + $pass = GETPOST("password", 'none'); // For password, we use 'none' + $photo = GETPOST("photo", 'alphanohtml'); $morphy = GETPOST("morphy", 'alphanohtml'); $public = GETPOST("public", 'alphanohtml'); @@ -634,7 +634,7 @@ if (empty($reshook)) { exit; } } else { - $errmesg = $object->error; + setEventMessages($object->error, null, 'errors'); } } @@ -999,7 +999,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; $generated_password = getRandomPassword(false); print ''.$langs->trans("Password").''; - print ''; + print ''; print ''; } @@ -1224,7 +1224,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Password if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''.$langs->trans("Password").'pass).'">'; + print ''.$langs->trans("Password").'pass).'">'; } // Morphy $morphys["phy"] = $langs->trans("Physical"); @@ -1280,7 +1280,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ' '.$langs->trans("Delete").'

'; } print ''.$langs->trans("PhotoFile").''; - print ''; + print ''; + $maxfilesizearray = getMaxFileSizeArray(); + $maxmin = $maxfilesizearray['maxmin']; + if ($maxmin > 0) { + print ''; // MAX_FILE_SIZE must precede the field type=file + } + print ''; + print ''; print ''; } print ''; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 39b6eaa97d0..c860a19d588 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2777,24 +2777,10 @@ class Adherent extends CommonObject if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - - if ($obj->fk_user_valid) { - $vuser = new User($this->db); - $vuser->fetch($obj->fk_user_valid); - $this->user_validation = $vuser; - } - - if ($obj->fk_user_mod) { - $muser = new User($this->db); - $muser->fetch($obj->fk_user_mod); - $this->user_modification = $muser; - } + $this->user_creation_id = $obj->fk_user_author; + $this->user_validation_id = $obj->fk_user_valid; + $this->user_modification_id = $obj->fk_user_mod; $this->date_creation = $this->db->jdate($obj->datec); $this->date_validation = $this->db->jdate($obj->datev); $this->date_modification = $this->db->jdate($obj->datem); diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 1cfbb80f65b..cf0ad445c92 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -831,11 +831,11 @@ if ($rowid > 0) { $bankviainvoice = 1; } } else { - if (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) { + if (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) { $bankviainvoice = 1; } elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && !empty($conf->banque->enabled)) { $bankdirect = 1; - } elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) { + } elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) { $invoiceonly = 1; } } @@ -982,7 +982,7 @@ if ($rowid > 0) { print '">'; // Complementary action - if ((!empty($conf->banque->enabled) || !empty($conf->facture->enabled)) && empty($conf->global->ADHERENT_SUBSCRIPTION_HIDECOMPLEMENTARYACTIONS)) { + if ((!empty($conf->banque->enabled) || isModEnabled('facture')) && empty($conf->global->ADHERENT_SUBSCRIPTION_HIDECOMPLEMENTARYACTIONS)) { $company = new Societe($db); if ($object->fk_soc) { $result = $company->fetch($object->fk_soc); @@ -1003,7 +1003,7 @@ if ($rowid > 0) { print '>
'; } // Add invoice with no payments - if (!empty($conf->societe->enabled) && !empty($conf->facture->enabled)) { + if (!empty($conf->societe->enabled) && isModEnabled('facture')) { print 'fk_soc)) print ' disabled'; print '>
'; } // Add invoice with payments - if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) { + if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) { print 'fk_soc)) print ' disabled'; print '>
'; } else { - print 'Error: Failed to found dolibarr_htdocs_dir into XML file '.$xmlfile; + print '
'; + print 'Error: Failed to found dolibarr_htdocs_dir into content of XML file:
'.dol_escape_htmltag(dol_trunc($xmlfile, 500)); + print '

'; $error++; } diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index f902c3fb39b..99d1b34749f 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -642,7 +642,7 @@ $mail_intro = $conf->global->TICKET_MESSAGE_MAIL_INTRO ? $conf->global->TICKET_M print ''.$langs->trans("TicketMessageMailIntroLabelAdmin"); print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; -$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_INTRO', $mail_intro, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70); +$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_INTRO', $mail_intro, '100%', 120, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, 70); $doleditor->Create(); print ''; print ''; @@ -654,7 +654,7 @@ $mail_signature = $conf->global->TICKET_MESSAGE_MAIL_SIGNATURE ? $conf->global-> print ''.$langs->trans("TicketMessageMailSignatureLabelAdmin").''; print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; -$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70); +$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, '100%', 120, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, 70); $doleditor->Create(); print ''; print ''; diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index 621eceb50a3..0fd654b5d28 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -89,7 +89,7 @@ if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE') { } } - $topic_interface = GETPOST('TICKET_PUBLIC_INTERFACE_TOPIC', 'nohtml'); + $topic_interface = GETPOST('TICKET_PUBLIC_INTERFACE_TOPIC', 'alphanohtml'); if (!empty($topic_interface)) { $res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', $topic_interface, 'chaine', 0, '', $conf->entity); } else { @@ -375,7 +375,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { print ''.$langs->trans("TicketPublicInterfaceTextHomeLabelAdmin").''; print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HOME', $public_text_home, '100%', 180, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70); + $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HOME', $public_text_home, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_2, 70); $doleditor->Create(); print ''; print ''; @@ -387,7 +387,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { print ''.$langs->trans("TicketPublicInterfaceTextHelpMessageLabelAdmin").''; print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HELP_MESSAGE', $public_text_help_message, '100%', 180, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70); + $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HELP_MESSAGE', $public_text_help_message, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_2, 70); $doleditor->Create(); print ''; print ''; @@ -434,7 +434,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { print ''; print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('TICKET_MESSAGE_MAIL_NEW', $mail_mesg_new, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70); + $doleditor = new DolEditor('TICKET_MESSAGE_MAIL_NEW', $mail_mesg_new, '100%', 120, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, 70); $doleditor->Create(); print ''; print ''; diff --git a/htdocs/admin/tools/dolibarr_import.php b/htdocs/admin/tools/dolibarr_import.php index 77dea6f23ab..c409d6a500b 100644 --- a/htdocs/admin/tools/dolibarr_import.php +++ b/htdocs/admin/tools/dolibarr_import.php @@ -189,7 +189,7 @@ if (in_array($type, array('mysql', 'mysqli'))) { $param .= " -U ".$dolibarr_main_db_user; $paramcrypted = $param; $paramclear = $param; - /*if (! empty($dolibarr_main_db_pass)) + /*if (!empty($dolibarr_main_db_pass)) { $paramcrypted.=" -p".preg_replace('/./i','*',$dolibarr_main_db_pass); $paramclear.=" -p".$dolibarr_main_db_pass; diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 4968e75989a..1e667e7abb4 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -554,7 +554,7 @@ if ($mode == 'searchkey') { break; } print ''.$langcode.''.$key.''; - $titleforvalue = $langs->trans("Translation").' en_US for key '.$key.':
'.($langsenfileonly->tab_translate[$key] ? $langsenfileonly->trans($key) : ''.$langs->trans("None").''); + $titleforvalue = $langs->trans("Translation").' en_US for key '.$key.':
'.(!empty($langsenfileonly->tab_translate[$key]) ? $langsenfileonly->trans($key) : ''.$langs->trans("None").''); print ''; print dol_escape_htmltag($val); print ''; diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index 53de8fe2502..6f1012d1af4 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -35,9 +35,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; // Load translation files required by the page $langs->loadLangs(array('admin', 'members', 'users')); -if (!$user->admin) { - accessforbidden(); -} $extrafields = new ExtraFields($db); @@ -51,6 +48,10 @@ $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scandir', 'alpha'); $type = 'user'; +if (empty($user->admin)) { + accessforbidden(); +} + /* * Action @@ -58,6 +59,8 @@ $type = 'user'; include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; +$reg = array(); + if ($action == 'set_default') { $ret = addDocumentModel($value, $type, $label, $scandir); $res = true; @@ -83,6 +86,9 @@ if ($action == 'set_default') { $ret = addDocumentModel($value, $type, $label, $scandir); } $res = true; +} elseif ($action == 'unsetdoc') { + // We disable the template + dolibarr_del_const($db, "USER_ADDON_PDF_ODT", $conf->entity); } elseif (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { $code = $reg[1]; if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) { @@ -118,6 +124,9 @@ if ($action == 'set_default') { $form = new Form($db); +dol_mkdir(DOL_DATA_ROOT.'/doctemplates/users'); +dol_mkdir(DOL_DATA_ROOT.'/doctemplates/usergroups'); + $help_url = 'EN:Module_Users|FR:Module_Utilisateurs|ES:Módulo_Usuarios'; llxHeader('', $langs->trans("UsersSetup"), $help_url); @@ -264,14 +273,17 @@ foreach ($dirmodels as $reldir) { print ''; } else { print ''."\n"; - print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; print ""; } // Defaut print ''; if (getDolGlobalString('USER_ADDON_PDF_ODT') == $name) { - print img_picto($langs->trans("Default"), 'on'); + //print img_picto($langs->trans("Default"), 'on'); + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Default"), 'on').''; } else { print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } diff --git a/htdocs/admin/webhook.php b/htdocs/admin/webhook.php new file mode 100644 index 00000000000..963b76c238a --- /dev/null +++ b/htdocs/admin/webhook.php @@ -0,0 +1,733 @@ + + * Copyright (C) 2022 SuperAdmin + * + * 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file webhook/admin/webhook.php + * \ingroup webhook + * \brief Webhook setup page. + */ + +// Load Dolibarr environment +$res = 0; +// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) +if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { + $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; +} +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME +$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; +while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { + $i--; $j--; +} +if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { + $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; +} +if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { + $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; +} +// Try main.inc.php using relative path +if (!$res && file_exists("../main.inc.php")) { + $res = @include "../main.inc.php"; +} +if (!$res && file_exists("../../main.inc.php")) { + $res = @include "../../main.inc.php"; +} +if (!$res && file_exists("../../../main.inc.php")) { + $res = @include "../../../main.inc.php"; +} +if (!$res) { + die("Include of main fails"); +} + +global $langs, $user; + +// Libraries +require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; +require_once DOL_DOCUMENT_ROOT.'/webhook/lib/webhook.lib.php'; + +// Translations +$langs->loadLangs(array("admin", "webhook")); + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('webhooksetup', 'globalsetup')); + +// Access control +if (!$user->admin) { + accessforbidden(); +} + +// Parameters +$action = GETPOST('action', 'aZ09'); +$backtopage = GETPOST('backtopage', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + +$value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); +$type = 'myobject'; + +$arrayofparameters = array( + 'WEBHOOK_MYPARAM1'=>array('type'=>'string', 'css'=>'minwidth500' ,'enabled'=>0), + //'WEBHOOK_MYPARAM2'=>array('type'=>'textarea','enabled'=>1), + //'WEBHOOK_MYPARAM3'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1), + //'WEBHOOK_MYPARAM4'=>array('type'=>'emailtemplate:thirdparty', 'enabled'=>1), + //'WEBHOOK_MYPARAM5'=>array('type'=>'yesno', 'enabled'=>1), + //'WEBHOOK_MYPARAM5'=>array('type'=>'thirdparty_type', 'enabled'=>1), + //'WEBHOOK_MYPARAM6'=>array('type'=>'securekey', 'enabled'=>1), + //'WEBHOOK_MYPARAM7'=>array('type'=>'product', 'enabled'=>1), +); + +$error = 0; +$setupnotempty = 0; + +// Set this to 1 to use the factory to manage constants. Warning, the generated module will be compatible with version v15+ only +$useFormSetup = 0; +// Convert arrayofparameter into a formSetup object +if ($useFormSetup && (float) DOL_VERSION >= 15) { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php'; + $formSetup = new FormSetup($db); + + // you can use the param convertor + $formSetup->addItemsFromParamsArray($arrayofparameters); + + // or use the new system see exemple as follow (or use both because you can ;-) ) + + /* + // Hôte + $item = $formSetup->newItem('NO_PARAM_JUST_TEXT'); + $item->fieldOverride = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST']; + $item->cssClass = 'minwidth500'; + + // Setup conf WEBHOOK_MYPARAM1 as a simple string input + $item = $formSetup->newItem('WEBHOOK_MYPARAM1'); + + // Setup conf WEBHOOK_MYPARAM1 as a simple textarea input but we replace the text of field title + $item = $formSetup->newItem('WEBHOOK_MYPARAM2'); + $item->nameText = $item->getNameText().' more html text '; + + // Setup conf WEBHOOK_MYPARAM3 + $item = $formSetup->newItem('WEBHOOK_MYPARAM3'); + $item->setAsThirdpartyType(); + + // Setup conf WEBHOOK_MYPARAM4 : exemple of quick define write style + $formSetup->newItem('WEBHOOK_MYPARAM4')->setAsYesNo(); + + // Setup conf WEBHOOK_MYPARAM5 + $formSetup->newItem('WEBHOOK_MYPARAM5')->setAsEmailTemplate('thirdparty'); + + // Setup conf WEBHOOK_MYPARAM6 + $formSetup->newItem('WEBHOOK_MYPARAM6')->setAsSecureKey()->enabled = 0; // disabled + + // Setup conf WEBHOOK_MYPARAM7 + $formSetup->newItem('WEBHOOK_MYPARAM7')->setAsProduct(); + */ + + $setupnotempty = count($formSetup->items); +} + + +$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); + + +/* + * Actions + */ + +include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; + +if ($action == 'updateMask') { + $maskconst = GETPOST('maskconst', 'alpha'); + $maskvalue = GETPOST('maskvalue', 'alpha'); + + if ($maskconst) { + $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity); + if (!($res > 0)) { + $error++; + } + } + + if (!$error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} elseif ($action == 'specimen') { + $modele = GETPOST('module', 'alpha'); + $tmpobjectkey = GETPOST('object'); + + $tmpobject = new $tmpobjectkey($db); + $tmpobject->initAsSpecimen(); + + // Search template files + $file = ''; $classname = ''; $filefound = 0; + $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); + foreach ($dirmodels as $reldir) { + $file = dol_buildpath($reldir."core/modules/webhook/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0); + if (file_exists($file)) { + $filefound = 1; + $classname = "pdf_".$modele; + break; + } + } + + if ($filefound) { + require_once $file; + + $module = new $classname($db); + + if ($module->write_file($tmpobject, $langs) > 0) { + header("Location: ".DOL_URL_ROOT."/document.php?modulepart=".strtolower($tmpobjectkey)."&file=SPECIMEN.pdf"); + return; + } else { + setEventMessages($module->error, null, 'errors'); + dol_syslog($module->error, LOG_ERR); + } + } else { + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); + dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); + } +} elseif ($action == 'setmod') { + // TODO Check if numbering module chosen can be activated by calling method canBeActivated + $tmpobjectkey = GETPOST('object'); + if (!empty($tmpobjectkey)) { + $constforval = 'WEBHOOK_'.strtoupper($tmpobjectkey)."_ADDON"; + dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity); + } +} elseif ($action == 'set') { + // Activate a model + $ret = addDocumentModel($value, $type, $label, $scandir); +} elseif ($action == 'del') { + $ret = delDocumentModel($value, $type); + if ($ret > 0) { + $tmpobjectkey = GETPOST('object'); + if (!empty($tmpobjectkey)) { + $constforval = 'WEBHOOK_'.strtoupper($tmpobjectkey).'_ADDON_PDF'; + if ($conf->global->$constforval == "$value") { + dolibarr_del_const($db, $constforval, $conf->entity); + } + } + } +} elseif ($action == 'setdoc') { + // Set or unset default model + $tmpobjectkey = GETPOST('object'); + if (!empty($tmpobjectkey)) { + $constforval = 'WEBHOOK_'.strtoupper($tmpobjectkey).'_ADDON_PDF'; + if (dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity)) { + // The constant that was read before the new set + // We therefore requires a variable to have a coherent view + $conf->global->$constforval = $value; + } + + // We disable/enable the document template (into llx_document_model table) + $ret = delDocumentModel($value, $type); + if ($ret > 0) { + $ret = addDocumentModel($value, $type, $label, $scandir); + } + } +} elseif ($action == 'unsetdoc') { + $tmpobjectkey = GETPOST('object'); + if (!empty($tmpobjectkey)) { + $constforval = 'WEBHOOK_'.strtoupper($tmpobjectkey).'_ADDON_PDF'; + dolibarr_del_const($db, $constforval, $conf->entity); + } +} + + + +/* + * View + */ + +$form = new Form($db); + +$help_url = ''; +$page_name = "WebhookSetup"; + +llxHeader('', $langs->trans($page_name), $help_url); + +// Subheader +$linkback = ''.$langs->trans("BackToModuleList").''; + +print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); + +// Configuration header +$head = webhookAdminPrepareHead(); +print dol_get_fiche_head($head, 'settings', $langs->trans($page_name), -1, "webhook@webhook"); + +// Setup page goes here +echo ''.$langs->trans("WebhookSetupPage").'

'; + + +if ($action == 'edit') { + if ($useFormSetup && (float) DOL_VERSION >= 15) { + print $formSetup->generateOutput(true); + } else { + print ''; + print ''; + print ''; + + print ''; + print ''; + + foreach ($arrayofparameters as $constname => $val) { + if ($val['enabled']==1) { + $setupnotempty++; + print ''; + } + } + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); + print ''.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).''; + print ''; + + if ($val['type'] == 'textarea') { + print '\n"; + } elseif ($val['type']== 'html') { + require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; + $doleditor = new DolEditor($constname, $conf->global->{$constname}, '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%'); + $doleditor->Create(); + } elseif ($val['type'] == 'yesno') { + print $form->selectyesno($constname, $conf->global->{$constname}, 1); + } elseif (preg_match('/emailtemplate:/', $val['type'])) { + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + + $tmp = explode(':', $val['type']); + $nboftemplates = $formmail->fetchAllEMailTemplate($tmp[1], $user, null, 1); // We set lang=null to get in priority record with no lang + //$arraydefaultmessage = $formmail->getEMailTemplate($db, $tmp[1], $user, null, 0, 1, ''); + $arrayofmessagename = array(); + if (is_array($formmail->lines_model)) { + foreach ($formmail->lines_model as $modelmail) { + //var_dump($modelmail); + $moreonlabel = ''; + if (!empty($arrayofmessagename[$modelmail->label])) { + $moreonlabel = ' (' . $langs->trans("SeveralLangugeVariatFound") . ')'; + } + // The 'label' is the key that is unique if we exclude the language + $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)) . $moreonlabel; + } + } + print $form->selectarray($constname, $arrayofmessagename, $conf->global->{$constname}, 'None', 0, 0, '', 0, 0, 0, '', '', 1); + } elseif (preg_match('/category:/', $val['type'])) { + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; + $formother = new FormOther($db); + + $tmp = explode(':', $val['type']); + print img_picto('', 'category', 'class="pictofixedwidth"'); + print $formother->select_categories($tmp[1], $conf->global->{$constname}, $constname, 0, $langs->trans('CustomersProspectsCategoriesShort')); + } elseif (preg_match('/thirdparty_type/', $val['type'])) { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; + $formcompany = new FormCompany($db); + print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname); + } elseif ($val['type'] == 'securekey') { + print ''; + if (!empty($conf->use_javascript_ajax)) { + print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"'); + } + if (!empty($conf->use_javascript_ajax)) { + print "\n".''; + } + } elseif ($val['type'] == 'product') { + if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { + $selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname); + $form->select_produits($selected, $constname, '', 0); + } + } else { + print ''; + } + print '
'; + + print '
'; + print ''; + print '
'; + + print ''; + } + + print '
'; +} else { + if ($useFormSetup && (float) DOL_VERSION >= 15) { + if (!empty($formSetup->items)) { + print $formSetup->generateOutput(); + } + } else { + if (!empty($arrayofparameters)) { + print ''; + print ''; + + foreach ($arrayofparameters as $constname => $val) { + if ($val['enabled']==1) { + $setupnotempty++; + print ''; + } + } + + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); + print $form->textwithpicto($langs->trans($constname), $tooltiphelp); + print ''; + + if ($val['type'] == 'textarea') { + print dol_nl2br($conf->global->{$constname}); + } elseif ($val['type']== 'html') { + print $conf->global->{$constname}; + } elseif ($val['type'] == 'yesno') { + print ajax_constantonoff($constname); + } elseif (preg_match('/emailtemplate:/', $val['type'])) { + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + + $tmp = explode(':', $val['type']); + + $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, $conf->global->{$constname}); + if ($template<0) { + setEventMessages(null, $formmail->errors, 'errors'); + } + print $langs->trans($template->label); + } elseif (preg_match('/category:/', $val['type'])) { + $c = new Categorie($db); + $result = $c->fetch($conf->global->{$constname}); + if ($result < 0) { + setEventMessages(null, $c->errors, 'errors'); + } elseif ($result > 0 ) { + $ways = $c->print_all_ways(' >> ', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text + $toprint = array(); + foreach ($ways as $way) { + $toprint[] = '
  • color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '
  • '; + } + print '
      ' . implode(' ', $toprint) . '
    '; + } + } elseif (preg_match('/thirdparty_type/', $val['type'])) { + if ($conf->global->{$constname}==2) { + print $langs->trans("Prospect"); + } elseif ($conf->global->{$constname}==3) { + print $langs->trans("ProspectCustomer"); + } elseif ($conf->global->{$constname}==1) { + print $langs->trans("Customer"); + } elseif ($conf->global->{$constname}==0) { + print $langs->trans("NorProspectNorCustomer"); + } + } elseif ($val['type'] == 'product') { + $product = new Product($db); + $resprod = $product->fetch($conf->global->{$constname}); + if ($resprod > 0) { + print $product->ref; + } elseif ($resprod < 0) { + setEventMessages(null, $object->errors, "errors"); + } + } else { + print $conf->global->{$constname}; + } + print '
    '; + } + } + + if ($setupnotempty) { + print '
    '; + print ''.$langs->trans("Modify").''; + print '
    '; + } else { + //print '
    '.$langs->trans("NothingToSetup"); + } +} + + +$moduledir = 'webhook'; +$myTmpObjects['MyObject'] = array('includerefgeneration'=>0, 'includedocgeneration'=>0); + + +foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { + if ($myTmpObjectKey == 'MyObject') { + continue; + } + if ($myTmpObjectArray['includerefgeneration']) { + /* + * Orders Numbering model + */ + $setupnotempty++; + + print load_fiche_titre($langs->trans("NumberingModules", $myTmpObjectKey), '', ''); + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''."\n"; + + clearstatcache(); + + foreach ($dirmodels as $reldir) { + $dir = dol_buildpath($reldir."core/modules/".$moduledir); + + if (is_dir($dir)) { + $handle = opendir($dir); + if (is_resource($handle)) { + while (($file = readdir($handle)) !== false) { + if (strpos($file, 'mod_'.strtolower($myTmpObjectKey).'_') === 0 && substr($file, dol_strlen($file) - 3, 3) == 'php') { + $file = substr($file, 0, dol_strlen($file) - 4); + + require_once $dir.'/'.$file.'.php'; + + $module = new $file($db); + + // Show modules according to features level + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) { + continue; + } + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) { + continue; + } + + if ($module->isEnabled()) { + dol_include_once('/'.$moduledir.'/class/'.strtolower($myTmpObjectKey).'.class.php'); + + print ''; + + // Show example of numbering model + print ''."\n"; + + print ''; + + $mytmpinstance = new $myTmpObjectKey($db); + $mytmpinstance->initAsSpecimen(); + + // Info + $htmltooltip = ''; + $htmltooltip .= ''.$langs->trans("Version").': '.$module->getVersion().'
    '; + + $nextval = $module->getNextValue($mytmpinstance); + if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval + $htmltooltip .= ''.$langs->trans("NextValue").': '; + if ($nextval) { + if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') { + $nextval = $langs->trans($nextval); + } + $htmltooltip .= $nextval.'
    '; + } else { + $htmltooltip .= $langs->trans($module->error).'
    '; + } + } + + print ''; + + print "\n"; + } + } + } + closedir($handle); + } + } + } + print "
    '.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("ShortInfo").'
    '.$module->name."\n"; + print $module->info(); + print ''; + $tmp = $module->getExample(); + if (preg_match('/^Error/', $tmp)) { + $langs->load("errors"); + print '
    '.$langs->trans($tmp).'
    '; + } elseif ($tmp == 'NotConfigured') { + print $langs->trans($tmp); + } else { + print $tmp; + } + print '
    '; + $constforvar = 'WEBHOOK_'.strtoupper($myTmpObjectKey).'_ADDON'; + if ($conf->global->$constforvar == $file) { + print img_picto($langs->trans("Activated"), 'switch_on'); + } else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; + } + print ''; + print $form->textwithpicto('', $htmltooltip, 1, 0); + print '

    \n"; + } + + if ($myTmpObjectArray['includedocgeneration']) { + /* + * Document templates generators + */ + $setupnotempty++; + $type = strtolower($myTmpObjectKey); + + print load_fiche_titre($langs->trans("DocumentModules", $myTmpObjectKey), '', ''); + + // Load array def with activated templates + $def = array(); + $sql = "SELECT nom"; + $sql .= " FROM ".MAIN_DB_PREFIX."document_model"; + $sql .= " WHERE type = '".$db->escape($type)."'"; + $sql .= " AND entity = ".$conf->entity; + $resql = $db->query($sql); + if ($resql) { + $i = 0; + $num_rows = $db->num_rows($resql); + while ($i < $num_rows) { + $array = $db->fetch_array($resql); + array_push($def, $array[0]); + $i++; + } + } else { + dol_print_error($db); + } + + print "\n"; + print "\n"; + print ''; + print ''; + print '\n"; + print '\n"; + print ''; + print ''; + print "\n"; + + clearstatcache(); + + foreach ($dirmodels as $reldir) { + foreach (array('', '/doc') as $valdir) { + $realpath = $reldir."core/modules/".$moduledir.$valdir; + $dir = dol_buildpath($realpath); + + if (is_dir($dir)) { + $handle = opendir($dir); + if (is_resource($handle)) { + while (($file = readdir($handle)) !== false) { + $filelist[] = $file; + } + closedir($handle); + arsort($filelist); + + foreach ($filelist as $file) { + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { + if (file_exists($dir.'/'.$file)) { + $name = substr($file, 4, dol_strlen($file) - 16); + $classname = substr($file, 0, dol_strlen($file) - 12); + + require_once $dir.'/'.$file; + $module = new $classname($db); + + $modulequalified = 1; + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) { + $modulequalified = 0; + } + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) { + $modulequalified = 0; + } + + if ($modulequalified) { + print ''; + + // Active + if (in_array($name, $def)) { + print ''; + } else { + print '"; + } + + // Default + print ''; + + // Info + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip .= '
    '.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown")); + if ($module->type == 'pdf') { + $htmltooltip .= '
    '.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + } + $htmltooltip .= '
    '.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file; + + $htmltooltip .= '

    '.$langs->trans("FeaturesSupported").':'; + $htmltooltip .= '
    '.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); + $htmltooltip .= '
    '.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); + + print ''; + + // Preview + print ''; + + print "\n"; + } + } + } + } + } + } + } + } + + print '
    '.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Status")."'.$langs->trans("Default")."'.$langs->trans("ShortInfo").''.$langs->trans("Preview").'
    '; + print (empty($module->name) ? $name : $module->name); + print "\n"; + if (method_exists($module, 'info')) { + print $module->info($langs); + } else { + print $module->description; + } + print ''."\n"; + print ''; + print img_picto($langs->trans("Enabled"), 'switch_on'); + print ''; + print ''."\n"; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print "'; + $constforvar = 'WEBHOOK_'.strtoupper($myTmpObjectKey).'_ADDON'; + if ($conf->global->$constforvar == $name) { + //print img_picto($langs->trans("Default"), 'on'); + // Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset + print 'scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; + } else { + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + } + print ''; + print $form->textwithpicto('', $htmltooltip, 1, 0); + print ''; + if ($module->type == 'pdf') { + print ''.img_object($langs->trans("Preview"), 'pdf').''; + } else { + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); + } + print '
    '; + } +} + +if (empty($setupnotempty)) { + print '
    '.$langs->trans("NothingToSetup"); +} + +// Page end +print dol_get_fiche_end(); + +llxFooter(); +$db->close(); diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index 53760aaa586..5f51bccb240 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -95,7 +95,7 @@ $tabfield[1] = "ref,description,virtualhost,position,date_creation"; // Nom des champs d'edition pour modification d'un enregistrement $tabfieldvalue = array(); -$tabfieldvalue[1] = "ref,description,virtualhost,position"; +$tabfieldvalue[1] = "ref,description,virtualhost,position,entity"; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert = array(); diff --git a/htdocs/admin/website_options.php b/htdocs/admin/website_options.php index f6c92888384..1f5ebaec4c6 100644 --- a/htdocs/admin/website_options.php +++ b/htdocs/admin/website_options.php @@ -112,7 +112,7 @@ if ($action == 'edit') { foreach ($arrayofparameters as $key => $val) { print ''; print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip')); - print ''; + print ''; } print ''; @@ -130,7 +130,7 @@ if ($action == 'edit') { foreach ($arrayofparameters as $key => $val) { print ''; print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip')); - print ''.$conf->global->$key.''; + print ''.getDolGlobalString($key).''; } print ''; diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index a68f49e36e3..47e6e87a244 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -68,7 +68,7 @@ $workflowcodes = array( 'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array( 'family'=>'create', 'position'=>20, - 'enabled'=>(!empty($conf->commande->enabled) && !empty($conf->facture->enabled)), + 'enabled'=>(!empty($conf->commande->enabled) && isModEnabled('facture')), 'picto'=>'bill' ), 'WORKFLOW_TICKET_CREATE_INTERVENTION' => array ( @@ -91,7 +91,7 @@ $workflowcodes = array( 'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array( 'family'=>'classify_proposal', 'position'=>31, - 'enabled'=>(!empty($conf->propal->enabled) && !empty($conf->facture->enabled)), + 'enabled'=>(!empty($conf->propal->enabled) && isModEnabled('facture')), 'picto'=>'propal', 'warning'=>'' ), @@ -112,7 +112,7 @@ $workflowcodes = array( 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array( 'family'=>'classify_order', 'position'=>42, - 'enabled'=>(!empty($conf->facture->enabled) && !empty($conf->commande->enabled)), + 'enabled'=>(isModEnabled('facture') && !empty($conf->commande->enabled)), 'picto'=>'order', 'warning'=>'' ), // For this option, if module invoice is disabled, it does not exists, so "Classify billed" for order must be done manually from order card. @@ -165,7 +165,7 @@ $workflowcodes = array( 'WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE' => array( 'family' => 'classify_shipping', 'position' => 90, - 'enabled' => ! empty($conf->expedition->enabled) && ! empty($conf->facture->enabled), + 'enabled' => !empty($conf->expedition->enabled) && !empty($conf->facture->enabled), 'picto' => 'shipment' ), @@ -173,13 +173,13 @@ $workflowcodes = array( 'WORKFLOW_TICKET_LINK_CONTRACT' => array( 'family' => 'link_ticket', 'position' => 75, - 'enabled' => ! empty($conf->ticket->enabled) && ! empty($conf->contract->enabled), + 'enabled' => !empty($conf->ticket->enabled) && !empty($conf->contract->enabled), 'picto' => 'ticket' ), 'WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS' => array( 'family' => 'link_ticket', 'position' => 76, - 'enabled' => ! empty($conf->ticket->enabled) && ! empty($conf->contract->enabled), + 'enabled' => !empty($conf->ticket->enabled) && !empty($conf->contract->enabled), 'picto' => 'ticket' ), ); diff --git a/htdocs/admin/workstation.php b/htdocs/admin/workstation.php index 6ac7a425246..bdd7ba662cd 100644 --- a/htdocs/admin/workstation.php +++ b/htdocs/admin/workstation.php @@ -188,7 +188,7 @@ if ($action == 'edit') { print ''; $tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : ''); print $form->textwithpicto($langs->trans($key), $tooltiphelp); - print ''; + print ''; } print ''; @@ -209,7 +209,7 @@ if ($action == 'edit') { print ''; $tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : ''); print $form->textwithpicto($langs->trans($key), $tooltiphelp); - print ''.$conf->global->$key.''; + print ''.getDolGlobalString($key).''; } print ''; diff --git a/htdocs/asset/agenda.php b/htdocs/asset/agenda.php index 49a0c215701..3d40cf62328 100644 --- a/htdocs/asset/agenda.php +++ b/htdocs/asset/agenda.php @@ -179,7 +179,7 @@ if ($object->id > 0) { print '
    '; - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { print '' . $langs->trans("AddAction") . ''; } else { @@ -189,7 +189,7 @@ if ($object->id > 0) { print '
    '; - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { $param = '&id=' . $object->id . '&socid=' . $socid; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage=' . urlencode($contextpage); diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 410af398bc7..d144d95819b 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -155,6 +155,7 @@ class Asset extends CommonObject public $import_key; public $model_pdf; public $status; + public $user_cloture_id; // /** // * @var string Field with ID of parent key if this object has a parent @@ -1441,24 +1442,10 @@ class Asset extends CommonObject if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - - if ($obj->fk_user_valid) { - $vuser = new User($this->db); - $vuser->fetch($obj->fk_user_valid); - $this->user_validation = $vuser; - } - - if ($obj->fk_user_cloture) { - $cluser = new User($this->db); - $cluser->fetch($obj->fk_user_cloture); - $this->user_cloture = $cluser; - } + $this->user_creation_id = $obj->fk_user_author; + $this->user_validation_id = $obj->fk_user_valid; + $this->user_cloture_id = $obj->fk_user_cloture; $this->date_creation = $this->db->jdate($obj->datec); $this->date_modification = $this->db->jdate($obj->datem); $this->date_validation = $this->db->jdate($obj->datev); diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php index 077f33936e8..6b75702278d 100644 --- a/htdocs/asset/class/assetmodel.class.php +++ b/htdocs/asset/class/assetmodel.class.php @@ -734,27 +734,11 @@ class AssetModel extends CommonObject if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - - if ($obj->fk_user_valid) { - $vuser = new User($this->db); - $vuser->fetch($obj->fk_user_valid); - $this->user_validation = $vuser; - } - - if ($obj->fk_user_cloture) { - $cluser = new User($this->db); - $cluser->fetch($obj->fk_user_cloture); - $this->user_cloture = $cluser; - } + $this->user_creation_id = $obj->fk_user_creat; + $this->user_modification_id = $obj->fk_user_modif; $this->date_creation = $this->db->jdate($obj->datec); $this->date_modification = $this->db->jdate($obj->datem); - $this->date_validation = $this->db->jdate($obj->datev); } $this->db->free($result); diff --git a/htdocs/asset/model/agenda.php b/htdocs/asset/model/agenda.php index a915f540ce9..f1db3030dc2 100644 --- a/htdocs/asset/model/agenda.php +++ b/htdocs/asset/model/agenda.php @@ -181,7 +181,7 @@ if ($object->id > 0) { print '
    '; - // if (!empty($conf->agenda->enabled)) { + // if (isModEnabled('agenda')) { // if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { // print '' . $langs->trans("AddAction") . ''; // } else { @@ -191,7 +191,7 @@ if ($object->id > 0) { print '
    '; - // if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + // if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { // $param = '&id=' . $object->id . '&socid=' . $socid; // if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { // $param .= '&contextpage=' . urlencode($contextpage); diff --git a/htdocs/asset/model/card.php b/htdocs/asset/model/card.php index f4cf1074dd2..3d3ec2f67d2 100644 --- a/htdocs/asset/model/card.php +++ b/htdocs/asset/model/card.php @@ -300,7 +300,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Clone - print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&socid=' . $object->socid . '&action=clone&token=' . newToken(), '', $permissiontoadd); + print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . (!empty($socid) ? '&socid=' . $socid : '') . '&action=clone&token=' . newToken(), '', $permissiontoadd); // Delete (need delete permission, or if draft, just need create/modify permission) print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php index 1a5f99b27ee..b4e365fe018 100644 --- a/htdocs/barcode/codeinit.php +++ b/htdocs/barcode/codeinit.php @@ -188,7 +188,7 @@ print ''; print '
    '; // For thirdparty -if ($conf->societe->enabled) { +if (isModEnabled('societe')) { $nbno = $nbtotal = 0; print load_fiche_titre($langs->trans("BarcodeInitForThirdparties"), '', 'company'); diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index ef4ca462008..ea5069cb840 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -140,7 +140,7 @@ class BlockedLog $this->trackedevents = array(); - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { $this->trackedevents['BILL_VALIDATE'] = 'logBILL_VALIDATE'; $this->trackedevents['BILL_DELETE'] = 'logBILL_DELETE'; $this->trackedevents['BILL_SENTBYMAIL'] = 'logBILL_SENTBYMAIL'; diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index 4bc9095a57e..d2c64eea0b6 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -150,7 +150,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -220,7 +220,7 @@ if ($object->id > 0) { print '
    '; - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { print ''.$langs->trans("AddAction").''; } else { @@ -230,7 +230,7 @@ if ($object->id > 0) { print '
    '; - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { $param = '&id='.$object->id.'&socid='.$socid; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index aee1f6ba0bf..ee619a589e3 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -476,7 +476,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -584,7 +584,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print "\n"; - print mrpCollapseBomManagement(); + mrpCollapseBomManagement(); } @@ -638,7 +638,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Create MO - if ($conf->mrp->enabled) { + if (isModEnabled('mrp')) { if ($object->status == $object::STATUS_VALIDATED && !empty($user->rights->mrp->write)) { print ''.$langs->trans("CreateMO").''."\n"; } diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 598c4c73945..655af8b0a1f 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -909,27 +909,11 @@ class BOM extends CommonObject if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - if (!empty($obj->fk_user_author)) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - - if (!empty($obj->fk_user_valid)) { - $vuser = new User($this->db); - $vuser->fetch($obj->fk_user_valid); - $this->user_validation = $vuser; - } - - if (!empty($obj->fk_user_cloture)) { - $cluser = new User($this->db); - $cluser->fetch($obj->fk_user_cloture); - $this->user_cloture = $cluser; - } + $this->user_creation_id = $obj->fk_user_creat; + $this->user_modification_id = $obj->fk_user_modif; $this->date_creation = $this->db->jdate($obj->datec); - $this->date_modification = !empty($obj->datem) ? $this->db->jdate($obj->datem) : ""; - $this->date_validation = !empty($obj->datev) ? $this->db->jdate($obj->datev) : ""; + $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem); } $this->db->free($result); @@ -1581,29 +1565,11 @@ class BOMLine extends CommonObjectLine if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - - if ($obj->fk_user_valid) { - $vuser = new User($this->db); - $vuser->fetch($obj->fk_user_valid); - $this->user_validation = $vuser; - } - - if ($obj->fk_user_cloture) { - $cluser = new User($this->db); - $cluser->fetch($obj->fk_user_cloture); - $this->user_cloture = $cluser; - } - + $this->user_creation_id = $obj->fk_user_creat; + $this->user_modification_id = $obj->fk_user_modif; $this->date_creation = $this->db->jdate($obj->datec); - $this->date_modification = $this->db->jdate($obj->datem); - $this->date_validation = $this->db->jdate($obj->datev); + $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem); } - $this->db->free($result); } else { dol_print_error($this->db); diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index ec3d75dee1a..361f2a5f1ce 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -246,7 +246,7 @@ if ($user->rights->categorie->creer) { // Description print ''.$langs->trans("Description").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('description', $description, '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_5, '90%'); + $doleditor = new DolEditor('description', $description, '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_5, '90%'); $doleditor->Create(); print ''; diff --git a/htdocs/categories/class/api_categories.class.php b/htdocs/categories/class/api_categories.class.php index 7e3720abad8..fcac14f1337 100644 --- a/htdocs/categories/class/api_categories.class.php +++ b/htdocs/categories/class/api_categories.class.php @@ -51,10 +51,13 @@ class Categories extends DolibarrApi 4 => 'contact', 5 => 'account', 6 => 'project', - //7 => 'user', - //8 => 'bank_line', - //9 => 'warehouse', - //10 => 'actioncomm', + 7 => 'user', + 8 => 'bank_line', + 9 => 'warehouse', + 10 => 'actioncomm', + 11 => 'website_page', + 12 => 'ticket', + 13 => 'knowledgemanagement' ); /** @@ -662,6 +665,10 @@ class Categories extends DolibarrApi $object = parent::_cleanObjectDatas($object); // Remove fields not relevent to categories + unset($object->MAP_CAT_FK); + unset($object->MAP_CAT_TABLE); + unset($object->MAP_OBJ_CLASS); + unset($object->MAP_OBJ_TABLE); unset($object->country); unset($object->country_id); unset($object->country_code); diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 05b1822f45f..dad25199566 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -175,11 +175,10 @@ class Categorie extends CommonObject ); /** - * @var array Object table mapping from type string (table llx_...) when value of key does not match table name. - * - * @note Move to const array when PHP 5.6 will be our minimum target + * @var array Object table mapping from type string (table llx_...) when value of key does not match table name. + * This array may be completed by external modules with hook "constructCategory" */ - public static $MAP_OBJ_TABLE = array( + public $MAP_OBJ_TABLE = array( 'customer' => 'societe', 'supplier' => 'societe', 'member' => 'adherent', @@ -372,6 +371,8 @@ class Categorie extends CommonObject $this->entity = (int) $res['entity']; $this->date_creation = $this->db->jdate($res['date_creation']); $this->date_modification = $this->db->jdate($res['tms']); + $this->user_creation_id = (int) $res['fk_user_creat']; + $this->user_modification_id = (int) $res['fk_user_modif']; $this->user_creation = (int) $res['fk_user_creat']; $this->user_modification = (int) $res['fk_user_modif']; @@ -989,7 +990,7 @@ class Categorie extends CommonObject $categories[$i]['array_options'] = $category_static->array_options; // multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (!empty($conf->global->MAIN_MULTILANGS) && isset($category_static->multilangs)) { $categories[$i]['multilangs'] = $category_static->multilangs; } } diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 2bbb4b5f0a8..512f25a67e2 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -263,7 +263,7 @@ if ($action == 'edit') { // Desc $desc = (GETPOST('desc-'.$key) ? GETPOST('desc-'.$key) : $object->multilangs[$key]['description']); print ''.$langs->trans('Description').''; - $doleditor = new DolEditor("desc-$key", $desc, '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%'); + $doleditor = new DolEditor("desc-$key", $desc, '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%'); $doleditor->Create(); print ''; @@ -323,7 +323,7 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service print ''.$langs->trans('Label').''; print ''; print ''.$langs->trans('Description').''; - $doleditor = new DolEditor('desc', GETPOST('desc', 'restricthtml'), '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%'); + $doleditor = new DolEditor('desc', GETPOST('desc', 'restricthtml'), '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%'); $doleditor->Create(); print ''; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index b1ae9dee61b..351ab9212bc 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1234,7 +1234,7 @@ if ($action == 'create') { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $projectid = GETPOST('projectid', 'int'); @@ -1737,7 +1737,7 @@ if ($id > 0) { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); print ''.$langs->trans("Project").''; @@ -1762,7 +1762,7 @@ if ($id > 0) { print ''; print ''.$langs->trans("LinkedObject").''; - if ($object->elementtype == 'task' && !empty($conf->projet->enabled)) { + if ($object->elementtype == 'task' && !empty($conf->project->enabled)) { print ''; $urloption = '?action=create&donotclearsession=1'; // we use create not edit for more flexibility @@ -1946,7 +1946,7 @@ if ($id > 0) { // Thirdparty //$morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); //$morehtmlref.='
    '.$langs->trans('Project') . ' '; $morehtmlref .= $langs->trans('Project').' '; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 19eb35376cd..7d03def1464 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1448,21 +1448,10 @@ class ActionComm extends CommonObject if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); $this->id = $obj->id; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - if ($obj->fk_user_mod) { - $muser = new User($this->db); - $muser->fetch($obj->fk_user_mod); - $this->user_modification = $muser; - } - - $this->date_creation = $this->db->jdate($obj->datec); - if (!empty($obj->fk_user_mod)) { - $this->date_modification = $this->db->jdate($obj->datem); - } + $this->user_creation_id = $obj->fk_user_author; + $this->user_modification_id = $obj->fk_user_mod; + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem); } $this->db->free($result); } else { @@ -2513,14 +2502,16 @@ class ActionComm extends CommonObject * * @param int $id The id of the event * @param int $percent The new percent value for the event + * @param int $usermodid The user who modified the percent * @return int 1 when update of the event was suscessfull, otherwise -1 */ - public function updatePercent($id, $percent) + public function updatePercent($id, $percent, $usermodid = 0) { $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm "; $sql .= " SET percent = ".(int) $percent; + if ($usermodid > 0) $sql .= ", fk_user_mod = ".$usermodid; $sql .= " WHERE id = ".((int) $id); if ($this->db->query($sql)) { diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 8dd6b008045..d2b089491a7 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -198,7 +198,7 @@ class CActionComm //var_dump($obj->type.' '.$obj->module.' '); var_dump($user->rights->facture->lire); $qualified = 0; // Special cases - if ($obj->module == 'invoice' && !empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) { + if ($obj->module == 'invoice' && isModEnabled('facture') && !empty($user->rights->facture->lire)) { $qualified = 1; } if ($obj->module == 'order' && !empty($conf->commande->enabled) && empty($user->rights->commande->lire)) { diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 38779e300ed..90ed4ea1944 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -159,7 +159,7 @@ if ($object->id > 0) { // Thirdparty //$morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); //$morehtmlref.='
    '.$langs->trans('Project') . ' '; $morehtmlref .= $langs->trans('Project').': '; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index ec80dc90a4c..9fcb8375193 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -848,7 +848,6 @@ if ($resql) { $event->fk_project = $obj->fk_project; $event->socid = $obj->fk_soc; - $event->thirdparty_id = $obj->fk_soc; $event->contact_id = $obj->fk_contact; // Defined date_start_in_calendar and date_end_in_calendar property diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php index 19f4c4bfa03..0ea24279df4 100644 --- a/htdocs/comm/action/info.php +++ b/htdocs/comm/action/info.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -86,7 +86,7 @@ $morehtmlref = '
    '; // Thirdparty //$morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); //$morehtmlref.='
    '.$langs->trans('Project') . ' '; $morehtmlref .= $langs->trans('Project').': '; diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 06e6684d99b..dd877e903e4 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -987,10 +987,10 @@ while ($i < $imaxinloop) { if (!empty($arrayfields['a.datep']['checked'])) { print ''; if (empty($obj->fulldayevent)) { - print dol_print_date($db->jdate($obj->dp), $formatToUse, 'tzuser'); + print dol_print_date($db->jdate($obj->dp), $formatToUse, 'tzuserrel'); } else { $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); - print dol_print_date($db->jdate($obj->dp), $formatToUse, ($tzforfullday ? $tzforfullday : 'tzuser')); + print dol_print_date($db->jdate($obj->dp), $formatToUse, ($tzforfullday ? $tzforfullday : 'tzuserrel')); } $late = 0; if ($actionstatic->hasDelay() && $actionstatic->percentage >= 0 && $actionstatic->percentage < 100 ) { @@ -1006,10 +1006,10 @@ while ($i < $imaxinloop) { if (!empty($arrayfields['a.datep2']['checked'])) { print ''; if (empty($obj->fulldayevent)) { - print dol_print_date($db->jdate($obj->dp2), $formatToUse, 'tzuser'); + print dol_print_date($db->jdate($obj->dp2), $formatToUse, 'tzuserrel'); } else { $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); - print dol_print_date($db->jdate($obj->dp2), $formatToUse, ($tzforfullday ? $tzforfullday : 'tzuser')); + print dol_print_date($db->jdate($obj->dp2), $formatToUse, ($tzforfullday ? $tzforfullday : 'tzuserrel')); } print ''; } @@ -1091,11 +1091,11 @@ while ($i < $imaxinloop) { // Date creation if (!empty($arrayfields['a.datec']['checked'])) { // Status/Percent - print ''.dol_print_date($db->jdate($obj->datec), 'dayhour', 'tzuser').''; + print ''.dol_print_date($db->jdate($obj->datec), 'dayhour', 'tzuserrel').''; } // Date update if (!empty($arrayfields['a.tms']['checked'])) { - print ''.dol_print_date($db->jdate($obj->datem), 'dayhour', 'tzuser').''; + print ''.dol_print_date($db->jdate($obj->datem), 'dayhour', 'tzuserrel').''; } if (!empty($arrayfields['a.percent']['checked'])) { // Status/Percent diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index d0cb4d7be2f..1c63189db0e 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -40,10 +40,8 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -} -if (!empty($conf->facture->enabled)) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; } if (!empty($conf->propal->enabled)) { @@ -77,10 +75,10 @@ if (!empty($conf->commande->enabled)) { if (!empty($conf->expedition->enabled)) { $langs->load("sendings"); } -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { $langs->load("bills"); } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); } if (!empty($conf->ficheinter->enabled)) { @@ -741,7 +739,7 @@ if ($object->id > 0) { } } - if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { + if (isModEnabled('facture') && $user->rights->facture->lire) { // Box factures $tmp = $object->getOutstandingBills('customer', 0); $outstandingOpened = $tmp['opened']; @@ -1123,7 +1121,7 @@ if ($object->id > 0) { * Latest contracts */ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { - $sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut as contract_status, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup"; + $sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut as contract_status, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup, c.entity"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; $sql .= " WHERE c.fk_soc = s.rowid "; $sql .= " AND s.rowid = ".((int) $object->id); @@ -1193,7 +1191,7 @@ if ($object->id > 0) { } } $relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf'; - print $formfile->showPreview($file_list, $contrat->element, $relativepath, 0, $param); + print $formfile->showPreview($file_list, $contrat->element, $relativepath, 0); } // $filename = dol_sanitizeFileName($objp->ref); // $filedir = $conf->contrat->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); @@ -1311,7 +1309,7 @@ if ($object->id > 0) { /* * Latest invoices templates */ - if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { + if (isModEnabled('facture') && $user->rights->facture->lire) { $sql = 'SELECT f.rowid as id, f.titre as ref'; $sql .= ', f.total_ht'; $sql .= ', f.total_tva'; @@ -1406,11 +1404,12 @@ if ($object->id > 0) { /* * Latest invoices */ - if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { + if (isModEnabled('facture') && $user->rights->facture->lire) { $sql = 'SELECT f.rowid as facid, f.ref, f.type'; $sql .= ', f.total_ht'; $sql .= ', f.total_tva'; $sql .= ', f.total_ttc'; + $sql .= ', f.entity'; $sql .= ', f.datef as df, f.datec as dc, f.paye as paye, f.fk_statut as status'; $sql .= ', s.nom, s.rowid as socid'; $sql .= ', SUM(pf.amount) as am'; @@ -1419,7 +1418,7 @@ if ($object->id > 0) { $sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = ".((int) $object->id); $sql .= " AND f.entity IN (".getEntity('invoice').")"; $sql .= ' GROUP BY f.rowid, f.ref, f.type, f.total_ht, f.total_tva, f.total_ttc,'; - $sql .= ' f.datef, f.datec, f.paye, f.fk_statut,'; + $sql .= ' f.entity, f.datef, f.datec, f.paye, f.fk_statut,'; $sql .= ' s.nom, s.rowid'; $sql .= " ORDER BY f.datef DESC, f.datec DESC"; @@ -1477,7 +1476,7 @@ if ($object->id > 0) { } } $relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf'; - print $formfile->showPreview($file_list, $facturestatic->element, $relativepath, 0, $param); + print $formfile->showPreview($file_list, $facturestatic->element, $relativepath, 0); } // $filename = dol_sanitizeFileName($objp->ref); // $filedir = $conf->facture->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); @@ -1569,7 +1568,7 @@ if ($object->id > 0) { print ''; } - if (!empty($conf->facture->enabled) && $object->status == 1) { + if (isModEnabled('facture') && $object->status == 1) { if (empty($user->rights->facture->creer)) { print ''; } else { @@ -1597,7 +1596,7 @@ if ($object->id > 0) { } // Add action - if (!empty($conf->agenda->enabled) && !empty($conf->global->MAIN_REPEATTASKONEACHTAB) && $object->status == 1) { + if (isModEnabled('agenda') && !empty($conf->global->MAIN_REPEATTASKONEACHTAB) && $object->status == 1) { if ($user->rights->agenda->myactions->create) { print ''; } else { diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 5903b7e4bdb..c63ece66cd2 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -39,6 +39,9 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; +if (!empty($conf->ficheinter->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; +} // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager = new HookManager($db); @@ -100,6 +103,10 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU $supplierorderstatic = new CommandeFournisseur($db); } +if (!empty($conf->ficheinter->enabled)) { + $fichinterstatic = new Fichinter($db); +} + llxHeader("", $langs->trans("CommercialArea")); print load_fiche_titre($langs->trans("CommercialArea"), '', 'commercial'); @@ -508,7 +515,12 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU * Draft interventionals */ if (!empty($conf->ficheinter->enabled)) { - $sql = "SELECT f.rowid, f.ref, s.nom as name, s.rowid as socid"; + $sql = "SELECT f.rowid, f.ref, s.nom as name, f.fk_statut"; + $sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; + $sql .= ", s.code_client, s.code_compta, s.client"; + $sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur"; + $sql .= ", s.logo, s.email, s.entity"; + $sql .= ", s.canvas"; $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; if (empty($user->rights->societe->client->voir) && !$socid) { @@ -524,22 +536,46 @@ if (!empty($conf->ficheinter->enabled)) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } + $resql = $db->query($sql); if ($resql) { + $num = $db->num_rows($resql); + $nbofloop = min($num, $maxofloop); + print '
    '; print ''; print ''; print ''; - $langs->load("fichinter"); - $num = $db->num_rows($resql); + if ($num) { $i = 0; - while ($i < $num) { + while ($i < $nbofloop) { $obj = $db->fetch_object($resql); + + $fichinterstatic->id=$obj->rowid; + $fichinterstatic->ref=$obj->ref; + $fichinterstatic->statut=$obj->fk_statut; + + $companystatic->id = $obj->socid; + $companystatic->name = $obj->name; + $companystatic->name_alias = $obj->name_alias; + $companystatic->code_client = $obj->code_client; + $companystatic->code_compta = $obj->code_compta; + $companystatic->client = $obj->client; + $companystatic->code_fournisseur = $obj->code_fournisseur; + $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur; + $companystatic->fournisseur = $obj->fournisseur; + $companystatic->logo = $obj->logo; + $companystatic->email = $obj->email; + $companystatic->entity = $obj->entity; + $companystatic->canvas = $obj->canvas; print ''; - print '"; - print ''; + print '"; + print ''; $i++; } } diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index b3d3dd25e90..d46a02132a1 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -753,7 +753,7 @@ if ($action == 'create') { print '
    '; // wysiwyg editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('bodyemail', GETPOST('bodyemail', 'restricthtmlallowunvalid'), '', 600, 'dolibarr_mailings', '', true, true, $conf->global->FCKEDITOR_ENABLE_MAILING, 20, '90%'); + $doleditor = new DolEditor('bodyemail', GETPOST('bodyemail', 'restricthtmlallowunvalid'), '', 600, 'dolibarr_mailings', '', true, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '90%'); $doleditor->Create(); print '
    '; @@ -1249,6 +1249,11 @@ if ($action == 'create') { $out .= ''.$langs->trans("NoAttachedFiles").'
    '; } // Add link to add file + $maxfilesizearray = getMaxFileSizeArray(); + $maxmin = $maxfilesizearray['maxmin']; + if ($maxmin > 0) { + $out .= ''; // MAX_FILE_SIZE must precede the field type=file + } $out .= ''; $out .= ' '; $out .= ''; @@ -1268,7 +1273,7 @@ if ($action == 'create') { if ($action == 'edit') { // wysiwyg editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, true, $conf->global->FCKEDITOR_ENABLE_MAILING, 20, '90%'); + $doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '90%'); $doleditor->Create(); } if ($action == 'edithtml') { diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 95639a25997..c9b48665c95 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -384,6 +384,7 @@ if ($object->fetch($id) >= 0) { if ($allowaddtarget) { print ''; print ''; + print ''; } else { print '
    '; } @@ -428,7 +429,7 @@ if ($object->fetch($id) >= 0) { print '
    '; if ($allowaddtarget) { - print ''; + print ''; } else { print ''; //print $langs->trans("MailNoChangePossible"); @@ -640,10 +641,10 @@ if ($object->fetch($id) >= 0) { $obj = $db->fetch_object($resql); print '
    '; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print ''; if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD) && !empty($soc->shipping_method_id)) { @@ -1718,7 +1718,7 @@ if ($action == 'create') { // Mode of payment print ''; // Bank Account @@ -1779,7 +1779,7 @@ if ($action == 'create') { print ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); print ''; print ''; - print ''; + print ''; print ''; // Multicurrency Amount VAT print ''; - print ''; + print ''; print ''; // Multicurrency Amount TTC print ''; - print ''; + print ''; print ''; } // Amount HT print ''; - print ''; + print ''; print ''; // Amount VAT print ''; - print ''; + print ''; print ''; // Amount Local Taxes if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { // Localtax1 print ''; - print ''; + print ''; print ''; } if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { // Localtax2 print ''; - print ''; + print ''; print ''; } // Amount TTC print ''; - print ''; + print ''; print ''; // Statut @@ -2801,7 +2801,7 @@ if ($action == 'create') { // Create an invoice and classify billed if ($object->statut == Propal::STATUS_SIGNED && empty($conf->global->PROPOSAL_ARE_NOT_BILLABLE)) { - if (!empty($conf->facture->enabled) && $usercancreateinvoice) { + if (isModEnabled('facture') && $usercancreateinvoice) { print ''.$langs->trans("CreateBill").''; } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 73e73fbe2f9..cafca0d05a9 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -297,7 +297,7 @@ class Propal extends CommonObject 'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>22), 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'RefExt', 'enabled'=>1, 'visible'=>0, 'position'=>40), 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'position'=>23), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>24), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>24), 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25), 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>55), 'datep' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>-1, 'position'=>60), @@ -1367,7 +1367,7 @@ class Propal extends CommonObject $object->mode_reglement_id = (!empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0); $object->fk_delivery_address = ''; - /*if (!empty($conf->projet->enabled)) + /*if (!empty($conf->project->enabled)) { $project = new Project($db); if ($this->fk_project > 0 && $project->fetch($this->fk_project)) { @@ -3258,7 +3258,7 @@ class Propal extends CommonObject public function info($id) { $sql = "SELECT c.rowid, "; - $sql .= " c.datec, c.date_valid as datev, c.date_signature, c.date_cloture as dateo,"; + $sql .= " c.datec, c.date_valid as datev, c.date_signature, c.date_cloture,"; $sql .= " c.fk_user_author, c.fk_user_valid, c.fk_user_signature, c.fk_user_cloture"; $sql .= " FROM ".MAIN_DB_PREFIX."propal as c"; $sql .= " WHERE c.rowid = ".((int) $id); @@ -3274,7 +3274,7 @@ class Propal extends CommonObject $this->date_creation = $this->db->jdate($obj->datec); $this->date_validation = $this->db->jdate($obj->datev); $this->date_signature = $this->db->jdate($obj->date_signature); - $this->date_cloture = $this->db->jdate($obj->dateo); + $this->date_cloture = $this->db->jdate($obj->date_cloture); $cuser = new User($this->db); $cuser->fetch($obj->fk_user_author); @@ -3673,6 +3673,9 @@ class Propal extends CommonObject if (!empty($this->total_ttc)) { $label .= '
    '.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); } + if (!empty($this->date)) { + $label .= '
    '.$langs->trans('Date').': '.dol_print_date($this->date, 'day'); + } if (!empty($this->delivery_date)) { $label .= '
    '.$langs->trans('DeliveryDate').': '.dol_print_date($this->delivery_date, 'dayhour'); } diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index 2b8c5d9047d..1e688457623 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -172,7 +172,7 @@ class PropaleStats extends Stats * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month * @return array Array with amount by month */ - public function getAmountByMonth($year, $format) + public function getAmountByMonth($year, $format = 0) { global $user; diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 989dcfe7098..d9942e9153c 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -137,7 +137,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->propal->creer) { diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 804fedd623b..31cf2c18f42 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -136,7 +136,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->propal->creer) { diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php index dc43af9ceff..65ff9c19e2b 100644 --- a/htdocs/comm/propal/info.php +++ b/htdocs/comm/propal/info.php @@ -28,7 +28,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -83,7 +83,7 @@ $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_cl // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->propal->creer) { diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 103ef815e48..e490a5ca7ac 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -204,8 +204,8 @@ $checkedtypetiers = 0; $arrayfields = array( 'p.ref'=>array('label'=>"Ref", 'checked'=>1), 'p.ref_client'=>array('label'=>"RefCustomer", 'checked'=>1), - 'pr.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1)), - 'pr.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1)), + 'pr.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1)), + 'pr.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1)), 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1), 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>-1), 's.town'=>array('label'=>"Town", 'checked'=>-1), diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 13fa42edb29..7e40552fefb 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -29,7 +29,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -107,7 +107,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->propal->creer) { diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index 0bcf2662a44..e63aee6f240 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -169,7 +169,7 @@ print '
    '; /* * Actions commerciales a faire */ -if (!empty($conf->agenda->enabled)) { +if (isModEnabled('agenda')) { show_array_actions_to_do(10); } diff --git a/htdocs/comm/recap-client.php b/htdocs/comm/recap-client.php index ee32c0dd016..da37fe1048c 100644 --- a/htdocs/comm/recap-client.php +++ b/htdocs/comm/recap-client.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Load translation files required by the page $langs->load("companies"); -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { $langs->load("bills"); } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index c0aae93dff9..22505f6b921 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -48,7 +48,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (!empty($conf->propal->enabled)) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -1217,10 +1217,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -1492,7 +1492,7 @@ $form = new Form($db); $formfile = new FormFile($db); $formorder = new FormOrder($db); $formmargin = new FormMargin($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -1753,10 +1753,9 @@ if ($action == 'create' && $usercancreate) { } // Shipping Method - if (!empty($conf->expedition->enabled)) { + if (isModEnabled('expedition')) { print '
    '; } @@ -1778,7 +1777,7 @@ if ($action == 'create' && $usercancreate) { // TODO How record was recorded OrderMode (llx_c_input_method) // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); print ''; print ''; // Shipping Method - if (!empty($conf->expedition->enabled)) { + if (isModEnabled('expedition')) { print ''; - print ''; + print ''; print ''; // Multicurrency Amount VAT print ''; - print ''; + print ''; print ''; // Multicurrency Amount TTC print ''; - print ''; + print ''; print ''; } @@ -2588,23 +2587,23 @@ if ($action == 'create' && $usercancreate) { $alert = ' '.img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->order_min_amount)); } print ''; - print ''; + print ''; // Total VAT - print ''; + print ''; // Amount Local Taxes if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { // Localtax1 print ''; - print ''; + print ''; } if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { // Localtax2 IRPF print ''; - print ''; + print ''; } // Total TTC - print ''; + print ''; // Statut //print ''; @@ -2740,7 +2739,7 @@ if ($action == 'create' && $usercancreate) { if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0) { if ($user->rights->ficheinter->creer) { - print dolGetButtonAction('', $langs->trans('AddInterventionGR'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, ''); + print dolGetButtonAction('', $langs->trans('AddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, ''); } else { print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('AddIntervention'), 'default', $_SERVER['PHP_SELF']. '#', '', false); } @@ -2758,11 +2757,11 @@ if ($action == 'create' && $usercancreate) { // Ship $numshipping = 0; - if (!empty($conf->expedition->enabled)) { + if (isModEnabled('expedition')) { $numshipping = $object->nb_expedition(); if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { - if (($conf->expedition_bon->enabled && $user->rights->expedition->creer) || ($conf->delivery_note->enabled && $user->rights->expedition->delivery->creer)) { + if ((isModEnabled('expedition_bon') && $user->rights->expedition->creer) || ($conf->delivery_note->enabled && $user->rights->expedition->delivery->creer)) { if ($user->rights->expedition->creer) { print dolGetButtonAction('', $langs->trans('CreateShipment'), 'default', DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id, ''); } else { @@ -2782,7 +2781,7 @@ if ($action == 'create' && $usercancreate) { // Create bill and Classify billed // Note: Even if module invoice is not enabled, we should be able to use button "Classified billed" if ($object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) { - if (!empty($conf->facture->enabled) && $user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) { + if (isModEnabled('facture') && $user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) { print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&token='.newToken().'&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, ''); } if ($usercancreate && $object->statut >= Commande::STATUS_VALIDATED && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { @@ -2800,8 +2799,8 @@ if ($action == 'create' && $usercancreate) { } // Cancel order - if ($object->statut == Commande::STATUS_VALIDATED && (!empty($usercanclose) || !empty($usercancancel))) { - print dolGetButtonAction('', $langs->trans('Cancel'), 'danger', $_SERVER["PHP_SELF"].'?action=cancel&token='.newToken().'&id='.$object->id, ''); + if ($object->statut == Commande::STATUS_VALIDATED && !empty($usercancancel)) { + print ''.$langs->trans("Cancel").''; } // Delete order diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 44cc5c6effd..d75b64c8dab 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -314,7 +314,7 @@ class Commande extends CommonOrder 'ref_int' =>array('type'=>'varchar(255)', 'label'=>'RefInt', 'enabled'=>1, 'visible'=>0, 'position'=>27), // deprecated 'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>28), 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>20), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>25), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>25), 'date_commande' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>1, 'position'=>60), 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>62), 'date_cloture' =>array('type'=>'datetime', 'label'=>'DateClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>65), @@ -1882,8 +1882,11 @@ class Commande extends CommonOrder $this->status = $obj->fk_statut; $this->user_author_id = $obj->fk_user_author; + $this->user_creation_id = $obj->fk_user_author; + $this->user_validation_id = $obj->fk_user_valid; $this->user_valid = $obj->fk_user_valid; - $this->user_modification = $obj->fk_user_modif; + $this->user_modification_id = $obj->fk_user_modif; + $this->user_modification = $obj->fk_user_modif; $this->total_ht = $obj->total_ht; $this->total_tva = $obj->total_tva; $this->total_localtax1 = $obj->total_localtax1; @@ -2123,9 +2126,9 @@ class Commande extends CommonOrder $line->product_ref = $objp->product_ref; $line->product_label = $objp->product_label; - $line->product_desc = $objp->product_desc; $line->product_tosell = $objp->product_tosell; $line->product_tobuy = $objp->product_tobuy; + $line->product_desc = $objp->product_desc; $line->product_tobatch = $objp->product_tobatch; $line->product_barcode = $objp->product_barcode; @@ -2264,8 +2267,8 @@ class Commande extends CommonOrder } $sql .= ' ed.fk_origin_line = cd.rowid'; $sql .= ' AND cd.fk_commande = '.((int) $this->id); - if ($this->fk_product > 0) { - $sql .= ' AND cd.fk_product = '.((int) $this->fk_product); + if ($fk_product > 0) { + $sql .= ' AND cd.fk_product = '.((int) $fk_product); } if ($filtre_statut >= 0) { $sql .= ' AND e.fk_statut >= '.((int) $filtre_statut); diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index b89623fc3a0..5f4de8b59a0 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -131,7 +131,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 684d8e61334..d85400243e7 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -130,7 +130,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php index 38d8beba2ec..93b80b80f1c 100644 --- a/htdocs/commande/info.php +++ b/htdocs/commande/info.php @@ -27,7 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -83,7 +83,7 @@ $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_cl // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index cdabf9f2a5a..264613ac597 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -165,8 +165,8 @@ $checkedtypetiers = 0; $arrayfields = array( 'c.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>5), 'c.ref_client'=>array('label'=>"RefCustomerOrder", 'checked'=>-1, 'position'=>10), - 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>-1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>20), - 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>25), + 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>-1, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1), 'position'=>20), + 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1), 'position'=>25), 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30), 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>-1, 'position'=>31), 's.town'=>array('label'=>"Town", 'checked'=>-1, 'position'=>35), @@ -1821,8 +1821,9 @@ if ($resql) { $total_ht = 0; $total_margin = 0; + $imaxinloop = ($limit ? min($num, $limit) : $num); $last_num = min($num, $limit); - while ($i < $last_num) { + while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); $notshippable = 0; @@ -1928,7 +1929,7 @@ if ($resql) { print $getNomUrl_cache[$obj->socid]; // If module invoices enabled and user with invoice creation permissions - if (!empty($conf->facture->enabled) && !empty($conf->global->ORDER_BILLING_ALL_CUSTOMER)) { + if (isModEnabled('facture') && !empty($conf->global->ORDER_BILLING_ALL_CUSTOMER)) { if ($user->rights->facture->creer) { if (($obj->fk_statut > 0 && $obj->fk_statut < 3) || ($obj->fk_statut == 3 && $obj->billed == 0)) { print ' '; @@ -2318,8 +2319,11 @@ if ($resql) { $numlines = count($generic_commande->lines); // Loop on each line of order for ($lig = 0; $lig < $numlines; $lig++) { - $reliquat = $generic_commande->lines[$lig]->qty - $generic_commande->expeditions[$generic_commande->lines[$lig]->id]; - + if (isset($generic_commande->expeditions[$generic_commande->lines[$lig]->id])) { + $reliquat = $generic_commande->lines[$lig]->qty - $generic_commande->expeditions[$generic_commande->lines[$lig]->id]; + } else { + $reliquat = $generic_commande->lines[$lig]->qty; + } if ($generic_commande->lines[$lig]->product_type == 0 && $generic_commande->lines[$lig]->fk_product > 0) { // If line is a product and not a service $nbprod++; // order contains real products $generic_product->id = $generic_commande->lines[$lig]->fk_product; @@ -2457,6 +2461,17 @@ if ($resql) { // Show total line include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + // If no record found + if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''; + } + $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php index 55140c30ae2..75d8e587ccb 100644 --- a/htdocs/commande/note.php +++ b/htdocs/commande/note.php @@ -28,7 +28,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -102,7 +102,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php index 8c1df906ab7..819a6ecb74f 100644 --- a/htdocs/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php @@ -53,7 +53,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { echo ''; echo '
    '; echo ''; - echo ''; + echo ''; echo '"; print '"; for ($annee = $year_start; $annee <= $year_end; $annee++) { - print ''; + print ''; + print ''; } print "\n"; @@ -245,6 +249,7 @@ if ($resql) { print '
    '.$langs->trans("DraftFichinter").'
    '; - print "rowid."\">".img_object($langs->trans("ShowFichinter"), "intervention").' '.$obj->ref."'.img_object($langs->trans("ShowCompany"), "company").' '.dol_trunc($obj->name, 24).'
    '; + print $fichinterstatic->getNomUrl(1); + print "'; + print $companystatic->getNomUrl(1, 'customer'); + print '
    '.img_picto('$obj->email', 'email', 'class="paddingright"').$obj->email.''.$obj->lastname.''.$obj->firstname.''.$obj->other.''.img_picto('$obj->email', 'email', 'class="paddingright"').dol_escape_htmltag($obj->email).''.dol_escape_htmltag($obj->lastname).''.dol_escape_htmltag($obj->firstname).''.dol_escape_htmltag($obj->other).''; if (empty($obj->source_id) || empty($obj->source_type)) { print empty($obj->source_url) ? '' : $obj->source_url; // For backward compatibility diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index cc35cfc65a9..b8b46a0c8d9 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -50,7 +50,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -124,7 +124,7 @@ $usercancreateorder = $user->rights->commande->creer; $usercancreateinvoice = $user->rights->facture->creer; $usercancreatecontract = $user->rights->contrat->creer; $usercancreateintervention = $user->hasRight('ficheinter', 'creer'); -$usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); +$usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer')); $permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php $permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php @@ -696,7 +696,7 @@ if (empty($reshook)) { if ( !$error && GETPOST('statut', 'int') == $object::STATUS_SIGNED && GETPOST('generate_deposit', 'alpha') == 'on' - && ! empty($deposit_percent_from_payment_terms) && ! empty($conf->facture->enabled) && ! empty($user->rights->facture->creer) + && ! empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && !empty($user->rights->facture->creer) ) { require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; @@ -1522,7 +1522,7 @@ $form = new Form($db); $formfile = new FormFile($db); $formpropal = new FormPropal($db); $formmargin = new FormMargin($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -1653,7 +1653,7 @@ if ($action == 'create') { $shipping_method_id = 0; if ($socid > 0) { print ''; - print $soc->getNomUrl(1); + print $soc->getNomUrl(1, 'customer'); print ''; print '
    '.$langs->trans('PaymentMode').''; print img_picto('', 'bank', 'class="pictofixedwidth"'); - $form->select_types_paiements((GETPOSTISSET('mode_reglement_id') ? GETPOST('mode_reglement_id', 'int') : $soc->mode_reglement_id), 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx'); + $form->select_types_paiements((GETPOSTISSET('mode_reglement_id') && GETPOST('mode_reglement_id') != 0) ? GETPOST('mode_reglement_id', 'int') : $soc->mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx'); print '
    '.$langs->trans("Project").''; @@ -2001,7 +2001,7 @@ if ($action == 'create') { $deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id); - if (! empty($deposit_percent_from_payment_terms) && ! empty($conf->facture->enabled) && ! empty($user->rights->facture->creer)) { + if (!empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && ! empty($user->rights->facture->creer)) { require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; $object->fetchObjectLinked(); @@ -2211,7 +2211,7 @@ if ($action == 'create') { $morehtmlref .= ' ('.$langs->trans("OtherProposals").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').''; if ($usercancreate) { @@ -2596,45 +2596,45 @@ if ($action == 'create') { if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT print '
    '.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).''.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
    '.$form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0).''.price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''.price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
    '.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).''.price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''.price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
    '.$langs->trans('AmountHT').''.price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency).''.price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency).'
    '.$langs->trans('AmountVAT').''.price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency).''.price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency).'
    '.$langs->transcountry("AmountLT1", $mysoc->country_code).''.price($object->total_localtax1, '', $langs, 0, - 1, - 1, $conf->currency).''.price($object->total_localtax1, '', $langs, 0, - 1, - 1, $conf->currency).'
    '.$langs->transcountry("AmountLT2", $mysoc->country_code).''.price($object->total_localtax2, '', $langs, 0, - 1, - 1, $conf->currency).''.price($object->total_localtax2, '', $langs, 0, - 1, - 1, $conf->currency).'
    '.$langs->trans('AmountTTC').''.price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency).''.price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency).'
    '.$langs->trans('SendingMethod').''; - print img_picto('', 'object_dolly', 'class="pictofixedwidth"'); - print $form->selectShippingMethod($shipping_method_id, 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); + print img_picto('', 'object_dolly', 'class="pictofixedwidth"').$form->selectShippingMethod($shipping_method_id, 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); print '
    '.$langs->trans("Project").''; @@ -2246,7 +2245,7 @@ if ($action == 'create' && $usercancreate) { $morehtmlref .= ' ('.$langs->trans("OtherOrders").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($usercancreate) { @@ -2383,7 +2382,7 @@ if ($action == 'create' && $usercancreate) { print '
    '; $editenable = $usercancreate; print $form->editfieldkey("SendingMethod", 'shippingmethod', '', $object, $editenable); @@ -2568,17 +2567,17 @@ if ($action == 'create' && $usercancreate) { if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT print '
    '.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).''.price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''.price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
    '.$form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0).''.price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''.price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
    '.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).''.price($object->multicurrency_total_ttc, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''.price($object->multicurrency_total_ttc, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
    '.$langs->trans('AmountHT').''.price($object->total_ht, 1, '', 1, -1, -1, $conf->currency).$alert.''.price($object->total_ht, 1, '', 1, -1, -1, $conf->currency).$alert.'
    '.$langs->trans('AmountVAT').''.price($object->total_tva, 1, '', 1, -1, -1, $conf->currency).'
    '.$langs->trans('AmountVAT').''.price($object->total_tva, 1, '', 1, -1, -1, $conf->currency).'
    '.$langs->transcountry("AmountLT1", $mysoc->country_code).''.price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency).'
    '.price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency).'
    '.$langs->transcountry("AmountLT2", $mysoc->country_code).''.price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency).'
    '.price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency).'
    '.$langs->trans('AmountTTC').''.price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency).'
    '.$langs->trans('AmountTTC').''.price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency).'
    ' . $langs->trans('Status') . '' . $object->getLibStatut(4) . '
    '.$langs->trans("NoRecordFound").'
    '.$objectlink->getNomUrl(1).''.$objectlink->ref_client.''.dol_print_date($objectlink->date, 'day').''.dol_print_date($objectlink->date, 'day').''; if ($user->rights->commande->lire) { $total = $total + $objectlink->total_ht; diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 8f61261bc11..996ad22fbce 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -127,7 +127,7 @@ if (empty($entity)) { $error = 0; $listofchoices = array( - 'selectinvoices'=>array('label'=>'Invoices', 'lang'=>'bills', 'enabled' => !empty($conf->facture->enabled), 'perms' => !empty($user->rights->facture->lire)), + 'selectinvoices'=>array('label'=>'Invoices', 'lang'=>'bills', 'enabled' => isModEnabled('facture'), 'perms' => !empty($user->rights->facture->lire)), 'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'lang'=>'bills', 'enabled' => !empty($conf->supplier_invoice->enabled), 'perms' => !empty($user->rights->fournisseur->facture->lire)), 'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips', 'enabled' => !empty($conf->expensereport->enabled), 'perms' => !empty($user->rights->expensereport->lire)), 'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation', 'enabled' => !empty($conf->don->enabled), 'perms' => !empty($user->rights->don->lire)), diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index 36a9d17315a..5d6c2045d47 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -1,8 +1,8 @@ - * Copyright (C) 2004-2017 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2013 Charles-Fr BENKE +/* Copyright (C) 2005 Rodolphe Quiedeville + * Copyright (C) 2004-2017 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2013 Charles-Fr BENKE * * 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 @@ -78,6 +78,9 @@ if (!empty($ref)) { $id = $object->id; } +$annee = ''; +$totentrees = array(); +$totsorties = array(); // Ce rapport de tresorerie est base sur llx_bank (car doit inclure les transactions sans facture) // plutot que sur llx_paiement + llx_paiementfourn @@ -192,14 +195,14 @@ for ($mois = 1; $mois < 13; $mois++) { $case = sprintf("%04s-%02s", $annee, $mois); print ' '; - if ($decaiss[$case] > 0) { + if (isset($decaiss[$case]) && $decaiss[$case] > 0) { print price($decaiss[$case]); $totsorties[$annee] += $decaiss[$case]; } print " '; - if ($encaiss[$case] > 0) { + if (isset($encaiss[$case]) && $encaiss[$case] > 0) { print price($encaiss[$case]); $totentrees[$annee] += $encaiss[$case]; } @@ -211,7 +214,8 @@ for ($mois = 1; $mois < 13; $mois++) { // Total debit-credit print '
    '.$langs->trans("Total")."'.price($totsorties[$annee]).''.price($totentrees[$annee]).''. (isset($totsorties[$annee]) ? price($totsorties[$annee]) : '') .''. (isset($totentrees[$annee]) ? price($totentrees[$annee]) : '') .'
    '; +$nbcol = ''; print '"; print ''; print "\n"; @@ -267,7 +272,7 @@ if ($result < 0) { $sql .= ", ".MAIN_DB_PREFIX."bank_account as ba"; $sql .= " WHERE b.fk_account = ba.rowid"; $sql .= " AND ba.entity IN (".getEntity('bank_account').")"; - if ($id && $_GET["option"] != 'all') { + if ($id && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($id).")"; } @@ -299,7 +304,7 @@ if ($result < 0) { $sql .= " AND b.datev >= '".($year - $annee)."-01-01 00:00:00'"; $sql .= " AND b.datev <= '".($year - $annee)."-12-31 23:59:59'"; $sql .= " AND b.amount > 0"; - if ($id && $_GET["option"] != 'all') { + if ($id && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($id).")"; } $sql .= " GROUP BY date_format(b.datev,'%m');"; @@ -381,7 +386,7 @@ if ($result < 0) { $sql .= " AND b.datev >= '".($year - $annee)."-01-01 00:00:00'"; $sql .= " AND b.datev <= '".($year - $annee)."-12-31 23:59:59'"; $sql .= " AND b.amount < 0"; - if ($id && $_GET["option"] != 'all') { + if ($id && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($id).")"; } $sql .= " GROUP BY date_format(b.datev,'%m');"; diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index ce373bbf5b5..29341b0fb99 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -125,11 +125,11 @@ if (empty($reshook)) { $object->cle_rib = trim(GETPOST("cle_rib")); $object->bic = trim(GETPOST("bic")); $object->iban = trim(GETPOST("iban")); - $object->domiciliation = trim(GETPOST("domiciliation", "nohtml")); + $object->domiciliation = trim(GETPOST("domiciliation", "alphanohtml")); $object->pti_in_ctti = empty(GETPOST("pti_in_ctti")) ? 0 : 1; $object->proprio = trim(GETPOST("proprio", 'alphanohtml')); - $object->owner_address = trim(GETPOST("owner_address", 'nohtml')); + $object->owner_address = trim(GETPOST("owner_address", 'alphanohtml')); $object->ics = trim(GETPOST("ics", 'alpha')); $object->ics_transfer = trim(GETPOST("ics_transfer", 'alpha')); @@ -226,11 +226,11 @@ if (empty($reshook)) { $object->cle_rib = trim(GETPOST("cle_rib")); $object->bic = trim(GETPOST("bic")); $object->iban = trim(GETPOST("iban")); - $object->domiciliation = trim(GETPOST("domiciliation", "nohtml")); + $object->domiciliation = trim(GETPOST("domiciliation", "alphanohtml")); $object->pti_in_ctti = empty(GETPOST("pti_in_ctti")) ? 0 : 1; $object->proprio = trim(GETPOST("proprio", 'alphanohtml')); - $object->owner_address = trim(GETPOST("owner_address", 'nohtml')); + $object->owner_address = trim(GETPOST("owner_address", 'alphanohtml')); $object->ics = trim(GETPOST("ics", 'alpha')); $object->ics_transfer = trim(GETPOST("ics_transfer", 'alpha')); @@ -458,7 +458,7 @@ if ($action == 'create') { print ''; @@ -541,7 +541,7 @@ if ($action == 'create') { print ''; print ''; - if ($conf->paymentbybanktransfer->enabled) { + if (isModEnabled('paymentbybanktransfer')) { print ''; print ''; - if ($conf->prelevement->enabled) { + if (isModEnabled('prelevement')) { print ''; print ''; print ''; } // TODO ICS is not used with bank transfer ! - if ($conf->paymentbybanktransfer->enabled) { + if (isModEnabled('paymentbybanktransfer')) { print ''; print ''; print ''; @@ -986,7 +986,7 @@ if ($action == 'create') { print ''; @@ -1083,12 +1083,12 @@ if ($action == 'create') { print ''; print ''; - if (!empty($conf->prelevement->enabled)) { + if (isModEnabled('prelevement')) { print ''; print ''; } - if (!empty($conf->paymentbybanktransfer->enabled)) { + if (!empty(isModEnabled('paymentbybanktransfer'))) { print ''; print ''; diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index 2605bc39d30..aa60c1ddf41 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -113,7 +113,7 @@ if ($action != 'edit') { print ''; print ''; print ''; - print ''; + print ''; print ''; } diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 429d7c704c8..13fdffcb3c9 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -145,6 +145,12 @@ class Account extends CommonObject */ public $iban_prefix; + /** + * Address of the bank + * @var string + */ + public $domiciliation; + /** * XML SEPA format: place Payment Type Information (PmtTpInf) in Credit Transfer Transaction Information (CdtTrfTxInf) * @var int @@ -1200,7 +1206,7 @@ class Account extends CommonObject * Return current sold * * @param int $option 1=Exclude future operation date (this is to exclude input made in advance and have real account sold) - * @param tms $date_end Date until we want to get bank account sold + * @param int $date_end Date until we want to get bank account sold * @param string $field dateo or datev * @return int current sold (value date <= today) */ diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 4c0efec57d2..459134dc68a 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -95,7 +95,7 @@ if ($result < 0) { $sql .= ", ".MAIN_DB_PREFIX."bank_account as ba"; $sql .= " WHERE b.fk_account = ba.rowid"; $sql .= " AND ba.entity IN (".getEntity('bank_account').")"; - if ($account && $_GET["option"] != 'all') { + if ($account && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($account).")"; } @@ -137,7 +137,7 @@ if ($result < 0) { $sql .= " AND ba.entity IN (".getEntity('bank_account').")"; $sql .= " AND b.datev >= '".$db->escape($year)."-".$db->escape($month)."-01 00:00:00'"; $sql .= " AND b.datev < '".$db->escape($yearnext)."-".$db->escape($monthnext)."-01 00:00:00'"; - if ($account && $_GET["option"] != 'all') { + if ($account && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($account).")"; } $sql .= " GROUP BY date_format(b.datev,'%Y%m%d')"; @@ -165,7 +165,7 @@ if ($result < 0) { $sql .= " WHERE b.fk_account = ba.rowid"; $sql .= " AND ba.entity IN (".getEntity('bank_account').")"; $sql .= " AND b.datev < '".$db->escape($year)."-".sprintf("%02s", $month)."-01'"; - if ($account && $_GET["option"] != 'all') { + if ($account && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($account).")"; } @@ -279,7 +279,7 @@ if ($result < 0) { $sql .= " AND ba.entity IN (".getEntity('bank_account').")"; $sql .= " AND b.datev >= '".$db->escape($year)."-01-01 00:00:00'"; $sql .= " AND b.datev <= '".$db->escape($year)."-12-31 23:59:59'"; - if ($account && $_GET["option"] != 'all') { + if ($account && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($account).")"; } $sql .= " GROUP BY date_format(b.datev,'%Y%m%d')"; @@ -307,7 +307,7 @@ if ($result < 0) { $sql .= " WHERE b.fk_account = ba.rowid"; $sql .= " AND ba.entity IN (".getEntity('bank_account').")"; $sql .= " AND b.datev < '".$db->escape($year)."-01-01'"; - if ($account && $_GET["option"] != 'all') { + if ($account && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($account).")"; } @@ -415,7 +415,7 @@ if ($result < 0) { $sql .= ", ".MAIN_DB_PREFIX."bank_account as ba"; $sql .= " WHERE b.fk_account = ba.rowid"; $sql .= " AND ba.entity IN (".getEntity('bank_account').")"; - if ($account && $_GET["option"] != 'all') { + if ($account && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($account).")"; } $sql .= " GROUP BY date_format(b.datev,'%Y%m%d')"; @@ -540,7 +540,7 @@ if ($result < 0) { $sql .= " AND b.datev >= '".$db->escape($year)."-".$db->escape($month)."-01 00:00:00'"; $sql .= " AND b.datev < '".$db->escape($yearnext)."-".$db->escape($monthnext)."-01 00:00:00'"; $sql .= " AND b.amount > 0"; - if ($account && $_GET["option"] != 'all') { + if ($account && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($account).")"; } $sql .= " GROUP BY date_format(b.datev,'%d')"; @@ -575,7 +575,7 @@ if ($result < 0) { $sql .= " AND b.datev >= '".$db->escape($year)."-".$db->escape($month)."-01 00:00:00'"; $sql .= " AND b.datev < '".$db->escape($yearnext)."-".$db->escape($monthnext)."-01 00:00:00'"; $sql .= " AND b.amount < 0"; - if ($account && $_GET["option"] != 'all') { + if ($account && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($account).")"; } $sql .= " GROUP BY date_format(b.datev,'%d')"; @@ -649,7 +649,7 @@ if ($result < 0) { $sql .= " AND b.datev >= '".$db->escape($year)."-01-01 00:00:00'"; $sql .= " AND b.datev <= '".$db->escape($year)."-12-31 23:59:59'"; $sql .= " AND b.amount > 0"; - if ($account && $_GET["option"] != 'all') { + if ($account && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($account).")"; } $sql .= " GROUP BY date_format(b.datev,'%m');"; @@ -676,7 +676,7 @@ if ($result < 0) { $sql .= " AND b.datev >= '".$db->escape($year)."-01-01 00:00:00'"; $sql .= " AND b.datev <= '".$db->escape($year)."-12-31 23:59:59'"; $sql .= " AND b.amount < 0"; - if ($account && $_GET["option"] != 'all') { + if ($account && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($account).")"; } $sql .= " GROUP BY date_format(b.datev,'%m')"; @@ -748,7 +748,7 @@ if ($account) { if (!preg_match('/,/', $account)) { $moreparam = '&month='.$month.'&year='.$year.($mode == 'showalltime' ? '&mode=showalltime' : ''); - if ($_GET["option"] != 'all') { + if (GETPOST("option") != 'all') { $morehtml = ''.$langs->trans("ShowAllAccounts").''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', '', $moreparam, 0, '', '', 1); } else { diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index d91a14f14cd..238b9919ef1 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -550,7 +550,7 @@ foreach ($accounts as $key => $type) { // Account type if (!empty($arrayfields['accountype']['checked'])) { - print ''; if (!$i) { diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 9a0adb6957f..d424a3a8fef 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -1,10 +1,11 @@ - * Copyright (C) 2004-2019 Laurent Destailleur - * Copyright (C) 2005-2013 Regis Houssin - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2017 Patrick Delcroix - * Copyright (C) 2019 Nicolas ZABOURI +/* Copyright (C) 2001-2003 Rodolphe Quiedeville + * Copyright (C) 2004-2019 Laurent Destailleur + * Copyright (C) 2005-2013 Regis Houssin + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2017 Patrick Delcroix + * Copyright (C) 2019 Nicolas ZABOURI + * Copyright (C) 2022 Alexandre Spangaro * * 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 @@ -57,6 +58,8 @@ $ve = GETPOST("ve", 'alpha'); $brref = GETPOST('brref', 'alpha'); $oldbankreceipt = GETPOST('oldbankreceipt', 'alpha'); $newbankreceipt = GETPOST('newbankreceipt', 'alpha'); +$rel = GETPOST("rel", 'alphanohtml'); +$backtopage = GETPOST('backtopage', 'alpha'); // Security check $fieldid = (!empty($ref) ? $ref : $id); @@ -112,7 +115,7 @@ $contextpage = 'banktransactionlist'.(empty($object->ref) ? '' : '-'.$object->id // Define number of receipt to show (current, previous or next one ?) $found = false; -if ($_GET["rel"] == 'prev') { +if ($rel == 'prev') { // Recherche valeur pour num = numero releve precedent $sql = "SELECT DISTINCT(b.num_releve) as num"; $sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; @@ -130,7 +133,7 @@ if ($_GET["rel"] == 'prev') { $found = true; } } -} elseif ($_GET["rel"] == 'next') { +} elseif ($rel == 'next') { // Recherche valeur pour num = numero releve precedent $sql = "SELECT DISTINCT(b.num_releve) as num"; $sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; @@ -237,10 +240,10 @@ if (empty($numref)) { $sql .= $db->order($sortfield, $sortorder); // Count total nb of records - $nbtotalofrecords = ''; + $totalnboflines = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); - $nbtotalofrecords = $db->num_rows($result); + $totalnboflines = $db->num_rows($result); } $sql .= $db->plimit($conf->liste_limit + 1, $offset); @@ -399,9 +402,8 @@ if (empty($numref)) { $title = $langs->trans("AccountStatement").' '.$numref.' - '.$langs->trans("BankAccount").' '.$object->getNomUrl(1, 'receipts'); print load_fiche_titre($title, $morehtmlright, ''); - //print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, 0, $nbtotalofrecords, 'bank_account', 0, '', '', 0, 1); - print ""; + print ''; print ''; print ''; diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 98a51947c0e..71e5cf37c87 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -1,8 +1,8 @@ - * Copyright (C) 2008-2009 Laurent Destailleur (Eldy) - * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2015 Marcos García + * Copyright (C) 2008-2009 Laurent Destailleur (Eldy) + * Copyright (C) 2008 Raphael Bertrand (Resultic) + * Copyright (C) 2015 Marcos García * * This program is free software; you can redistribute it and/or modify @@ -185,7 +185,7 @@ if (GETPOST("account") || GETPOST("ref")) { $solde = $object->solde(0); - if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED) { + if (getDolGlobalInt('MULTICOMPANY_INVOICE_SHARING_ENABLED')) { $colspan = 6; } else { $colspan = 5; @@ -199,7 +199,7 @@ if (GETPOST("account") || GETPOST("ref")) { print ''; print ''; print ''; - if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED) { + if (getDolGlobalInt('MULTICOMPANY_INVOICE_SHARING_ENABLED')) { print ''; } print ''; diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index ab4b24e3889..95d5ffa0e9e 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -311,7 +311,7 @@ $form = new Form($db); if (!empty($conf->accounting->enabled)) { $formaccounting = new FormAccounting($db); } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -481,7 +481,7 @@ if ($action == 'create') { print ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); // Associated project @@ -553,7 +553,7 @@ if ($id) { $morehtmlref = '
    '; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($user->rights->banque->modifier) { diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php index ad199caaf5a..b7cb8ee6bbf 100644 --- a/htdocs/compta/bank/various_payment/document.php +++ b/htdocs/compta/bank/various_payment/document.php @@ -97,7 +97,7 @@ if ($object->id) { $morehtmlref = '
    '; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' : '; if ($user->rights->banque->modifier && 0) { diff --git a/htdocs/compta/bank/various_payment/info.php b/htdocs/compta/bank/various_payment/info.php index e50dc10ff7f..b46ab36ddf6 100644 --- a/htdocs/compta/bank/various_payment/info.php +++ b/htdocs/compta/bank/various_payment/info.php @@ -57,7 +57,7 @@ print dol_get_fiche_head($head, 'info', $langs->trans("VariousPayment"), -1, $ob $morehtmlref = '
    '; // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' : '; if ($user->rights->banque->modifier && 0) { diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index 98cb0e27804..f75ce6d4471 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017-2022 Alexandre Spangaro * Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2018 Frédéric France * Copyright (C) 2020 Tobias Sekan @@ -35,6 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; // Load translation files required by the page $langs->loadLangs(array("compta", "banks", "bills", "accountancy")); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'directdebitcredittransferlist'; // To manage different context of search + // Security check $socid = GETPOST("socid", "int"); if ($user->socid) { @@ -75,6 +77,7 @@ if (empty($search_datev_start)) { if (empty($search_datev_end)) { $search_datev_end = GETPOST("search_datev_end", 'int'); } +$search_type_id = GETPOST('search_type_id', 'int'); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); @@ -94,19 +97,6 @@ if (!$sortorder) { $filtre = GETPOST("filtre", 'alpha'); -if (!GETPOST('typeid')) { - $newfiltre = str_replace('filtre=', '', $filtre); - $filterarray = explode('-', $newfiltre); - foreach ($filterarray as $val) { - $part = explode(':', $val); - if ($part[0] == 'v.fk_typepayment') { - $typeid = $part[1]; - } - } -} else { - $typeid = GETPOST('typeid'); -} - if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All test are required to be compatible with all browsers $search_ref = ''; $search_label = ''; @@ -120,7 +110,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $search_bank_entry = ''; $search_accountancy_account = ''; $search_accountancy_subledger = ''; - $typeid = ''; + $search_type_id = ''; } $search_all = GETPOSTISSET("search_all") ? trim(GETPOST("search_all", 'alpha')) : trim(GETPOST('sall')); @@ -161,7 +151,7 @@ $arrayfields = array( 'datep' =>array('label'=>"DatePayment", 'checked'=>1, 'position'=>120), 'datev' =>array('label'=>"DateValue", 'checked'=>-1, 'position'=>130), 'type' =>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>140), - 'project' =>array('label'=>"Project", 'checked'=>1, 'position'=>200, "enabled"=>!empty($conf->projet->enabled)), + 'project' =>array('label'=>"Project", 'checked'=>1, 'position'=>200, "enabled"=>!empty($conf->project->enabled)), 'bank' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>300, "enabled"=>!empty($conf->banque->enabled)), 'entry' =>array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>310, "enabled"=>!empty($conf->banque->enabled)), 'account' =>array('label'=>"AccountAccountingShort", 'checked'=>1, 'position'=>400, "enabled"=>!empty($conf->accounting->enabled)), @@ -265,8 +255,8 @@ if ($search_accountancy_account > 0) { if ($search_accountancy_subledger > 0) { $sql .= " AND v.subledger_account = ".((int) $search_accountancy_subledger); } -if ($typeid > 0) { - $sql .= " AND v.fk_typepayment=".((int) $typeid); +if ($search_type_id > 0) { + $sql .= " AND v.fk_typepayment=".((int) $search_type_id); } if ($search_all) { $sql .= natural_search(array_keys($fieldstosearchall), $search_all); @@ -324,8 +314,8 @@ if ($resql) { if ($search_datev_end) { $param .= '&search_datev_end='.urlencode($search_datev_end); } - if ($typeid > 0) { - $param .= '&typeid='.urlencode($typeid); + if ($search_type_id > 0) { + $param .= '&search_type_id='.urlencode($search_type_id); } if ($search_amount_deb) { $param .= '&search_amount_deb='.urlencode($search_amount_deb); @@ -375,6 +365,7 @@ if ($resql) { $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields + $moreforfilter= ''; print '
    '; print '
    '.$langs->trans("CurrentBalance")."'.price($balance).'
    '; // Editor wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('account_comment', (GETPOST("account_comment") ?GETPOST("account_comment") : $object->comment), '', 90, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_4, '90%'); + $doleditor = new DolEditor('account_comment', (GETPOST("account_comment") ?GETPOST("account_comment") : $object->comment), '', 90, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_4, '90%'); $doleditor->Create(); print '
    '.$langs->trans($bickey).'
    '.$langs->trans("SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation").' '; print img_picto($langs->trans("SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp"), 'info'); @@ -778,14 +778,14 @@ if ($action == 'create') { } print '
    '.$form->textwithpicto($langs->trans("ICS"), $langs->trans("ICS").' ('.$langs->trans("UsedFor", $langs->transnoentitiesnoconv("StandingOrder")).')').''.$object->ics.'
    '.$form->textwithpicto($langs->trans("IDS"), $langs->trans("IDS").' ('.$langs->trans("UsedFor", $langs->transnoentitiesnoconv("BankTransfer")).')').''.$object->ics_transfer.'
    '; // Editor wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('account_comment', (GETPOST("account_comment") ?GETPOST("account_comment") : $object->comment), '', 90, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_4, '95%'); + $doleditor = new DolEditor('account_comment', (GETPOST("account_comment") ?GETPOST("account_comment") : $object->comment), '', 90, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_4, '95%'); $doleditor->Create(); print '
    '.$langs->trans($bickey).'
    '.$form->textwithpicto($langs->trans("ICS"), $langs->trans("ICS").' ('.$langs->trans("UsedFor", $langs->transnoentitiesnoconv("StandingOrder")).')').'
    '.$form->textwithpicto($langs->trans("IDS"), $langs->trans("IDS").' ('.$langs->trans("UsedFor", $langs->transnoentitiesnoconv("BankTransfer")).')').'
     
    '; + print ''; print $objecttmp->type_lib[$objecttmp->type]; print '
    '.$langs->trans("DateDue").''.$langs->trans("Description").''.$langs->trans("Entity").''.$langs->trans("ThirdParty").'
    '; @@ -427,7 +418,7 @@ if ($resql) { // Payment type if ($arrayfields['type']['checked']) { print ''; } @@ -544,6 +535,8 @@ if ($resql) { $totalarray = array(); + $totalarray['nbfield'] = 0; + $totalarray['val']['total_cred'] = 0; while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); @@ -656,7 +649,7 @@ if ($resql) { if ($arrayfields['account']['checked']) { $accountingaccount->fetch('', $obj->accountancy_code, 1); - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index c16b6523d1f..169666477f4 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -1,12 +1,12 @@ - * Copyright (C) 2004-2016 Laurent Destailleur - * Copyright (C) 2005-2010 Regis Houssin - * Copyright (C) 2011-2016 Alexandre Spangaro - * Copyright (C) 2011-2014 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2019 Nicolas ZABOURI - * Copyright (C) 2021 Gauthier VERDOL +/* Copyright (C) 2001-2003 Rodolphe Quiedeville + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2005-2010 Regis Houssin + * Copyright (C) 2011-2022 Alexandre Spangaro + * Copyright (C) 2011-2014 Juanjo Menent + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2019 Nicolas ZABOURI + * Copyright (C) 2021 Gauthier VERDOL * * 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 @@ -58,6 +58,7 @@ $filtre = GETPOST("filtre", 'alpha'); if (!$year) { $year = date("Y", time()); } +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $search_account = GETPOST('search_account', 'int'); @@ -184,7 +185,6 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { $num = $db->num_rows($resql); $i = 0; $total = 0; - $totalnb = 0; $totalpaid = 0; while ($i < min($num, $limit)) { @@ -204,7 +204,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { print $socialcontrib->getNomUrl(1, '20'); print ''; // Type - print ''; + print ''; // Expected to pay print ''; // Ref payment @@ -246,7 +246,6 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { print ''; $total = $total + $obj->total; - $totalnb = $totalnb + $obj->nb; $totalpaid = $totalpaid + $obj->totalpaid; $i++; } @@ -274,7 +273,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { print load_fiche_titre($langs->trans("VATDeclarations").($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', ''); - $sql = "SELECT ptva.rowid, pv.rowid as id_tva, pv.amount as amount_tva, ptva.amount, pv.label, pv.datev as dm, ptva.datep as date_payment, ptva.fk_bank,"; + $sql = "SELECT ptva.rowid, pv.rowid as id_tva, pv.amount as amount_tva, ptva.amount, pv.label, pv.datev as dm, ptva.datep as date_payment, ptva.fk_bank, ptva.num_paiement as num_payment,"; $sql .= " pct.code as payment_code,"; $sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel"; $sql .= " FROM ".MAIN_DB_PREFIX."tva as pv"; diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index 33b453cd0b4..029c5b5f223 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -29,7 +29,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/trip.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -84,7 +84,7 @@ if ($action == 'validate' && $user->rights->deplacement->creer) { } } } elseif ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->deplacement->supprimer) { - $result = $object->delete($id); + $result = $object->delete($user); if ($result >= 0) { header("Location: index.php"); exit; @@ -422,7 +422,7 @@ if ($action == 'create') { print ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load('projects'); print ''; print ''; print ''; - print ''; + print ''; print ''; // Multicurrency Amount VAT print ''; - print ''; + print ''; print ''; // Multicurrency Amount TTC print ''; - print ''; + print ''; print ''; } // Amount print ''; - print ''; + print ''; // Vat - print ''; + print ''; print ''; // Amount Local Taxes if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) { // Localtax1 print ''; - print ''; + print ''; } if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) { // Localtax2 print ''; - print ''; + print ''; } // Revenue stamp @@ -4796,14 +4796,14 @@ if ($action == 'create') { } // Total with tax - print ''; + print ''; print '
    '; - $form->select_types_paiements($typeid, 'typeid', '', 0, 1, 1, 16, 1, 'maxwidth100'); + $form->select_types_paiements($search_type_id, 'search_type_id', '', 0, 1, 1, 16, 1, 'maxwidth100'); print ''.$accountingaccount->getNomUrl(0, 1, 1, '', 1).''.$accountingaccount->getNomUrl(0, 1, 1, '', 1).''.$obj->label.''.$obj->label.''.price($obj->total).'
    '; diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index c09943540bc..fb4f9eb17d4 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -1,4 +1,6 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2009-2012 Regis Houssin @@ -310,13 +312,15 @@ class Deplacement extends CommonObject /** * Delete record * - * @param int $id Id of record to delete + * @param User $user USer that Delete * @return int <0 if KO, >0 if OK */ - public function delete($id) + public function delete($user) { $this->db->begin(); + $id = $this->id; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."deplacement WHERE rowid = ".((int) $id); dol_syslog(get_class($this)."::delete", LOG_DEBUG); @@ -469,7 +473,7 @@ class Deplacement extends CommonObject public function info($id) { $sql = 'SELECT c.rowid, c.datec, c.fk_user_author, c.fk_user_modif,'; - $sql .= ' c.tms'; + $sql .= ' c.tms as datem'; $sql .= ' FROM '.MAIN_DB_PREFIX.'deplacement as c'; $sql .= ' WHERE c.rowid = '.((int) $id); @@ -480,18 +484,11 @@ class Deplacement extends CommonObject if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - if ($obj->fk_user_modif) { - $muser = new User($this->db); - $muser->fetch($obj->fk_user_modif); - $this->user_modification = $muser; - } + + $this->user_creation_id = $obj->fk_user_author; + $this->user_modification_id = $obj->fk_user_modif; $this->date_creation = $this->db->jdate($obj->datec); - $this->date_modification = $this->db->jdate($obj->tms); + $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem); } $this->db->free($result); } else { diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 39b8c16614d..18a935cedb4 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -34,7 +34,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; //include_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; } @@ -201,12 +201,12 @@ if (empty($reshook)) { } if (!$error) { - $object->titre = GETPOST('title', 'nohtml'); // deprecated - $object->title = GETPOST('title', 'nohtml'); + $object->titre = GETPOST('title', 'alphanohtml'); // deprecated + $object->title = GETPOST('title', 'alphanohtml'); $object->note_private = GETPOST('note_private', 'restricthtml'); $object->note_public = GETPOST('note_public', 'restricthtml'); - $object->model_pdf = GETPOST('modelpdf', 'alpha'); - $object->usenewprice = GETPOST('usenewprice', 'alpha'); + $object->model_pdf = GETPOST('modelpdf', 'alphanohtml'); + $object->usenewprice = GETPOST('usenewprice', 'alphanohtml'); $object->mode_reglement_id = GETPOST('mode_reglement_id', 'int'); $object->cond_reglement_id = GETPOST('cond_reglement_id', 'int'); @@ -924,7 +924,7 @@ llxHeader('', $langs->trans("RepeatableInvoices"), $help_url); $form = new Form($db); $formother = new FormOther($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } $companystatic = new Societe($db); @@ -954,7 +954,7 @@ if ($action == 'create') { print dol_get_fiche_head(null, '', '', 0); $rowspan = 4; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $rowspan++; } if ($object->fk_account > 0) { @@ -1047,7 +1047,7 @@ if ($action == 'create') { } // Project - if (!empty($conf->projet->enabled) && is_object($object->thirdparty) && $object->thirdparty->id > 0) { + if (!empty($conf->project->enabled) && is_object($object->thirdparty) && $object->thirdparty->id > 0) { $projectid = GETPOST('projectid') ?GETPOST('projectid') : $object->fk_project; $langs->load('projects'); print '
    '.$langs->trans('Project').''; @@ -1203,7 +1203,7 @@ if ($action == 'create') { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 0fefbbab118..a886f8a49c8 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -54,7 +54,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (!empty($conf->commande->enabled)) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -1030,7 +1030,7 @@ if (empty($reshook)) { $object->date = $dateinvoice; $object->date_pointoftax = $date_pointoftax; $object->note_public = trim(GETPOST('note_public', 'restricthtml')); - // We do not copy the private note + $object->note_private = trim(GETPOST('note_private', 'restricthtml')); $object->ref_client = GETPOST('ref_client', 'alphanohtml'); $object->model_pdf = GETPOST('model', 'alphanohtml'); $object->fk_project = GETPOST('projectid', 'int'); @@ -1083,7 +1083,7 @@ if (empty($reshook)) { $object->date = $dateinvoice; $object->date_pointoftax = $date_pointoftax; $object->note_public = trim(GETPOST('note_public', 'restricthtml')); - // We do not copy the private note + $object->note_private = trim(GETPOST('note_private', 'restricthtml')); $object->ref_client = GETPOST('ref_client'); $object->model_pdf = GETPOST('model'); $object->fk_project = GETPOST('projectid', 'int'); @@ -2874,7 +2874,7 @@ $formmargin = new FormMargin($db); $soc = new Societe($db); $paymentstatic = new Paiement($db); $bankaccountstatic = new Account($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -3093,7 +3093,7 @@ if ($action == 'create') { // If thirdparty known and not a predefined invoiced without a recurring rule print '
    '.$langs->trans('Customer').''; - print $soc->getNomUrl(1); + print $soc->getNomUrl(1, 'customer'); print ''; // Outstanding Bill $arrayoutstandingbills = $soc->getOutstandingBills(); @@ -3658,7 +3658,7 @@ if ($action == 'create') { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load('projects'); print '
    '.$langs->trans('Project').''; print img_picto('', 'project').$formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); @@ -4284,7 +4284,7 @@ if ($action == 'create') { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($usercancreate) { @@ -4711,36 +4711,36 @@ if ($action == 'create') { if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT print '
    '.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).''.price($sign * $object->multicurrency_total_ht, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''.price($sign * $object->multicurrency_total_ht, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
    '.$form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0).''.price($sign * $object->multicurrency_total_tva, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''.price($sign * $object->multicurrency_total_tva, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
    '.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).''.price($sign * $object->multicurrency_total_ttc, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''.price($sign * $object->multicurrency_total_ttc, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
    '.$langs->trans('AmountHT').''.price($sign * $object->total_ht, 1, '', 1, - 1, - 1, $conf->currency).'
    '.price($sign * $object->total_ht, 1, '', 1, - 1, - 1, $conf->currency).'
    '.$langs->trans('AmountVAT').''.price($sign * $object->total_tva, 1, '', 1, - 1, - 1, $conf->currency).'
    '.$langs->trans('AmountVAT').''.price($sign * $object->total_tva, 1, '', 1, - 1, - 1, $conf->currency).'
    '.$langs->transcountry("AmountLT1", $mysoc->country_code).''.price($sign * $object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency).'
    '.price($sign * $object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency).'
    '.$langs->transcountry("AmountLT2", $mysoc->country_code).''.price($sign * $object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency).'
    '.price($sign * $object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency).'
    '.$langs->trans('AmountTTC').''.price($sign * $object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency).'
    '.$langs->trans('AmountTTC').''.price($sign * $object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency).'
    '; $nbrows = 8; $nbcols = 3; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $nbrows++; } if (!empty($conf->banque->enabled)) { diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 34df7bcf097..f15f65954cf 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -181,7 +181,7 @@ class FactureRec extends CommonInvoice 'total_ht' =>array('type'=>'double(24,8)', 'label'=>'Total', 'enabled'=>1, 'visible'=>-1, 'position'=>70, 'isameasure'=>1), 'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'Total ttc', 'enabled'=>1, 'visible'=>-1, 'position'=>75, 'isameasure'=>1), 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>80), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>85), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>85), 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'Fk cond reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>90), 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'Fk mode reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>95), 'date_lim_reglement' =>array('type'=>'date', 'label'=>'Date lim reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>100), diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index a2c22d7f878..59564612cc2 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -124,6 +124,12 @@ class Facture extends CommonInvoice */ public $fk_user_valid; + /** + * @var int ID + */ + public $fk_user_modif; + + public $date; // Date invoice public $datem; @@ -1935,7 +1941,7 @@ class Facture extends CommonInvoice $sql .= ', f.datec as datec'; $sql .= ', f.date_valid as datev'; $sql .= ', f.tms as datem'; - $sql .= ', f.note_private, f.note_public, f.fk_statut, f.paye, f.close_code, f.close_note, f.fk_user_author, f.fk_user_valid, f.model_pdf, f.last_main_doc'; + $sql .= ', f.note_private, f.note_public, f.fk_statut, f.paye, f.close_code, f.close_note, f.fk_user_author, f.fk_user_valid, f.fk_user_modif, f.model_pdf, f.last_main_doc'; $sql .= ', f.fk_facture_source, f.fk_fac_rec_source'; $sql .= ', f.fk_mode_reglement, f.fk_cond_reglement, f.fk_projet as fk_project, f.extraparams'; $sql .= ', f.situation_cycle_ref, f.situation_counter, f.situation_final'; @@ -2023,8 +2029,10 @@ class Facture extends CommonInvoice $this->note_public = $obj->note_public; $this->user_author = $obj->fk_user_author; // deprecated $this->user_valid = $obj->fk_user_valid; // deprecated - $this->fk_user_author = $obj->fk_user_author; + $this->user_modification = $obj->fk_user_modif; // deprecated + $this->fk_user_author = $obj->fk_user_author; $this->fk_user_valid = $obj->fk_user_valid; + $this->fk_user_modif = $obj->fk_user_modif; $this->model_pdf = $obj->model_pdf; $this->modelpdf = $obj->model_pdf; // deprecated $this->last_main_doc = $obj->last_main_doc; @@ -5415,7 +5423,7 @@ class Facture extends CommonInvoice $langs->load("bills"); - if (empty($conf->facture->enabled)) { // Should not happen. If module disabled, cron job should not be visible. + if (!isModEnabled('facture')) { // Should not happen. If module disabled, cron job should not be visible. $this->output .= $langs->trans('ModuleNotEnabled', $langs->transnoentitiesnoconv("Facture")); return 0; } diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index a4441804570..3ad533b6d3b 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -172,9 +172,10 @@ class PaymentTerm // extends CommonObject * Load object in memory from database * * @param int $id Id object + * @param string $code Code object * @return int <0 if KO, >0 if OK */ - public function fetch($id) + public function fetch($id, $code = '') { global $langs; $sql = "SELECT"; @@ -192,7 +193,12 @@ class PaymentTerm // extends CommonObject $sql .= " FROM ".MAIN_DB_PREFIX."c_payment_term as t"; - $sql .= " WHERE t.rowid = ".((int) $id); + if ($id) { + $sql .= " WHERE t.rowid = ".((int) $id); + } + if ($code) { + $sql .= " WHERE t.code='".$this->db->escape($code)."' AND t.entity IN (".getEntity('payment_term').")"; + } dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql = $this->db->query($sql); diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index b1799350ce8..1b75d43753e 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -137,7 +137,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index f55e9c4b36f..1685da08a2e 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -138,7 +138,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php index ceea7dcbb62..4521c7e5096 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -51,12 +51,12 @@ if ($id > 0 || !empty($ref)) { } // Security check -$fieldid = (!empty($ref) ? 'ref' : 'rowid'); if ($user->socid) { $socid = $user->socid; } $isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0); -$result = restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', $fieldid, $isdraft); + +$result = restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); /* @@ -97,7 +97,7 @@ $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_cl // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 02925225df9..1f516c31795 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -257,7 +257,7 @@ llxHeader('', $langs->trans("RepeatableInvoices"), 'ch-facture.html#s-fac-factur $form = new Form($db); $formother = new FormOther($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } $companystatic = new Societe($db); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 54de9440b8b..e963057f7ef 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -215,8 +215,8 @@ $arrayfields = array( 'f.date_valid'=>array('label'=>"DateValidation", 'checked'=>0, 'position'=>22), 'f.date_lim_reglement'=>array('label'=>"DateDue", 'checked'=>1, 'position'=>25), 'f.date_closing'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>30), - 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>40), - 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>41), + 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1), 'position'=>40), + 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1), 'position'=>41), 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>50), 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>1, 'position'=>51), 's.town'=>array('label'=>"Town", 'checked'=>-1, 'position'=>55), @@ -256,7 +256,7 @@ $arrayfields = array( 'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), ); -if (getDolGlobalString("INVOICE_USE_SITUATION") && $conf->global->INVOICE_USE_RETAINED_WARRANTY) { +if (getDolGlobalString("INVOICE_USE_SITUATION") && !empty($conf->global->INVOICE_USE_RETAINED_WARRANTY)) { $arrayfields['f.retained_warranty'] = array('label'=>$langs->trans("RetainedWarranty"), 'checked'=>0, 'position'=>86); } // Overwrite $arrayfields from columns into ->fields (transition before removal of $arrayoffields) @@ -1091,7 +1091,7 @@ if ($resql) { $param .= '&search_categ_cus='.urlencode($search_categ_cus); } if (!empty($search_fac_rec_source_title)) { - $param .= '&$search_fac_rec_source_title='.urlencode($search_fac_rec_source_title); + $param .= '&search_fac_rec_source_title='.urlencode($search_fac_rec_source_title); } // Add $param from extra fields diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index cab6d3ac680..5b30d39da12 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -29,7 +29,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -114,7 +114,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index afdd871371c..8bd953f98b5 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -349,7 +349,7 @@ if ($object->id > 0) { } } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($usercancreate) { diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index def6318ed95..e7cb0b1d4b5 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -1,8 +1,8 @@ - * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2004-2022 Laurent Destailleur * Copyright (C) 2005-2015 Regis Houssin - * Copyright (C) 2015-2020 Juanjo Menent + * Copyright (C) 2015-2020 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2016 Marcos García @@ -121,7 +121,7 @@ print '
    '; // Latest modified customer invoices -if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) { +if (isModEnabled('facture') && !empty($user->rights->facture->lire)) { $langs->load("boxes"); $tmpinvoice = new Facture($db); @@ -237,7 +237,7 @@ if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) { } print ''.price($obj->total_ttc).''; - print ''.dol_print_date($db->jdate($obj->tms), 'day').''; + print 'jdate($obj->tms), 'dayhour', 'tzuserrel')).'">'.dol_print_date($db->jdate($obj->tms), 'day', 'tzuserrel').''; print ''.$tmpinvoice->getLibStatut(3, $obj->am).''; @@ -367,7 +367,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU print ''.price($obj->total_ht).''; } print ''.price($obj->total_ttc).''; - print ''.dol_print_date($db->jdate($obj->tms), 'day').''; + print 'jdate($obj->tms), 'dayhour', 'tzuserrel')).'">'.dol_print_date($db->jdate($obj->tms), 'day', 'tzuserrel').''; $alreadypaid = $facstatic->getSommePaiement(); print ''.$facstatic->getLibStatut(3, $alreadypaid).''; print ''; @@ -437,7 +437,7 @@ if (!empty($conf->don->enabled) && !empty($user->rights->don->lire)) { $total_ttc = $totalam = $total_ht = 0; while ($i < $num && $i < $max) { - $objp = $db->fetch_object($result); + $obj = $db->fetch_object($result); if ($i >= $max) { $othernb += 1; @@ -447,24 +447,24 @@ if (!empty($conf->don->enabled) && !empty($user->rights->don->lire)) { continue; } - $donationstatic->id = $objp->rowid; - $donationstatic->ref = $objp->rowid; - $donationstatic->lastname = $objp->lastname; - $donationstatic->firstname = $objp->firstname; - $donationstatic->date = $objp->date; - $donationstatic->statut = $objp->status; - $donationstatic->status = $objp->status; + $donationstatic->id = $obj->rowid; + $donationstatic->ref = $obj->rowid; + $donationstatic->lastname = $obj->lastname; + $donationstatic->firstname = $obj->firstname; + $donationstatic->date = $obj->date; + $donationstatic->statut = $obj->status; + $donationstatic->status = $obj->status; $label = $donationstatic->getFullName($langs); - if ($objp->societe) { - $label .= ($label ? ' - ' : '').$objp->societe; + if ($obj->societe) { + $label .= ($label ? ' - ' : '').$obj->societe; } print ''; print ''.$donationstatic->getNomUrl(1).''; print ''.$label.''; - print ''.price($objp->amount).''; - print ''.dol_print_date($db->jdate($objp->dm), 'day').''; + print ''.price($obj->amount).''; + print 'jdate($obj->dm), 'dayhour', 'tzuserrel')).'">'.dol_print_date($db->jdate($obj->dm), 'day', 'tzuserrel').''; print ''.$donationstatic->getLibStatut(3).''; print ''; @@ -582,7 +582,7 @@ if (!empty($conf->tax->enabled) && !empty($user->rights->tax->charges->lire)) { /* * Customers orders to be billed */ -if (!empty($conf->facture->enabled) && !empty($conf->commande->enabled) && $user->rights->commande->lire && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) { +if (isModEnabled('facture') && !empty($conf->commande->enabled) && $user->rights->commande->lire && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) { $commandestatic = new Commande($db); $langs->load("orders"); diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 3d0698118ff..988d6e041be 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -564,8 +564,12 @@ while ($i < min($num, $limit)) { // Bank transaction if (!empty($arrayfields['transaction']['checked'])) { - $bankline->fetch($objp->fk_bank); - print ''.$bankline->getNomUrl(1, 0).''; + print ''; + if ($objp->fk_bank > 0) { + $bankline->fetch($objp->fk_bank); + print $bankline->getNomUrl(1, 0); + } + print ''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index db48b2767f2..ba62c36b0fa 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -1,6 +1,7 @@ * Copyright (C) 2016-2018 Frédéric France + * Copyright (C) 2022 Alexandre Spangaro * * 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 @@ -254,6 +255,7 @@ if ($action == 'create') { print "\n"; $total = 0; + $total_ttc = 0; $totalrecu = 0; while ($i < $num) { diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index b1ec9800aa5..f5ff5a101f2 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -1,8 +1,9 @@ - * Copyright (C) 2004-2014 Laurent Destailleur - * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2009 Regis Houssin +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2022 Alexandre Spangaro * * 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 @@ -134,7 +135,7 @@ print ''.$langs->trans('Mode').''.$langs->trans("Pa print ''.$langs->trans('Numero').''.$object->num_payment.''; // Amount -print ''.$langs->trans('Amount').''.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).''; +print ''.$langs->trans('Amount').''.price($object->amount, 0, $langs, 1, -1, -1, $conf->currency).''; // Note print ''.$langs->trans('Note').''.nl2br($object->note).''; diff --git a/htdocs/compta/paymentbybanktransfer/index.php b/htdocs/compta/paymentbybanktransfer/index.php index 6c14987e5ba..ee7cc064df6 100644 --- a/htdocs/compta/paymentbybanktransfer/index.php +++ b/htdocs/compta/paymentbybanktransfer/index.php @@ -159,11 +159,11 @@ if ($resql) { $thirdpartystatic->idprof5 = $obj->idprof5; $thirdpartystatic->idprof6 = $obj->idprof6; - print ''; + print ''; print $invoicestatic->getNomUrl(1, 'withdraw'); print ''; - print ''; + print ''; print $thirdpartystatic->getNomUrl(1, 'supplier'); print ''; @@ -226,14 +226,14 @@ if ($result) { print ''; - print ""; + print ''; $bprev->id = $obj->rowid; $bprev->ref = $obj->ref; $bprev->statut = $obj->statut; print $bprev->getNomUrl(1); print "\n"; print ''.dol_print_date($db->jdate($obj->datec), "dayhour")."\n"; - print ''.price($obj->amount)."\n"; + print ''.price($obj->amount)."\n"; print ''.$bprev->getLibStatut(3)."\n"; print "\n"; diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index 469985679c9..129f083895c 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -185,18 +185,18 @@ if ($id > 0 || $ref) { print ''; */ - if ($object->date_trans <> 0) { + if (!empty($object->date_trans)) { $muser = new User($db); $muser->fetch($object->user_trans); print ''.$langs->trans("TransData").''; print dol_print_date($object->date_trans, 'day'); - print ' '.$langs->trans("By").' '.$muser->getNomUrl(-1).''; + print '   '.$langs->trans("By").' '.$muser->getNomUrl(-1).''; print ''.$langs->trans("TransMetod").''; print $object->methodes_trans[$object->method_trans]; print ''; } - if ($object->date_credit <> 0) { + if (!empty($object->date_credit)) { print ''.$langs->trans('CreditDate').''; print dol_print_date($object->date_credit, 'day'); print ''; @@ -290,7 +290,7 @@ if ($id > 0 || $ref) { print '
    '; } - if (!empty($object->date_trans) && $object->date_credit == 0 && $user->rights->prelevement->bons->credit && $action == 'setcredited') { + if (!empty($object->date_trans) && empty($object->date_credit) && $user->rights->prelevement->bons->credit && $action == 'setcredited') { $btnLabel = ($object->type == 'bank-transfer') ? $langs->trans("ClassDebited") : $langs->trans("ClassCredited"); print ''; print ''; @@ -318,8 +318,7 @@ if ($id > 0 || $ref) { if ($object->type == 'bank-transfer') print dolGetButtonAction($langs->trans("SetToStatusSent"), '', 'default', 'card.php?action=settransmitted&token='.newToken().'&id='.$object->id, '', $user->rights->paymentbybanktransfer->send); else print dolGetButtonAction($langs->trans("SetToStatusSent"), '', 'default', 'card.php?action=settransmitted&token='.newToken().'&id='.$object->id, '', $user->rights->prelevement->bons->send); } - - if (!empty($object->date_trans) && $object->date_credit == 0) { + if (!empty($object->date_trans) && empty($object->date_credit)) { if ($object->type == 'bank-transfer') print dolGetButtonAction($langs->trans("ClassDebited"), '', 'default', 'card.php?action=setcredited&token='.newToken().'&id='.$object->id, '', $user->rights->paymentbybanktransfer->debit); else print dolGetButtonAction($langs->trans("ClassCredited"), '', 'default', 'card.php?action=setcredited&token='.newToken().'&id='.$object->id, '', $user->rights->prelevement->bons->credit); } diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index d60002f479d..d87317e2420 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1488,7 +1488,7 @@ class BonPrelevement extends CommonObject fputs($this->file, ' '.$i.''.$CrLf); fputs($this->file, ' '.$this->total.''.$CrLf); fputs($this->file, ' '.$CrLf); - fputs($this->file, ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).''.$CrLf); + fputs($this->file, ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).''.$CrLf); fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$CrLf); @@ -1604,7 +1604,7 @@ class BonPrelevement extends CommonObject fputs($this->file, ' '.$i.''.$CrLf); fputs($this->file, ' '.$this->total.''.$CrLf); fputs($this->file, ' '.$CrLf); - fputs($this->file, ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).''.$CrLf); + fputs($this->file, ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).''.$CrLf); fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$CrLf); @@ -1854,16 +1854,16 @@ class BonPrelevement extends CommonObject $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.$CrLf; - $XML_DEBITOR .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom)))).''.$CrLf; + $XML_DEBITOR .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom), ' '))).''.$CrLf; $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.$row_country_code.''.$CrLf; $addressline1 = strtr($row_address, array(CHR(13) => ", ", CHR(10) => "")); $addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : ''.$row_town), array(CHR(13) => ", ", CHR(10) => "")); if (trim($addressline1)) { - $XML_DEBITOR .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1)), 70, 'right', 'UTF-8', 1)).''.$CrLf; + $XML_DEBITOR .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).''.$CrLf; } if (trim($addressline2)) { - $XML_DEBITOR .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2)), 70, 'right', 'UTF-8', 1)).''.$CrLf; + $XML_DEBITOR .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)).''.$CrLf; } $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.$CrLf; @@ -1908,14 +1908,14 @@ class BonPrelevement extends CommonObject $XML_CREDITOR .= ' '.round($row_somme, 2).''.$CrLf; $XML_CREDITOR .= ' '.$CrLf; /* - $XML_CREDITOR .= ' '.$CrLf; - $XML_CREDITOR .= ' '.$CrLf; - $XML_CREDITOR .= ' '.$Rum.''.$CrLf; - $XML_CREDITOR .= ' '.$DtOfSgntr.''.$CrLf; - $XML_CREDITOR .= ' false'.$CrLf; - $XML_CREDITOR .= ' '.$CrLf; - $XML_CREDITOR .= ' '.$CrLf; - */ + $XML_CREDITOR .= ' '.$CrLf; + $XML_CREDITOR .= ' '.$CrLf; + $XML_CREDITOR .= ' '.$Rum.''.$CrLf; + $XML_CREDITOR .= ' '.$DtOfSgntr.''.$CrLf; + $XML_CREDITOR .= ' false'.$CrLf; + $XML_CREDITOR .= ' '.$CrLf; + $XML_CREDITOR .= ' '.$CrLf; + */ //$XML_CREDITOR .= ' SLEV'.$CrLf; $XML_CREDITOR .= ' '.$CrLf; $XML_CREDITOR .= ' '.$CrLf; @@ -1923,16 +1923,16 @@ class BonPrelevement extends CommonObject $XML_CREDITOR .= ' '.$CrLf; $XML_CREDITOR .= ' '.$CrLf; $XML_CREDITOR .= ' '.$CrLf; - $XML_CREDITOR .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom)))).''.$CrLf; + $XML_CREDITOR .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom), ' '))).''.$CrLf; $XML_CREDITOR .= ' '.$CrLf; $XML_CREDITOR .= ' '.$row_country_code.''.$CrLf; $addressline1 = strtr($row_address, array(CHR(13) => ", ", CHR(10) => "")); $addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : ''.$row_town), array(CHR(13) => ", ", CHR(10) => "")); if (trim($addressline1)) { - $XML_CREDITOR .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1)), 70, 'right', 'UTF-8', 1)).''.$CrLf; + $XML_CREDITOR .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).''.$CrLf; } if (trim($addressline2)) { - $XML_CREDITOR .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2)), 70, 'right', 'UTF-8', 1)).''.$CrLf; + $XML_CREDITOR .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)).''.$CrLf; } $XML_CREDITOR .= ' '.$CrLf; $XML_CREDITOR .= ' '.$CrLf; @@ -2096,16 +2096,16 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$dateTime_ETAD.''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).''.$CrLf; + $XML_SEPA_INFO .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$country[1].''.$CrLf; $addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(CHR(13) => ", ", CHR(10) => "")); $addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(CHR(13) => ", ", CHR(10) => "")); if ($addressline1) { - $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1)), 70, 'right', 'UTF-8', 1)).''.$CrLf; + $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).''.$CrLf; } if ($addressline2) { - $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2)), 70, 'right', 'UTF-8', 1)).''.$CrLf; + $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)).''.$CrLf; } $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; @@ -2120,11 +2120,11 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; /* $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).''.$CrLf; + $XML_SEPA_INFO .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$country[1].''.$CrLf; - $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ADDRESS))).''.$CrLf; - $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN)).''.$CrLf; + $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ADDRESS), ' ')).''.$CrLf; + $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN), ' ')).''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf;*/ $XML_SEPA_INFO .= ' SLEV'.$CrLf; // Field "Responsible of fees". Must be SLEV @@ -2162,16 +2162,16 @@ class BonPrelevement extends CommonObject } $XML_SEPA_INFO .= ' '.dol_print_date($dateTime_ETAD, 'dayrfc').''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).''.$CrLf; + $XML_SEPA_INFO .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$country[1].''.$CrLf; $addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(CHR(13) => ", ", CHR(10) => "")); $addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(CHR(13) => ", ", CHR(10) => "")); if ($addressline1) { - $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1)), 70, 'right', 'UTF-8', 1)).''.$CrLf; + $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).''.$CrLf; } if ($addressline2) { - $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2)), 70, 'right', 'UTF-8', 1)).''.$CrLf; + $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)).''.$CrLf; } $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; @@ -2186,26 +2186,26 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; /* $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).''.$CrLf; + $XML_SEPA_INFO .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$country[1].''.$CrLf; - $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ADDRESS))).''.$CrLf; - $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN)).''.$CrLf; + $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ADDRESS), ' ')).''.$CrLf; + $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN), ' ')).''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf;*/ $XML_SEPA_INFO .= ' SLEV'.$CrLf; // Field "Responsible of fees". Must be SLEV /*$XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.$this->emetteur_ics.''.$CrLf; - $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' SEPA'.$CrLf; - $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.$CrLf;*/ + $XML_SEPA_INFO .= ' '.$CrLf; + $XML_SEPA_INFO .= ' '.$CrLf; + $XML_SEPA_INFO .= ' '.$CrLf; + $XML_SEPA_INFO .= ' '.$this->emetteur_ics.''.$CrLf; + $XML_SEPA_INFO .= ' '.$CrLf; + $XML_SEPA_INFO .= ' SEPA'.$CrLf; + $XML_SEPA_INFO .= ' '.$CrLf; + $XML_SEPA_INFO .= ' '.$CrLf; + $XML_SEPA_INFO .= ' '.$CrLf; + $XML_SEPA_INFO .= ' '.$CrLf; + $XML_SEPA_INFO .= ' '.$CrLf;*/ } } else { fputs($this->file, 'INCORRECT EMETTEUR '.$XML_SEPA_INFO.$CrLf); @@ -2343,59 +2343,59 @@ class BonPrelevement extends CommonObject } /* - if ($mode == 'direct_debit') { - $sql = "SELECT b.rowid, f.datedue as datefin"; - $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql .= " WHERE f.entity IN (".getEntity('facture').")"; - $sql .= " AND f.total_ttc > 0"; - } else { - $sql = "SELECT b.rowid, f.datedue as datefin"; - $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; - $sql .= " WHERE f.entity IN (".getEntity('facture_fourn').")"; - $sql .= " AND f.total_ttc > 0"; - } + if ($mode == 'direct_debit') { + $sql = "SELECT b.rowid, f.datedue as datefin"; + $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; + $sql .= " WHERE f.entity IN (".getEntity('facture').")"; + $sql .= " AND f.total_ttc > 0"; + } else { + $sql = "SELECT b.rowid, f.datedue as datefin"; + $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; + $sql .= " WHERE f.entity IN (".getEntity('facture_fourn').")"; + $sql .= " AND f.total_ttc > 0"; + } - $resql = $this->db->query($sql); - if ($resql) { - $langs->load("banks"); - $now = dol_now(); + $resql = $this->db->query($sql); + if ($resql) { + $langs->load("banks"); + $now = dol_now(); - $response = new WorkboardResponse(); - if ($mode == 'direct_debit') { - $response->warning_delay = $conf->prelevement->warning_delay / 60 / 60 / 24; - $response->label = $langs->trans("PendingDirectDebitToComplete"); - $response->labelShort = $langs->trans("PendingDirectDebitToCompleteShort"); - $response->url = DOL_URL_ROOT.'/compta/prelevement/index.php?leftmenu=checks&mainmenu=bank'; - } else { - $response->warning_delay = $conf->paymentbybanktransfer->warning_delay / 60 / 60 / 24; - $response->label = $langs->trans("PendingCreditTransferToComplete"); - $response->labelShort = $langs->trans("PendingCreditTransferToCompleteShort"); - $response->url = DOL_URL_ROOT.'/compta/paymentbybanktransfer/index.php?leftmenu=checks&mainmenu=bank'; - } - $response->img = img_object('', "payment"); + $response = new WorkboardResponse(); + if ($mode == 'direct_debit') { + $response->warning_delay = $conf->prelevement->warning_delay / 60 / 60 / 24; + $response->label = $langs->trans("PendingDirectDebitToComplete"); + $response->labelShort = $langs->trans("PendingDirectDebitToCompleteShort"); + $response->url = DOL_URL_ROOT.'/compta/prelevement/index.php?leftmenu=checks&mainmenu=bank'; + } else { + $response->warning_delay = $conf->paymentbybanktransfer->warning_delay / 60 / 60 / 24; + $response->label = $langs->trans("PendingCreditTransferToComplete"); + $response->labelShort = $langs->trans("PendingCreditTransferToCompleteShort"); + $response->url = DOL_URL_ROOT.'/compta/paymentbybanktransfer/index.php?leftmenu=checks&mainmenu=bank'; + } + $response->img = img_object('', "payment"); - while ($obj = $this->db->fetch_object($resql)) { - $response->nbtodo++; + while ($obj = $this->db->fetch_object($resql)) { + $response->nbtodo++; - if ($this->db->jdate($obj->datefin) < ($now - $conf->withdraw->warning_delay)) { - $response->nbtodolate++; - } - } + if ($this->db->jdate($obj->datefin) < ($now - $conf->withdraw->warning_delay)) { + $response->nbtodolate++; + } + } - $response->nbtodo = 0; - $response->nbtodolate = 0; - // Return workboard only if quantity is not 0 - if ($response->nbtodo) { - return $response; - } else { - return 0; - } - } else { - dol_print_error($this->db); - $this->error = $this->db->error(); - return -1; - } - */ + $response->nbtodo = 0; + $response->nbtodolate = 0; + // Return workboard only if quantity is not 0 + if ($response->nbtodo) { + return $response; + } else { + return 0; + } + } else { + dol_print_error($this->db); + $this->error = $this->db->error(); + return -1; + } + */ return 0; } } diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index fc640eccc1c..df45a5bdabd 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -159,11 +159,11 @@ if ($resql) { $thirdpartystatic->idprof5 = $obj->idprof5; $thirdpartystatic->idprof6 = $obj->idprof6; - print ''; + print ''; print $invoicestatic->getNomUrl(1, 'withdraw'); print ''; - print ''; + print ''; print $thirdpartystatic->getNomUrl(1, 'customer'); print ''; @@ -225,17 +225,17 @@ if ($result) { while ($i < min($num, $limit)) { $obj = $db->fetch_object($result); - - print ''; - - print ""; $bprev->id = $obj->rowid; $bprev->ref = $obj->ref; $bprev->statut = $obj->statut; + + print ''; + + print ''; print $bprev->getNomUrl(1); print "\n"; print ''.dol_print_date($db->jdate($obj->datec), "dayhour")."\n"; - print ''.price($obj->amount)."\n"; + print ''.price($obj->amount)."\n"; print ''.$bprev->getLibStatut(3)."\n"; print "\n"; diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index 8b2bf351094..4bd79a3c0d5 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; // Load translation files required by the page $langs->load("companies"); -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { $langs->load("bills"); } @@ -116,7 +116,7 @@ if ($id > 0) { dol_banner_tab($object, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom', '', '', 0, '', '', 1); print dol_get_fiche_end(); - if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { + if (isModEnabled('facture') && $user->rights->facture->lire) { // Invoice list print load_fiche_titre($langs->trans("CustomerPreview")); diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 68068dec866..719b1deb29a 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -212,7 +212,7 @@ if (!empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') { $subtotal_ht = 0; $subtotal_ttc = 0; -if (!empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { +if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc, date_format(f.datef,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; @@ -269,7 +269,7 @@ if (!empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $mod // Nothing from this table } -if (!empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { +if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { // On ajoute les paiements clients anciennes version, non lies par paiement_facture if ($modecompta != 'CREANCES-DETTES') { $sql = "SELECT sum(p.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; @@ -324,7 +324,7 @@ if (!empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $mod $subtotal_ht = 0; $subtotal_ttc = 0; -if (!empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { +if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc, date_format(f.datef,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 900f1a179e9..6cc3496ced0 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -1,9 +1,9 @@ - * Copyright (C) 2005-2013 Regis Houssin - * Copyright (C) 2016-2018 Frédéric France - * Copyright (C) 2017 Alexandre Spangaro - * Copyright (C) 2021 Gauthier VERDOL +/* Copyright (C) 2004-2020 Laurent Destailleur + * Copyright (C) 2005-2013 Regis Houssin + * Copyright (C) 2016-2018 Frédéric France + * Copyright (C) 2017-2022 Alexandre Spangaro + * Copyright (C) 2021 Gauthier VERDOL * * 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 @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -53,6 +53,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); +$lineid = GETPOST('lineid', 'int'); $fk_project = (GETPOST('fk_project') ? GETPOST('fk_project', 'int') : 0); @@ -332,7 +333,7 @@ $form = new Form($db); $formfile = new FormFile($db); $formsocialcontrib = new FormSocialContrib($db); $bankaccountstatic = new Account($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -406,7 +407,7 @@ if ($action == 'create') { print ''.img_picto('', 'user', 'class="pictofixedwidth"').$form->select_dolusers($fk_user, 'userid', 1).''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); // Associated project @@ -539,7 +540,7 @@ if ($id > 0) { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->tax->charges->creer) { diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 1b83915714d..318e7fcd96b 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -1,6 +1,7 @@ - * Copyright (C) 2004-2007 Laurent Destailleur +/* Copyright (C) 2002 Rodolphe Quiedeville + * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2022 Alexandre Spangaro * * 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 @@ -544,7 +545,7 @@ class PaymentSocialContribution extends CommonObject */ public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque) { - global $conf; + global $conf, $langs; // Clean data $this->num_payment = trim($this->num_payment); diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index 3de8687433f..2b0d17337a5 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -101,7 +101,7 @@ if ($action == 'setlib' && $user->rights->tax->charges->creer) { */ $form = new Form($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -121,7 +121,7 @@ if ($object->id) { $morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' : '; if (!empty($object->fk_project)) { diff --git a/htdocs/compta/sociales/info.php b/htdocs/compta/sociales/info.php index 8363459171b..0976a76c26d 100644 --- a/htdocs/compta/sociales/info.php +++ b/htdocs/compta/sociales/info.php @@ -25,7 +25,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -68,7 +68,7 @@ if ($action == 'setlib' && $user->rights->tax->charges->creer) { $form = new Form($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -90,7 +90,7 @@ $morehtmlref = '
    '; $morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' : '; if (!empty($object->fk_project)) { diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 082a485f817..14b8bfa043f 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -1,12 +1,12 @@ - * Copyright (C) 2004-2017 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2016 Frédéric France - * Copyright (C) 2020 Pierre Ardoin - * Copyright (C) 2020 Tobias Sekan - * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2021 Alexandre Spangaro +/* Copyright (C) 2001-2003 Rodolphe Quiedeville + * Copyright (C) 2004-2017 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2016 Frédéric France + * Copyright (C) 2020 Pierre Ardoin + * Copyright (C) 2020 Tobias Sekan + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021-2022 Alexandre Spangaro * * 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 @@ -34,23 +34,24 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } // Load translation files required by the page $langs->loadLangs(array('compta', 'banks', 'bills', 'hrm', 'projects')); -$action = GETPOST('action', 'aZ09'); -$massaction = GETPOST('massaction', 'alpha'); -$confirm = GETPOST('confirm', 'alpha'); +$action = GETPOST('action', 'aZ09'); +$massaction = GETPOST('massaction', 'alpha'); +$confirm = GETPOST('confirm', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); -$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'sclist'; +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'sclist'; -$search_ref = GETPOST('search_ref', 'int'); +$search_ref = GETPOST('search_ref', 'int'); $search_label = GETPOST('search_label', 'alpha'); -$search_amount = GETPOST('search_amount', 'alpha'); -$search_status = GETPOST('search_status', 'int'); +$search_typeid = GETPOST('search_typeid', 'int'); +$search_amount = GETPOST('search_amount', 'alpha'); +$search_status = GETPOST('search_status', 'int'); $search_date_startday = GETPOST('search_date_startday', 'int'); $search_date_startmonth = GETPOST('search_date_startmonth', 'int'); $search_date_startyear = GETPOST('search_date_startyear', 'int'); @@ -70,11 +71,11 @@ $search_date_limit_end = dol_mktime(23, 59, 59, $search_date_limit_endmonth, $se $search_project_ref = GETPOST('search_project_ref', 'alpha'); $search_users = GETPOST('search_users'); $search_type = GETPOST('search_type', 'int'); -$search_account = GETPOST('search_account', 'int'); +$search_account = GETPOST('search_account', 'int'); $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; -$sortfield = GETPOST('sortfield', 'aZ09comma'); -$sortorder = GETPOST("sortorder", 'aZ09comma'); +$sortfield = GETPOST('sortfield', 'aZ09comma'); +$sortorder = GETPOST("sortorder", 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (empty($page) || $page == -1) { @@ -93,26 +94,13 @@ if (!$sortorder) { $filtre = GETPOST("filtre", 'int'); -if (!GETPOSTISSET('search_typeid')) { - $newfiltre = str_replace('filtre=', '', $filtre); - $filterarray = explode('-', $newfiltre); - foreach ($filterarray as $val) { - $part = explode(':', $val); - if ($part[0] == 'cs.fk_type') { - $search_typeid = $part[1]; - } - } -} else { - $search_typeid = GETPOST('search_typeid', 'int'); -} - $arrayfields = array( 'cs.rowid' =>array('label'=>"Ref", 'checked'=>1, 'position'=>10), 'cs.libelle' =>array('label'=>"Label", 'checked'=>1, 'position'=>20), 'cs.fk_type' =>array('label'=>"Type", 'checked'=>1, 'position'=>30), 'cs.date_ech' =>array('label'=>"Date", 'checked'=>1, 'position'=>40), 'cs.periode' =>array('label'=>"PeriodEndDate", 'checked'=>1, 'position'=>50), - 'p.ref' =>array('label'=>"ProjectRef", 'checked'=>1, 'position'=>60, 'enable'=>(!empty($conf->projet->enabled))), + 'p.ref' =>array('label'=>"ProjectRef", 'checked'=>1, 'position'=>60, 'enable'=>(!empty($conf->project->enabled))), 'cs.fk_user' =>array('label'=>"Employee", 'checked'=>1, 'position'=>70), 'cs.fk_mode_reglement' =>array('checked'=>-1, 'position'=>80, 'label'=>"DefaultPaymentMode"), 'cs.amount' =>array('label'=>"Amount", 'checked'=>1, 'position'=>100), @@ -191,7 +179,7 @@ $formother = new FormOther($db); $bankstatic = new Account($db); $formsocialcontrib = new FormSocialContrib($db); $chargesociale_static = new ChargeSociales($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $projectstatic = new Project($db); } @@ -199,7 +187,7 @@ llxHeader('', $langs->trans("SocialContributions")); $sql = "SELECT cs.rowid, cs.fk_type as type, cs.fk_user,"; $sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode, cs.fk_account,"; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label,"; } $sql .= " c.libelle as type_label, c.accountancy_code as type_accountancy_code,"; @@ -209,7 +197,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,"; $sql .= " ".MAIN_DB_PREFIX."chargesociales as cs"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON (cs.fk_account = ba.rowid)"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as pay ON (cs.fk_mode_reglement = pay.id)'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = cs.fk_projet"; } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid"; @@ -223,7 +211,7 @@ if ($search_ref) { if ($search_label) { $sql .= natural_search("cs.libelle", $search_label); } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { if ($search_project_ref != '') { $sql .= natural_search("p.ref", $search_project_ref); } @@ -259,7 +247,7 @@ if ($search_typeid > 0) { $sql .= " AND cs.fk_type = ".((int) $search_typeid); } $sql .= " GROUP BY cs.rowid, cs.fk_type, cs.fk_user, cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode, cs.fk_account, c.libelle, c.accountancy_code, ba.label, ba.ref, ba.number, ba.account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.clos, pay.code, u.lastname"; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $sql .= ", p.rowid, p.ref, p.title"; } $sql .= $db->order($sortfield, $sortorder); @@ -388,6 +376,9 @@ if (empty($mysoc->country_id) && empty($mysoc->country_code)) { $db->close(); } +$moreforfilter = ''; +$massactionbutton = ''; + $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields if ($massactionbutton) { @@ -551,7 +542,9 @@ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', '', $ print ''; $i = 0; - $totalarray = $TLoadedUsers = array(); +$totalarray = $TLoadedUsers = array(); +$totalarray['nbfield'] = 0; +$totalarray['val']['totalttcfield'] = 0; while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); @@ -560,7 +553,7 @@ while ($i < min($num, $limit)) { $chargesociale_static->label = $obj->label; $chargesociale_static->type_label = $obj->type_label; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $projectstatic->id = $obj->project_id; $projectstatic->ref = $obj->project_ref; $projectstatic->title = $obj->project_label; diff --git a/htdocs/compta/sociales/note.php b/htdocs/compta/sociales/note.php index 0447d3168b1..8ede1c3b502 100644 --- a/htdocs/compta/sociales/note.php +++ b/htdocs/compta/sociales/note.php @@ -25,7 +25,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -93,7 +93,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' : '; if (!empty($object->fk_project)) { diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index d2646d241ea..843dbd58a50 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -1,12 +1,12 @@ - * Copyright (C) 2004-2016 Laurent Destailleur - * Copyright (C) 2005-2010 Regis Houssin - * Copyright (C) 2011-2016 Alexandre Spangaro - * Copyright (C) 2011-2014 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2019 Nicolas ZABOURI - * Copyright (C) 2021 Gauthier VERDOL +/* Copyright (C) 2001-2003 Rodolphe Quiedeville + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2005-2010 Regis Houssin + * Copyright (C) 2011-2022 Alexandre Spangaro + * Copyright (C) 2011-2014 Juanjo Menent + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2019 Nicolas ZABOURI + * Copyright (C) 2021 Gauthier VERDOL * * 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 @@ -37,6 +37,9 @@ require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.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.'/core/class/html.formsocialcontrib.class.php'; +if (!empty($conf->accounting->enabled)) { + include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; +} $hookmanager = new HookManager($db); @@ -48,6 +51,7 @@ $langs->loadLangs(array('compta', 'bills', 'hrm')); $year = GETPOST("year", 'int'); $search_sc_type = GETPOST('search_sc_type', 'int'); +$optioncss = GETPOST('optioncss', 'alpha'); $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -123,6 +127,9 @@ if ($year) { if ($search_sc_type) { $param .= '&search_sc_type='.urlencode($search_sc_type); } +if ($optioncss != '') { + $param .= '&optioncss='.urlencode($optioncss); +} $num = 0; print ''; @@ -139,14 +146,16 @@ $sql = "SELECT c.id, c.libelle as type_label,"; $sql .= " cs.rowid, cs.libelle as label_sc, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total, cs.paye,"; $sql .= " pc.rowid as pid, pc.datep, pc.amount as totalpaid, pc.num_paiement as num_payment, pc.fk_bank,"; $sql .= " pct.code as payment_code,"; -$sql .= " u.rowid uid, u.lastname, u.firstname, u.email, u.login, u.admin,"; -$sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel, ba.iban_prefix as iban, ba.bic, ba.currency_code, ba.clos"; +$sql .= " u.rowid as uid, u.lastname, u.firstname, u.email, u.login, u.admin, u.statut,"; +$sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel, ba.iban_prefix as iban, ba.bic, ba.currency_code, ba.clos,"; +$sql .= " aj.label as account_journal"; $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,"; $sql .= " ".MAIN_DB_PREFIX."chargesociales as cs"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON pc.fk_typepaiement = pct.id"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON pc.fk_bank = b.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_journal as aj ON ba.fk_accountancy_journal = aj.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = cs.fk_user"; $sql .= " WHERE cs.fk_type = c.id"; $sql .= " AND cs.entity IN (".getEntity("tax").")"; @@ -278,7 +287,7 @@ while ($i < min($num, $limit)) { print $socialcontrib->getNomUrl(1, ''); print ''; // Type - print ''.$obj->label.''; + print ''.$obj->label_sc.''; // Date $date = $obj->periode; if (empty($date)) { @@ -297,8 +306,7 @@ while ($i < min($num, $limit)) { $userstatic->admin = $obj->admin; $userstatic->login = $obj->login; $userstatic->email = $obj->email; - $userstatic->socid = $obj->fk_soc; - $userstatic->statut = $obj->status; + $userstatic->statut = $obj->statut; print $userstatic->getNomUrl(1); print "\n"; } @@ -327,13 +335,16 @@ while ($i < min($num, $limit)) { $accountstatic->id = $obj->bid; $accountstatic->ref = $obj->bref; $accountstatic->number = $obj->bnumber; - $accountstatic->accountancy_number = $obj->account_number; - $accountstatic->accountancy_journal = $obj->accountancy_journal; $accountstatic->label = $obj->blabel; $accountstatic->iban = $obj->iban; $accountstatic->bic = $obj->bic; $accountstatic->currency_code = $langs->trans("Currency".$obj->currency_code); $accountstatic->clos = $obj->clos; + + if (!empty($conf->accounting->enabled)) { + $accountstatic->account_number = $obj->account_number; + $accountstatic->accountancy_journal = $obj->account_journal; + } print $accountstatic->getNomUrl(1); } else { print ' '; @@ -356,7 +367,6 @@ while ($i < min($num, $limit)) { print ''; $total = $total + $obj->total; - $totalnb = $totalnb + $obj->nb; $totalpaid = $totalpaid + $obj->totalpaid; $i++; } diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 35d5028e938..2b8f40b3aba 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -484,7 +484,7 @@ if (count($amount)) { if (!empty($conf->commande->enabled) && $key > 0) { print ' '.img_picto($langs->trans("OrderStats"), "stats").' '; } - if (!empty($conf->facture->enabled) && $key > 0) { + if (isModEnabled('facture') && $key > 0) { print ' '.img_picto($langs->trans("InvoiceStats"), "stats").' '; } print ''; diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 1df7ae4db62..320efa36ed6 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -658,7 +658,7 @@ if (count($amount)) { if (!empty($conf->commande->enabled) && $key > 0) { print ' '.img_picto($langs->trans("OrderStats"), "stats").' '; } - if (!empty($conf->facture->enabled) && $key > 0) { + if (isModEnabled('facture') && $key > 0) { print ' '.img_picto($langs->trans("InvoiceStats"), "stats").' '; } print ''; diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index 22b3f988a70..dc362e60051 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/vat.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -102,7 +102,7 @@ if ($action == 'setlib' && $permissiontoadd) { */ $form = new Form($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index 98b6ccea3b1..5f07922b2e4 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -252,7 +252,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $out = ''; $newcardbutton = ''; - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { $permok = $user->rights->agenda->myactions->create; if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { if (is_object($objthirdparty) && get_class($objthirdparty) == 'Societe') { @@ -267,7 +267,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } } - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { print '
    '; $param = '&id='.$id; diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index 195a4d028f4..a72ea3d7d21 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -206,7 +206,7 @@ abstract class ActionsContactCardCommon $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_contrat ? $this->object->ref_contrat : $langs->trans("NoContactForAnyContract"); $i++; } - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForInvoices"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_facturation ? $this->object->ref_facturation : $langs->trans("NoContactForAnyInvoice"); $i++; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index cd12fd12150..67b144ffd89 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1039,7 +1039,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''; print '
    '; - print ''; + print ''; print '
    '; if ($conf->use_javascript_ajax) { print ''.$langs->trans('CopyAddressFromSoc').'
    '; @@ -1241,7 +1241,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { print ''.$langs->trans("ContactForInvoices").''; print $object->ref_facturation ? $object->ref_facturation : (''.$langs->trans("NoContactForAnyInvoice").''); print ''; @@ -1271,7 +1271,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ' '.$langs->trans("Delete").'

    '; } //print ''.$langs->trans("PhotoFile").''; - print ''; + print ''; + $maxfilesizearray = getMaxFileSizeArray(); + $maxmin = $maxfilesizearray['maxmin']; + if ($maxmin > 0) { + print ''; // MAX_FILE_SIZE must precede the field type=file + } + print ''; + print ''; print ''; print ''; @@ -1511,7 +1518,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { print ''.$langs->trans("ContactForInvoices").''; print $object->ref_facturation ? $object->ref_facturation : $langs->trans("NoContactForAnyInvoice"); print ''; diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index b7fc682d2c6..41a6a74dd4b 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -159,7 +159,7 @@ if ($object->thirdparty->client) { if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); } - if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { + if (isModEnabled('facture') && $user->rights->facture->lire) { $elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices'); } if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index e90f8b46bd0..6030fc1e6bd 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -159,7 +159,14 @@ if ($action == 'edit') { print ' '.$langs->trans("Delete").'

    '; } print ''.$langs->trans("PhotoFile").''; - print ''; + print ''; + $maxfilesizearray = getMaxFileSizeArray(); + $maxmin = $maxfilesizearray['maxmin']; + if ($maxmin > 0) { + print ''; // MAX_FILE_SIZE must precede the field type=file + } + print ''; + print ''; print ''; print ''; diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index d654ac38d9f..a8dc5e7ee3b 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -110,7 +110,7 @@ if (empty($reshook)) { $form = new Form($db); $formfile = new FormFile($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -171,7 +171,7 @@ if ($id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherContracts").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { @@ -243,7 +243,7 @@ if ($id > 0) { $newcardbutton = ''; - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { $backtopage = $_SERVER['PHP_SELF'].'?id='.$object->id; $out = '&origin='.$object->element.'&originid='.$object->id.'&backtopage='.urlencode($backtopage); @@ -251,7 +251,7 @@ if ($id > 0) { } } - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { print '
    '; $param = '&id='.$id; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index d17f5399679..75689f509ea 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -44,7 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; if (!empty($conf->propal->enabled)) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -1002,7 +1002,7 @@ llxHeader('', $langs->trans("Contract"), $help_url); $form = new Form($db); $formfile = new FormFile($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -1161,7 +1161,7 @@ if ($action == 'create') { print ""; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load('projects'); $formproject = new FormProjets($db); @@ -1285,9 +1285,8 @@ if ($action == 'create') { // Print form confirm print $formconfirm; - /* - * Contrat - */ + + // Contract if (!empty($object->brouillon) && $user->rights->contrat->creer) { print ''; print ''; @@ -1321,7 +1320,7 @@ if ($action == 'create') { $morehtmlref .= ' ('.$langs->trans("OtherContracts").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { @@ -1415,7 +1414,7 @@ if ($action == 'create') { } - $arrayothercontracts = $object->getListOfContracts('others'); + $arrayothercontracts = $object->getListOfContracts('others'); // array or -1 if technical error /* * Lines of contracts @@ -1544,9 +1543,9 @@ if ($action == 'create') { print ''.price($objp->pa_ht).''; } - // Icon move, update et delete (statut contrat 0=brouillon,1=valide,2=ferme) + // Icon move, update et delete (status contract 0=draft,1=validated,2=closed) print ''; - if ($user->rights->contrat->creer && count($arrayothercontracts) && ($object->statut >= 0)) { + if ($user->rights->contrat->creer && is_array($arrayothercontracts) && count($arrayothercontracts) && ($object->statut >= 0)) { print ''; print ''; print img_picto($langs->trans("MoveToAnotherContract"), 'uparrow'); @@ -2071,7 +2070,7 @@ if ($action == 'create') { } } - if (!empty($conf->facture->enabled) && $object->statut > 0) { + if (isModEnabled('facture') && $object->statut > 0) { $langs->load("bills"); if ($user->rights->facture->creer) { print dolGetButtonAction($langs->trans('CreateBill'), '', 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id, '', true, $params); diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 79f2e8e9e15..ee59a5465dc 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -233,7 +233,7 @@ class Contrat extends CommonObject 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>40), 'date_contrat' =>array('type'=>'datetime', 'label'=>'Date contrat', 'enabled'=>1, 'visible'=>-1, 'position'=>45), 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>70), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>75), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>75), 'fk_commercial_signature' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'SaleRepresentative Signature', 'enabled'=>1, 'visible'=>-1, 'position'=>80), 'fk_commercial_suivi' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'SaleRepresentative follower', 'enabled'=>1, 'visible'=>-1, 'position'=>85), 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>90), @@ -1058,7 +1058,7 @@ class Contrat extends CommonObject if (count($exp->linkedObjectsIds['commande']) > 0) { foreach ($exp->linkedObjectsIds['commande'] as $key => $value) { $originforcontact = 'commande'; - $originidforcontact = $value->id; + $originidforcontact = $value; break; // We take first one } } @@ -2126,7 +2126,7 @@ class Contrat extends CommonObject } /** - * Return list of other contracts for same company than current contract + * Return list of other contracts for the same company than current contract * * @param string $option 'all' or 'others' * @param array $status sort contracts having these status @@ -2138,7 +2138,7 @@ class Contrat extends CommonObject { $tab = array(); - $sql = "SELECT c.rowid, c.ref"; + $sql = "SELECT c.rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."contrat as c"; if (!empty($product_categories)) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."contratdet as cd ON cd.fk_contrat = c.rowid"; @@ -2159,12 +2159,12 @@ class Contrat extends CommonObject $obj = $this->db->fetch_object($resql); $contrat = new Contrat($this->db); $contrat->fetch($obj->rowid); - $tab[] = $contrat; + $tab[$contrat->id] = $contrat; $i++; } return $tab; } else { - $this->error = $this->db->error(); + $this->error = $this->db->lasterror(); return -1; } } @@ -2690,6 +2690,7 @@ class ContratLigne extends CommonObjectLine public $date_cloture; // date end real public $tva_tx; + public $vat_src_code; public $localtax1_tx; public $localtax2_tx; public $localtax1_type; // Local tax 1 type diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index d053a9a4fa0..1bd9d3388f6 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -154,7 +154,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 953fd0002d2..ce386fe21b9 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -144,7 +144,7 @@ if ($object->id) { $morehtmlref .= ' (
    '.$langs->trans("OtherContracts").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index e76261010da..4f5d8d00b49 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -995,6 +995,18 @@ while ($i < min($num, $limit)) { print "\n"; $i++; } + +// If no record found +if ($num == 0) { + $colspan = 4; // Include the 4 columns of status + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''.$langs->trans("NoRecordFound").''; +} + $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index 01378a65786..540491698c1 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -27,7 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -111,7 +111,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 1f3ccf70f3a..2869c66cd9f 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -218,7 +218,7 @@ $form = new Form($db); $sql = "SELECT c.rowid as cid, c.ref, c.statut as cstatut, c.ref_customer, c.ref_supplier,"; $sql .= " s.rowid as socid, s.nom as name, s.email, s.client, s.fournisseur,"; $sql .= " cd.rowid, cd.description, cd.statut,"; -$sql .= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype, p.entity as pentity,"; +$sql .= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype, p.tobuy, p.tosell, p.barcode, p.entity as pentity,"; if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " sc.fk_soc, sc.fk_user,"; } @@ -486,7 +486,7 @@ $morefilter = ''; $moreforfilter = ''; // If the user can view categories of products -if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights->service->lire)) { +if (isModEnabled('categorie') && ($user->rights->produit->lire || $user->rights->service->lire)) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
    '; $tmptitle = $langs->trans('IncludingProductWithTag'); @@ -678,7 +678,7 @@ if (!empty($arrayfields['status']['checked'])) { '4&filter=expired'=>$langs->trans("ServiceStatusLate"), '5'=>$langs->trans("ServiceStatusClosed") ); - print $form->selectarray('search_status', $arrayofstatus, (strstr($search_status, ',') ?-1 : $search_status), 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100'); + print $form->selectarray('search_status', $arrayofstatus, (strstr($search_status, ',') ?-1 : $search_status), 1, 0, 0, '', 0, 0, 0, '', 'minwidth100imp maxwidth150'); print ''; } // Action column @@ -707,6 +707,16 @@ while ($i < min($num, $limit)) { $companystatic->client = $obj->client; $companystatic->fournisseur = $obj->fournisseur; + $productstatic->id = $obj->pid; + $productstatic->type = $obj->ptype; + $productstatic->ref = $obj->pref; + $productstatic->entity = $obj->pentity; + $productstatic->status = $obj->tosell; + $productstatic->status_buy = $obj->tobuy; + $productstatic->label = $obj->label; + $productstatic->description = $obj->description; + $productstatic->barcode = $obj->barcode; + print ''; // Ref @@ -720,16 +730,12 @@ while ($i < min($num, $limit)) { } // Service if (!empty($arrayfields['p.description']['checked'])) { - print ''; + print ''; if ($obj->pid > 0) { - $productstatic->id = $obj->pid; - $productstatic->type = $obj->ptype; - $productstatic->ref = $obj->pref; - $productstatic->entity = $obj->pentity; print $productstatic->getNomUrl(1, '', 24); print $obj->label ? ' - '.dol_trunc($obj->label, 16) : ''; if (!empty($obj->description) && !empty($conf->global->PRODUCT_DESC_IN_LIST)) { - print '
    '.dol_nl2br($obj->description); + print '
    '.dol_nl2br($obj->description).''; } } else { if ($obj->type == 0) { @@ -746,7 +752,7 @@ while ($i < min($num, $limit)) { } if (!empty($arrayfields['cd.tva_tx']['checked'])) { - print ''; + print ''; print price2num($obj->tva_tx).'%'; print ''; if (!$i) { @@ -754,7 +760,7 @@ while ($i < min($num, $limit)) { } } if (!empty($arrayfields['cd.subprice']['checked'])) { - print ''; + print ''; print price($obj->subprice); print ''; if (!$i) { @@ -762,7 +768,7 @@ while ($i < min($num, $limit)) { } } if (!empty($arrayfields['cd.qty']['checked'])) { - print ''; + print ''; print $obj->qty; print ''; if (!$i) { @@ -770,7 +776,7 @@ while ($i < min($num, $limit)) { } } if (!empty($arrayfields['cd.total_ht']['checked'])) { - print ''; + print ''; print ''.price($obj->total_ht).''; print ''; if (!$i) { @@ -782,7 +788,7 @@ while ($i < min($num, $limit)) { $totalarray['val']['cd.total_ht'] += $obj->total_ht; } if (!empty($arrayfields['cd.total_tva']['checked'])) { - print ''; + print ''; print ''.price($obj->total_tva).''; print ''; if (!$i) { @@ -806,7 +812,7 @@ while ($i < min($num, $limit)) { // Start date if (!empty($arrayfields['cd.date_ouverture_prevue']['checked'])) { - print ''; + print ''; print ($obj->date_ouverture_prevue ?dol_print_date($db->jdate($obj->date_ouverture_prevue), 'dayhour') : ' '); if ($db->jdate($obj->date_ouverture_prevue) && ($db->jdate($obj->date_ouverture_prevue) < ($now - $conf->contrat->services->inactifs->warning_delay)) && $obj->statut == 0) { print ' '.img_picto($langs->trans("Late"), "warning"); @@ -819,14 +825,14 @@ while ($i < min($num, $limit)) { } } if (!empty($arrayfields['cd.date_ouverture']['checked'])) { - print ''.($obj->date_ouverture ?dol_print_date($db->jdate($obj->date_ouverture), 'dayhour') : ' ').''; + print ''.($obj->date_ouverture ?dol_print_date($db->jdate($obj->date_ouverture), 'dayhour') : ' ').''; if (!$i) { $totalarray['nbfield']++; } } // End date if (!empty($arrayfields['cd.date_fin_validite']['checked'])) { - print ''.($obj->date_fin_validite ?dol_print_date($db->jdate($obj->date_fin_validite), 'dayhour') : ' '); + print ''.($obj->date_fin_validite ?dol_print_date($db->jdate($obj->date_fin_validite), 'dayhour') : ' '); if ($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < ($now - $conf->contrat->services->expires->warning_delay) && $obj->statut < 5) { $warning_delay = $conf->contrat->services->expires->warning_delay / 3600 / 24; $textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($warning_delay) >= 0 ? '+' : '').ceil($warning_delay).' '.$langs->trans("days"); @@ -841,7 +847,7 @@ while ($i < min($num, $limit)) { } // Close date (real end date) if (!empty($arrayfields['cd.date_cloture']['checked'])) { - print ''.dol_print_date($db->jdate($obj->date_cloture), 'dayhour').''; + print ''.dol_print_date($db->jdate($obj->date_cloture), 'dayhour').''; if (!$i) { $totalarray['nbfield']++; } @@ -864,7 +870,7 @@ while ($i < min($num, $limit)) { } // Date modification if (!empty($arrayfields['cd.tms']['checked'])) { - print ''; + print ''; print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''; if (!$i) { diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index b90f3c8ebd0..506a1465fdc 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -137,14 +137,14 @@ if ($action == 'add' && !empty($permissiontoadd)) { $result = $object->create($user); if ($result > 0) { // Creation OK - if ($conf->categorie->enabled && method_exists($object, 'setCategories')) { + if (isModEnabled('categorie') && method_exists($object, 'setCategories')) { $categories = GETPOST('categories', 'array:int'); $object->setCategories($categories); } $urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist; $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation - if (!empty($noback)) { + if (empty($noback)) { header("Location: " . $urltogo); exit; } @@ -244,7 +244,7 @@ if ($action == 'update' && !empty($permissiontoadd)) { } } - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { $categories = GETPOST('categories', 'array'); if (method_exists($object, 'setCategories')) { $object->setCategories($categories); @@ -266,7 +266,7 @@ if ($action == 'update' && !empty($permissiontoadd)) { $action = 'view'; $urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist; $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation - if ($urltogo) { + if ($urltogo && !$noback) { header("Location: " . $urltogo); exit; } @@ -320,7 +320,7 @@ if ($action == 'confirm_delete' && !empty($permissiontodelete)) { // Delete OK setEventMessages("RecordDeleted", null, 'mesgs'); - if (!empty($noback)) { + if (empty($noback)) { header("Location: " . $backurlforlist); exit; } @@ -366,7 +366,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && !empty($permissionto setEventMessages($langs->trans('RecordDeleted'), null, 'mesgs'); - if (!empty($noback)) { + if (empty($noback)) { header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); exit; } @@ -507,7 +507,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && !empty($permissiontoadd)) $newid = $result; } - if (!empty($noback)) { + if (empty($noback)) { header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $newid); // Open record of new object exit; } diff --git a/htdocs/core/actions_builddoc.inc.php b/htdocs/core/actions_builddoc.inc.php index c813e8af4a0..69d46dae51c 100644 --- a/htdocs/core/actions_builddoc.inc.php +++ b/htdocs/core/actions_builddoc.inc.php @@ -26,7 +26,7 @@ // $id must be defined // $object must be defined and must have a method generateDocument(). // $permissiontoadd must be defined -// $upload_dir must be defined (example $conf->projet->dir_output . "/";) +// $upload_dir must be defined (example $conf->project->dir_output . "/";) // $hidedetails, $hidedesc, $hideref and $moreparams may have been set or not. if (!empty($permissioncreate) && empty($permissiontoadd)) { diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 7951ce726dc..7a0a5fb0a07 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -31,7 +31,7 @@ // $parameters, $object, $action must be defined for the hook. // $permissiontoread, $permissiontoadd, $permissiontodelete, $permissiontoclose may be defined -// $uploaddir may be defined (example to $conf->projet->dir_output."/";) +// $uploaddir may be defined (example to $conf->project->dir_output."/";) // $toselect may be defined // $diroutputmassaction may be defined @@ -455,7 +455,7 @@ if (!$error && $massaction == 'confirm_presend') { //var_dump($oneemailperrecipient); var_dump($listofqualifiedobj); var_dump($listofqualifiedref); foreach ($looparray as $objectid => $objecttmp) { // $objecttmp is a real object or an empty object if we choose to send one email per thirdparty instead of one per object // Make substitution in email content - if (!empty($conf->projet->enabled) && method_exists($objecttmp, 'fetch_projet') && is_null($objecttmp->project)) { + if (!empty($conf->project->enabled) && method_exists($objecttmp, 'fetch_projet') && is_null($objecttmp->project)) { $objecttmp->fetch_projet(); } $substitutionarray = getCommonSubstitutionArray($langs, 0, null, $objecttmp); @@ -1058,6 +1058,8 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == ' if (in_array($objecttmp->element, array('societe', 'member'))) { $result = $objecttmp->delete($objecttmp->id, $user, 1); + } elseif (in_array($objecttmp->element, array('action'))) { + $result = $objecttmp->delete(); } else { $result = $objecttmp->delete($user); } diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index c4b79d89920..ce47cc3568f 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -252,9 +252,9 @@ if ($type == 'directory') { } elseif ($module == 'salaries') { $upload_dir = $conf->salaries->dir_output; } elseif ($module == 'project') { - $upload_dir = $conf->projet->dir_output; + $upload_dir = $conf->project->dir_output; } elseif ($module == 'project_task') { - $upload_dir = $conf->projet->dir_output; + $upload_dir = $conf->project->dir_output; } elseif ($module == 'fichinter') { $upload_dir = $conf->ficheinter->dir_output; } elseif ($module == 'user') { diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index ae4f7c41515..c1199477f58 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -89,10 +89,10 @@ if (!empty($conf->mrp->enabled) && $user->rights->mrp->read && empty($conf->glob $arrayresult['searchintomo'] = array('position'=>35, 'shortcut'=>'', 'img'=>'object_mrp', 'label'=>$langs->trans("SearchIntoMO", $search_boxvalue), 'text'=>img_picto('', 'object_mrp', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMO", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/mrp/mo_list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } -if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire) { +if (!empty($conf->project->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire) { $arrayresult['searchintoprojects'] = array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_project', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('', 'object_project', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } -if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->rights->projet->lire) { +if (!empty($conf->project->enabled) && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->rights->projet->lire) { $arrayresult['searchintotasks'] = array('position'=>45, 'img'=>'object_projecttask', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('', 'object_projecttask', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } @@ -105,7 +105,7 @@ if (!empty($conf->commande->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUS if (!empty($conf->expedition->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED) && $user->rights->expedition->lire) { $arrayresult['searchintoshipment'] = array('position'=>80, 'img'=>'object_shipment', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('', 'object_shipment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } -if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) { +if (isModEnabled('facture') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) { $arrayresult['searchintoinvoice'] = array('position'=>90, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_bill', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } @@ -120,7 +120,7 @@ if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_S } // Customer payments -if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) { +if (isModEnabled('facture') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) { $arrayresult['searchintocustomerpayments'] = array( 'position'=>170, 'img'=>'object_payment', diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 02b5070a96c..ea43eff12fc 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -62,7 +62,7 @@ class box_activity extends ModeleBoxes // FIXME: Pb into some status $this->enabled = ($conf->global->MAIN_FEATURES_LEVEL); // Not enabled by default due to bugs (see previous comments) - $this->hidden = !((!empty($conf->facture->enabled) && $user->rights->facture->lire) + $this->hidden = !((isModEnabled('facture') && $user->rights->facture->lire) || (!empty($conf->commande->enabled) && $user->rights->commande->lire) || (!empty($conf->propal->enabled) && $user->rights->propale->lire) ); @@ -278,7 +278,7 @@ class box_activity extends ModeleBoxes // list the summary of the bills - if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { + if (isModEnabled('facture') && $user->rights->facture->lire) { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $facturestatic = new Facture($this->db); diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php index ae939afe25c..b5656c36292 100644 --- a/htdocs/core/boxes/box_commandes.php +++ b/htdocs/core/boxes/box_commandes.php @@ -139,6 +139,8 @@ class box_commandes extends ModeleBoxes $commandestatic->total_ht = $objp->total_ht; $commandestatic->total_tva = $objp->total_tva; $commandestatic->total_ttc = $objp->total_ttc; + $commandestatic->date = $date; + $commandestatic->date_modification = $datem; $societestatic->id = $objp->socid; $societestatic->name = $objp->name; @@ -179,8 +181,8 @@ class box_commandes extends ModeleBoxes } $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', - 'text' => dol_print_date($date, 'day', 'tzuserrel'), + 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"', + 'text' => dol_print_date($datem, 'day', 'tzuserrel'), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php index 22fafb4633c..0f1fe97dfee 100644 --- a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php +++ b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php @@ -155,9 +155,9 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes } if ($num == 0 || $nboutstandingbillreachedcustomers == 0) { - $this->info_box_contents[$line][0] = array( - 'td' => 'class="center"', - 'text'=> ''.$langs->trans("None").'' + $this->info_box_contents[0][] = array( + 'td' => 'class="center"', + 'text'=> ''.$langs->trans("None").'' ); } diff --git a/htdocs/core/boxes/box_dolibarr_state_board.php b/htdocs/core/boxes/box_dolibarr_state_board.php index 24be4100dab..b25a42228e7 100644 --- a/htdocs/core/boxes/box_dolibarr_state_board.php +++ b/htdocs/core/boxes/box_dolibarr_state_board.php @@ -126,14 +126,14 @@ class box_dolibarr_state_board extends ModeleBoxes 'services' => !empty($conf->service->enabled) && $user->rights->service->lire, 'proposals' => !empty($conf->propal->enabled) && $user->rights->propale->lire, 'orders' => !empty($conf->commande->enabled) && $user->rights->commande->lire, - 'invoices' => !empty($conf->facture->enabled) && $user->rights->facture->lire, + 'invoices' => isModEnabled('facture') && $user->rights->facture->lire, 'donations' => !empty($conf->don->enabled) && $user->rights->don->lire, 'contracts' => !empty($conf->contrat->enabled) && $user->rights->contrat->lire, 'interventions' => !empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire, 'supplier_orders' => !empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS), 'supplier_invoices' => !empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS), 'supplier_proposals' => !empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS), - 'projects' => !empty($conf->projet->enabled) && $user->rights->projet->lire, + 'projects' => !empty($conf->project->enabled) && $user->rights->projet->lire, 'expensereports' => !empty($conf->expensereport->enabled) && $user->rights->expensereport->lire, 'holidays' => !empty($conf->holiday->enabled) && $user->rights->holiday->read, 'ticket' => !empty($conf->ticket->enabled) && $user->rights->ticket->read, diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index e1d2860b212..43087949e47 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -92,7 +92,7 @@ class box_factures extends ModeleBoxes $sql .= ", f.ref, f.type, f.total_ht"; $sql .= ", f.total_tva"; $sql .= ", f.total_ttc"; - $sql .= ", f.datef as df"; + $sql .= ", f.datef as date"; $sql .= ", f.paye, f.fk_statut as status, f.datec, f.tms"; $sql .= ", f.date_lim_reglement as datelimite"; $sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; @@ -130,7 +130,7 @@ class box_factures extends ModeleBoxes while ($line < $num) { $objp = $this->db->fetch_object($result); $datelimite = $this->db->jdate($objp->datelimite); - $date = $this->db->jdate($objp->df); + $date = $this->db->jdate($objp->date); $datem = $this->db->jdate($objp->tms); $facturestatic->id = $objp->facid; @@ -141,6 +141,7 @@ class box_factures extends ModeleBoxes $facturestatic->total_ttc = $objp->total_ttc; $facturestatic->statut = $objp->status; $facturestatic->status = $objp->status; + $facturestatic->date = $this->db->jdate($objp->date); $facturestatic->date_lim_reglement = $this->db->jdate($objp->datelimite); $facturestatic->alreadypaid = $objp->paye; @@ -185,8 +186,8 @@ class box_factures extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', - 'text' => dol_print_date($date, 'day', 'tzuserrel'), + 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"', + 'text' => dol_print_date($datem, 'day', 'tzuserrel'), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index 42a945b9289..5fc3bdafa38 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -95,7 +95,7 @@ class box_factures_fourn extends ModeleBoxes $sql .= ", f.total_tva"; $sql .= ", f.total_ttc"; $sql .= ", f.paye, f.fk_statut as status"; - $sql .= ', f.datef as df'; + $sql .= ', f.datef as date'; $sql .= ', f.datec as datec'; $sql .= ', f.date_lim_reglement as datelimite, f.tms, f.type'; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; @@ -129,7 +129,7 @@ class box_factures_fourn extends ModeleBoxes $objp = $this->db->fetch_object($result); $datelimite = $this->db->jdate($objp->datelimite); - $date = $this->db->jdate($objp->df); + $date = $this->db->jdate($objp->date); $datem = $this->db->jdate($objp->tms); $facturestatic->id = $objp->facid; @@ -137,6 +137,7 @@ class box_factures_fourn extends ModeleBoxes $facturestatic->total_ht = $objp->total_ht; $facturestatic->total_tva = $objp->total_tva; $facturestatic->total_ttc = $objp->total_ttc; + $facturestatic->date = $date; $facturestatic->date_echeance = $datelimite; $facturestatic->statut = $objp->status; $facturestatic->status = $objp->status; @@ -188,8 +189,8 @@ class box_factures_fourn extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', - 'text' => dol_print_date($date, 'day', 'tzuserrel'), + 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"', + 'text' => dol_print_date($datem, 'day', 'tzuserrel'), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index a421706e855..d8c9321411d 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -132,6 +132,7 @@ class box_factures_fourn_imp extends ModeleBoxes $facturestatic->total_tva = $objp->total_tva; $facturestatic->total_ttc = $objp->total_ttc; $facturestatic->date_echeance = $datelimite; + $facturestatic->date = $date; $facturestatic->statut = $objp->status; $facturestatic->status = $objp->status; @@ -175,7 +176,7 @@ class box_factures_fourn_imp extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', + 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateDue").': '.dol_print_date($datelimite, 'day', 'tzuserrel')).'"', 'text' => dol_print_date($datelimite, 'day', 'tzuserrel'), ); diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index 9a8e764f208..6d6893f8ae2 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -98,7 +98,7 @@ class box_factures_imp extends ModeleBoxes $sql .= ", s.tva_intra, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6"; $sql .= ", f.ref, f.date_lim_reglement as datelimite"; $sql .= ", f.type"; - $sql .= ", f.datef as df"; + $sql .= ", f.datef as date"; $sql .= ", f.total_ht"; $sql .= ", f.total_tva"; $sql .= ", f.total_ttc"; @@ -156,6 +156,7 @@ class box_factures_imp extends ModeleBoxes $facturestatic->total_ttc = $objp->total_ttc; $facturestatic->statut = $objp->status; $facturestatic->status = $objp->status; + $facturestatic->date = $this->db->jdate($objp->date); $facturestatic->date_lim_reglement = $this->db->jdate($objp->datelimite); $facturestatic->alreadypaid = $objp->paye; @@ -200,7 +201,7 @@ class box_factures_imp extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', + 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateDue").': '.dol_print_date($datelimite, 'day', 'tzuserrel')).'"', 'text' => dol_print_date($datelimite, 'day', 'tzuserrel'), ); diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index e0bdaf709ce..b0f0e691471 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -115,6 +115,7 @@ class box_ficheinter extends ModeleBoxes while ($i < $num) { $objp = $this->db->fetch_object($resql); $datec = $this->db->jdate($objp->datec); + $datem = $this->db->jdate($objp->datem); $ficheinterstatic->statut = $objp->status; $ficheinterstatic->status = $objp->status; @@ -144,8 +145,8 @@ class box_ficheinter extends ModeleBoxes ); $this->info_box_contents[$i][] = array( - 'td' => 'class="right"', - 'text' => dol_print_date($datec, 'day', 'tzuserrel'), + 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"', + 'text' => dol_print_date($datem, 'day', 'tzuserrel'), ); $this->info_box_contents[$i][] = array( diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index 3cb1f570a30..2dceee98dda 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -134,7 +134,7 @@ class box_fournisseurs extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="center nowraponall"', + 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"', 'text' => dol_print_date($datem, "day", 'tzuserrel'), ); diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index adcc750a6a8..afed778912f 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -60,7 +60,7 @@ class box_graph_product_distribution extends ModeleBoxes $this->db = $db; $this->hidden = !( - (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) + (isModEnabled('facture') && !empty($user->rights->facture->lire)) || (!empty($conf->commande->enabled) && !empty($user->rights->commande->lire)) || (!empty($conf->propal->enabled) && !empty($user->rights->propale->lire)) ); @@ -107,7 +107,7 @@ class box_graph_product_distribution extends ModeleBoxes $showinvoicenb = 1; $showordernb = 1; } - if (empty($conf->facture->enabled) || empty($user->rights->facture->lire)) { + if (!isModEnabled('facture') || empty($user->rights->facture->lire)) { $showinvoicenb = 0; } if (empty($conf->propal->enabled) || empty($user->rights->propale->lire)) { @@ -278,7 +278,7 @@ class box_graph_product_distribution extends ModeleBoxes } - if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) { + if (isModEnabled('facture') && !empty($user->rights->facture->lire)) { // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) if ($showinvoicenb) { $langs->load("bills"); @@ -372,7 +372,7 @@ class box_graph_product_distribution extends ModeleBoxes if (!empty($conf->commande->enabled) || !empty($user->rights->commande->lire)) { $stringtoshow .= ' '.$langs->trans("ForCustomersOrders"); } - if (!empty($conf->facture->enabled) || !empty($user->rights->facture->lire)) { + if (isModEnabled('facture') || !empty($user->rights->facture->lire)) { $stringtoshow .= ' '.$langs->trans("ForCustomersInvoices"); $stringtoshow .= '   '; } diff --git a/htdocs/core/boxes/box_last_modified_ticket.php b/htdocs/core/boxes/box_last_modified_ticket.php index fd8ecd95eaf..311f76e5011 100644 --- a/htdocs/core/boxes/box_last_modified_ticket.php +++ b/htdocs/core/boxes/box_last_modified_ticket.php @@ -85,7 +85,7 @@ class box_last_modified_ticket extends ModeleBoxes ); if ($user->rights->ticket->read) { - $sql = "SELECT t.rowid as id, t.ref, t.track_id, t.fk_soc, t.fk_user_create, t.fk_user_assign, t.subject, t.message, t.fk_statut, t.type_code, t.category_code, t.severity_code, t.datec, t.date_read, t.date_close, t.origin_email "; + $sql = "SELECT t.rowid as id, t.ref, t.track_id, t.fk_soc, t.fk_user_create, t.fk_user_assign, t.subject, t.message, t.fk_statut, t.type_code, t.category_code, t.severity_code, t.datec, t.tms as datem, t.date_read, t.date_close, t.origin_email "; $sql .= ", type.label as type_label, category.label as category_label, severity.label as severity_label"; $sql .= ", s.nom as company_name, s.email as socemail, s.client, s.fournisseur"; $sql .= " FROM ".MAIN_DB_PREFIX."ticket as t"; @@ -113,6 +113,7 @@ class box_last_modified_ticket extends ModeleBoxes while ($i < $num) { $objp = $this->db->fetch_object($resql); $datec = $this->db->jdate($objp->datec); + $datem = $this->db->jdate($objp->datem); $ticket = new Ticket($this->db); $ticket->id = $objp->id; @@ -120,6 +121,10 @@ class box_last_modified_ticket extends ModeleBoxes $ticket->ref = $objp->ref; $ticket->fk_statut = $objp->fk_statut; $ticket->subject = $objp->subject; + $ticket->date_creation = $datec; + $ticket->date_modification = $datem; + $ticket->fk_statut = $objp->fk_statut; + $ticket->fk_statut = $objp->fk_statut; if ($objp->fk_soc > 0) { $thirdparty = new Societe($this->db); $thirdparty->id = $objp->fk_soc; @@ -161,8 +166,8 @@ class box_last_modified_ticket extends ModeleBoxes // Date creation $this->info_box_contents[$i][$r] = array( - 'td' => 'class="right"', - 'text' => dol_print_date($datec, 'dayhour', 'tzuserrel') + 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"', + 'text' => dol_print_date($datem, 'dayhour', 'tzuserrel') ); $r++; diff --git a/htdocs/core/boxes/box_last_ticket.php b/htdocs/core/boxes/box_last_ticket.php index 41ac39c1239..f73566fe972 100644 --- a/htdocs/core/boxes/box_last_ticket.php +++ b/htdocs/core/boxes/box_last_ticket.php @@ -166,7 +166,7 @@ class box_last_ticket extends ModeleBoxes // Date creation $this->info_box_contents[$i][$r] = array( - 'td' => 'class="right"', + 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateCreation").': '.dol_print_date($datec, 'dayhour', 'tzuserrel')).'"', 'text' => dol_print_date($datec, 'dayhour', 'tzuserrel'), ); $r++; diff --git a/htdocs/core/boxes/box_members_last_modified.php b/htdocs/core/boxes/box_members_last_modified.php index 6b4a033f1a2..91ce3c93c36 100644 --- a/htdocs/core/boxes/box_members_last_modified.php +++ b/htdocs/core/boxes/box_members_last_modified.php @@ -109,7 +109,7 @@ class box_members_last_modified extends ModeleBoxes while ($line < $num) { $objp = $this->db->fetch_object($result); $datec = $this->db->jdate($objp->datec); - $datem = $this->db->jdate($objp->tms); + $datem = $this->db->jdate($objp->datem); $memberstatic->lastname = $objp->lastname; $memberstatic->firstname = $objp->firstname; diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index 8ea14ebc8d5..afd0db27990 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -148,6 +148,7 @@ class box_produits extends ModeleBoxes $productstatic->accountancy_code_buy = $objp->accountancy_code_buy; $productstatic->accountancy_code_buy_intra = $objp->accountancy_code_buy_intra; $productstatic->accountancy_code_buy_export = $objp->accountancy_code_buy_export; + $productstatic->date_modification = $datem; $this->info_box_contents[$line][] = array( 'td' => 'class="tdoverflowmax100 maxwidth100onsmartphone"', @@ -190,7 +191,7 @@ class box_produits extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="center nowraponall"', + 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"', 'text' => dol_print_date($datem, 'day', 'tzuserrel'), ); diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 63a4e90cdd0..909ff32acb9 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -84,6 +84,7 @@ class box_project extends ModeleBoxes $textHead = $langs->trans("OpenedProjects"); $this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead)); + $i = 0; // list the summary of the orders if ($user->rights->projet->lire) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; @@ -113,7 +114,6 @@ class box_project extends ModeleBoxes if ($result) { $num = $this->db->num_rows($result); - $i = 0; while ($i < min($num, $max)) { $objp = $this->db->fetch_object($result); diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index 97b7bd5fd51..cdaf629ae3f 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -130,6 +130,7 @@ class box_propales extends ModeleBoxes $propalstatic->total_ttc = $objp->total_ttc; $propalstatic->statut = $objp->status; $propalstatic->status = $objp->status; + $propalstatic->date = $date; $societestatic->id = $objp->socid; $societestatic->name = $objp->name; @@ -165,8 +166,8 @@ class box_propales extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("Date").': '.dol_print_date($datem, 'day', 'tzuserrel')).'"', - 'text' => dol_print_date($date, 'day', 'tzuserrel'), + 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"', + 'text' => dol_print_date($datem, 'day', 'tzuserrel'), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index 3bf69f91fe0..e9824339f1e 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -141,7 +141,7 @@ class box_prospect extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="center nowraponall"', + 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"', 'text' => dol_print_date($datem, "day", 'tzuserrel'), ); diff --git a/htdocs/core/boxes/box_scheduled_jobs.php b/htdocs/core/boxes/box_scheduled_jobs.php index f2195659654..cd610543e47 100644 --- a/htdocs/core/boxes/box_scheduled_jobs.php +++ b/htdocs/core/boxes/box_scheduled_jobs.php @@ -63,7 +63,7 @@ class box_scheduled_jobs extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->service->lire && $user->rights->contrat->lire); + $this->hidden = !($user->hasRight('service', 'lire') && $user->hasRight('contrat', 'lire')); } /** diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index c72a378a1a2..9a212d0a10e 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -200,7 +200,7 @@ class box_services_contracts extends ModeleBoxes ); $this->info_box_contents[$i][] = array( - 'td' => 'class="center nowraponall"', + 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"', 'text' => dol_print_date($datem, 'day', 'tzuserrel'), 'text2'=> $late, ); diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php index 4353fb7eb02..e9cca792de1 100644 --- a/htdocs/core/boxes/box_services_expired.php +++ b/htdocs/core/boxes/box_services_expired.php @@ -151,7 +151,7 @@ class box_services_expired extends ModeleBoxes ); $this->info_box_contents[$i][] = array( - 'td' => 'class="center nowraponall"', + 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateEndPlanned").': '.dol_print_date($dateline, 'dayhour', 'tzuserrel')).'"', 'text' => dol_print_date($dateline, 'day', 'tzuserrel'), 'text2'=> $late, ); diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php index 89fd7850c5c..6ee0c5ef8a3 100644 --- a/htdocs/core/boxes/box_supplier_orders.php +++ b/htdocs/core/boxes/box_supplier_orders.php @@ -123,6 +123,9 @@ class box_supplier_orders extends ModeleBoxes $supplierorderstatic->id = $objp->rowid; $supplierorderstatic->ref = $objp->ref; $supplierorderstatic->statut = $objp->status; + $supplierorderstatic->status = $objp->status; + $supplierorderstatic->date = $date; + $supplierorderstatic->date_modification = $datem; $thirdpartystatic->id = $objp->socid; $thirdpartystatic->name = $objp->name; @@ -152,8 +155,8 @@ class box_supplier_orders extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', - 'text' => dol_print_date($date, 'day', 'tzuserrel'), + 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"', + 'text' => dol_print_date($datem, 'day', 'tzuserrel'), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php index 403c6c9fc6d..32151828b83 100644 --- a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php +++ b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php @@ -172,7 +172,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes if ($num == 0) { $this->info_box_contents[$line][] = array( 'td' => 'class="center"', - 'text' => $langs->trans("NoSupplierOrder"), + 'text' => ''.$langs->trans("NoSupplierOrder").'', ); } @@ -187,7 +187,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes } else { $this->info_box_contents[0][] = array( 'td' => 'class="nohover opacitymedium left"', - 'text' => $langs->trans("ReadPermissionNotAllowed") + 'text' => ''.$langs->trans("ReadPermissionNotAllowed").'' ); } } diff --git a/htdocs/core/class/canvas.class.php b/htdocs/core/class/canvas.class.php index a4414fa6edb..67443a7bdb8 100644 --- a/htdocs/core/class/canvas.class.php +++ b/htdocs/core/class/canvas.class.php @@ -151,7 +151,7 @@ class Canvas public function assign_values(&$action = 'view', $id = 0, $ref = '') { // phpcs:enable - if (method_exists($this->control, 'assign_values')) { + if (is_object($this->control) && method_exists($this->control, 'assign_values')) { $this->control->assign_values($action, $id, $ref); } } diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 155b2ca5819..e96eee5c553 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -168,17 +168,18 @@ abstract class CommonInvoice extends CommonObject /** * Return amount (with tax) of all deposits invoices used by invoice. - * Should always be empty, except if option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS is on (not recommended). + * Should always be empty, except if option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS is on for sale invoices (not recommended), + * of FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS is on for purchase invoices (not recommended). * * @param int $multicurrency Return multicurrency_amount instead of amount * @return float <0 and set ->error if KO, Sum of deposits amount otherwise */ public function getSumDepositsUsed($multicurrency = 0) { - if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') { + /*if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') { // FACTURE_DEPOSITS_ARE_JUST_PAYMENTS was never supported for purchase invoice, so we can return 0 with no need of SQL for this case. return 0.0; - } + }*/ require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; @@ -899,6 +900,101 @@ abstract class CommonInvoice extends CommonObject return $s; } + + + /** + * Build string for QR-Bill (Switzerland) + * + * @return string String for Switzerland QR Code if QR-Bill + */ + public function buildSwitzerlandQRString() + { + global $conf, $mysoc; + + $tmplang = new Translate('', $conf); + $tmplang->setDefaultLang('en_US'); + $tmplang->load("main"); + + $pricewithtaxstring = price2num($this->total_ttc, 2, 1); + $pricetaxstring = price2num($this->total_tva, 2, 1); + + $complementaryinfo = ''; + /* + Example: //S1/10/10201409/11/190512/20/1400.000-53/30/106017086/31/180508/32/7.7/40/2:10;0:30 + /10/ Numéro de facture – 10201409 + /11/ Date de facture – 12.05.2019 + /20/ Référence client – 1400.000-53 + /30/ Numéro IDE pour la TVA – CHE-106.017.086 TVA + /31/ Date de la prestation pour la comptabilisation de la TVA – 08.05.2018 + /32/ Taux de TVA sur le montant total de la facture – 7.7% + /40/ Conditions – 2% d’escompte à 10 jours, paiement net à 30 jours + */ + $datestring = dol_print_date($this->date, '%y%m%d'); + //$pricewithtaxstring = price($this->total_ttc, 0, $tmplang, 0, -1, 2); + //$pricetaxstring = price($this->total_tva, 0, $tmplang, 0, -1, 2); + $complementaryinfo = '//S1/10/'.str_replace('/', '', $this->ref).'/11/'.$datestring; + if ($this->ref_client) { + $complementaryinfo .= '/20/'.$this->ref_client; + } + if ($this->thirdparty->vat_number) { + $complementaryinfo .= '/30/'.$this->thirdparty->vat_number; + } + + // Header + $s .= "SPC\n"; + $s .= "0200\n"; + $s .= "1\n"; + if ($this->fk_account > 0) { + // Bank BAN if country is LI or CH + // TODO Add + $bankaccount = new Account($this->db); + $bankaccount->fetch($this->fk_account); + $s .= $bankaccount->iban."\n"; + } else { + $s .= "\n"; + } + // Seller + $s .= "S\n"; + $s .= dol_trunc($mysoc->name, 70, 'right', 'UTF-8', 1)."\n"; + $addresslinearray = explode("\n", $mysoc->address); + $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1 + $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2 + $s .= dol_trunc($mysoc->zip, 16, 'right', 'UTF-8', 1)."\n"; + $s .= dol_trunc($mysoc->town, 35, 'right', 'UTF-8', 1)."\n"; + $s .= dol_trunc($mysoc->country_code, 2, 'right', 'UTF-8', 1)."\n"; + // Final seller + $s .= "\n"; + $s .= "\n"; + $s .= "\n"; + $s .= "\n"; + $s .= "\n"; + $s .= "\n"; + $s .= "\n"; + // Amount of payment (to do?) + $s .= price($pricewithtaxstring, 0, 'none', 0, 0, 2)."\n"; + $s .= ($this->multicurrency_code ? $this->multicurrency_code : $conf->currency)."\n"; + // Buyer + $s .= "S\n"; + $s .= dol_trunc($this->thirdparty->name, 70, 'right', 'UTF-8', 1)."\n"; + $addresslinearray = explode("\n", $this->thirdparty->address); + $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1 + $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2 + $s .= dol_trunc($this->thirdparty->zip, 16, 'right', 'UTF-8', 1)."\n"; + $s .= dol_trunc($this->thirdparty->town, 35, 'right', 'UTF-8', 1)."\n"; + $s .= dol_trunc($this->thirdparty->country_code, 2, 'right', 'UTF-8', 1)."\n"; + // ID of payment + $s .= "NON\n"; // NON or QRR + $s .= "\n"; // QR Code if previous field is QRR + if ($complementaryinfo) { + $s .= $complementaryinfo."\n"; + } else { + $s .= "\n"; + } + $s .= "EPD\n"; + $s .= "\n"; + //var_dump($s);exit; + return $s; + } } @@ -1084,4 +1180,6 @@ abstract class CommonInvoiceLine extends CommonObjectLine public $fk_user_author; public $fk_user_modif; + + public $fk_accounting_account; } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b39facd16a4..42442f47fd0 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -169,13 +169,13 @@ abstract class CommonObject public $canvas; /** - * @var Project The related project + * @var Project The related project object * @see fetch_projet() */ public $project; /** - * @var int The related project ID + * @var int The related project ID * @see setProject(), project */ public $fk_project; @@ -187,19 +187,25 @@ abstract class CommonObject public $projet; /** - * @var Contact a related contact + * @deprecated + * @see $fk_project + */ + public $fk_projet; + + /** + * @var Contact A related contact object * @see fetch_contact() */ public $contact; /** - * @var int The related contact ID + * @var int The related contact ID * @see fetch_contact() */ public $contact_id; /** - * @var Societe A related thirdparty + * @var Societe A related thirdparty object * @see fetch_thirdparty() */ public $thirdparty; @@ -248,7 +254,7 @@ abstract class CommonObject public $newref; /** - * @var int The object's status + * @var int The object's status. Prefer use of status. * @see setStatut() */ public $statut; @@ -259,6 +265,7 @@ abstract class CommonObject */ public $status; + /** * @var string * @see getFullAddress() @@ -272,7 +279,7 @@ abstract class CommonObject public $country_id; /** - * @var string + * @var string The ISO country code on 2 chars. * @see getFullAddress(), isInEEC(), country */ public $country_code; @@ -313,6 +320,7 @@ abstract class CommonObject */ public $region; + /** * @var int * @see fetch_barcode() @@ -512,6 +520,47 @@ abstract class CommonObject */ public $date_modification; // Date last change (tms field) + /** + * @var User|int User author/creation + * @TODO Merge with user_creation + */ + public $user_author; + /** + * @var User|int User author/creation + * @TODO Remove type id + */ + public $user_creation; + /** + * @var int User id author/creation + */ + public $user_creation_id; + + /** + * @var User|int User of validation + * @TODO Merge with user_validation + */ + public $user_valid; + /** + * @var User|int User of validation + * @TODO Remove type id + */ + public $user_validation; + /** + * @var int User id of validation + */ + public $user_validation_id; + + /** + * @var User|int User last modifier + * @TODO Remove type id + */ + public $user_modification; + /** + * @var int User id last modifier + */ + public $user_modification_id; + + public $next_prev_filter; /** @@ -529,6 +578,7 @@ abstract class CommonObject */ public $alreadypaid; + /** * @var array List of child tables. To test if we can delete object. */ @@ -1659,13 +1709,13 @@ abstract class CommonObject // phpcs:enable global $conf; - if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty) && empty($force_thirdparty_id)) { + if (empty($this->socid) && empty($this->fk_soc) && empty($force_thirdparty_id)) { return 0; } require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; - $idtofetch = isset($this->socid) ? $this->socid : (isset($this->fk_soc) ? $this->fk_soc : $this->fk_thirdparty); + $idtofetch = isset($this->socid) ? $this->socid : (isset($this->fk_soc) ? $this->fk_soc : 0); if ($force_thirdparty_id) { $idtofetch = $force_thirdparty_id; } @@ -4285,7 +4335,7 @@ abstract class CommonObject if ($elementTable == 'commande_fournisseur_dispatch') { $fieldstatus = "status"; } - if (is_array($this->fields) && array_key_exists('status', $this->fields)) { + if (isset($this->fields) && is_array($this->fields) && array_key_exists('status', $this->fields)) { $fieldstatus = 'status'; } @@ -6148,7 +6198,7 @@ abstract class CommonObject //var_dump($this->oldcopy);exit; if (is_object($this->oldcopy)) { // If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value //var_dump($this->oldcopy->array_options[$key]); var_dump($this->array_options[$key]); - if ($this->array_options[$key] == $this->oldcopy->array_options[$key]) { // If old value crypted in database is same than submited new value, it means we don't change it, so we don't update. + if (isset($this->oldcopy->array_options[$key]) && $this->array_options[$key] == $this->oldcopy->array_options[$key]) { // If old value crypted in database is same than submited new value, it means we don't change it, so we don't update. $new_array_options[$key] = $this->array_options[$key]; // Value is kept } else { // var_dump($algo); @@ -7349,8 +7399,10 @@ abstract class CommonObject } // Format output value differently according to properties of field - if ($key == 'ref' && method_exists($this, 'getNomUrl')) { - $value = $this->getNomUrl(1, '', 0, '', 1); + if (in_array($key, array('rowid', 'ref')) && method_exists($this, 'getNomUrl')) { + if ($key != 'rowid' || empty($this->fields['ref'])) { // If we want ref field or if we want ID and there is no ref field, we show the link. + $value = $this->getNomUrl(1, '', 0, '', 1); + } } elseif ($key == 'status' && method_exists($this, 'getLibStatut')) { $value = $this->getLibStatut(3); } elseif ($type == 'date') { @@ -7556,11 +7608,15 @@ abstract class CommonObject if ($classname && class_exists($classname)) { $object = new $classname($this->db); if ($object->element === 'product') { // Special cas for product because default valut of fetch are wrong - $object->fetch($value, '', '', '', 0, 1, 1); + $result = $object->fetch($value, '', '', '', 0, 1, 1); } else { - $object->fetch($value); + $result = $object->fetch($value); + } + if ($result > 0) { + $value = $object->getNomUrl($getnomurlparam, $getnomurlparam2); + } else { + $value = ''; } - $value = $object->getNomUrl($getnomurlparam, $getnomurlparam2); } } else { dol_syslog('Error bad setup of extrafield', LOG_WARNING); @@ -8392,8 +8448,6 @@ abstract class CommonObject $photo = ''; $file = $val['name']; - //if (! utf8_check($file)) $file=utf8_encode($file); // To be sure file is stored in UTF8 in memory - //if (dol_is_file($dir.$file) && image_format_supported($file) >= 0) if (image_format_supported($file) >= 0) { $nbphoto++; diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index c376c6420d8..972ab7e4476 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -79,6 +79,8 @@ abstract class CommonObjectLine extends CommonObject public $product_type; // type in line public $fk_product; // product id in line (when line is linked to a product) + public $desc; + public $product; // To store full product object after a fetch_product() on a line public $product_ref; // ref in product table public $product_label; // label in product table diff --git a/htdocs/core/class/commonorder.class.php b/htdocs/core/class/commonorder.class.php index 410bf41a601..870d4c1d8df 100644 --- a/htdocs/core/class/commonorder.class.php +++ b/htdocs/core/class/commonorder.class.php @@ -72,11 +72,23 @@ abstract class CommonOrderLine extends CommonObjectLine */ public $product_label; + /** + * Boolean that indicates whether the product is available for sale '1' or not '0' + * @var int + */ + public $product_tosell=0; + + /** + * Boolean that indicates whether the product is available for purchase '1' or not '0' + * @var int + */ + public $product_tobuy=0; + /** * Product description * @var string */ - public $product_desc; + public $product_desc; /** * Product use lot diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 602e6b560d0..1345d2116f6 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -51,7 +51,7 @@ class Conf public $use_javascript_ajax; //! To store if javascript/ajax is enabked public $disable_compute; - //! Used to store current currency (ISO code like 'USD', 'EUR', ...) + //! Used to store current currency (ISO code like 'USD', 'EUR', ...). To get the currency symbol: $langs->getCurrencySymbol($this->currency) public $currency; //! Used to store current css (from theme) @@ -746,8 +746,8 @@ class Conf $this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT = 1; // allow html content into free footer text } - // Default max file size for upload - $this->maxfilesize = (empty($this->global->MAIN_UPLOAD_DOC) ? 0 : (int) $this->global->MAIN_UPLOAD_DOC * 1024); + // Default max file size for upload (deprecated) + //$this->maxfilesize = (empty($this->global->MAIN_UPLOAD_DOC) ? 0 : (int) $this->global->MAIN_UPLOAD_DOC * 1024); // By default, we propagate contacts if (!isset($this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) { diff --git a/htdocs/core/class/evalmath.class.php b/htdocs/core/class/evalmath.class.php index ccd495bb623..5c659344465 100644 --- a/htdocs/core/class/evalmath.class.php +++ b/htdocs/core/class/evalmath.class.php @@ -144,6 +144,10 @@ class EvalMath */ public function evaluate($expr) { + if (empty($expr)) { + return false; + } + $this->last_error = null; $this->last_error_code = null; $expr = trim($expr); @@ -366,18 +370,14 @@ class EvalMath } /** - * evaluate postfix notation + * Evaluate postfix notation * - * @param string $tokens Expression + * @param array $tokens Expression * @param array $vars Array * @return string Output */ private function pfx($tokens, $vars = array()) { - if ($tokens == false) { - return false; - } - $stack = new EvalMathStack(); foreach ($tokens as $token) { // nice and easy diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index c7651c81d26..baae549c050 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -60,6 +60,11 @@ class ExtraFields */ public $attribute_choice; + /** + * @var array array to store extrafields definition + * @deprecated + */ + public $attribute_list; /** * @var array New array to store extrafields definition @@ -1268,10 +1273,12 @@ class ExtraFields require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1); $out .= ''; - foreach ($data as $data_key => $data_value) { - $out .= ''."\n"; } + $companytemp = new Societe($this->db); + $num = $this->db->num_rows($resql); $i = 0; if ($num) { while ($i < $num) { $obj = $this->db->fetch_object($resql); $label = ''; - if ($conf->global->SOCIETE_ADD_REF_IN_LIST) { + if ($showcode || !empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) { if (($obj->client) && (!empty($obj->code_client))) { $label = $obj->code_client.' - '; } @@ -1468,7 +1472,17 @@ class Form $label .= ' - '.$obj->tva_intra.''; } + $labelhtml = $label; + if ($showtype) { + $companytemp->id = $obj->rowid; + $companytemp->client = $obj->client; + $companytemp->fournisseur = $obj->fournisseur; + $tmptype = $companytemp->getTypeUrl(1, '', 0, 'span'); + if ($tmptype) { + $labelhtml .= ' '.$tmptype; + } + if ($obj->client || $obj->fournisseur) { $label .= ' ('; } @@ -1487,20 +1501,22 @@ class Form } if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { - $label .= ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : ''); + $s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : ''); if (!empty($obj->country_code)) { - $label .= ', '.$langs->trans('Country'.$obj->country_code); + $s .= ', '.$langs->trans('Country'.$obj->country_code); } + $label .= $s; + $labelhtml .= $s; } if (empty($outputmode)) { if (in_array($obj->rowid, $selected)) { - $out .= ''; + $out .= ''; } else { - $out .= ''; + $out .= ''; } } else { - array_push($outarray, array('key'=>$obj->rowid, 'value'=>$label, 'label'=>$label)); + array_push($outarray, array('key'=>$obj->rowid, 'value'=>$label, 'label'=>$label, 'labelhtml'=>$labelhtml)); } $i++; @@ -4362,6 +4378,7 @@ class Form print ' selected'; } print '>'; + $value = ''; if ($format == 0) { $value = ($maxlength ?dol_trunc($arraytypes['label'], $maxlength) : $arraytypes['label']); } elseif ($format == 1) { @@ -4748,7 +4765,7 @@ class Form print img_picto('', 'bank_account', 'class="pictofixedwidth"'); $nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty); if ($nbaccountfound > 0) { - print ''; + print ''; } print ''; } else { @@ -4783,7 +4800,7 @@ class Form * @param int $outputmode 0=HTML select string, 1=Array * @param int $include [=0] Removed or 1=Keep only * @param string $morecss More CSS - * @return string + * @return string|array * @see select_categories() */ public function select_all_categories($type, $selected = '', $htmlname = "parent", $maxlength = 64, $markafterid = 0, $outputmode = 0, $include = 0, $morecss = '') @@ -4900,9 +4917,11 @@ class Form * @param int|string $height Force height of box (0 = auto) * @param int $width Force width of box ('999' or '90%'). Ignored and forced to 90% on smartphones. * @param int $disableformtag 1=Disable form tag. Can be used if we are already inside a
    section. + * @param string $labelbuttonyes Label for Yes + * @param string $labelbuttonno Label for No * @return string HTML ajax code if a confirm ajax popup is required, Pure HTML code if it's an html form */ - public function formconfirm($page, $title, $question, $action, $formquestion = '', $selectedchoice = '', $useajax = 0, $height = 0, $width = 500, $disableformtag = 0) + public function formconfirm($page, $title, $question, $action, $formquestion = '', $selectedchoice = '', $useajax = 0, $height = 0, $width = 500, $disableformtag = 0, $labelbuttonyes = 'Yes', $labelbuttonno = 'No') { global $langs, $conf; @@ -5011,7 +5030,7 @@ class Form $more .= ' checked="checked"'; } $more .= ' /> '; - $more .= ''; + $more .= ''; $more .= '
    '."\n"; $i++; } @@ -5117,6 +5136,7 @@ class Form $(this).parent().find("button.ui-button:eq(2)").focus(); },'; } + $formconfirm .= ' resizable: false, height: "'.$height.'", @@ -5124,7 +5144,7 @@ class Form modal: true, closeOnEscape: false, buttons: { - "'.dol_escape_js($langs->transnoentities("Yes")).'": function() { + "'.dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() { var options = "&token='.urlencode(newToken()).'"; var inputok = '.json_encode($inputok).'; /* List of fields into form */ var pageyes = "'.dol_escape_js(!empty($pageyes) ? $pageyes : '').'"; @@ -5147,7 +5167,7 @@ class Form if (pageyes.length > 0) { location.href = urljump; } $(this).dialog("close"); }, - "'.dol_escape_js($langs->transnoentities("No")).'": function() { + "'.dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() { var options = "&token='.urlencode(newToken()).'"; var inputko = '.json_encode($inputko).'; /* List of fields into form */ var pageno="'.dol_escape_js(!empty($pageno) ? $pageno : '').'"; @@ -5212,7 +5232,7 @@ class Form $formconfirm .= ''; $formconfirm .= ''.$question.''; $formconfirm .= ''; - $formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly'); + $formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno); $formconfirm .= ''; $formconfirm .= ''; $formconfirm .= ''."\n"; @@ -5844,12 +5864,13 @@ class Form /** * Retourne la liste des devises, dans la langue de l'utilisateur * - * @param string $selected preselected currency code - * @param string $htmlname name of HTML select list - * @param string $mode 0 = Add currency symbol into label, 1 = Add 3 letter iso code + * @param string $selected preselected currency code + * @param string $htmlname name of HTML select list + * @param string $mode 0 = Add currency symbol into label, 1 = Add 3 letter iso code + * @param string $useempty '1'=Allow empty value * @return string */ - public function selectCurrency($selected = '', $htmlname = 'currency_id', $mode = 0) + public function selectCurrency($selected = '', $htmlname = 'currency_id', $mode = 0, $useempty = '') { global $conf, $langs, $user; @@ -5862,6 +5883,9 @@ class Form } $out .= ''."\n"; @@ -8863,12 +8890,12 @@ class Form $resultyesno .= ''."\n"; } if (("$value" == 'yes') || ($value == 1)) { - $resultyesno .= ''."\n"; - $resultyesno .= ''."\n"; + $resultyesno .= ''."\n"; + $resultyesno .= ''."\n"; } else { $selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected'); - $resultyesno .= ''."\n"; - $resultyesno .= ''."\n"; + $resultyesno .= ''."\n"; + $resultyesno .= ''."\n"; } $resultyesno .= ''."\n"; @@ -9360,7 +9387,14 @@ class Form if ($object->photo) { $ret .= '

    '; } - $ret .= ''; + $ret .= ''; + $maxfilesizearray = getMaxFileSizeArray(); + $maxmin = $maxfilesizearray['maxmin']; + if ($maxmin > 0) { + $ret .= ''; // MAX_FILE_SIZE must precede the field type=file + } + $ret .= ''; + $ret .= ''; $ret .= ''; } } else { @@ -9374,16 +9408,16 @@ class Form /** * Return select list of groups * - * @param string $selected Id group preselected - * @param string $htmlname Field name in form - * @param int $show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue - * @param string $exclude Array list of groups id to exclude - * @param int $disabled If select list must be disabled - * @param string $include Array list of groups id to include - * @param int $enableonly Array list of groups id to be enabled. All other must be disabled - * @param string $force_entity '0' or Ids of environment to force - * @param bool $multiple add [] in the name of element and add 'multiple' attribut (not working with ajax_autocompleter) - * @param string $morecss More css to add to html component + * @param string $selected Id group preselected + * @param string $htmlname Field name in form + * @param int $show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue + * @param string|array $exclude Array list of groups id to exclude + * @param int $disabled If select list must be disabled + * @param string|array $include Array list of groups id to include + * @param int $enableonly Array list of groups id to be enabled. All other must be disabled + * @param string $force_entity '0' or Ids of environment to force + * @param bool $multiple add [] in the name of element and add 'multiple' attribut (not working with ajax_autocompleter) + * @param string $morecss More css to add to html component * @return string * @see select_dolusers() */ diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 67d12147a3a..10e23f3d2e4 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -283,7 +283,7 @@ class FormAccounting extends Form $out .= ''; //if ($user->admin && $help) $out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); } else { - $out .= $langs->trans("ErrorNoAccountingCategoryForThisCountry", $mysoc->country_code); + $out = $langs->trans("ErrorNoAccountingCategoryForThisCountry", $mysoc->country_code); } } else { dol_print_error($this->db); @@ -505,6 +505,7 @@ class FormAccounting extends Form } // Build select + $out = ''; $out .= Form::selectarray($htmlname, $aux_account, $selectid, ($showempty ? (is_numeric($showempty) ? 1 : $showempty): 0), 0, 0, '', 0, 0, 0, '', $morecss, 1); //automatic filling if we give the name of the subledger_label input if (!empty($conf->use_javascript_ajax) && !empty($labelhtmlname)) { diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 1bc009491d1..242c1476736 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -226,7 +226,7 @@ class FormActions } $newcardbutton = ''; - if (!empty($conf->agenda->enabled) && !empty($user->rights->agenda->myactions->create)) { + if (isModEnabled('agenda') && !empty($user->rights->agenda->myactions->create)) { $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&token='.newToken().'&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog', 'tzuser')).'&origin='.urlencode($typeelement).'&originid='.((int) $object->id).((!empty($object->socid) && $object->socid > 0) ? '&socid='.((int) $object->socid) : ((!empty($socid) && $socid > 0) ? '&socid='.((int) $socid) : '')).($projectid > 0 ? '&projectid='.((int) $projectid) : '').($taskid > 0 ? '&taskid='.((int) $taskid) : '').'&backtopage='.urlencode($urlbacktopage); $newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', $url); } diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index f3798181bcd..6267c6ff390 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -188,7 +188,7 @@ class FormContract print ''; print ''; $this->select_contract($socid, $selected, $htmlname, $maxlength, $showempty, $showRef); - print ''; + print ''; print ''; } } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 97f5eca5822..9ba4ccc7f19 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -148,64 +148,15 @@ class FormFile $out .= ''; - $max = $conf->global->MAIN_UPLOAD_DOC; // In Kb - $maxphp = @ini_get('upload_max_filesize'); // In unknown - if (preg_match('/k$/i', $maxphp)) { - $maxphp = preg_replace('/k$/i', '', $maxphp); - $maxphp = $maxphp * 1; - } - if (preg_match('/m$/i', $maxphp)) { - $maxphp = preg_replace('/m$/i', '', $maxphp); - $maxphp = $maxphp * 1024; - } - if (preg_match('/g$/i', $maxphp)) { - $maxphp = preg_replace('/g$/i', '', $maxphp); - $maxphp = $maxphp * 1024 * 1024; - } - if (preg_match('/t$/i', $maxphp)) { - $maxphp = preg_replace('/t$/i', '', $maxphp); - $maxphp = $maxphp * 1024 * 1024 * 1024; - } - $maxphp2 = @ini_get('post_max_size'); // In unknown - if (preg_match('/k$/i', $maxphp2)) { - $maxphp2 = preg_replace('/k$/i', '', $maxphp2); - $maxphp2 = $maxphp2 * 1; - } - if (preg_match('/m$/i', $maxphp2)) { - $maxphp2 = preg_replace('/m$/i', '', $maxphp2); - $maxphp2 = $maxphp2 * 1024; - } - if (preg_match('/g$/i', $maxphp2)) { - $maxphp2 = preg_replace('/g$/i', '', $maxphp2); - $maxphp2 = $maxphp2 * 1024 * 1024; - } - if (preg_match('/t$/i', $maxphp2)) { - $maxphp2 = preg_replace('/t$/i', '', $maxphp2); - $maxphp2 = $maxphp2 * 1024 * 1024 * 1024; - } - // Now $max and $maxphp and $maxphp2 are in Kb - $maxmin = $max; - $maxphptoshow = $maxphptoshowparam = ''; - if ($maxphp > 0) { - $maxmin = min($max, $maxphp); - $maxphptoshow = $maxphp; - $maxphptoshowparam = 'upload_max_filesize'; - } - if ($maxphp2 > 0) { - $maxmin = min($max, $maxphp2); - if ($maxphp2 < $maxphp) { - $maxphptoshow = $maxphp2; - $maxphptoshowparam = 'post_max_size'; - } - } - + $maxfilesizearray = getMaxFileSizeArray(); + $max = $maxfilesizearray['max']; + $maxmin = $maxfilesizearray['maxmin']; + $maxphptoshow = $maxfilesizearray['maxphptoshow']; + $maxphptoshowparam = $maxfilesizearray['maxphptoshowparam']; if ($maxmin > 0) { - // MAX_FILE_SIZE doit précéder le champ input de type file - $out .= ''; + $out .= ''; // MAX_FILE_SIZE must precede the field type=file } - $out .= 'global->MAIN_DISABLE_MULTIPLE_FILEUPLOAD) || $conf->browser->layout != 'classic') ? ' name="userfile"' : ' name="userfile[]" multiple'); $out .= ((!empty($conf->global->MAIN_DISABLE_MULTIPLE_FILEUPLOAD) || $disablemulti) ? ' name="userfile"' : ' name="userfile[]" multiple'); $out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm) ? ' disabled' : ''); $out .= (!empty($accept) ? ' accept="'.$accept.'"' : ' accept=""'); diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index ad6a6c12508..f2697bc3873 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -116,6 +116,7 @@ class FormMail extends Form * @var int|string|array */ public $withto; // Show recipient emails + public $withreplyto; /** * @var int|string 0 = Do not Show free text for recipient emails @@ -395,7 +396,7 @@ class FormMail extends Form // Define output language $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { + if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { $newlang = $this->param['langsmodels']; } if (!empty($newlang)) { @@ -584,7 +585,10 @@ class FormMail extends Form } // Add also company main email - $liste['company'] = $conf->global->MAIN_INFO_SOCIETE_NOM.' <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>'; + if (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL)) { + $liste['company'] = !empty($conf->global->MAIN_INFO_SOCIETE_NOM)?$conf->global->MAIN_INFO_SOCIETE_NOM:$conf->global->MAIN_INFO_SOCIETE_MAIL; + $liste['company'].=' <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>'; + } // Add also email aliases if there is some $listaliases = array( @@ -825,6 +829,11 @@ class FormMail extends Form $out .= ''.$langs->trans("NoAttachedFiles").'
    '; } if ($this->withfile == 2) { + $maxfilesizearray = getMaxFileSizeArray(); + $maxmin = $maxfilesizearray['maxmin']; + if ($maxmin > 0) { + $out .= ''; // MAX_FILE_SIZE must precede the field type=file + } // Can add other files if (!empty($conf->global->FROM_MAIL_USE_INPUT_FILE_MULTIPLE)) { $out .= ''; @@ -1540,7 +1549,7 @@ class FormMail extends Form $extrafields->fetch_name_optionals_label($product->table_element, true); - if (is_array($extrafields->attributes[$product->table_element]['label']) && count($extrafields->attributes[$product->table_element]['label']) > 0) { + if (!empty($extrafields->attributes[$product->table_element]['label']) && is_array($extrafields->attributes[$product->table_element]['label']) && count($extrafields->attributes[$product->table_element]['label']) > 0) { foreach ($extrafields->attributes[$product->table_element]['label'] as $key => $label) { $substit_line['__PRODUCT_EXTRAFIELD_'.strtoupper($key).'__'] = $product->array_options['options_'.$key]; } @@ -1618,7 +1627,7 @@ class FormMail extends Form if (!empty($conf->don->enabled)) { $tmparray['__SECUREKEYPAYMENT_DONATION__'] = 'SecureKeyPAYMENTUniquePerDonation'; } - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { $tmparray['__SECUREKEYPAYMENT_INVOICE__'] = 'SecureKeyPAYMENTUniquePerInvoice'; } if (!empty($conf->commande->enabled)) { @@ -1635,7 +1644,7 @@ class FormMail extends Form if (!empty($conf->don->enabled)) { $tmparray['__ONLINEPAYMENTLINK_DONATION__'] = 'OnlinePaymentLinkUniquePerDonation'; } - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { $tmparray['__ONLINEPAYMENTLINK_INVOICE__'] = 'OnlinePaymentLinkUniquePerInvoice'; } if (!empty($conf->commande->enabled)) { @@ -1672,6 +1681,8 @@ class FormMail extends Form /** * ModelMail + * + * Object of table llx_c_email_templates */ class ModelMail { @@ -1685,6 +1696,16 @@ class ModelMail */ public $label; + /** + * @var int Owner of email template + */ + public $fk_user; + + /** + * @var int Is template private + */ + public $private; + /** * @var string Model mail topic */ @@ -1702,4 +1723,9 @@ class ModelMail * @var string Module the template is dedicated for */ public $module; + + /** + * @var int Position of template in a combo list + */ + public $position; } diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 4e0d3da467e..5bee2f31dd4 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -700,11 +700,14 @@ class FormOther print ' selected'; } - $labeltoshow = $langs->trans("Project").' '.$lines[$i]->projectref; + $labeltoshow = $lines[$i]->projectref; + //$labeltoshow .= ' '.$lines[$i]->projectlabel; if (empty($lines[$i]->public)) { - $labeltoshow .= ' ('.$langs->trans("Visibility").': '.$langs->trans("PrivateProject").')'; + //$labeltoshow .= ' ('.$langs->trans("Visibility").': '.$langs->trans("PrivateProject").')'; + $labeltoshow = img_picto($lines[$i]->projectlabel, 'project', 'class="pictofixedwidth"').$labeltoshow; } else { - $labeltoshow .= ' ('.$langs->trans("Visibility").': '.$langs->trans("SharedProject").')'; + //$labeltoshow .= ' ('.$langs->trans("Visibility").': '.$langs->trans("SharedProject").')'; + $labeltoshow = img_picto($lines[$i]->projectlabel, 'projectpub', 'class="pictofixedwidth"').$labeltoshow; } print ' data-html="'.dol_escape_htmltag($labeltoshow).'"'; @@ -738,12 +741,14 @@ class FormOther print ' disabled'; } - $labeltoshow = $langs->trans("Project").' '.$lines[$i]->projectref; - $labeltoshow .= ' '.$lines[$i]->projectlabel; + $labeltoshow = $lines[$i]->projectref; + //$labeltoshow .= ' '.$lines[$i]->projectlabel; if (empty($lines[$i]->public)) { - $labeltoshow .= ' ('.$langs->trans("Visibility").': '.$langs->trans("PrivateProject").')'; + //$labeltoshow .= ' ('.$langs->trans("Visibility").': '.$langs->trans("PrivateProject").')'; + $labeltoshow = img_picto($lines[$i]->projectlabel, 'project', 'class="pictofixedwidth"').$labeltoshow; } else { - $labeltoshow .= ' ('.$langs->trans("Visibility").': '.$langs->trans("SharedProject").')'; + //$labeltoshow .= ' ('.$langs->trans("Visibility").': '.$langs->trans("SharedProject").')'; + $labeltoshow = img_picto($lines[$i]->projectlabel, 'projectpub', 'class="pictofixedwidth"').$labeltoshow; } if ($lines[$i]->id) { $labeltoshow .= ' > '; diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 31a48f38cf4..e13aaba4685 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -47,6 +47,9 @@ class FormTicket */ public $db; + /** + * @var string The track_id of the ticket. Used also for the $keytoavoidconflict to name session vars to upload files. + */ public $track_id; /** @@ -415,7 +418,7 @@ class FormTicket } include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $uselocalbrowser = true; - $doleditor = new DolEditor('message', $msg, '100%', 230, $toolbarname, 'In', true, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_TICKET, ROWS_8, '90%'); + $doleditor = new DolEditor('message', $msg, '100%', 230, $toolbarname, 'In', true, $uselocalbrowser, getDolGlobalInt('FCKEDITOR_ENABLE_TICKET'), ROWS_8, '90%'); $doleditor->Create(); print ''; @@ -433,7 +436,7 @@ class FormTicket } // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $cate_arbo = $form->select_all_categories(Categorie::TYPE_TICKET, '', 'parent', 64, 0, 1); @@ -488,6 +491,11 @@ class FormTicket $out .= $langs->trans("NoAttachedFiles").'
    '; } if ($this->withfile == 2) { // Can add other files + $maxfilesizearray = getMaxFileSizeArray(); + $maxmin = $maxfilesizearray['maxmin']; + if ($maxmin > 0) { + $out .= ''; // MAX_FILE_SIZE must precede the field type=file + } $out .= ''; $out .= ' '; $out .= ''; @@ -612,7 +620,7 @@ class FormTicket } if ($subelement != 'project') { - if (!empty($conf->projet->enabled) && !$this->ispublic) { + if (!empty($conf->project->enabled) && !$this->ispublic) { $formproject = new FormProjets($this->db); print ''; print img_picto('', 'project').$formproject->select_projects(-1, GETPOST('projectid', 'int'), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500'); @@ -1211,7 +1219,7 @@ class FormTicket dol_delete_dir_recursive($upload_dir); } - $keytoavoidconflict = empty($this->trackid) ? '' : '-'.$this->trackid; // this->trackid must be defined + $keytoavoidconflict = empty($this->track_id) ? '' : '-'.$this->track_id; // track_id instead of trackid unset($_SESSION["listofpaths".$keytoavoidconflict]); unset($_SESSION["listofnames".$keytoavoidconflict]); unset($_SESSION["listofmimes".$keytoavoidconflict]); @@ -1269,7 +1277,7 @@ class FormTicket $listofpaths = array(); $listofnames = array(); $listofmimes = array(); - $keytoavoidconflict = empty($this->trackid) ? '' : '-'.$this->trackid; // this->trackid must be defined + $keytoavoidconflict = empty($this->track_id) ? '' : '-'.$this->track_id; // track_id instead of trackid if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1')) { if (!empty($arraydefaultmessage->joinfiles) && is_array($this->param['fileinit'])) { @@ -1467,7 +1475,7 @@ class FormTicket print ''; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('mail_intro', $mail_intro, '100%', 90, 'dolibarr_details', '', false, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70); + $doleditor = new DolEditor('mail_intro', $mail_intro, '100%', 90, 'dolibarr_details', '', false, $uselocalbrowser, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_2, 70); $doleditor->Create(); print ''; @@ -1504,7 +1512,7 @@ class FormTicket //$toolbarname = 'dolibarr_details'; $toolbarname = 'dolibarr_notes'; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('message', $defaultmessage, '100%', 200, $toolbarname, '', false, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, 70); + $doleditor = new DolEditor('message', $defaultmessage, '100%', 200, $toolbarname, '', false, $uselocalbrowser, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_5, 70); $doleditor->Create(); print ''; @@ -1516,7 +1524,7 @@ class FormTicket print $form->textwithpicto('', $langs->trans("TicketMessageMailSignatureHelp"), 1, 'help'); print ''; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('mail_signature', $mail_signature, '100%', 150, 'dolibarr_details', '', false, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70); + $doleditor = new DolEditor('mail_signature', $mail_signature, '100%', 150, 'dolibarr_details', '', false, $uselocalbrowser, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_2, 70); $doleditor->Create(); print ''; } diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 452d066886e..3f26a98c728 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -615,7 +615,7 @@ class Notify $ref = dol_sanitizeFileName($newref); $pdf_path = $dir_output."/".$ref.".pdf"; - if (!dol_is_file($pdf_path)) { + if (!dol_is_file($pdf_path)||(is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0 && !$arraydefaultmessage->joinfiles)) { // We can't add PDF as it is not generated yet. $filepdf = ''; } else { @@ -847,6 +847,7 @@ class Notify $mimefilename_list[] = $ref.".pdf"; } + $message = ''; $message .= $langs->transnoentities("YouReceiveMailBecauseOfNotification2", $application, $mysoc->name)."\n"; $message .= "\n"; $message .= $mesg; diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index dbaaacc2d18..1f5a48a517d 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -581,6 +581,15 @@ class SMTPs // The error here just means the ID/password combo doesn't work. $_retVal = $this->socket_send_str(base64_encode("\0".$this->_smtpsID."\0".$this->_smtpsPW), '235'); break; + case 'XOAUTH2': + // "user=$email\1auth=Bearer $token\1\1" + $token = 'xxx'; + $xxxx = "user=".$this->_smtpsID."\1auth=Bearer ".$token."\1\1"; + $_retVal = $this->socket_send_str('AUTH XOAUTH2 '.base64_encode($xxxx), '235'); + if (!$_retVal) { + $this->_setErr(130, 'Error when asking for AUTH XOAUTH2'); + } + break; case 'LOGIN': // most common case default: $_retVal = $this->socket_send_str('AUTH LOGIN', '334'); @@ -590,7 +599,7 @@ class SMTPs // User name will not return any error, server will take anything we give it. $this->socket_send_str(base64_encode($this->_smtpsID), '334'); // The error here just means the ID/password combo doesn't work. - // There is not a method to determine which is the problem, ID or password + // There is no method to determine which is the problem, ID or password $_retVal = $this->socket_send_str(base64_encode($this->_smtpsPW), '235'); } break; diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index ae9a8e56e58..63125fffd9f 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -33,6 +33,13 @@ abstract class Stats protected $lastfetchdate = array(); // Dates of cache file read by methods public $cachefilesuffix = ''; // Suffix to add to name of cache file (to avoid file name conflicts) + /** + * @param int $year number + * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month + * @return int value + */ + protected abstract function getNbByMonth($year, $format = 0); + /** * Return nb of elements by month for several years * @@ -123,6 +130,13 @@ abstract class Stats return $data; } + /** + * @param int $year year number + * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month + * @return int value + */ + protected abstract function getAmountByMonth($year, $format = 0); + /** * Return amount of elements by month for several years. * Criterias used to build request are defined into the constructor of parent class into xxx/class/xxxstats.class.php @@ -219,6 +233,12 @@ abstract class Stats return $data; } + /** + * @param int $year year number + * @return int value + */ + protected abstract function getAverageByMonth($year); + /** * Return average of entity by month for several years * @@ -460,7 +480,6 @@ abstract class Stats return $data; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Return the amount per month for a given year diff --git a/htdocs/core/class/utils_diff.class.php b/htdocs/core/class/utils_diff.class.php index e18418d78a6..9abc1d899fe 100644 --- a/htdocs/core/class/utils_diff.class.php +++ b/htdocs/core/class/utils_diff.class.php @@ -12,6 +12,7 @@ /** * A class containing functions for computing diffs and formatting the output. + * We can compare 2 strings or 2 files (as one string or line by line) */ class Diff { @@ -236,7 +237,7 @@ class Diff * within 'span' elements, deletions are contained within 'del' elements, and * insertions are contained within 'ins' elements. The parameters are: * - * @param string $diff the diff array + * @param array $diff the diff array * @param string $separator the separator between lines; this optional parameter defaults to '
    ' * @return string HTML string */ @@ -275,7 +276,7 @@ class Diff /** * Returns a diff as an HTML table. The parameters are: * - * @param string $diff the diff array + * @param array $diff the diff array * @param string $indentation indentation to add to every line of the generated HTML; this optional parameter defaults to '' * @param string $separator the separator between lines; this optional parameter defaults to '
    ' * @return string HTML string @@ -287,7 +288,8 @@ class Diff // loop over the lines in the diff $index = 0; - while ($index < count($diff)) { + $nbdiff = count($diff); + while ($index < $nbdiff) { // determine the line type switch ($diff[$index][1]) { // display the content on the left and right @@ -365,7 +367,7 @@ class Diff * Returns the content of the cell, for use in the toTable function. The * parameters are: * - * @param string $diff the diff array + * @param array $diff the diff array * @param string $indentation indentation to add to every line of the generated HTML * @param string $separator the separator between lines * @param string $index the current index, passes by reference diff --git a/htdocs/core/class/validate.class.php b/htdocs/core/class/validate.class.php index ac4c14f7937..9d8832c36ce 100644 --- a/htdocs/core/class/validate.class.php +++ b/htdocs/core/class/validate.class.php @@ -300,13 +300,13 @@ class Validate /** * Check for all values in db * - * @param array $values Boolean to validate + * @param integer $id of element * @param string $classname the class name * @param string $classpath the class path * @return boolean Validity is ok or not * @throws Exception */ - public function isFetchable($values, $classname, $classpath) + public function isFetchable($id, $classname, $classpath) { if (!empty($classpath)) { if (dol_include_once($classpath)) { @@ -319,7 +319,7 @@ class Validate return false; } - if (!empty($object->table_element) && $object->isExistingObject($object->table_element, $values)) { + if (!empty($object->table_element) && $object->isExistingObject($object->table_element, $id)) { return true; } else { $this->error = $this->outputLang->trans('RequireValidExistingElement'); } } else { $this->error = $this->outputLang->trans('BadSetupOfFieldClassNotFoundForValidation'); } diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 476b1d5a4da..46b885bd60a 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -507,16 +507,16 @@ if ($mode == 'grid') { ); } } - // Add measure from extrafields - if ($object->isextrafieldmanaged) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key]) && (!isset($extrafields->attributes[$object->table_element]['enabled'][$key]) || dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1, 1, '1'))) { - $arrayofyaxis['te.'.$key] = array( - 'label' => $extrafields->attributes[$object->table_element]['label'][$key], - 'position' => (int) $extrafields->attributes[$object->table_element]['pos'][$key], - 'table' => $object->table_element - ); - } + } + // Add measure from extrafields + if ($object->isextrafieldmanaged) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key]) && (!isset($extrafields->attributes[$object->table_element]['enabled'][$key]) || dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1, 1, '1'))) { + $arrayofyaxis['te.'.$key] = array( + 'label' => $extrafields->attributes[$object->table_element]['label'][$key], + 'position' => (int) $extrafields->attributes[$object->table_element]['pos'][$key], + 'table' => $object->table_element + ); } } } diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index b085ce49db0..17a8b7c1231 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1712,7 +1712,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '', $text = 'Valu print 'mymailmanlist
    '; print 'mymailmanlist1,mymailmanlist2
    '; print 'TYPE:Type1:mymailmanlist1,TYPE:Type2:mymailmanlist2
    '; - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print 'CATEG:Categ1:mymailmanlist1,CATEG:Categ2:mymailmanlist2
    '; } print '
    '; @@ -1744,7 +1744,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '', $text = 'Valu print "\n"; } elseif ($obj->type == 'html') { require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('constvalue'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')), $obj->value, '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%'); + $doleditor = new DolEditor('constvalue'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')), $obj->value, '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%'); $doleditor->Create(); } elseif ($obj->type == 'yesno') { print $form->selectyesno('constvalue'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')), $obj->value, 1); @@ -1991,14 +1991,14 @@ function email_admin_prepare_head() $head[$h][2] = 'common'; $h++; - if (!empty($conf->mailing->enabled)) { + if (isModEnabled('mailing')) { $head[$h][0] = DOL_URL_ROOT."/admin/mails_emailing.php"; $head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing", $langs->transnoentitiesnoconv("EMailing")); $head[$h][2] = 'common_emailing'; $h++; } - if (!empty($conf->ticket->enabled)) { + if (isModEnabled('ticket')) { $head[$h][0] = DOL_URL_ROOT."/admin/mails_ticket.php"; $head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing", $langs->transnoentitiesnoconv("Ticket")); $head[$h][2] = 'common_ticket'; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 6feee8c35d5..0f7334345fa 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -92,7 +92,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', !$canedit, '', '', '0', false, 'minwidth100 maxwidth500 widthcentpercentminusxx'); print '
    '; - if (!empty($conf->resource->enabled)) { + if (isModEnabled('resource')) { include_once DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php'; $formresource = new FormResource($db); @@ -104,14 +104,14 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh } } - if (!empty($conf->societe->enabled) && !empty($user->rights->societe->lire)) { + if (isModEnabled('societe') && !empty($user->rights->societe->lire)) { print '
    '; print img_picto($langs->trans("ThirdParty"), 'company', 'class="pictofixedwidth inline-block"'); print $form->select_company($socid, 'search_socid', '', ' ', 0, 0, null, 0, 'minwidth100 maxwidth500'); print '
    '; } - if (!empty($conf->projet->enabled) && !empty($user->rights->projet->lire)) { + if (isModEnabled('projet') && !empty($user->rights->projet->lire)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; $formproject = new FormProjets($db); @@ -423,7 +423,7 @@ function actions_prepare_head($object) $h++; // Tab to link resources - if ($conf->resource->enabled) { + if (isModEnabled('resource')) { include_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php'; $resource = new DolResource($db); diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 4938d20c3c4..cc99471a69f 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -128,7 +128,7 @@ function societe_prepare_head(Societe $object) } } $supplier_module_enabled = 0; - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_proposal->enabled) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_proposal->enabled) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $supplier_module_enabled = 1; } if ($supplier_module_enabled == 1 && $object->fournisseur && !empty($user->rights->fournisseur->lire)) { @@ -138,7 +138,7 @@ function societe_prepare_head(Societe $object) $h++; } - if (!empty($conf->projet->enabled) && (!empty($user->rights->projet->lire))) { + if (!empty($conf->project->enabled) && (!empty($user->rights->projet->lire))) { $nbProject = 0; // Enable caching of thirdrparty count projects require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; @@ -171,7 +171,7 @@ function societe_prepare_head(Societe $object) } // Tab to link resources - if (!empty($conf->resource->enabled) && !empty($conf->global->RESOURCE_ON_THIRDPARTIES)) { + if (isModEnabled('resource') && !empty($conf->global->RESOURCE_ON_THIRDPARTIES)) { $head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=societe&element_id='.$object->id; $head[$h][1] = $langs->trans("Resources"); $head[$h][2] = 'resources'; @@ -179,7 +179,7 @@ function societe_prepare_head(Societe $object) } // Related items - if ((!empty($conf->commande->enabled) || !empty($conf->propal->enabled) || !empty($conf->facture->enabled) || !empty($conf->ficheinter->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) + if ((isModEnabled('commande') || isModEnabled('propal') || isModEnabled('facture') || isModEnabled('ficheinter') || (isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && empty($conf->global->THIRDPARTIES_DISABLE_RELATED_OBJECT_TAB)) { $head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id; $head[$h][1] = $langs->trans("Referers"); @@ -195,7 +195,7 @@ function societe_prepare_head(Societe $object) $title = $langs->trans("PaymentModes"); - if (!empty($conf->stripe->enabled)) { + if (isModEnabled('stripe')) { //$langs->load("stripe"); //$title = $langs->trans("BankAccountsAndGateways"); @@ -215,7 +215,7 @@ function societe_prepare_head(Societe $object) $sql = "SELECT COUNT(n.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."societe_rib as n"; $sql .= " WHERE n.fk_soc = ".((int) $object->id); - if (empty($conf->stripe->enabled)) { + if (!isModEnabled('stripe')) { $sql .= " AND n.stripe_card_ref IS NULL"; } else { $sql .= " AND (n.stripe_card_ref IS NULL OR (n.stripe_card_ref IS NOT NULL AND n.status = ".((int) $servicestatus)."))"; @@ -229,7 +229,7 @@ function societe_prepare_head(Societe $object) dol_print_error($db); } - //if (! empty($conf->stripe->enabled) && $nbBankAccount > 0) $nbBankAccount = '...'; // No way to know exact number + //if (isModEnabled('stripe') && $nbBankAccount > 0) $nbBankAccount = '...'; // No way to know exact number $head[$h][0] = DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.urlencode($object->id); $head[$h][1] = $title; @@ -242,7 +242,7 @@ function societe_prepare_head(Societe $object) $h++; } - if (!empty($conf->website->enabled) && (!empty($conf->global->WEBSITE_USE_WEBSITE_ACCOUNTS)) && (!empty($user->rights->societe->lire))) { + if (isModEnabled('website') && (!empty($conf->global->WEBSITE_USE_WEBSITE_ACCOUNTS)) && (!empty($user->rights->societe->lire))) { $head[$h][0] = DOL_URL_ROOT.'/societe/website.php?id='.urlencode($object->id); $head[$h][1] = $langs->trans("WebSiteAccounts"); $nbNote = 0; @@ -285,7 +285,7 @@ function societe_prepare_head(Societe $object) if ($user->socid == 0) { // Notifications - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $nbNotif = 0; // Enable caching of thirdparty count notifications require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; @@ -361,7 +361,7 @@ function societe_prepare_head(Societe $object) $head[$h][0] = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id; $head[$h][1] = $langs->trans("Events"); - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + if (isModEnabled('agenda')&& (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { $nbEvent = 0; // Enable caching of thirdrparty count actioncomm require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; @@ -781,11 +781,11 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel $i = -1; - if (!empty($conf->projet->enabled) && $user->rights->projet->lire) { + if (!empty($conf->project->enabled) && $user->rights->projet->lire) { $langs->load("projects"); $newcardbutton = ''; - if (!empty($conf->projet->enabled) && $user->rights->projet->creer && empty($nocreatelink)) { + if (!empty($conf->project->enabled) && $user->rights->projet->creer && empty($nocreatelink)) { $newcardbutton .= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage)); } @@ -1283,7 +1283,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') print ''; // Add to agenda - if (!empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { + if (isModEnabled('agenda')&& $user->rights->agenda->myactions->create) { print ''; print img_object($langs->trans("Event"), "action"); print '   '; @@ -1410,7 +1410,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin $sql = ''; - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { // Recherche histo sur actioncomm if (is_object($objcon) && $objcon->id > 0) { $sql = "SELECT DISTINCT a.id, a.label as label,"; @@ -1665,7 +1665,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin } } - if (!empty($conf->agenda->enabled) || (!empty($conf->mailing->enabled) && !empty($objcon->email))) { + if (isModEnabled('agenda')|| (isModEnabled('mailing') && !empty($objcon->email))) { $delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO * 24 * 60 * 60; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; @@ -2097,7 +2097,7 @@ function addMailingEventTypeSQL($actioncode, $objcon, $filterobj) { global $conf, $langs, $db; // Add also event from emailings. TODO This should be replaced by an automatic event ? May be it's too much for very large emailing. - if (!empty($conf->mailing->enabled) && !empty($objcon->email) + if (isModEnabled('mailing') && !empty($objcon->email) && (empty($actioncode) || $actioncode == 'AC_OTH_AUTO' || $actioncode == 'AC_EMAILING')) { $langs->load("mails"); diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index 5a0c6c376fb..b63e7b025c7 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -57,7 +57,7 @@ function contact_prepare_head(Contact $object) $head[$tab][2] = 'perso'; $tab++; - if (!empty($conf->projet->enabled) && (!empty($user->rights->projet->lire))) { + if (!empty($conf->project->enabled) && $user->hasRight('project', 'lire')) { $nbProject = 0; // Enable caching of thirdrparty count projects require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; @@ -92,7 +92,7 @@ function contact_prepare_head(Contact $object) } // Related items - if (!empty($conf->commande->enabled) || !empty($conf->propal->enabled) || !empty($conf->facture->enabled) || !empty($conf->ficheinter->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if (!empty($conf->commande->enabled) || !empty($conf->propal->enabled) || isModEnabled('facture') || !empty($conf->ficheinter->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $head[$tab][0] = DOL_URL_ROOT.'/contact/consumption.php?id='.$object->id; $head[$tab][1] = $langs->trans("Referers"); $head[$tab][2] = 'consumption'; @@ -133,7 +133,7 @@ function contact_prepare_head(Contact $object) // Agenda / Events $head[$tab][0] = DOL_URL_ROOT.'/contact/agenda.php?id='.$object->id; $head[$tab][1] = $langs->trans("Events"); - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { $head[$tab][1] .= '/'; $head[$tab][1] .= $langs->trans("Agenda"); } @@ -170,11 +170,11 @@ function show_contacts_projects($conf, $langs, $db, $object, $backtopage = '', $ $i = -1; - if (!empty($conf->projet->enabled) && $user->rights->projet->lire) { + if (!empty($conf->project->enabled) && $user->rights->projet->lire) { $langs->load("projects"); $newcardbutton = ''; - if (!empty($conf->projet->enabled) && $user->rights->projet->creer && empty($nocreatelink)) { + if (!empty($conf->project->enabled) && $user->rights->projet->creer && empty($nocreatelink)) { $newcardbutton .= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage)); } diff --git a/htdocs/core/lib/contract.lib.php b/htdocs/core/lib/contract.lib.php index 885ddec7255..2d627532010 100644 --- a/htdocs/core/lib/contract.lib.php +++ b/htdocs/core/lib/contract.lib.php @@ -89,7 +89,7 @@ function contract_prepare_head(Contrat $object) $head[$h][0] = DOL_URL_ROOT.'/contrat/agenda.php?id='.$object->id; $head[$h][1] .= $langs->trans("Events"); - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { $head[$h][1] .= '/'; $head[$h][1] .= $langs->trans("Agenda"); } diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 237adc9447a..558ba2aa322 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -322,20 +322,28 @@ function convertSecondToTime($iSecond, $format = 'all', $lengthOfDay = 86400, $l * Generate a SQL string to make a filter into a range (for second of date until last second of date). * This method allows to maje SQL request that will deal correctly the timezone of server. * - * @param string $datefield Name of SQL field where apply sql date filter - * @param int $day_date Day date - * @param int $month_date Month date - * @param int $year_date Year date - * @param int $excludefirstand Exclude first and - * @param mixed $gm False or 0 or 'tzserver' = Input date fields are date info in the server TZ. True or 1 or 'gmt' = Input are date info in GMT TZ. - * Note: In database, dates are always fot the server TZ. - * @return string $sqldate String with SQL filter + * @param string $datefield Name of SQL field where apply sql date filter + * @param int|string $day_date Day date (Can be 0 or '' for filter on a month) + * @param int|string $month_date Month date (Can be 0 or '' for filter on a year) + * @param int|string $year_date Year date + * @param int $excludefirstand Exclude first and + * @param mixed $gm False or 0 or 'tzserver' = Input date fields are date info in the server TZ. True or 1 or 'gmt' = Input are date info in GMT TZ. + * Note: In database, dates are always fot the server TZ. + * @return string $sqldate String with SQL filter */ function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand = 0, $gm = false) { global $db; - $sqldate = ""; + $sqldate = ''; + + $day_date = intval($day_date); + $month_date = intval($month_date); + $year_date = intval($year_date); + if ($month_date > 0) { + if ($month_date > 12) { // protection for bad value of month + return " AND 1 = 2"; + } if ($year_date > 0 && empty($day_date)) { $sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, $month_date, $gm)); $sqldate .= "' AND '".$db->idate(dol_get_last_day($year_date, $month_date, $gm))."'"; diff --git a/htdocs/core/lib/doc.lib.php b/htdocs/core/lib/doc.lib.php index d1a7cea5d9a..92cc140f299 100644 --- a/htdocs/core/lib/doc.lib.php +++ b/htdocs/core/lib/doc.lib.php @@ -78,12 +78,12 @@ function doc_getlinedesc($line, $outputlangs, $hideref = 0, $hidedesc = 0, $issu if ($desc == '(CREDIT_NOTE)' && $line->fk_remise_except) { $discount = new DiscountAbsolute($db); $discount->fetch($line->fk_remise_except); - $sourceref = !empty($discount->discount_type) ? $discount->ref_invoive_supplier_source : $discount->ref_facture_source; + $sourceref = !empty($discount->discount_type) ? $discount->ref_invoice_supplier_source : $discount->ref_facture_source; $libelleproduitservice = $outputlangs->transnoentitiesnoconv("DiscountFromCreditNote", $sourceref); } elseif ($desc == '(DEPOSIT)' && $line->fk_remise_except) { $discount = new DiscountAbsolute($db); $discount->fetch($line->fk_remise_except); - $sourceref = !empty($discount->discount_type) ? $discount->ref_invoive_supplier_source : $discount->ref_facture_source; + $sourceref = !empty($discount->discount_type) ? $discount->ref_invoice_supplier_source : $discount->ref_facture_source; $libelleproduitservice = $outputlangs->transnoentitiesnoconv("DiscountFromDeposit", $sourceref); // Add date of deposit if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) { diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php index fec64f931dc..6bfb7f717de 100644 --- a/htdocs/core/lib/fichinter.lib.php +++ b/htdocs/core/lib/fichinter.lib.php @@ -64,7 +64,7 @@ function fichinter_prepare_head($object) complete_head_from_modules($conf, $langs, $object, $head, $h, 'intervention'); // Tab to link resources - if ($conf->resource->enabled) { + if (isModEnabled('resource')) { require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php'; $objectres = new Dolresource($db); $linked_resources = $objectres->getElementResources('fichinter', $object->id); diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 76948308c70..223095609d3 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1443,7 +1443,7 @@ function dol_delete_preview($object) } elseif ($object->element == 'invoice_supplier') { $dir = $conf->fournisseur->facture->dir_output; } elseif ($object->element == 'project') { - $dir = $conf->projet->dir_output; + $dir = $conf->project->dir_output; } elseif ($object->element == 'shipping') { $dir = $conf->expedition->dir_output.'/sending'; } elseif ($object->element == 'delivery') { @@ -1525,7 +1525,7 @@ function dol_meta_create($object) } elseif ($object->element == 'invoice_supplier') { $dir = $conf->fournisseur->dir_output.'/facture'; } elseif ($object->element == 'project') { - $dir = $conf->projet->dir_output; + $dir = $conf->project->dir_output; } elseif ($object->element == 'shipping') { $dir = $conf->expedition->dir_output.'/sending'; } elseif ($object->element == 'delivery') { @@ -2812,7 +2812,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, } $original_file = $conf->commande->multidir_output[$entity].'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."commande WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('order').")"; - } elseif ($modulepart == 'project' && !empty($conf->projet->dir_output)) { + } elseif ($modulepart == 'project' && !empty($conf->project->dir_output)) { // Wrapping pour les projets if ($fuser->rights->projet->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; @@ -2824,9 +2824,9 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $accessallowed = checkUserAccessToObject($user, array('projet'), $tmpproject->id, 'projet&project', '', '', 'rowid', ''); } } - $original_file = $conf->projet->dir_output.'/'.$original_file; + $original_file = $conf->project->dir_output.'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project').")"; - } elseif ($modulepart == 'project_task' && !empty($conf->projet->dir_output)) { + } elseif ($modulepart == 'project_task' && !empty($conf->project->dir_output)) { if ($fuser->rights->projet->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; // If we known $id of project, call checkUserAccessToObject to check permission on properties and contact of project @@ -2837,7 +2837,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $accessallowed = checkUserAccessToObject($user, array('projet_task'), $tmptask->id, 'projet_task&project', '', '', 'rowid', ''); } } - $original_file = $conf->projet->dir_output.'/'.$original_file; + $original_file = $conf->project->dir_output.'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project').")"; } elseif (($modulepart == 'commande_fournisseur' || $modulepart == 'order_supplier') && !empty($conf->fournisseur->commande->dir_output)) { // Wrapping pour les commandes fournisseurs @@ -2977,6 +2977,10 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, // Wrapping for import module $accessallowed = $user->rights->import->run; $original_file = $conf->import->dir_temp.'/'.$original_file; + } elseif ($modulepart == 'recruitment' && !empty($conf->recruitment->dir_temp)) { + // Wrapping for recruitment module + $accessallowed = $user->rights->$modulepart->recruitmentjobposition->read; + $original_file = $conf->recruitment->dir_output .'/'. $original_file; } elseif ($modulepart == 'editor' && !empty($conf->fckeditor->dir_output)) { // Wrapping for wysiwyg editor $accessallowed = 1; diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php index 683b4b49912..2fd4ce3799a 100644 --- a/htdocs/core/lib/fourn.lib.php +++ b/htdocs/core/lib/fourn.lib.php @@ -223,7 +223,7 @@ function ordersupplier_prepare_head(CommandeFournisseur $object) $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/info.php?id='.$object->id; $head[$h][1] .= $langs->trans("Events"); - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { $head[$h][1] .= '/'; $head[$h][1] .= $langs->trans("Agenda"); } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b17b837aa88..df4fe39bcfd 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -42,6 +42,34 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; + +if (!function_exists('utf8_encode')) { + /** + * Implement utf8_encode for PHP that does not support it. + * + * @param mixed $elements PHP Object to json encode + * @return string Json encoded string + */ + function utf8_encode($elements) + { + return mb_convert_encoding($elements, 'UTF-8', 'ISO-8859-1'); + } +} + +if (!function_exists('utf8_decode')) { + /** + * Implement utf8_decode for PHP that does not support it. + * + * @param mixed $elements PHP Object to json encode + * @return string Json encoded string + */ + function utf8_decode($elements) + { + return mb_convert_encoding($elements, 'ISO-8859-1', 'UTF-8'); + } +} + + /** * Return dolibarr global constant string value * @param string $key key to return value, return '' if not set @@ -132,6 +160,9 @@ function getEntity($element, $shared = 1, $currentobject = null) case 'order_supplier': $element = 'supplier_order'; break; // "/fourn/class/fournisseur.commande.class.php" + case 'invoice_supplier': + $element = 'supplier_invoice'; + break; // "/fourn/class/fournisseur.facture.class.php" } if (is_object($mc)) { @@ -342,7 +373,7 @@ function dol_shutdown() $depth = $db->transaction_opened; $disconnectdone = $db->close(); } - dol_syslog("--- End access to ".$_SERVER["PHP_SELF"].(($disconnectdone && $depth) ? ' (Warn: db disconnection forced, transaction depth was '.$depth.')' : ''), (($disconnectdone && $depth) ?LOG_WARNING:LOG_INFO)); + dol_syslog("--- End access to ".$_SERVER["PHP_SELF"].(($disconnectdone && $depth) ? ' (Warn: db disconnection forced, transaction depth was '.$depth.')' : ''), (($disconnectdone && $depth) ? LOG_WARNING : LOG_INFO)); } /** @@ -742,7 +773,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null // - posted value not empty, or // - if posted value is empty and a default value exists that is not empty (it means we did a filter to an empty value when default was not). - if ($out != '') { // $out = '0' or 'abc', it is a search criteria to keep + if ($out != '' && isset($user)) {// $out = '0' or 'abc', it is a search criteria to keep $user->lastsearch_values_tmp[$relativepathstring][$paramname] = $out; } } @@ -2246,6 +2277,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi } } + // Show address and email if (method_exists($object, 'getBannerAddress') && !in_array($object->element, array('product', 'bookmark', 'ecm_directories', 'ecm_files'))) { $moreaddress = $object->getBannerAddress('refaddress', $object); if ($moreaddress) { @@ -2950,6 +2982,7 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64, //$rep .= '
    '; if ($hookmanager) { $parameters = array('cid' => $cid, 'socid' => $socid, 'addlink' => $addlink, 'picto' => $withpicto); + $reshook = $hookmanager->executeHooks('printEmail', $parameters, $email); if ($reshook > 0) { $rep = ''; @@ -3357,7 +3390,7 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli } //if (($cid || $socid) && ! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) - if (!empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { + if (isModEnabled('agenda') && $user->rights->agenda->myactions->create) { $type = 'AC_TEL'; $link = ''; if ($addlink == 'AC_FAX') { @@ -3502,7 +3535,7 @@ function dolGetCountryCodeFromIp($ip) $countrycode = ''; if (!empty($conf->geoipmaxmind->enabled)) { - $datafile = $conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE; + $datafile = getDolGlobalString('GEOIPMAXMIND_COUNTRY_DATAFILE'); //$ip='24.24.24.24'; //$datafile='/usr/share/GeoIP/GeoIP.dat'; Note that this must be downloaded datafile (not same than datafile provided with ubuntu packages) include_once DOL_DOCUMENT_ROOT.'/core/class/dolgeoip.class.php'; @@ -3529,7 +3562,7 @@ function dol_user_country() $ret = ''; if (!empty($conf->geoipmaxmind->enabled)) { $ip = getUserRemoteIP(); - $datafile = $conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE; + $datafile = getDolGlobalString('GEOIPMAXMIND_COUNTRY_DATAFILE'); //$ip='24.24.24.24'; //$datafile='E:\Mes Sites\Web\Admin1\awstats\maxmind\GeoIP.dat'; include_once DOL_DOCUMENT_ROOT.'/core/class/dolgeoip.class.php'; @@ -3912,7 +3945,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource', 'recurring', 'shapes', 'square', 'stop-circle', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice', 'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda', - 'uncheck', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'world', 'private', + 'uncheck', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'webhook', 'world', 'private', 'conferenceorbooth', 'eventorganization' ))) { $fakey = $pictowithouttext; @@ -3963,7 +3996,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'title_agenda'=>'calendar-alt', 'uncheck'=>'times', 'uparrow'=>'share', 'vat'=>'money-check-alt', 'vcard'=>'address-card', 'jabber'=>'comment-o', - 'website'=>'globe-americas', 'workstation'=>'pallet', 'world'=>'globe', 'private'=>'user-lock', + 'website'=>'globe-americas', 'workstation'=>'pallet', 'webhook'=>'bullseye', 'world'=>'globe', 'private'=>'user-lock', 'conferenceorbooth'=>'chalkboard-teacher', 'eventorganization'=>'project-diagram' ); if ($pictowithouttext == 'off') { @@ -5350,7 +5383,8 @@ function print_fleche_navigation($page, $file, $options = '', $nextpage = 0, $be print ''; } if ((int) $limit > 0 && empty($hideselectlimit)) { - $pagesizechoices = '10:10,15:15,20:20,30:30,40:40,50:50,100:100,250:250,500:500,1000:1000,5000:5000,25000:25000'; + $pagesizechoices = '10:10,15:15,20:20,30:30,40:40,50:50,100:100,250:250,500:500,1000:1000'; + $pagesizechoices .= ',5000:5000,10000:10000,20000:20000'; //$pagesizechoices.=',0:'.$langs->trans("All"); // Not yet supported //$pagesizechoices.=',2:2'; if (!empty($conf->global->MAIN_PAGESIZE_CHOICES)) { @@ -5464,7 +5498,7 @@ function vatrate($rate, $addpercent = false, $info_bits = 0, $usestarfornpr = 0) * * @param float $amount Amount to format * @param integer $form Type of format, HTML or not (not by default) - * @param Translate|string $outlangs Object langs for output + * @param Translate|string $outlangs Object langs for output. '' use default lang. 'none' use international separators. * @param int $trunc 1=Truncate if there is more decimals than MAIN_MAX_DECIMALS_SHOWN (default), 0=Does not truncate. Deprecated because amount are rounded (to unit or total amount accurancy) before beeing inserted into database or after a computation, so this parameter should be useless. * @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT) * @param int $forcerounding Force the number of decimal to forcerounding decimal (-1=do not force) @@ -5487,25 +5521,31 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $ } $nbdecimal = $rounding; - // Output separators by default (french) - $dec = ','; - $thousand = ' '; - - // If $outlangs not forced, we use use language - if (!is_object($outlangs)) { - $outlangs = $langs; - } - - if ($outlangs->transnoentitiesnoconv("SeparatorDecimal") != "SeparatorDecimal") { - $dec = $outlangs->transnoentitiesnoconv("SeparatorDecimal"); - } - if ($outlangs->transnoentitiesnoconv("SeparatorThousand") != "SeparatorThousand") { - $thousand = $outlangs->transnoentitiesnoconv("SeparatorThousand"); - } - if ($thousand == 'None') { + if ($outlangs === 'none') { + // Use international separators + $dec = '.'; $thousand = ''; - } elseif ($thousand == 'Space') { + } else { + // Output separators by default (french) + $dec = ','; $thousand = ' '; + + // If $outlangs not forced, we use use language + if (!is_object($outlangs)) { + $outlangs = $langs; + } + + if ($outlangs->transnoentitiesnoconv("SeparatorDecimal") != "SeparatorDecimal") { + $dec = $outlangs->transnoentitiesnoconv("SeparatorDecimal"); + } + if ($outlangs->transnoentitiesnoconv("SeparatorThousand") != "SeparatorThousand") { + $thousand = $outlangs->transnoentitiesnoconv("SeparatorThousand"); + } + if ($thousand == 'None') { + $thousand = ''; + } elseif ($thousand == 'Space') { + $thousand = ' '; + } } //print "outlangs=".$outlangs->defaultlang." amount=".$amount." html=".$form." trunc=".$trunc." nbdecimal=".$nbdecimal." dec='".$dec."' thousand='".$thousand."'
    "; @@ -5544,7 +5584,7 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $ } // Add symbol of currency if requested $cursymbolbefore = $cursymbolafter = ''; - if ($currency_code) { + if ($currency_code && is_object($outlangs)) { if ($currency_code == 'auto') { $currency_code = $conf->currency; } @@ -6420,6 +6460,7 @@ function get_default_localtax($thirdparty_seller, $thirdparty_buyer, $local, $id function yn($yesno, $case = 1, $color = 0) { global $langs; + $result = 'unknown'; $classname = ''; if ($yesno == 1 || strtolower($yesno) == 'yes' || strtolower($yesno) == 'true') { // A mettre avant test sur no a cause du == 0 @@ -6634,12 +6675,22 @@ function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto = if ($strip_tags) { $temp = strip_tags($temp); } else { - $temp = str_replace('<>', '', $temp); // No reason to have this into a text, except if value is to try bypass the next html cleaning + // Remove '<' into remainging, so remove non closing html tags like '0000-021 - $temp = preg_replace($pattern, "", $temp); // pass 1 - $temp after pass 1: 0000-021 - $temp = preg_replace($pattern, "", $temp); // pass 2 - $temp after pass 2: 0000-021 - // Remove '<' into remainging, so remove non closing html tags like '0000-021 + // pass 2 - $temp after pass 2: 0000-021 + $tempbis = $temp; + do { + $temp = $tempbis; + $tempbis = str_replace('<>', '', $temp); // No reason to have this into a text, except if value is to try bypass the next html cleaning + $tempbis = preg_replace($pattern, '', $tempbis); + //$idowhile++; print $temp.'-'.$tempbis."\n"; if ($idowhile > 100) break; + } while ($tempbis != $temp); + + $temp = $tempbis; + + // Remove '<' into remaining, so remove non closing html tags like 'projet->enabled)) { // Most objects + if (!empty($conf->project->enabled)) { // Most objects $substitutionarray['__PROJECT_ID__'] = '__PROJECT_ID__'; $substitutionarray['__PROJECT_REF__'] = '__PROJECT_REF__'; $substitutionarray['__PROJECT_NAME__'] = '__PROJECT_NAME__'; @@ -8495,7 +8546,7 @@ function verifCond($strToEvaluate) //dol_eval($str, 0, 1, '2'); // The dol_eval must contains all the global $xxx used into a condition //var_dump($strToEvaluate); $rep = dol_eval($strToEvaluate, 1, 1, '1'); // The dol_eval must contains all the global $xxx for all variables $xxx found into the string condition - $rights = (($rep && strpos($rep, 'Bad string syntax to evaluate') === false) ? true : false); + $rights = $rep && (!is_string($rep) || strpos($rep, 'Bad string syntax to evaluate') === false); //var_dump($rights); } return $rights; @@ -8939,8 +8990,12 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, foreach ($conf->modules_parts['tabs'][$type] as $value) { $values = explode(':', $value); + $reg = array(); if ($mode == 'add' && !preg_match('/^\-/', $values[1])) { - if (count($values) == 6) { // new declaration with permissions: $value='objecttype:+tabname1:Title1:langfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__' + if (count($values) == 6) { + // new declaration with permissions: + // $value='objecttype:+tabname1:Title1:langfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__' + // $value='objecttype:+tabname1:Title1,class,pathfile,method:langfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__' if ($values[0] != $type) { continue; } @@ -8954,7 +9009,7 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, complete_substitutions_array($substitutionarray, $langs, $object, array('needforkey'=>$values[2])); $label = make_substitutions($reg[1], $substitutionarray); } else { - $labeltemp = explode(':', $values[2]); + $labeltemp = explode(',', $values[2]); $label = $langs->trans($labeltemp[0]); if (!empty($labeltemp[1]) && is_object($object) && !empty($object->id)) { dol_include_once($labeltemp[2]); @@ -10423,14 +10478,14 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = $TCompiledAttr[] = $key.'="'.$value.'"'; } - $compiledAttributes = !empty($TCompiledAttr) ?implode(' ', $TCompiledAttr) : ''; + $compiledAttributes = empty($TCompiledAttr) ? '' : implode(' ', $TCompiledAttr); $tag = !empty($attr['href']) ? 'a' : 'span'; $parameters = array( - 'TCompiledAttr' => $TCompiledAttr, - 'compiledAttributes' => $compiledAttributes, + 'TCompiledAttr' => $TCompiledAttr, // array + 'compiledAttributes' => $compiledAttributes, // string 'attr' => $attr, 'tag' => $tag, 'label' => $label, diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index f80f041730e..eac16e4b22b 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -286,7 +286,7 @@ function dol_print_object_info($object, $usetable = 0) } print dol_print_date($object->date_creation, 'dayhour', 'tzserver'); if ($deltadateforuser) { - print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_creation, "dayhour", "tzuserrel").'  '.$langs->trans("ClientHour"); + print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_creation, "dayhour", "tzuserrel").'  '.$langs->trans("ClientHour").''; } if ($usetable) { print ''; @@ -341,7 +341,7 @@ function dol_print_object_info($object, $usetable = 0) } print dol_print_date($object->date_modification, 'dayhour', 'tzserver'); if ($deltadateforuser) { - print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_modification, "dayhour", "tzuserrel").'  '.$langs->trans("ClientHour"); + print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_modification, "dayhour", "tzuserrel").'  '.$langs->trans("ClientHour").''; } if ($usetable) { print ''; @@ -396,7 +396,7 @@ function dol_print_object_info($object, $usetable = 0) } print dol_print_date($object->date_validation, 'dayhour', 'tzserver'); if ($deltadateforuser) { - print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_validation, "dayhour", 'tzuserrel').'  '.$langs->trans("ClientHour"); + print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_validation, "dayhour", 'tzuserrel').'  '.$langs->trans("ClientHour").''; } if ($usetable) { print ''; @@ -451,7 +451,7 @@ function dol_print_object_info($object, $usetable = 0) } print dol_print_date($object->date_approve, 'dayhour', 'tzserver'); if ($deltadateforuser) { - print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_approve, "dayhour", 'tzuserrel').'  '.$langs->trans("ClientHour"); + print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_approve, "dayhour", 'tzuserrel').'  '.$langs->trans("ClientHour").''; } if ($usetable) { print ''; @@ -498,7 +498,7 @@ function dol_print_object_info($object, $usetable = 0) } print dol_print_date($object->date_approve2, 'dayhour', 'tzserver'); if ($deltadateforuser) { - print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_approve2, "dayhour", 'tzuserrel').'  '.$langs->trans("ClientHour"); + print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_approve2, "dayhour", 'tzuserrel').'  '.$langs->trans("ClientHour").''; } if ($usetable) { print ''; @@ -553,7 +553,7 @@ function dol_print_object_info($object, $usetable = 0) } print dol_print_date($object->date_signature, 'dayhour'); if ($deltadateforuser) { - print ' '.$langs->trans('CurrentHour').'   /   '.dol_print_date($object->date_signature, 'dayhour', 'tzuserrel').'  '.$langs->trans('ClientHour'); + print ' '.$langs->trans('CurrentHour').'   /   '.dol_print_date($object->date_signature, 'dayhour', 'tzuserrel').'  '.$langs->trans('ClientHour').''; } if ($usetable) { print ''; @@ -614,7 +614,7 @@ function dol_print_object_info($object, $usetable = 0) } print dol_print_date($object->date_closing, 'dayhour', 'tzserver'); if ($deltadateforuser) { - print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_closing, "dayhour", 'tzuserrel').'  '.$langs->trans("ClientHour"); + print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_closing, "dayhour", 'tzuserrel').'  '.$langs->trans("ClientHour").''; } if ($usetable) { print ''; @@ -669,7 +669,7 @@ function dol_print_object_info($object, $usetable = 0) } print dol_print_date($object->date_rappro, 'dayhour', 'tzserver'); if ($deltadateforuser) { - print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_rappro, "dayhour", 'tzuserrel').'  '.$langs->trans("ClientHour"); + print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_rappro, "dayhour", 'tzuserrel').'  '.$langs->trans("ClientHour").''; } if ($usetable) { print ''; @@ -691,7 +691,7 @@ function dol_print_object_info($object, $usetable = 0) } print dol_print_date($object->date_envoi, 'dayhour', 'tzserver'); if ($deltadateforuser) { - print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_envoi, "dayhour", 'tzuserrel').'  '.$langs->trans("ClientHour"); + print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_envoi, "dayhour", 'tzuserrel').'  '.$langs->trans("ClientHour").''; } if ($usetable) { print ''; diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index 64cc4388718..3d1f7157e83 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -107,6 +107,11 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, empty($conf->global->MAIN_USE_CONNECT_TIMEOUT) ? 5 : $conf->global->MAIN_USE_CONNECT_TIMEOUT); curl_setopt($ch, CURLOPT_TIMEOUT, empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT) ? 30 : $conf->global->MAIN_USE_RESPONSE_TIMEOUT); + /* + if ($maxsize) { + curl_setopt($ch, CURLOPT_MAXFILESIZE_LARGE, $maxsize); + } */ + //curl_setopt($ch, CURLOPT_SAFE_UPLOAD, true); // PHP 5.5 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // We want response if ($postorget == 'POST') { diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 786483e257b..580e30db650 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -254,7 +254,7 @@ function supplier_invoice_rec_prepare_head($object) function getNumberInvoicesPieChart($mode) { global $conf, $db, $langs, $user; - if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) { + if (isModEnabled('facture') && !empty($user->rights->facture->lire)) { include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; $now = date_create(date('Y-m-d', dol_now())); @@ -882,7 +882,7 @@ function getCustomerInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0) $result = ''; - if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) { + if (isModEnabled('facture') && !empty($user->rights->facture->lire)) { $tmpinvoice = new Facture($db); $sql = "SELECT f.rowid, f.ref, f.fk_statut as status, f.datef, f.type, f.total_ht, f.total_tva, f.total_ttc, f.paye, f.tms"; diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index ed3b69752f1..677d8cfdaef 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -112,10 +112,10 @@ function member_prepare_head(Adherent $object) $h++; // Show agenda tab - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { $head[$h][0] = DOL_URL_ROOT."/adherents/agenda.php?id=".$object->id; $head[$h][1] = $langs->trans("Events"); - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { $head[$h][1] .= '/'; $head[$h][1] .= $langs->trans("Agenda"); } diff --git a/htdocs/core/lib/oauth.lib.php b/htdocs/core/lib/oauth.lib.php index ab1b5a217b8..f99266db178 100644 --- a/htdocs/core/lib/oauth.lib.php +++ b/htdocs/core/lib/oauth.lib.php @@ -25,13 +25,13 @@ // Supported OAUTH (a provider is supported when a file xxx_oauthcallback.php is available into htdocs/core/modules/oauth) $supportedoauth2array = array( - 'OAUTH_GOOGLE_NAME'=>array('callbackfile' => 'google', 'picto' => 'google', 'urlforapp' => 'OAUTH_GOOGLE_DESC', 'name'=>'Google'), + 'OAUTH_GOOGLE_NAME'=>array('callbackfile' => 'google', 'picto' => 'google', 'urlforapp' => 'OAUTH_GOOGLE_DESC', 'name'=>'Google', 'urlforcredentials'=>'https://console.developers.google.com/'), ); if (!empty($conf->stripe->enabled)) { - $supportedoauth2array['OAUTH_STRIPE_TEST_NAME'] = array('callbackfile' => 'stripetest', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeTest'); - $supportedoauth2array['OAUTH_STRIPE_LIVE_NAME'] = array('callbackfile' => 'stripelive', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeLive'); + $supportedoauth2array['OAUTH_STRIPE_TEST_NAME'] = array('callbackfile' => 'stripetest', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeTest', 'urlforcredentials'=>''); + $supportedoauth2array['OAUTH_STRIPE_LIVE_NAME'] = array('callbackfile' => 'stripelive', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeLive', 'urlforcredentials'=>''); } -$supportedoauth2array['OAUTH_GITHUB_NAME'] = array('callbackfile' => 'github', 'picto' => 'github', 'urlforapp' => 'OAUTH_GITHUB_DESC', 'name'=>'GitHub'); +$supportedoauth2array['OAUTH_GITHUB_NAME'] = array('callbackfile' => 'github', 'picto' => 'github', 'urlforapp' => 'OAUTH_GITHUB_DESC', 'name'=>'GitHub', 'urlforcredentials'=>'https://github.com/settings/developers'); diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 0109847c59a..8860f4126c4 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -60,7 +60,7 @@ function commande_prepare_head(Commande $object) $h++; } - if (($conf->expedition_bon->enabled && $user->rights->expedition->lire) + if ((isModEnabled('expedition_bon') && $user->rights->expedition->lire) || ($conf->delivery_note->enabled && $user->rights->expedition->delivery->lire)) { $nbShipments = $object->getNbOfShipments(); $nbReceiption = 0; diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 2911564adef..fe89dcea00f 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -182,7 +182,7 @@ function showOnlinePaymentUrl($type, $ref) // Load translation files required by the page $langs->loadLangs(array('payment', 'stripe')); - $servicename = $langs->transnoentitiesnoconv('Online'); + $servicename = ''; // Link is a generic link for all payments services (paypal, stripe, ...) $out = img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePayment", $servicename).'
    '; $url = getOnlinePaymentUrl(0, $type, $ref); diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 709d6e5d404..ff0350a9552 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1490,12 +1490,12 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, if ($desc == '(CREDIT_NOTE)' && $object->lines[$i]->fk_remise_except) { $discount = new DiscountAbsolute($db); $discount->fetch($object->lines[$i]->fk_remise_except); - $sourceref = !empty($discount->discount_type) ? $discount->ref_invoive_supplier_source : $discount->ref_facture_source; + $sourceref = !empty($discount->discount_type) ? $discount->ref_invoice_supplier_source : $discount->ref_facture_source; $libelleproduitservice = $outputlangs->transnoentitiesnoconv("DiscountFromCreditNote", $sourceref); } elseif ($desc == '(DEPOSIT)' && $object->lines[$i]->fk_remise_except) { $discount = new DiscountAbsolute($db); $discount->fetch($object->lines[$i]->fk_remise_except); - $sourceref = !empty($discount->discount_type) ? $discount->ref_invoive_supplier_source : $discount->ref_facture_source; + $sourceref = !empty($discount->discount_type) ? $discount->ref_invoice_supplier_source : $discount->ref_facture_source; $libelleproduitservice = $outputlangs->transnoentitiesnoconv("DiscountFromDeposit", $sourceref); // Add date of deposit if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) { diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 117871b4712..7b3d1e4637f 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -201,7 +201,7 @@ function product_prepare_head($object) // Log $head[$h][0] = DOL_URL_ROOT.'/product/agenda.php?id='.$object->id; $head[$h][1] = $langs->trans("Events"); - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { $head[$h][1] .= '/'; $head[$h][1] .= $langs->trans("Agenda"); } @@ -450,7 +450,7 @@ function show_stats_for_company($product, $socid) print ''; } // Customer invoices - if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { + if (isModEnabled('facture') && $user->rights->facture->lire) { $nblines++; $ret = $product->load_stats_facture($socid); if ($ret < 0) { @@ -468,6 +468,25 @@ function show_stats_for_company($product, $socid) print ''; print ''; } + // Customer template invoices + if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { + $nblines++; + $ret = $product->load_stats_facturerec($socid); + if ($ret < 0) { + dol_print_error($db); + } + $langs->load("bills"); + print ''; + print '
    '.img_object('', 'bill', 'class="pictofixedwidth"').$langs->trans("RecurringInvoiceTemplate").''; + print ''; + print $product->stats_facture['customers']; + print ''; + print $product->stats_facturerec['nb']; + print ''; + print $product->stats_facturerec['qty']; + print ''; + print ''; + } // Supplier invoices if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) { $nblines++; diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 14b25a517c6..273922ff615 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -126,7 +126,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) - || !empty($conf->facture->enabled) || !empty($conf->contrat->enabled) + || isModEnabled('facture') || !empty($conf->contrat->enabled) || !empty($conf->ficheinter->enabled) || !empty($conf->agenda->enabled) || !empty($conf->deplacement->enabled) || !empty($conf->stock->enabled)) { $nbElements = 0; // Enable caching of thirdrparty count Contacts @@ -144,10 +144,10 @@ function project_prepare_head(Project $project, $moreparam = '') if (!empty($conf->commande->enabled)) { $nbElements += $project->getElementCount('order', 'commande'); } - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { $nbElements += $project->getElementCount('invoice', 'facture'); } - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { $nbElements += $project->getElementCount('invoice_predefined', 'facture_rec'); } if (!empty($conf->supplier_proposal->enabled)) { @@ -186,7 +186,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (!empty($conf->tax->enabled)) { $nbElements += $project->getElementCount('chargesociales', 'chargesociales'); } - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $nbElements += $project->getElementCount('project_task', 'projet_task'); } if (!empty($conf->stock->enabled)) { @@ -275,7 +275,7 @@ function project_prepare_head(Project $project, $moreparam = '') } else { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->projet->dir_output."/".dol_sanitizeFileName($project->ref); + $upload_dir = $conf->project->dir_output."/".dol_sanitizeFileName($project->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $project->element, $project->id); $totalAttached = $nbFiles + $nbLinks; @@ -313,7 +313,7 @@ function project_prepare_head(Project $project, $moreparam = '') $head[$h][0] = DOL_URL_ROOT.'/projet/info.php?id='.$project->id; $head[$h][1] = $langs->trans("Events"); - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { $head[$h][1] .= '/'; $head[$h][1] .= $langs->trans("Agenda"); } @@ -401,7 +401,7 @@ function task_prepare_head($object) } $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.(GETPOST('withproject') ? '&withproject=1' : ''); - $filesdir = $conf->projet->dir_output."/".dol_sanitizeFileName($object->project->ref).'/'.dol_sanitizeFileName($object->ref); + $filesdir = $conf->project->dir_output."/".dol_sanitizeFileName($object->project->ref).'/'.dol_sanitizeFileName($object->ref); include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; $nbFiles = count(dol_dir_list($filesdir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); @@ -650,7 +650,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t if ($showproject) { // Project ref - print ""; + print ''; //if ($showlineingray) print ''; if ($lines[$i]->public || in_array($lines[$i]->fk_project, $projectsArrayId) || !empty($user->rights->projet->all->lire)) { print $projectstatic->getNomUrl(1); @@ -701,21 +701,21 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t } if (count($arrayfields) > 0 && !empty($arrayfields['t.description']['checked'])) { - print ""; + print ''; print $lines[$i]->description; print "\n"; } // Date start if (count($arrayfields) > 0 && !empty($arrayfields['t.dateo']['checked'])) { - print ''; + print ''; print dol_print_date($lines[$i]->date_start, 'dayhour'); print ''; } // Date end if (count($arrayfields) > 0 && !empty($arrayfields['t.datee']['checked'])) { - print ''; + print ''; print dol_print_date($lines[$i]->date_end, 'dayhour'); if ($taskstatic->hasDelay()) { print img_warning($langs->trans("Late")); @@ -2549,8 +2549,8 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks $projectstatic->ref = $objp->ref; $projectstatic->status = $objp->status; $projectstatic->title = $objp->title; - $projectstatic->datee = $db->jdate($objp->datee); - $projectstatic->dateo = $db->jdate($objp->dateo); + $projectstatic->date_end = $db->jdate($objp->datee); + $projectstatic->date_start = $db->jdate($objp->dateo); print ''; diff --git a/htdocs/core/lib/resource.lib.php b/htdocs/core/lib/resource.lib.php index 29cd8a5b089..f222857b9d8 100644 --- a/htdocs/core/lib/resource.lib.php +++ b/htdocs/core/lib/resource.lib.php @@ -87,7 +87,7 @@ function resource_prepare_head($object) $head[$h][0] = DOL_URL_ROOT.'/resource/agenda.php?id='.$object->id; $head[$h][1] = $langs->trans("Events"); - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { $head[$h][1] .= '/'; $head[$h][1] .= $langs->trans("Agenda"); } diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 19b4d01f9d9..1d3f013e9f3 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -774,7 +774,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $checkonentitydone = 1; } if (in_array($feature, $checkproject)) { - if (!empty($conf->projet->enabled) && empty($user->rights->projet->all->lire)) { + if (!empty($conf->project->enabled) && empty($user->rights->projet->all->lire)) { $projectid = $objectid; include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; @@ -795,7 +795,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $checkonentitydone = 1; } if (in_array($feature, $checktask)) { - if (!empty($conf->projet->enabled) && empty($user->rights->projet->all->lire)) { + if (!empty($conf->project->enabled) && empty($user->rights->projet->all->lire)) { $task = new Task($db); $task->fetch($objectid); $projectid = $task->fk_project; @@ -977,3 +977,70 @@ function accessforbidden($message = '', $printheader = 1, $printfooter = 1, $sho } exit(0); } + + +/** + * Return the max allowed for file upload. + * Analyze among: upload_max_filesize, post_max_size, MAIN_UPLOAD_DOC + * + * @return array Array with all max size for file upload + */ +function getMaxFileSizeArray() +{ + global $conf; + + $max = $conf->global->MAIN_UPLOAD_DOC; // In Kb + $maxphp = @ini_get('upload_max_filesize'); // In unknown + if (preg_match('/k$/i', $maxphp)) { + $maxphp = preg_replace('/k$/i', '', $maxphp); + $maxphp = $maxphp * 1; + } + if (preg_match('/m$/i', $maxphp)) { + $maxphp = preg_replace('/m$/i', '', $maxphp); + $maxphp = $maxphp * 1024; + } + if (preg_match('/g$/i', $maxphp)) { + $maxphp = preg_replace('/g$/i', '', $maxphp); + $maxphp = $maxphp * 1024 * 1024; + } + if (preg_match('/t$/i', $maxphp)) { + $maxphp = preg_replace('/t$/i', '', $maxphp); + $maxphp = $maxphp * 1024 * 1024 * 1024; + } + $maxphp2 = @ini_get('post_max_size'); // In unknown + if (preg_match('/k$/i', $maxphp2)) { + $maxphp2 = preg_replace('/k$/i', '', $maxphp2); + $maxphp2 = $maxphp2 * 1; + } + if (preg_match('/m$/i', $maxphp2)) { + $maxphp2 = preg_replace('/m$/i', '', $maxphp2); + $maxphp2 = $maxphp2 * 1024; + } + if (preg_match('/g$/i', $maxphp2)) { + $maxphp2 = preg_replace('/g$/i', '', $maxphp2); + $maxphp2 = $maxphp2 * 1024 * 1024; + } + if (preg_match('/t$/i', $maxphp2)) { + $maxphp2 = preg_replace('/t$/i', '', $maxphp2); + $maxphp2 = $maxphp2 * 1024 * 1024 * 1024; + } + // Now $max and $maxphp and $maxphp2 are in Kb + $maxmin = $max; + $maxphptoshow = $maxphptoshowparam = ''; + if ($maxphp > 0) { + $maxmin = min($maxmin, $maxphp); + $maxphptoshow = $maxphp; + $maxphptoshowparam = 'upload_max_filesize'; + } + if ($maxphp2 > 0) { + $maxmin = min($maxmin, $maxphp2); + if ($maxphp2 < $maxphp) { + $maxphptoshow = $maxphp2; + $maxphptoshowparam = 'post_max_size'; + } + } + //var_dump($maxphp.'-'.$maxphp2); + //var_dump($maxmin); + + return array('max'=>$max, 'maxmin'=>$maxmin, 'maxphptoshow'=>$maxphptoshow, 'maxphptoshowparam'=>$maxphptoshowparam); +} diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 5b220553bfe..e1544e763df 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -126,7 +126,7 @@ function ticket_prepare_head($object) $head[$h][0] = DOL_URL_ROOT.'/ticket/agenda.php?track_id='.$object->track_id; } $head[$h][1] = $langs->trans('Events'); - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { $head[$h][1] .= '/'; $head[$h][1] .= $langs->trans("Agenda"); } @@ -304,7 +304,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no } $sortfield_new = implode(',', $sortfield_new_list); - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { // Search histo on actioncomm if (is_object($objcon) && $objcon->id > 0) { $sql = "SELECT DISTINCT a.id, a.label as label,"; @@ -565,7 +565,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no $out = info_admin($langs->trans("WarningModuleXDisabledSoYouMayMissEventHere", $langs->transnoentitiesnoconv("Module2400Name")), 0, 0, 'warning'); } - if (!empty($conf->agenda->enabled) || (!empty($conf->mailing->enabled) && !empty($objcon->email))) { + if (isModEnabled('agenda') || (!empty($conf->mailing->enabled) && !empty($objcon->email))) { $delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO * 24 * 60 * 60; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index dac412f92a6..538fc299564 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -72,7 +72,7 @@ function user_prepare_head(User $object) $head[$h][2] = 'guisetup'; $h++; - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { if (empty($conf->global->AGENDA_EXT_NB)) { $conf->global->AGENDA_EXT_NB = 5; } @@ -372,7 +372,12 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''; } - print ''; + print ''; + + if (!empty($conf->global->MAIN_FORCETHEME)) { + $langs->load("errors"); + print $langs->trans("WarningThemeForcedTo", $conf->global->MAIN_FORCETHEME); + } print ''; - $texte .= ''; + $texte .= ''; $texte .= ''; $texte .= ''; $texte .= '
    '; diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 9270b946199..96625dd1f95 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -15,7 +15,7 @@ insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, left insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 2__+MAX_llx_menu__, 'societe|fournisseur|supplier_order|supplier_invoice', '($conf->societe->enabled && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) || !empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || $conf->supplier_order->enabled || $conf->supplier_invoice->enabled))', __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 3__+MAX_llx_menu__, 'product|service', '$conf->product->enabled || $conf->service->enabled', __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'ProductsPipeServices', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 16__+MAX_llx_menu__, 'bom|mrp', '$conf->bom->enabled || $conf->mrp->enabled', __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&leftmenu=', 'MRP', -1, 'mrp', '$user->rights->bom->read||$user->rights->mrp->read', '', 0, 31, __ENTITY__); -insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 7__+MAX_llx_menu__, 'projet', '$conf->projet->enabled', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 32, __ENTITY__); +insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 7__+MAX_llx_menu__, 'projet', '$conf->project->enabled', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 32, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 5__+MAX_llx_menu__, 'propal|commande|fournisseur|supplier_order|supplier_invoice|contrat|ficheinter', '$conf->propal->enabled || $conf->commande->enabled || $conf->supplier_order->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled', __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 6__+MAX_llx_menu__, 'facture|don|tax|salaries|loan|banque', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read || $user->rights->banque->lire', '', 2, 50, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 14__+MAX_llx_menu__, 'banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 52, __ENTITY__); @@ -404,19 +404,19 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left -- Project -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3600__+MAX_llx_menu__, 'project', 'projects', 7__+MAX_llx_menu__, '/projet/index.php?mainmenu=project&leftmenu=projects', 'LeadsOrProjects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/card.php?mainmenu=project&leftmenu=projects&action=create', 'New', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_OPPORTUNITIES != 0', __HANDLER__, 'left', 3603__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects&search_opp_status=openedopp&search_status=99', 'ListOpenLeads', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_OPPORTUNITIES != 2', __HANDLER__, 'left', 3604__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects&search_opp_status=notopenedopp&search_status=99', 'ListOpenProjects', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3605__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/stats/index.php?mainmenu=project&leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled', __HANDLER__, 'left', 3600__+MAX_llx_menu__, 'project', 'projects', 7__+MAX_llx_menu__, '/projet/index.php?mainmenu=project&leftmenu=projects', 'LeadsOrProjects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled', __HANDLER__, 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/card.php?mainmenu=project&leftmenu=projects&action=create', 'New', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && $conf->global->PROJECT_USE_OPPORTUNITIES != 0', __HANDLER__, 'left', 3603__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects&search_opp_status=openedopp&search_status=99', 'ListOpenLeads', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && $conf->global->PROJECT_USE_OPPORTUNITIES != 2', __HANDLER__, 'left', 3604__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects&search_opp_status=notopenedopp&search_status=99', 'ListOpenProjects', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled', __HANDLER__, 'left', 3605__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/stats/index.php?mainmenu=project&leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?mainmenu=project&leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?mainmenu=project&leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?mainmenu=project&leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?mainmenu=project&leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?mainmenu=project&leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?mainmenu=project&leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?mainmenu=project&leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?mainmenu=project&leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?mainmenu=project&leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?mainmenu=project&leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); -- Project - Categories insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 7__+MAX_llx_menu__, '/categories/index.php?mainmenu=project&leftmenu=cat&type=6', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index ea6d21fe457..adc4f8d487c 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -229,7 +229,7 @@ function print_start_menu_entry_auguria($idsel, $classname, $showmode) */ function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $classname, $atarget) { - global $langs; + global $langs, $conf; $classnameimg = str_replace('class="', 'class="tmenuimage ', $classname); $classnametxt = str_replace('class="', 'class="tmenulabel ', $classname); @@ -339,7 +339,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t $newmenu = $menuArbo->menuLeftCharger($newmenu, $mainmenu, $leftmenu, ($user->socid ? 1 : 0), 'auguria', $tabMenu); // We update newmenu for special dynamic menus - if (!empty($conf->banque->enabled) && $user->rights->banque->lire && $mainmenu == 'bank') { // Entry for each bank account + if (isModEnabled('banque') && $user->rights->banque->lire && $mainmenu == 'bank') { // Entry for each bank account include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Required for to get Account::TYPE_CASH for example $sql = "SELECT rowid, label, courant, rappro, courant"; @@ -371,7 +371,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t $db->free($resql); } - if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { // Entry in accountancy journal for each bank account + if (isModEnabled('accounting') && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { // Entry in accountancy journal for each bank account $newmenu->add('', $langs->trans("RegistrationInAccounting"), 1, $user->rights->accounting->comptarapport->lire, '', 'accountancy', 'accountancy', 10); // Multi journal @@ -393,18 +393,18 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t $nature = ''; // Must match array $sourceList defined into journals_list.php - if ($objp->nature == 2 && !empty($conf->facture->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) { + if ($objp->nature == 2 && isModEnabled('facture') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) { $nature = "sells"; } if ($objp->nature == 3 - && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) + && ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_invoice')) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) { $nature = "purchases"; } - if ($objp->nature == 4 && !empty($conf->banque->enabled)) { + if ($objp->nature == 4 && isModEnabled('banque')) { $nature = "bank"; } - if ($objp->nature == 5 && !empty($conf->expensereport->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) { + if ($objp->nature == 5 && isModEnabled('expensereport') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) { $nature = "expensereports"; } if ($objp->nature == 1) { @@ -441,7 +441,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t $db->free($resql); } - if (!empty($conf->ftp->enabled) && $mainmenu == 'ftp') { // Entry for FTP + if (isModEnabled('ftp') && $mainmenu == 'ftp') { // Entry for FTP $MAXFTP = 20; $i = 1; while ($i <= $MAXFTP) { diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 61d9872e09f..9e88d4dda3d 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -94,7 +94,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Members $tmpentry = array( - 'enabled' => (!empty($conf->adherent->enabled)), + 'enabled' => (isModEnabled('adherent')), 'perms' => (!empty($user->rights->adherent->lire)), 'module' => 'adherent' ); @@ -119,10 +119,10 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Third parties $tmpentry = array( - 'enabled'=> ((!empty($conf->societe->enabled) && + 'enabled'=> ((isModEnabled('societe') && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) ) - || ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) + || ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) ), 'perms'=> (!empty($user->rights->societe->lire) || !empty($user->rights->fournisseur->lire) || !empty($user->rights->supplier_order->lire) || !empty($user->rights->supplier_invoice->lire) || !empty($user->rights->supplier_proposal->lire)), 'module'=>'societe|fournisseur' @@ -148,16 +148,16 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Products-Services $tmpentry = array( - 'enabled'=> (!empty($conf->product->enabled) || !empty($conf->service->enabled) || !empty($conf->expedition->enabled)), + 'enabled'=> (isModEnabled('product') || isModEnabled('service') || isModEnabled('expedition')), 'perms'=> (!empty($user->rights->produit->lire) || !empty($user->rights->service->lire) || !empty($user->rights->expedition->lire)), 'module'=>'product|service' ); $menu_arr[] = array( 'name' => 'Products', 'link' => '/product/index.php?mainmenu=products&leftmenu=', - 'title' => (!empty($conf->product->enabled) && !empty($conf->service->enabled)) + 'title' => (isModEnabled('product') && isModEnabled('service')) ? (array("TMenuProducts", " | ", "TMenuServices")) - : (!empty($conf->product->enabled) ? "TMenuProducts" : "TMenuServices"), + : (isModEnabled('product') ? "TMenuProducts" : "TMenuServices"), 'level' => 0, 'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal), 'target' => $atarget, @@ -175,7 +175,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // MRP - GPAO $tmpentry = array( - 'enabled'=>(!empty($conf->bom->enabled) || !empty($conf->mrp->enabled)), + 'enabled'=>(isModEnabled('bom') || isModEnabled('mrp')), 'perms'=>(!empty($user->rights->bom->read) || !empty($user->rights->mrp->read)), 'module'=>'bom|mrp' ); @@ -200,7 +200,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Projects $tmpentry = array( - 'enabled'=> (!empty($conf->projet->enabled) ? 1 : 0), + 'enabled'=> (isModEnabled('projet') ? 1 : 0), 'perms'=> (!empty($user->rights->projet->lire) ? 1 : 0), 'module'=>'projet' ); @@ -225,13 +225,13 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Commercial (propal, commande, supplier_proposal, supplier_order, contrat, ficheinter) $tmpentry = array( - 'enabled'=>(!empty($conf->propal->enabled) - || !empty($conf->commande->enabled) - || !empty($conf->fournisseur->enabled) - || !empty($conf->supplier_proposal->enabled) - || !empty($conf->supplier_order->enabled) - || !empty($conf->contrat->enabled) - || !empty($conf->ficheinter->enabled) + 'enabled'=>(isModEnabled('propal') + || isModEnabled('commande') + || isModEnabled('fournisseur') + || isModEnabled('supplier_proposal') + || isModEnabled('supplier_order') + || isModEnabled('contrat') + || isModEnabled('ficheinter') ) ? 1 : 0, 'perms'=>(!empty($user->rights->propal->lire) || !empty($user->rights->commande->lire) @@ -274,13 +274,13 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Billing - Financial $tmpentry = array( - 'enabled'=>(!empty($conf->facture->enabled) || - !empty($conf->don->enabled) || - !empty($conf->tax->enabled) || - !empty($conf->salaries->enabled) || - !empty($conf->supplier_invoice->enabled) || - !empty($conf->loan->enabled) || - !empty($conf->margins->enabled) + 'enabled'=>(isModEnabled('facture') || + isModEnabled('don') || + isModEnabled('tax') || + isModEnabled('salaries') || + isModEnabled('supplier_invoice') || + isModEnabled('loan') || + isModEnabled('margins') ) ? 1 : 0, 'perms'=>(!empty($user->rights->facture->lire) || !empty($user->rights->don->contact->lire) || !empty($user->rights->tax->charges->lire) || !empty($user->rights->salaries->read) @@ -308,7 +308,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Bank $tmpentry = array( - 'enabled'=>(!empty($conf->banque->enabled) || !empty($conf->prelevement->enabled)), + 'enabled'=>(isModEnabled('banque') || isModEnabled('prelevement')), 'perms'=>(!empty($user->rights->banque->lire) || !empty($user->rights->prelevement->lire) || !empty($user->rights->paymentbybanktransfer->read)), 'module'=>'banque|prelevement|paymentbybanktransfer' ); @@ -333,7 +333,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Accounting $tmpentry = array( - 'enabled'=>(!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled) || !empty($conf->asset->enabled) || !empty($conf->intracommreport->enabled)), + 'enabled'=>(isModEnabled('comptabilite') || isModEnabled('accounting') || isModEnabled('asset') || isModEnabled('intracommreport')), 'perms'=>(!empty($user->rights->compta->resultat->lire) || !empty($user->rights->accounting->comptarapport->lire) || !empty($user->rights->accounting->mouvements->lire) || !empty($user->rights->asset->read) || !empty($user->rights->intracommreport->read)), 'module'=>'comptabilite|accounting|asset|intracommreport' ); @@ -358,7 +358,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // HRM $tmpentry = array( - 'enabled'=>(!empty($conf->hrm->enabled) || (!empty($conf->holiday->enabled)) || !empty($conf->deplacement->enabled) || !empty($conf->expensereport->enabled) || !empty($conf->recruitment->enabled)), + 'enabled'=>(isModEnabled('hrm') || (isModEnabled('holiday')) || isModEnabled('deplacement') || isModEnabled('expensereport') || isModEnabled('recruitment')), 'perms'=>(!empty($user->rights->user->user->lire) || !empty($user->rights->holiday->read) || !empty($user->rights->deplacement->lire) || !empty($user->rights->expensereport->lire) || !empty($user->rights->recruitment->recruitmentjobposition->read)), 'module'=>'hrm|holiday|deplacement|expensereport|recruitment' ); @@ -384,12 +384,12 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Tickets and knowledge base $tmpentry = array( - 'enabled'=>(!empty($conf->ticket->enabled) || !empty($conf->knowledgemanagement->enabled)), + 'enabled'=>(isModEnabled('ticket') || isModEnabled('knowledgemanagement')), 'perms'=>(!empty($user->rights->ticket->read) || !empty($user->rights->knowledgemanagement->knowledgerecord->read)), 'module'=>'ticket|knowledgemanagement' ); $link = ''; - if (!empty($conf->ticket->enabled)) { + if (isModEnabled('ticket')) { $link = '/ticket/index.php?mainmenu=ticket&leftmenu='; } else { $link = '/knowledgemanagement/knowledgerecord_list.php?mainmenu=ticket&leftmenu='; @@ -827,7 +827,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu = $menuArbo->menuLeftCharger($newmenu, $mainmenu, $leftmenu, (empty($user->socid) ? 0 : 1), 'eldy', $tabMenu); //var_dump($newmenu->liste); // - if (!empty($conf->ftp->enabled) && $mainmenu == 'ftp') { // Entry for FTP + if (isModEnabled('ftp') && $mainmenu == 'ftp') { // Entry for FTP $MAXFTP = 20; $i = 1; while ($i <= $MAXFTP) { @@ -1142,7 +1142,7 @@ function get_left_menu_home($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $newmenu->add("/admin/tools/listsessions.php?mainmenu=home&leftmenu=admintools", $langs->trans("Sessions"), 1); $newmenu->add('/admin/system/about.php?mainmenu=home&leftmenu=admintools', $langs->trans('ExternalResources'), 1); - if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { + if (isModEnabled('product') || isModEnabled('service')) { $langs->load("products"); $newmenu->add("/product/admin/product_tools.php?mainmenu=home&leftmenu=admintools", $langs->trans("ProductVatMassChange"), 1, $user->admin); } @@ -1152,16 +1152,16 @@ function get_left_menu_home($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = if ($user->rights->user->user->lire) { if ($usemenuhider || empty($leftmenu) || $leftmenu == "users") { $newmenu->add("", $langs->trans("Users"), 1, $user->rights->user->user->lire || $user->admin); - $newmenu->add("/user/card.php?leftmenu=users&action=create", $langs->trans("NewUser"), 2, ($user->rights->user->user->creer || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE), '', 'home'); + $newmenu->add("/user/card.php?leftmenu=users&action=create", $langs->trans("NewUser"), 2, ($user->rights->user->user->creer || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE), '', 'home'); $newmenu->add("/user/list.php?leftmenu=users", $langs->trans("ListOfUsers"), 2, $user->rights->user->user->lire || $user->admin); $newmenu->add("/user/hierarchy.php?leftmenu=users", $langs->trans("HierarchicView"), 2, $user->rights->user->user->lire || $user->admin); - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $langs->load("categories"); $newmenu->add("/categories/index.php?leftmenu=users&type=7", $langs->trans("UsersCategoriesShort"), 2, $user->rights->categorie->lire, '', $mainmenu, 'cat'); } - $newmenu->add("", $langs->trans("Groups"), 1, ($user->rights->user->user->lire || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); - $newmenu->add("/user/group/card.php?leftmenu=users&action=create", $langs->trans("NewGroup"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->rights->user->group_advance->write : $user->rights->user->user->creer) || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); - $newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->rights->user->group_advance->read : $user->rights->user->user->lire) || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); + $newmenu->add("", $langs->trans("Groups"), 1, ($user->rights->user->user->lire || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); + $newmenu->add("/user/group/card.php?leftmenu=users&action=create", $langs->trans("NewGroup"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->rights->user->group_advance->write : $user->rights->user->user->creer) || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); + $newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->rights->user->group_advance->read : $user->rights->user->user->lire) || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); } } } @@ -1183,7 +1183,7 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le if ($mainmenu == 'companies') { // Societes - if (!empty($conf->societe->enabled)) { + if (isModEnabled('societe')) { $langs->load("companies"); $newmenu->add("/societe/index.php?leftmenu=thirdparties", $langs->trans("ThirdParty"), 0, $user->rights->societe->lire, '', $mainmenu, 'thirdparties', 0, '', '', '', img_picto('', 'company', 'class="paddingright pictofixedwidth"')); @@ -1198,7 +1198,7 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le $newmenu->add("/societe/list.php?leftmenu=thirdparties", $langs->trans("List"), 1); // Prospects - if (!empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { + if (isModEnabled('societe') && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { $langs->load("commercial"); $newmenu->add("/societe/list.php?type=p&leftmenu=prospects", $langs->trans("ListProspectsShort"), 2, $user->rights->societe->lire, '', $mainmenu, 'prospects'); /* no more required, there is a filter that can do more @@ -1212,7 +1212,7 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le } // Customers/Prospects - if (!empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { + if (isModEnabled('societe') && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { $langs->load("commercial"); $newmenu->add("/societe/list.php?type=c&leftmenu=customers", $langs->trans("ListCustomersShort"), 2, $user->rights->societe->lire, '', $mainmenu, 'customers'); @@ -1220,14 +1220,14 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le } // Suppliers - if (!empty($conf->societe->enabled) && (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) || !empty($conf->supplier_proposal->enabled))) { + if (isModEnabled('societe') && (((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) || isModEnabled('supplier_proposal'))) { $langs->load("suppliers"); $newmenu->add("/societe/list.php?type=f&leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 2, ($user->rights->fournisseur->lire || $user->rights->supplier_order->lire || $user->rights->supplier_invoice->lire || $user->rights->supplier_proposal->lire), '', $mainmenu, 'suppliers'); $newmenu->add("/societe/card.php?leftmenu=suppliers&action=create&type=f", $langs->trans("MenuNewSupplier"), 3, $user->rights->societe->creer && ($user->rights->fournisseur->lire || $user->rights->supplier_order->lire || $user->rights->supplier_invoice->lire || $user->rights->supplier_proposal->lire)); } // Categories - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $langs->load("categories"); if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { // Categories prospects/customers @@ -1241,7 +1241,7 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le $newmenu->add("/categories/index.php?leftmenu=cat&type=2", $menutoshow, 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); } // Categories suppliers - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { $newmenu->add("/categories/index.php?leftmenu=catfournish&type=1", $langs->trans("SuppliersCategoriesShort"), 1, $user->rights->categorie->lire); } } @@ -1257,14 +1257,14 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { $newmenu->add("/contact/list.php?leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->rights->societe->contact->lire); } - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { $newmenu->add("/contact/list.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->rights->societe->contact->lire); } $newmenu->add("/contact/list.php?leftmenu=contacts&type=o", $langs->trans("ContactOthers"), 2, $user->rights->societe->contact->lire); //$newmenu->add("/contact/list.php?userid=$user->id", $langs->trans("MyContacts"), 1, $user->rights->societe->contact->lire); // Categories - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $langs->load("categories"); // Categories Contact $newmenu->add("/categories/index.php?leftmenu=catcontact&type=4", $langs->trans("ContactCategoriesShort"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); @@ -1290,7 +1290,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left $langs->load("companies"); // Customer proposal - if (!empty($conf->propal->enabled)) { + if (isModEnabled('propal')) { $langs->load("propal"); $newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Proposals"), 0, $user->rights->propale->lire, '', $mainmenu, 'propals', 100, '', '', '', img_picto('', 'propal', 'class="paddingright pictofixedwidth"')); $newmenu->add("/comm/propal/card.php?action=create&leftmenu=propals", $langs->trans("NewPropal"), 1, $user->rights->propale->creer); @@ -1307,7 +1307,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left } // Customers orders - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { $langs->load("orders"); $newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders', 200, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"')); $newmenu->add("/commande/card.php?action=create&leftmenu=orders", $langs->trans("NewOrder"), 1, $user->rights->commande->creer); @@ -1315,7 +1315,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left if ($usemenuhider || empty($leftmenu) || $leftmenu == "orders") { $newmenu->add("/commande/list.php?leftmenu=orders&search_status=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire); $newmenu->add("/commande/list.php?leftmenu=orders&search_status=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire); - if (!empty($conf->expedition->enabled)) { + if (isModEnabled('expedition')) { $newmenu->add("/commande/list.php?leftmenu=orders&search_status=2", $langs->trans("StatusOrderSentShort"), 2, $user->rights->commande->lire); } $newmenu->add("/commande/list.php?leftmenu=orders&search_status=3", $langs->trans("StatusOrderDelivered"), 2, $user->rights->commande->lire); @@ -1326,7 +1326,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left } // Supplier proposal - if (!empty($conf->supplier_proposal->enabled)) { + if (isModEnabled('supplier_proposal')) { $langs->load("supplier_proposal"); $newmenu->add("/supplier_proposal/index.php?leftmenu=propals_supplier", $langs->trans("SupplierProposalsShort"), 0, $user->rights->supplier_proposal->lire, '', $mainmenu, 'propals_supplier', 300, '', '', '', img_picto('', 'supplier_proposal', 'class="paddingright pictofixedwidth"')); $newmenu->add("/supplier_proposal/card.php?action=create&leftmenu=supplier_proposals", $langs->trans("SupplierProposalNew"), 1, $user->rights->supplier_proposal->creer); @@ -1335,7 +1335,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left } // Suppliers orders - if (!empty($conf->supplier_order->enabled)) { + if (isModEnabled('supplier_order')) { $langs->load("orders"); $newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers", $langs->trans("SuppliersOrders"), 0, $user->rights->fournisseur->commande->lire, '', $mainmenu, 'orders_suppliers', 400, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"')); $newmenu->add("/fourn/commande/card.php?action=create&leftmenu=orders_suppliers", $langs->trans("NewSupplierOrderShort"), 1, $user->rights->fournisseur->commande->creer); @@ -1360,7 +1360,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left } // Contrat - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { $langs->load("contracts"); $newmenu->add("/contrat/index.php?leftmenu=contracts", $langs->trans("ContractsSubscriptions"), 0, $user->rights->contrat->lire, '', $mainmenu, 'contracts', 2000, '', '', '', img_picto('', 'contract', 'class="paddingright pictofixedwidth"')); $newmenu->add("/contrat/card.php?action=create&leftmenu=contracts", $langs->trans("NewContractSubscription"), 1, $user->rights->contrat->creer); @@ -1375,7 +1375,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left } // Interventions - if (!empty($conf->ficheinter->enabled)) { + if (isModEnabled('ficheinter')) { $langs->load("interventions"); $newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire, '', $mainmenu, 'ficheinter', 2200, '', '', '', img_picto('', 'intervention', 'class="paddingright pictofixedwidth"')); $newmenu->add("/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->rights->ficheinter->creer, '', '', '', 201); @@ -1406,7 +1406,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen $langs->load("companies"); // Customers invoices - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { $langs->load("bills"); $newmenu->add("/compta/facture/index.php?leftmenu=customers_bills", $langs->trans("BillsCustomers"), 0, $user->rights->facture->lire, '', $mainmenu, 'customers_bills', 0, '', '', '', img_picto('', 'bill', 'class="paddingright pictofixedwidth"')); $newmenu->add("/compta/facture/card.php?action=create", $langs->trans("NewBill"), 1, $user->rights->facture->creer); @@ -1433,7 +1433,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen } // Suppliers invoices - if (!empty($conf->societe->enabled) && !empty($conf->supplier_invoice->enabled)) { + if (isModEnabled('societe') && isModEnabled('supplier_invoice')) { $langs->load("bills"); $newmenu->add("/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills', 0, '', '', '', img_picto('', 'supplier_invoice', 'class="paddingright pictofixedwidth"')); $newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer), '', $mainmenu, 'suppliers_bills_create'); @@ -1457,16 +1457,16 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen } // Orders - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { $langs->load("orders"); - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-3&billed=0&contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"')); } //if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire); } // Supplier Orders to bill - if (!empty($conf->supplier_invoice->enabled)) { + if (isModEnabled('supplier_invoice')) { if (!empty($conf->global->SUPPLIER_MENU_ORDER_RECEIVED_INTO_INVOICE)) { $langs->load("supplier"); $newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5&billed=0", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"')); @@ -1476,7 +1476,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen // Donations - if (!empty($conf->don->enabled)) { + if (isModEnabled('don')) { $langs->load("donations"); $newmenu->add("/don/index.php?leftmenu=donations&mainmenu=billing", $langs->trans("Donations"), 0, $user->rights->don->lire, '', $mainmenu, 'donations', 0, '', '', '', img_picto('', 'donation', 'class="paddingright pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || $leftmenu == "donations") { @@ -1487,7 +1487,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen } // Taxes and social contributions - if (!empty($conf->tax->enabled)) { + if (isModEnabled('tax')) { $newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing", $langs->trans("MenuTaxesAndSpecialExpenses"), 0, $user->rights->tax->charges->lire, '', $mainmenu, 'tax', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("MenuSocialContributions"), 1, $user->rights->tax->charges->lire); @@ -1536,7 +1536,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen } // Salaries - if (!empty($conf->salaries->enabled)) { + if (isModEnabled('salaries')) { $langs->load("salaries"); $newmenu->add("/salaries/list.php?leftmenu=tax_salary&mainmenu=billing", $langs->trans("Salaries"), 0, $user->rights->salaries->read, '', $mainmenu, 'tax_salary', 0, '', '', '', img_picto('', 'salary', 'class="paddingright pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i', $leftmenu)) { @@ -1548,7 +1548,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen } // Loan - if (!empty($conf->loan->enabled)) { + if (isModEnabled('loan')) { $langs->load("loan"); $newmenu->add("/loan/list.php?leftmenu=tax_loan&mainmenu=billing", $langs->trans("Loans"), 0, $user->rights->loan->read, '', $mainmenu, 'tax_loan', 0, '', '', '', img_picto('', 'loan', 'class="paddingright pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_loan/i', $leftmenu)) { @@ -1558,7 +1558,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen } // Various payment - if (!empty($conf->banque->enabled) && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) { + if (isModEnabled('banque') && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) { $langs->load("banks"); $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various&mainmenu=billing", $langs->trans("MenuVariousPayment"), 0, $user->rights->banque->lire, '', $mainmenu, 'tax_various', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i', $leftmenu)) { @@ -1588,8 +1588,8 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef $langs->load("companies"); // Accounting (Double entries) - if (!empty($conf->accounting->enabled)) { - //$permtoshowmenu = (!empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire); + if (isModEnabled('accounting')) { + //$permtoshowmenu = (isModEnabled('accounting') || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire); //$newmenu->add("/accountancy/index.php?leftmenu=accountancy", $langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy'); // Configuration @@ -1609,16 +1609,16 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef $newmenu->add("/accountancy/admin/subaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ChartOfSubaccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 41); $newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 50); $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 60); - if (!empty($conf->banque->enabled)) { + if (isModEnabled('banque')) { $newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 70); } - if (!empty($conf->facture->enabled) || ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))) { + if (isModEnabled('facture') || ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_invoice'))) { $newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 80); } - if (!empty($conf->tax->enabled)) { + if (isModEnabled('tax')) { $newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 90); } - if (!empty($conf->expensereport->enabled)) { + if (isModEnabled('expensereport')) { $newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 100); } $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 110); @@ -1633,21 +1633,21 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef // Binding // $newmenu->add("", $langs->trans("Binding"), 0, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch'); - if (!empty($conf->facture->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) { + if (isModEnabled('facture') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) { $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy", $langs->trans("CustomersVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer'); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/', $leftmenu)) { $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write); $newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write); } } - if (!empty($conf->supplier_invoice->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) { + if (isModEnabled('supplier_invoice') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) { $newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy", $langs->trans("SuppliersVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_supplier'); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_supplier/', $leftmenu)) { $newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write); $newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write); } } - if (!empty($conf->expensereport->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) { + if (isModEnabled('expensereport') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) { $newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy", $langs->trans("ExpenseReportsVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_expensereport'); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_expensereport/', $leftmenu)) { $newmenu->add("/accountancy/expensereport/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write); @@ -1656,7 +1656,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef } // Journals - if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { + if (isModEnabled('accounting') && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { $newmenu->add('', $langs->trans("RegistrationInAccounting"), 1, $user->rights->accounting->comptarapport->lire, '', '', ''); // Multi journal @@ -1678,21 +1678,21 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef $nature = ''; // Must match array $sourceList defined into journals_list.php - if ($objp->nature == 2 && !empty($conf->facture->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) { + if ($objp->nature == 2 && isModEnabled('facture') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) { $nature = "sells"; } if ($objp->nature == 3 - && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) + && ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_invoice')) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) { $nature = "purchases"; } - if ($objp->nature == 4 && !empty($conf->banque->enabled)) { + if ($objp->nature == 4 && isModEnabled('banque')) { $nature = "bank"; } - if ($objp->nature == 5 && !empty($conf->expensereport->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) { + if ($objp->nature == 5 && isModEnabled('expensereport') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) { $nature = "expensereports"; } - if ($objp->nature == 1 && !empty($conf->asset->enabled)) { + if ($objp->nature == 1 && isModEnabled('asset')) { $nature = "various"; // Warning: The page /accountancy/journal/variousjournal.php is bugged. It read tables that does not exists. } if ($objp->nature == 8) { @@ -1757,7 +1757,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef } $modecompta = 'CREANCES-DETTES'; - if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { + if (isModEnabled('accounting') && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { $modecompta = 'BOOKKEEPING'; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED } if ($modecompta) { @@ -1771,7 +1771,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef } $modecompta = 'RECETTES-DEPENSES'; - //if (! empty($conf->accounting->enabled) && ! empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') $modecompta=''; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED + //if (isModEnabled('accounting') && ! empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') $modecompta=''; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED if ($modecompta) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 2, $user->rights->accounting->comptarapport->lire); @@ -1783,10 +1783,10 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef } $modecompta = 'CREANCES-DETTES'; - if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { + if (isModEnabled('accounting') && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { $modecompta = 'BOOKKEEPING'; // Not yet implemented. } - if ($modecompta && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))) { + if ($modecompta && ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_invoice'))) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 2, $user->rights->accounting->comptarapport->lire); $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire); @@ -1795,10 +1795,10 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef } $modecompta = 'RECETTES-DEPENSES'; - if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { + if (isModEnabled('accounting') && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { $modecompta = 'BOOKKEEPINGCOLLECTED'; // Not yet implemented. } - if ($modecompta && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))) { + if ($modecompta && ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_invoice'))) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnoverCollected"), 2, $user->rights->accounting->comptarapport->lire); $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire); @@ -1807,7 +1807,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef } // Accountancy (simple) - if (!empty($conf->comptabilite->enabled)) { + if (isModEnabled('comptabilite')) { // Files if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU)) { $newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'files'); @@ -1826,7 +1826,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef /* $newmenu->add("/compta/stats/cumul.php?leftmenu=report","Cumule",2,$user->rights->compta->resultat->lire); - if (! empty($conf->propal->enabled)) { + if (isModEnabled('propal')) { $newmenu->add("/compta/stats/prev.php?leftmenu=report","Previsionnel",2,$user->rights->compta->resultat->lire); $newmenu->add("/compta/stats/comp.php?leftmenu=report","Transforme",2,$user->rights->compta->resultat->lire); } @@ -1865,7 +1865,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef } // Intracomm report - if (!empty($conf->intracommreport->enabled)) { + if (isModEnabled('intracommreport')) { $newmenu->add("/intracommreport/list.php?leftmenu=intracommreport", $langs->trans("MenuIntracommReport"), 0, $user->rights->intracommreport->read, '', $mainmenu, 'intracommreport', 60, '', '', '', img_picto('', 'intracommreport', 'class="paddingright pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || preg_match('/intracommreport/', $leftmenu)) { // DEB / DES @@ -1875,7 +1875,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef } // Assets - if (!empty($conf->asset->enabled)) { + if (isModEnabled('asset')) { $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuAssets"), 0, $user->rights->asset->read, '', $mainmenu, 'asset', 100, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); $newmenu->add("/asset/card.php?leftmenu=asset&action=create", $langs->trans("MenuNewAsset"), 1, $user->rights->asset->write); $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->rights->asset->read); @@ -1907,7 +1907,7 @@ function get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $langs->loadLangs(array("withdrawals", "banks", "bills", "categories")); // Bank-Cash account - if (!empty($conf->banque->enabled)) { + if (isModEnabled('banque')) { $newmenu->add("/compta/bank/list.php?leftmenu=bank&mainmenu=bank", $langs->trans("MenuBankCash"), 0, $user->rights->banque->lire, '', $mainmenu, 'bank', 0, '', '', '', img_picto('', 'bank_account', 'class="paddingright pictofixedwidth"')); $newmenu->add("/compta/bank/card.php?action=create", $langs->trans("MenuNewFinancialAccount"), 1, $user->rights->banque->configurer); @@ -1918,14 +1918,14 @@ function get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $newmenu->add("/compta/bank/transfer.php", $langs->trans("MenuBankInternalTransfer"), 1, $user->rights->banque->transfer); } - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $langs->load("categories"); $newmenu->add("/categories/index.php?type=5", $langs->trans("Rubriques"), 1, $user->rights->categorie->creer, '', $mainmenu, 'tags'); $newmenu->add("/compta/bank/categ.php", $langs->trans("RubriquesTransactions"), 1, $user->rights->banque->configurer, '', $mainmenu, 'tags'); } // Direct debit order - if (!empty($conf->prelevement->enabled)) { + if (isModEnabled('prelevement')) { $newmenu->add("/compta/prelevement/index.php?leftmenu=withdraw&mainmenu=bank", $langs->trans("PaymentByDirectDebit"), 0, $user->rights->prelevement->bons->lire, '', $mainmenu, 'withdraw', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || $leftmenu == "withdraw") { @@ -1939,7 +1939,7 @@ function get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = } // Bank transfer order - if (!empty($conf->paymentbybanktransfer->enabled)) { + if (isModEnabled('paymentbybanktransfer')) { $newmenu->add("/compta/paymentbybanktransfer/index.php?leftmenu=banktransfer&mainmenu=bank", $langs->trans("PaymentByBankTransfer"), 0, $user->rights->paymentbybanktransfer->read, '', $mainmenu, 'banktransfer', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || $leftmenu == "banktransfer") { @@ -1953,7 +1953,7 @@ function get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = } // Management of checks - if (empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && !empty($conf->banque->enabled) && (!empty($conf->facture->enabled) || !empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))) { + if (empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled('banque') && (isModEnabled('facture') || !empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))) { $newmenu->add("/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank", $langs->trans("MenuChequeDeposits"), 0, $user->rights->banque->cheque, '', $mainmenu, 'checks', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); if (preg_match('/checks/', $leftmenu)) { $newmenu->add("/compta/paiement/cheque/card.php?leftmenu=checks_bis&action=new&mainmenu=bank", $langs->trans("NewChequeDeposit"), 1, $user->rights->banque->cheque); @@ -1962,7 +1962,7 @@ function get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = } // Cash Control - if (!empty($conf->takepos->enabled) || !empty($conf->cashdesk->enabled)) { + if (isModEnabled('takepos') || isModEnabled('cashdesk')) { $permtomakecashfence = ($user->hasRight('cashdesk', 'run')|| $user->hasRight('takepos', 'run')); $newmenu->add("/compta/cashcontrol/cashcontrol_list.php?action=list", $langs->trans("POS"), 0, $permtomakecashfence, '', $mainmenu, 'cashcontrol', 0, '', '', '', img_picto('', 'pos', 'class="pictofixedwidth"')); $newmenu->add("/compta/cashcontrol/cashcontrol_card.php?action=create", $langs->trans("NewCashFence"), 1, $permtomakecashfence); @@ -1987,27 +1987,27 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme if ($mainmenu == 'products') { // Products - if (!empty($conf->product->enabled)) { + if (isModEnabled('product')) { $newmenu->add("/product/index.php?leftmenu=product&type=0", $langs->trans("Products"), 0, $user->rights->produit->lire, '', $mainmenu, 'product', 0, '', '', '', img_picto('', 'product', 'class="pictofixedwidth"')); $newmenu->add("/product/card.php?leftmenu=product&action=create&type=0", $langs->trans("NewProduct"), 1, $user->rights->produit->creer); $newmenu->add("/product/list.php?leftmenu=product&type=0", $langs->trans("List"), 1, $user->rights->produit->lire); - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $newmenu->add("/product/reassort.php?type=0", $langs->trans("MenuStocks"), 1, $user->rights->produit->lire && $user->rights->stock->lire); } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $langs->load("stocks"); $newmenu->add("/product/reassortlot.php?type=0", $langs->trans("StocksByLotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); $newmenu->add("/product/stock/productlot_list.php", $langs->trans("LotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); } - if (!empty($conf->variants->enabled)) { + if (isModEnabled('variants')) { $newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->rights->produit->lire); } - if (!empty($conf->propal->enabled) || (!empty($conf->commande->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->facture->enabled) || !empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { - $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->rights->produit->lire && $user->rights->propale->lire); + if (isModEnabled('propal') || (isModEnabled('commande') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('facture') || isModEnabled('fournisseur') || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { + $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->rights->produit->lire); } // Categories - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $langs->load("categories"); $newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); //if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->rights->categorie->lire); @@ -2015,15 +2015,15 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme } // Services - if (!empty($conf->service->enabled)) { + if (isModEnabled('service')) { $newmenu->add("/product/index.php?leftmenu=service&type=1", $langs->trans("Services"), 0, $user->rights->service->lire, '', $mainmenu, 'service', 0, '', '', '', img_picto('', 'service', 'class="pictofixedwidth"')); $newmenu->add("/product/card.php?leftmenu=service&action=create&type=1", $langs->trans("NewService"), 1, $user->rights->service->creer); $newmenu->add("/product/list.php?leftmenu=service&type=1", $langs->trans("List"), 1, $user->rights->service->lire); - if (!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->facture->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_proposal->enabled) || !empty($conf->supplier_oder->enabled) || !empty($conf->supplier_invoice->enabled)) { - $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->rights->service->lire || $user->rights->product->lire); + if (isModEnabled('propal') || isModEnabled('commande') || isModEnabled('facture') || (isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { + $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->rights->service->lire); } // Categories - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $langs->load("categories"); $newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); //if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->rights->categorie->lire); @@ -2057,7 +2057,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme } // Inventory - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $langs->load("stocks"); if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"')); @@ -2075,7 +2075,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme } // Shipments - if (!empty($conf->expedition->enabled)) { + if (isModEnabled('expedition')) { $langs->load("sendings"); $newmenu->add("/expedition/index.php?leftmenu=sendings", $langs->trans("Shipments"), 0, $user->rights->expedition->lire, '', $mainmenu, 'sendings', 0, '', '', '', img_picto('', 'shipment', 'class="pictofixedwidth"')); $newmenu->add("/expedition/card.php?action=create2&leftmenu=sendings", $langs->trans("NewSending"), 1, $user->rights->expedition->creer); @@ -2089,7 +2089,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme } // Receptions - if (!empty($conf->reception->enabled)) { + if (isModEnabled('reception')) { $langs->load("receptions"); $newmenu->add("/reception/index.php?leftmenu=receptions", $langs->trans("Receptions"), 0, $user->rights->reception->lire, '', $mainmenu, 'receptions', 0, '', '', '', img_picto('', 'dollyrevert', 'class="pictofixedwidth"')); $newmenu->add("/reception/card.php?action=create2&leftmenu=receptions", $langs->trans("NewReception"), 1, $user->rights->reception->creer); @@ -2124,7 +2124,7 @@ function get_left_menu_mrp($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = if ($mainmenu == 'mrp') { // BOM - if (!empty($conf->bom->enabled) || !empty($conf->mrp->enabled)) { + if (isModEnabled('bom') || isModEnabled('mrp')) { $langs->load("mrp"); $newmenu->add("", $langs->trans("MenuBOM"), 0, $user->rights->bom->read, '', $mainmenu, 'bom', 0, '', '', '', img_picto('', 'bom', 'class="paddingrightonly pictofixedwidth"')); @@ -2132,7 +2132,7 @@ function get_left_menu_mrp($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->rights->bom->read, '', $mainmenu, 'bom'); } - if (!empty($conf->mrp->enabled)) { + if (isModEnabled('mrp')) { $langs->load("mrp"); $newmenu->add("", $langs->trans("MenuMRP"), 0, $user->rights->mrp->read, '', $mainmenu, 'mo', 0, '', '', '', img_picto('', 'mrp', 'class="paddingrightonly pictofixedwidth"')); @@ -2157,13 +2157,13 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme global $user, $conf, $langs; if ($mainmenu == 'project') { - if (!empty($conf->projet->enabled)) { + if (isModEnabled('projet')) { $langs->load("projects"); $search_project_user = GETPOST('search_project_user', 'int'); $tmpentry = array( - 'enabled'=>(!empty($conf->projet->enabled)), + 'enabled'=>(isModEnabled('projet')), 'perms'=>(!empty($user->rights->projet->lire)), 'module'=>'projet' ); @@ -2198,7 +2198,7 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme $newmenu->add("/projet/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire); // Categories - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $langs->load("categories"); $newmenu->add("/categories/index.php?leftmenu=cat&type=6", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); } @@ -2211,6 +2211,7 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme $newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire); $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->rights->projet->lire, '', 'project', 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="pictofixedwidth"')); + $newmenu->add("/projet/tasks/time.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->rights->projet->lire); } } } @@ -2232,7 +2233,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = if ($mainmenu == 'hrm') { // HRM module - if (!empty($conf->hrm->enabled)) { + if (isModEnabled('hrm')) { $langs->load("hrm"); $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->rights->user->user->lire, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'user', 'class="pictofixedwidth"')); @@ -2264,7 +2265,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = } // Leave/Holiday/Vacation module - if (!empty($conf->holiday->enabled)) { + if (isModEnabled('holiday')) { // Load translation files required by the page $langs->loadLangs(array("holiday", "trips")); @@ -2284,7 +2285,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = } // Trips and expenses (old module) - if (!empty($conf->deplacement->enabled)) { + if (isModEnabled('deplacement')) { $langs->load("trips"); $newmenu->add("/compta/deplacement/index.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->rights->deplacement->lire, '', $mainmenu, 'tripsandexpenses', 0, '', '', '', img_picto('', 'trip', 'class="pictofixedwidth"')); $newmenu->add("/compta/deplacement/card.php?action=create&leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("New"), 1, $user->rights->deplacement->creer); @@ -2293,7 +2294,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = } // Expense report - if (!empty($conf->expensereport->enabled)) { + if (isModEnabled('expensereport')) { $langs->loadLangs(array("trips", "bills")); $newmenu->add("/expensereport/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->rights->expensereport->lire, '', $mainmenu, 'expensereport', 0, '', '', '', img_picto('', 'trip', 'class="pictofixedwidth"')); $newmenu->add("/expensereport/card.php?action=create&leftmenu=expensereport&mainmenu=hrm", $langs->trans("New"), 1, $user->rights->expensereport->creer); @@ -2310,7 +2311,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $newmenu->add("/expensereport/stats/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->rights->expensereport->lire); } - if (!empty($conf->projet->enabled)) { + if (isModEnabled('projet')) { if (empty($conf->global->PROJECT_HIDE_TASKS)) { $langs->load("projects"); @@ -2343,20 +2344,20 @@ function get_left_menu_tools($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu $newmenu->add("/admin/mails_templates.php?leftmenu=email_templates", $langs->trans("EMailTemplates"), 0, 1, '', $mainmenu, 'email_templates', 0, '', '', '', img_picto('', 'email', 'class="paddingright pictofixedwidth"')); } - if (!empty($conf->mailing->enabled)) { + if (isModEnabled('mailing')) { $newmenu->add("/comm/mailing/index.php?leftmenu=mailing", $langs->trans("EMailings"), 0, $user->rights->mailing->lire, '', $mainmenu, 'mailing', 0, '', '', '', img_picto('', 'email', 'class="paddingright pictofixedwidth"')); $newmenu->add("/comm/mailing/card.php?leftmenu=mailing&action=create", $langs->trans("NewMailing"), 1, $user->rights->mailing->creer); $newmenu->add("/comm/mailing/list.php?leftmenu=mailing", $langs->trans("List"), 1, $user->rights->mailing->lire); } - if (!empty($conf->export->enabled)) { + if (isModEnabled('export')) { $langs->load("exports"); $newmenu->add("/exports/index.php?leftmenu=export", $langs->trans("FormatedExport"), 0, $user->rights->export->lire, '', $mainmenu, 'export', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); $newmenu->add("/exports/export.php?leftmenu=export", $langs->trans("NewExport"), 1, $user->rights->export->creer); //$newmenu->add("/exports/export.php?leftmenu=export",$langs->trans("List"),1, $user->rights->export->lire); } - if (!empty($conf->import->enabled)) { + if (isModEnabled('import')) { $langs->load("exports"); $newmenu->add("/imports/index.php?leftmenu=import", $langs->trans("FormatedImport"), 0, $user->rights->import->run, '', $mainmenu, 'import', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); $newmenu->add("/imports/import.php?leftmenu=import", $langs->trans("NewImport"), 1, $user->rights->import->run); @@ -2379,7 +2380,7 @@ function get_left_menu_members($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen global $user, $conf, $langs; if ($mainmenu == 'members') { - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { // Load translation files required by the page $langs->loadLangs(array("members", "compta")); @@ -2399,7 +2400,7 @@ function get_left_menu_members($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen $newmenu->add("/adherents/htpasswd.php?leftmenu=export", $langs->trans("Filehtpasswd"), 1, $user->rights->adherent->export); } - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $langs->load("categories"); $newmenu->add("/categories/index.php?leftmenu=cat&type=3", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); } @@ -2410,7 +2411,7 @@ function get_left_menu_members($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen $newmenu->add("/adherents/stats/index.php?leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->rights->adherent->lire); //$newmenu->add("/adherents/index.php?leftmenu=export&mainmenu=members",$langs->trans("Tools"),0,$user->rights->adherent->export, '', $mainmenu, 'export'); - //if (! empty($conf->export->enabled) && ($usemenuhider || empty($leftmenu) || $leftmenu=="export")) $newmenu->add("/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->rights->adherent->export); + //if (isModEnabled('export') && ($usemenuhider || empty($leftmenu) || $leftmenu=="export")) $newmenu->add("/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->rights->adherent->export); // Type $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members", $langs->trans("MembersTypes"), 0, $user->rights->adherent->configurer, '', $mainmenu, 'setup', 0, '', '', '', img_picto('', 'members', 'class="paddingright pictofixedwidth"')); diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 80ed0b345ba..627a13a7844 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1452,8 +1452,9 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it // Search if cron entry already present $sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."cronjob"; - $sql .= " WHERE module_name = '".$this->db->escape(empty($this->rights_class) ?strtolower($this->name) : $this->rights_class)."'"; - if ($class) { + //$sql .= " WHERE module_name = '".$this->db->escape(empty($this->rights_class) ?strtolower($this->name) : $this->rights_class)."'"; + $sql .= " WHERE label = '".$this->db->escape($label)."'"; + /*if ($class) { $sql .= " AND classesname = '".$this->db->escape($class)."'"; } if ($objectname) { @@ -1467,7 +1468,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it } if ($parameters) { $sql .= " AND params = '".$this->db->escape($parameters)."'"; - } + }*/ $sql .= " AND entity = ".((int) $entity); // Must be exact entity $now = dol_now(); @@ -1516,7 +1517,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $sql .= "'".$this->db->escape($priority)."', "; } if (is_int($status)) { - $sql .= "'".$this->db->escape($status)."', "; + $sql .= ((int) $status).", "; } $sql .= $entity.","; $sql .= "'".$this->db->escape($test)."'"; diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php index 23917c4b79c..43bf3ecd2cb 100644 --- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php +++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php @@ -174,7 +174,13 @@ class doc_generic_bom_odt extends ModelePDFBom $texte .= '
    '; } // Add input to upload a new template file. - $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; + $texte .= '
    '.$langs->trans("UploadNewTemplate"); + $maxfilesizearray = getMaxFileSizeArray(); + $maxmin = $maxfilesizearray['maxmin']; + if ($maxmin > 0) { + $texte .= ''; // MAX_FILE_SIZE must precede the field type=file + } + $texte .= ' '; $texte .= ''; $texte .= ''; $texte .= '
    '; diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 94e0a634328..86e43a9c021 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -181,7 +181,13 @@ class doc_generic_order_odt extends ModelePDFCommandes $texte .= '
    '; } // Add input to upload a new template file. - $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; + $texte .= '
    '.$langs->trans("UploadNewTemplate"); + $maxfilesizearray = getMaxFileSizeArray(); + $maxmin = $maxfilesizearray['maxmin']; + if ($maxmin > 0) { + $texte .= ''; // MAX_FILE_SIZE must precede the field type=file + } + $texte .= ' '; $texte .= ''; $texte .= ''; $texte .= '
    '; diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index bdda6f26862..cb73b6fc282 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -611,6 +611,9 @@ class pdf_einstein extends ModelePDFCommandes if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 212d324acaf..8930481d219 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -27,7 +27,7 @@ /** * \file htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php * \ingroup commande - * \brief File of Class to generate PDF orders with template Eratosthène + * \brief File of Class to generate PDF orders with template Eratosthene */ require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php'; @@ -835,6 +835,9 @@ class pdf_eratosthene extends ModelePDFCommandes if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == $pageposafter) { diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index 23ed4bec34a..9050e1accf5 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -166,7 +166,13 @@ class doc_generic_contract_odt extends ModelePDFContract } // Add input to upload a new template file. - $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; + $texte .= '
    '.$langs->trans("UploadNewTemplate"); + $maxfilesizearray = getMaxFileSizeArray(); + $maxmin = $maxfilesizearray['maxmin']; + if ($maxmin > 0) { + $texte .= ''; // MAX_FILE_SIZE must precede the field type=file + } + $texte .= ' '; $texte .= ''; $texte .= ''; $texte .= '
    '; diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 4dbad109cf4..1875cfb833c 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -437,6 +437,9 @@ class pdf_strato extends ModelePDFContract $pagenb++; $pdf->setPage($pagenb); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index 9c588fdf55e..7d880328663 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -574,6 +574,9 @@ class pdf_storm extends ModelePDFDeliveryOrder if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index a9537b324f1..2e0c3f2d05c 100644 --- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -498,6 +498,9 @@ class pdf_typhon extends ModelePDFDeliveryOrder if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 209acf648d6..f2035c89575 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -180,7 +180,13 @@ class doc_generic_shipment_odt extends ModelePdfExpedition $texte .= '
    '; } // Add input to upload a new template file. - $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; + $texte .= '
    '.$langs->trans("UploadNewTemplate"); + $maxfilesizearray = getMaxFileSizeArray(); + $maxmin = $maxfilesizearray['maxmin']; + if ($maxmin > 0) { + $texte .= ''; // MAX_FILE_SIZE must precede the field type=file + } + $texte .= ' '; $texte .= ''; $texte .= ''; $texte .= '
    '; diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 982a63dade8..3a8defb8db4 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -708,6 +708,9 @@ class pdf_espadon extends ModelePdfExpedition if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index e1da387d1ad..ab9461d104f 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -614,6 +614,9 @@ class pdf_rouget extends ModelePdfExpedition if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/expedition/mod_expedition_ribera.php b/htdocs/core/modules/expedition/mod_expedition_ribera.php index 736ddc3ab3f..aae32f0f459 100644 --- a/htdocs/core/modules/expedition/mod_expedition_ribera.php +++ b/htdocs/core/modules/expedition/mod_expedition_ribera.php @@ -80,7 +80,7 @@ class mod_expedition_ribera extends ModelNumRefExpedition $tooltip .= $langs->trans("GenericMaskCodes5"); $texte .= '
    '.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).' 
    '; @@ -125,9 +125,9 @@ class mod_expedition_ribera extends ModelNumRefExpedition require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $mask = $conf->global->EXPEDITION_RIBERA_MASK; + $mask = getDolGlobalString('EXPEDITION_RIBERA_MASK'); - if (!$mask) { + if (empty($mask)) { $this->error = 'NotConfigured'; return 0; } diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 907688b4878..43c1ae9e4de 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -152,7 +152,7 @@ class pdf_standard extends ModeleExpenseReport $this->posxqty = 150; $this->postotalht = 160; $this->postotalttc = 180; - // if (empty($conf->projet->enabled)) { + // if (empty($conf->project->enabled)) { // $this->posxtva-=20; // $this->posxup-=20; // $this->posxqty-=20; @@ -450,6 +450,9 @@ class pdf_standard extends ModeleExpenseReport if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { @@ -581,7 +584,7 @@ class pdf_standard extends ModeleExpenseReport if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) { $nextColumnPosX = $this->posxtva; } - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $nextColumnPosX = $this->posxprojet; } @@ -597,7 +600,7 @@ class pdf_standard extends ModeleExpenseReport //$pdf->MultiCell($nextColumnPosX-$this->posxtype-0.8, 4, $expensereporttypecodetoshow, 0, 'C'); // Project - //if (! empty($conf->projet->enabled)) + //if (! empty($conf->project->enabled)) //{ // $pdf->SetFont('','', $default_font_size - 1); // $pdf->SetXY($this->posxprojet, $curY); @@ -955,7 +958,7 @@ class pdf_standard extends ModeleExpenseReport // $pdf->MultiCell($this->posxprojet-$this->posxtype - 1, 2, $outputlangs->transnoentities("Type"), '', 'C'); //} - //if (!empty($conf->projet->enabled)) + //if (!empty($conf->project->enabled)) //{ // // Project // $pdf->line($this->posxprojet - 1, $tab_top, $this->posxprojet - 1, $tab_top + $tab_height); diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 07a1e3966a6..fc73460bd1b 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -179,7 +179,13 @@ class doc_generic_invoice_odt extends ModelePDFFactures $texte .= ''; } // Add input to upload a new template file. - $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; + $texte .= '
    '.$langs->trans("UploadNewTemplate"); + $maxfilesizearray = getMaxFileSizeArray(); + $maxmin = $maxfilesizearray['maxmin']; + if ($maxmin > 0) { + $texte .= ''; // MAX_FILE_SIZE must precede the field type=file + } + $texte .= ' '; $texte .= ''; $texte .= ''; $texte .= '
    '; diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 1bb5400acc7..63e9d61c409 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -452,8 +452,13 @@ class pdf_crabe extends ModelePDFFactures // You can add more thing under header here, if you increase $extra_under_address_shift too. $extra_under_address_shift = 0; + $qrcodestring = ''; if (! empty($conf->global->INVOICE_ADD_ZATCA_QR_CODE)) { $qrcodestring = $object->buildZATCAQRString(); + } elseif (! empty($conf->global->INVOICE_ADD_SWISS_QR_CODE)) { + $qrcodestring = $object->buildSwitzerlandQRString(); + } + if ($qrcodestring) { $qrcodecolor = array('25', '25', '25'); // set style for QR-code $styleQr = array( @@ -795,6 +800,9 @@ class pdf_crabe extends ModelePDFFactures if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index bc4dad25f91..46ac4ffde37 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -435,8 +435,13 @@ class pdf_sponge extends ModelePDFFactures // You can add more thing under header here, if you increase $extra_under_address_shift too. $extra_under_address_shift = 0; + $qrcodestring = ''; if (! empty($conf->global->INVOICE_ADD_ZATCA_QR_CODE)) { $qrcodestring = $object->buildZATCAQRString(); + } elseif (! empty($conf->global->INVOICE_ADD_SWISS_QR_CODE)) { + $qrcodestring = $object->buildSwitzerlandQRString(); + } + if ($qrcodestring) { $qrcodecolor = array('25', '25', '25'); // set style for QR-code $styleQr = array( @@ -929,6 +934,9 @@ class pdf_sponge extends ModelePDFFactures if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 8c07dbb64f3..bb4a6826278 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -418,6 +418,9 @@ class pdf_soleil extends ModelePDFFicheinter if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 8c3e5bfeab9..32284a2cbd1 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -470,9 +470,9 @@ class ImportCsv extends ModeleImports $newval = $classinstance->id; } else { if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) { - $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict'])); + $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', num2Alpha($key - 1), $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict'])); } elseif (!empty($objimport->array_import_convertvalue[0][$val]['element'])) { - $this->errors[$error]['lib'] = $langs->trans('ErrorFieldRefNotIn', $key, $newval, $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['element'])); + $this->errors[$error]['lib'] = $langs->trans('ErrorFieldRefNotIn', num2Alpha($key - 1), $newval, $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['element'])); } else { $this->errors[$error]['lib'] = 'ErrorBadDefinitionOfImportProfile'; } @@ -512,7 +512,7 @@ class ImportCsv extends ModeleImports $newval = $classinstance->id; } else { if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) { - $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, $newval, 'scale', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict'])); + $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', num2Alpha($key - 1), $newval, 'scale', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict'])); } else { $this->errors[$error]['lib'] = 'ErrorFieldValueNotIn'; } @@ -549,7 +549,7 @@ class ImportCsv extends ModeleImports $newval = $scaleorid ? $scaleorid : 0; } else { if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) { - $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, $newval, 'scale', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict'])); + $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', num2Alpha($key - 1), $newval, 'scale', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict'])); } else { $this->errors[$error]['lib'] = 'ErrorFieldValueNotIn'; } @@ -697,7 +697,7 @@ class ImportCsv extends ModeleImports if (!empty($filter)) { $tableforerror .= ':'.$filter; } - $this->errors[$error]['lib'] = $langs->transnoentitiesnoconv('ErrorFieldValueNotIn', $key, $newval, $field, $tableforerror); + $this->errors[$error]['lib'] = $langs->transnoentitiesnoconv('ErrorFieldValueNotIn', num2Alpha($key - 1), $newval, $field, $tableforerror); $this->errors[$error]['type'] = 'FOREIGNKEY'; $errorforthistable++; $error++; @@ -705,13 +705,22 @@ class ImportCsv extends ModeleImports } elseif (!preg_match('/'.$objimport->array_import_regex[0][$val].'/i', $newval)) { // If test is just a static regex //if ($key == 19) print "xxx".$newval."zzz".$objimport->array_import_regex[0][$val]."
    "; - $this->errors[$error]['lib'] = $langs->transnoentitiesnoconv('ErrorWrongValueForField', $key, $newval, $objimport->array_import_regex[0][$val]); + $this->errors[$error]['lib'] = $langs->transnoentitiesnoconv('ErrorWrongValueForField', num2Alpha($key - 1), $newval, $objimport->array_import_regex[0][$val]); $this->errors[$error]['type'] = 'REGEX'; $errorforthistable++; $error++; } } + // Check HTML injection + $inj = testSqlAndScriptInject($newval, 0); + if ($inj) { + $this->errors[$error]['lib'] = $langs->transnoentitiesnoconv('ErrorHtmlInjectionForField', num2Alpha($key - 1), dol_trunc($newval, 100)); + $this->errors[$error]['type'] = 'HTMLINJECTION'; + $errorforthistable++; + $error++; + } + // Other tests // ... } diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 4740f7d3390..d8a9d77a98e 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -756,6 +756,15 @@ class ImportXlsx extends ModeleImports } } + // Check HTML injection + $inj = testSqlAndScriptInject($newval, 0); + if ($inj) { + $this->errors[$error]['lib'] = $langs->transnoentitiesnoconv('ErrorHtmlInjectionForField', $key, dol_trunc($newval, 100)); + $this->errors[$error]['type'] = 'HTMLINJECTION'; + $errorforthistable++; + $error++; + } + // Other tests // ... } diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index e3e349d2a17..decbc81716b 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -310,7 +310,7 @@ class mailing_contacts1 extends MailingTargets // Choose language require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; $formadmin = new FormAdmin($this->db); - $s .= $langs->trans("DefaultLang").': '; + $s .= ''.$langs->trans("DefaultLang").': '; $s .= $formadmin->select_language($langs->getDefaultLang(1), 'filter_lang', 0, 0, 1, 0, 0, '', 0, 0, 0, null, 1); return $s; diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 073d45439eb..89bc2cf2b5e 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -117,6 +117,10 @@ class mailing_thirdparties extends MailingTargets $addFilter .= " AND s.default_lang LIKE '".$this->db->escape(GETPOST('default_lang', 'alpha'))."%'"; $addDescription = $langs->trans('DefaultLang')."="; } + if (GETPOST('filter_lang_thirdparties', 'alpha')) { + $addFilter .= " AND s.default_lang LIKE '".$this->db->escape(GETPOST('filter_lang_thirdparties', 'alpha'))."%'"; + $addDescription = $langs->trans('DefaultLang')."="; + } $sql = "SELECT s.rowid as id, s.email as email, s.nom as name, null as fk_contact, null as firstname, c.label as label"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."categorie_societe as cs, ".MAIN_DB_PREFIX."categorie as c"; @@ -315,8 +319,8 @@ class mailing_thirdparties extends MailingTargets // Choose language require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; $formadmin = new FormAdmin($this->db); - $s .= $langs->trans("DefaultLang").': '; - $s .= $formadmin->select_language($langs->getDefaultLang(1), 'filter_lang', 0, 0, 1, 0, 0, '', 0, 0, 0, null, 1); + $s .= ''.$langs->trans("DefaultLang").': '; + $s .= $formadmin->select_language($langs->getDefaultLang(1), 'filter_lang_thirdparties', 0, null, 1, 0, 0, '', 0, 0, 0, null, 1); return $s; } diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php index 77044ddb29e..d698a646371 100644 --- a/htdocs/core/modules/mailings/xinputfile.modules.php +++ b/htdocs/core/modules/mailings/xinputfile.modules.php @@ -110,6 +110,11 @@ class mailing_xinputfile extends MailingTargets global $langs; $s = ''; + $maxfilesizearray = getMaxFileSizeArray(); + $maxmin = $maxfilesizearray['maxmin']; + if ($maxmin > 0) { + $s .= ''; // MAX_FILE_SIZE must precede the field type=file + } $s .= ''; return $s; } @@ -151,10 +156,12 @@ class mailing_xinputfile extends MailingTargets $cpt++; $buffer = trim(fgets($handle)); $tab = explode(';', $buffer, 4); - $email = $tab[0]; - $name = $tab[1]; - $firstname = $tab[2]; - $other = $tab[3]; + + $email = dol_string_nohtmltag($tab[0]); + $name = dol_string_nohtmltag(empty($tab[1]) ? '' : $tab[1]); + $firstname = dol_string_nohtmltag(empty($tab[2]) ? '' : $tab[2]); + $other = dol_string_nohtmltag(empty($tab[3]) ? '' : $tab[3]); + if (!empty($buffer)) { //print 'xx'.dol_strlen($buffer).empty($buffer)."
    \n"; if (isValidEMail($email)) { diff --git a/htdocs/core/modules/mailings/xinputuser.modules.php b/htdocs/core/modules/mailings/xinputuser.modules.php index 117a5722c3c..74ed18ba91f 100644 --- a/htdocs/core/modules/mailings/xinputuser.modules.php +++ b/htdocs/core/modules/mailings/xinputuser.modules.php @@ -127,10 +127,11 @@ class mailing_xinputuser extends MailingTargets require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $tmparray = explode(';', GETPOST('xinputuser')); + $email = $tmparray[0]; - $lastname = $tmparray[1]; - $firstname = $tmparray[2]; - $other = $tmparray[3]; + $lastname = empty($tmparray[1]) ? '' : $tmparray[1]; + $firstname = empty($tmparray[2]) ? '' : $tmparray[2]; + $other = empty($tmparray[3]) ? '' : $tmparray[3]; $cibles = array(); if (!empty($email)) { diff --git a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php index fb084f312fe..0b64203798f 100644 --- a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php +++ b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php @@ -169,7 +169,13 @@ class doc_generic_member_odt extends ModelePDFMember $texte .= '
    '; } // Add input to upload a new template file. - $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; + $texte .= '
    '.$langs->trans("UploadNewTemplate"); + $maxfilesizearray = getMaxFileSizeArray(); + $maxmin = $maxfilesizearray['maxmin']; + if ($maxmin > 0) { + $texte .= ''; // MAX_FILE_SIZE must precede the field type=file + } + $texte .= ' '; $texte .= ''; $texte .= ''; $texte .= '
    '; diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index 0d4a85e00ae..215e7dd3c64 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -286,8 +286,8 @@ class modAdherent extends DolibarrModules $this->export_label[$r] = 'MembersAndSubscriptions'; $this->export_permission[$r] = array(array("adherent", "export")); $this->export_fields_array[$r] = array( - 'a.rowid'=>'Id', 'a.civility'=>"UserTitle", 'a.lastname'=>"Lastname", 'a.firstname'=>"Firstname", 'a.login'=>"Login", 'a.gender'=>"Gender", 'a.morphy'=>'MemberNature', - 'a.societe'=>'Company', 'a.address'=>"Address", 'a.zip'=>"Zip", 'a.town'=>"Town", 'd.nom'=>"State", 'co.code'=>"CountryCode", 'co.label'=>"Country", + 'a.rowid'=>'MemberId', 'a.ref'=>'MemberRef', 'a.civility'=>"UserTitle", 'a.lastname'=>"Lastname", 'a.firstname'=>"Firstname", 'a.login'=>"Login", 'a.gender'=>"Gender", 'a.morphy'=>'MemberNature', + 'a.societe'=>'Company', 'a.address'=>"Address", 'a.zip'=>"Zip", 'a.town'=>"Town", 'd.code_departement'=>'StateCode', 'd.nom'=>"State", 'co.code'=>"CountryCode", 'co.label'=>"Country", 'a.phone'=>"PhonePro", 'a.phone_perso'=>"PhonePerso", 'a.phone_mobile'=>"PhoneMobile", 'a.email'=>"Email", 'a.birth'=>"Birthday", 'a.statut'=>"Status", 'a.photo'=>"Photo", 'a.note_public'=>"NotePublic", 'a.note_private'=>"NotePrivate", 'a.datec'=>'DateCreation', 'a.datevalid'=>'DateValidation', 'a.tms'=>'DateLastModification', 'a.datefin'=>'DateEndSubscription', 'ta.rowid'=>'MemberTypeId', 'ta.libelle'=>'MemberTypeLabel', @@ -301,7 +301,7 @@ class modAdherent extends DolibarrModules 'c.rowid'=>'Numeric', 'c.dateadh'=>'Date', 'c.datef'=>'Date', 'c.subscription'=>'Numeric' ); $this->export_entities_array[$r] = array( - 'a.rowid'=>'member', 'a.civility'=>"member", 'a.lastname'=>"member", 'a.firstname'=>"member", 'a.login'=>"member", 'a.gender'=>'member', 'a.morphy'=>'member', + 'a.rowid'=>'member', 'a.ref'=>'member', 'a.civility'=>"member", 'a.lastname'=>"member", 'a.firstname'=>"member", 'a.login'=>"member", 'a.gender'=>'member', 'a.morphy'=>'member', 'a.societe'=>'member', 'a.address'=>"member", 'a.zip'=>"member", 'a.town'=>"member", 'd.nom'=>"member", 'co.code'=>"member", 'co.label'=>"member", 'a.phone'=>"member", 'a.phone_perso'=>"member", 'a.phone_mobile'=>"member", 'a.email'=>"member", 'a.birth'=>"member", 'a.statut'=>"member", 'a.photo'=>"member", 'a.note_public'=>"member", 'a.note_private'=>"member", 'a.datec'=>'member', 'a.datevalid'=>'member', 'a.tms'=>'member', @@ -338,10 +338,10 @@ class modAdherent extends DolibarrModules $this->import_tables_array[$r] = array('a'=>MAIN_DB_PREFIX.'adherent', 'extra'=>MAIN_DB_PREFIX.'adherent_extrafields'); $this->import_tables_creator_array[$r] = array('a'=>'fk_user_author'); // Fields to store import user id $this->import_fields_array[$r] = array( - 'a.ref' => 'Member Ref*', + 'a.ref' => 'MemberRef*', 'a.civility'=>"UserTitle", 'a.lastname'=>"Lastname*", 'a.firstname'=>"Firstname", 'a.gender'=>"Gender", 'a.login'=>"Login*", "a.pass"=>"Password", - "a.fk_adherent_type"=>"MemberType*", 'a.morphy'=>'MemberNature*', 'a.societe'=>'Company', 'a.address'=>"Address", 'a.zip'=>"Zip", 'a.town'=>"Town", - 'a.state_id'=>'StateId', 'a.country'=>"CountryId", 'a.phone'=>"PhonePro", 'a.phone_perso'=>"PhonePerso", 'a.phone_mobile'=>"PhoneMobile", + "a.fk_adherent_type"=>"MemberTypeId*", 'a.morphy'=>'MemberNature*', 'a.societe'=>'Company', 'a.address'=>"Address", 'a.zip'=>"Zip", 'a.town'=>"Town", + 'a.state_id'=>'StateId|StateCode', 'a.country'=>"CountryId|CountryCode", 'a.phone'=>"PhonePro", 'a.phone_perso'=>"PhonePerso", 'a.phone_mobile'=>"PhoneMobile", 'a.email'=>"Email", 'a.birth'=>"Birthday", 'a.statut'=>"Status*", 'a.photo'=>"Photo", 'a.note_public'=>"NotePublic", 'a.note_private'=>"NotePrivate", 'a.datec'=>'DateCreation', 'a.datefin'=>'DateEndSubscription' ); @@ -397,7 +397,7 @@ class modAdherent extends DolibarrModules if (!empty($conf->societe->enabled)) { $this->import_examplevalues_array[$r]['a.fk_soc'] = "rowid or name"; } - $this->import_updatekeys_array[$r] = array('a.ref'=>'Member Ref', 'a.login'=>'Login'); + $this->import_updatekeys_array[$r] = array('a.ref'=>'MemberRef', 'a.login'=>'Login'); // Cronjobs $arraydate = dol_getdate(dol_now()); diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index 9e138c6ccef..57ac7a637dc 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -145,7 +145,7 @@ class modCategorie extends DolibarrModules if (!empty($conf->bank->enabled)) { $typeexample .= ($typeexample ? " / " : "")."5=Bank account"; } - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $typeexample .= ($typeexample ? " / " : "")."6=Project"; } if (!empty($conf->user->enabled)) { @@ -157,7 +157,7 @@ class modCategorie extends DolibarrModules if (!empty($conf->stock->enabled)) { $typeexample .= ($typeexample ? " / " : "")."9=Warehouse"; } - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { $typeexample .= ($typeexample ? " / " : "")."10=Agenda event"; } if (!empty($conf->website->enabled)) { @@ -379,7 +379,7 @@ class modCategorie extends DolibarrModules $this->export_code[$r] = $this->rights_class.'_6_'.Categorie::$MAP_ID_TO_CODE[6]; $this->export_label[$r] = 'CatProjectsList'; $this->export_icon[$r] = $this->picto; - $this->export_enabled[$r] = '!empty($conf->projet->enabled)'; + $this->export_enabled[$r] = '!empty($conf->project->enabled)'; $this->export_permission[$r] = array(array("categorie", "lire"), array("projet", "export")); $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'p.rowid'=>'ProjectId', 'p.ref'=>'Ref', 's.rowid'=>"IdThirdParty", 's.nom'=>"Name"); $this->export_TypeFields_array[$r] = array('cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'List:categorie:label:rowid', 'p.ref'=>'Text', 's.rowid'=>"Numeric", 's.nom'=>"Text"); @@ -568,7 +568,7 @@ class modCategorie extends DolibarrModules // 5 Bank accounts, TODO ? // 6 Projects - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $r++; $this->import_code[$r] = $this->rights_class.'_6_'.Categorie::$MAP_ID_TO_CODE[6]; $this->import_label[$r] = "CatProjectsLinks"; // Translation key diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index 80e5468b140..e75147ba78a 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -370,7 +370,7 @@ class modCommande extends DolibarrModules ), ); - //Import CPV Lines + //Import Order Lines $r++; $this->import_code[$r] = 'commande_lines_'.$r; $this->import_label[$r] = 'SaleOrderLines'; diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 817fa1b53cf..2cdc8229e51 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -134,7 +134,7 @@ class modFacture extends DolibarrModules 'objectname'=>'Facture', 'method'=>'sendEmailsRemindersOnInvoiceDueDate', 'parameters'=>"10,all,EmailTemplateCode", - 'comment'=>'Send an emails when the unpaid invoices reach a due date + n days = today. First param is the offset n of days, second parameter is "all" or a payment mode code, last parameter is the code of email template to use (an email template with EmailTemplateCode must exists. the version in the language of the thirdparty will be used in priority).', + 'comment'=>'Send an emails when the unpaid invoices reach a due date + n days = today. First param is the offset n of days, second parameter is "all" or a payment mode code, last parameter is the code of email template to use (an email template with EmailTemplateCode must exists. The version in the language of the thirdparty will be used in priority to update the PDF of the sent invoice).', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, @@ -224,6 +224,274 @@ class modFacture extends DolibarrModules $this->menu = 1; // This module add menu entries. They are coded into menu manager. + // Imports + //-------- + $r = 1; + + $r++; + $this->import_code[$r] = $this->rights_class.'_'.$r; + $this->import_label[$r] = "Invoices"; // Translation key + $this->import_icon[$r] = $this->picto; + $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon + $this->import_tables_array[$r] = array('f' => MAIN_DB_PREFIX.'facture', 'extra' => MAIN_DB_PREFIX.'facture_extrafields'); + $this->import_tables_creator_array[$r] = array('f' => 'fk_user_author'); // Fields to store import user id + $this->import_fields_array[$r] = array( + 'f.ref' => 'InvoiceRef*', + 'f.ref_ext' => 'ExternalRef', + 'f.ref_int' => 'ExternalRef', + 'f.ref_client' => 'CutomerRef', + 'f.type' => 'Type*', + 'f.fk_soc' => 'Customer*', + 'f.datec' => 'InvoiceDateCreation', + 'f.datef' => 'DateInvoice', + 'f.date_valid' => 'Validation Date', + 'f.paye' => 'InvoicePaid', + 'f.remise_percent' => 'RemisePercent', + 'f.remise_absolue' => 'RemiseAbsolue', + 'f.remise' => 'Remise', + 'f.total_tva' => 'TotalVAT', + 'f.total_ht' => 'TotalHT', + 'f.total_ttc' => 'TotalTTC', + 'f.fk_statut' => 'InvoiceStatus', + 'f.fk_user_modif' => 'Modifier Id', + 'f.fk_user_valid' => 'Validator Id', + 'f.fk_user_closing' => 'Closer Id', + 'f.fk_facture_source' => 'Invoice Source Id', + 'f.fk_projet' => 'Project Id', + 'f.fk_account' => 'Bank Account', + 'f.fk_currency' => 'Currency*', + 'f.fk_cond_reglement' => 'Payment Condition', + 'f.fk_mode_reglement' => 'Payment Mode', + 'f.date_lim_reglement' => 'DateMaxPayment', + 'f.note_public' => 'InvoiceNote', + 'f.note_private' => 'NotePrivate', + 'f.model_pdf' => 'Model' + ); + if (!empty($conf->multicurrency->enabled)) { + $this->import_fields_array[$r]['f.multicurrency_code'] = 'Currency'; + $this->import_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate'; + $this->import_fields_array[$r]['f.multicurrency_total_ht'] = 'MulticurrencyAmountHT'; + $this->import_fields_array[$r]['f.multicurrency_total_tva'] = 'MulticurrencyAmountVAT'; + $this->import_fields_array[$r]['f.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC'; + } + // Add extra fields + $import_extrafield_sample = array(); + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture' AND entity IN (0, ".$conf->entity.")"; + $resql = $this->db->query($sql); + if ($resql) { + while ($obj = $this->db->fetch_object($resql)) { + $fieldname = 'extra.'.$obj->name; + $fieldlabel = ucfirst($obj->label); + $this->import_fields_array[$r][$fieldname] = $fieldlabel.($obj->fieldrequired ? '*' : ''); + $import_extrafield_sample[$fieldname] = $fieldlabel; + } + } + // End add extra fields + $this->import_fieldshidden_array[$r] = array('extra.fk_object' => 'lastrowid-'.MAIN_DB_PREFIX.'facture'); + $this->import_regex_array[$r] = array('f.multicurrency_code' => 'code@'.MAIN_DB_PREFIX.'multicurrency'); + $import_sample = array( + 'f.ref' => '(PROV0001)', + 'f.ref_ext' => '', + 'f.ref_int' => '', + 'f.ref_client' => '', + 'f.type' => '0', + 'f.fk_soc' => '80LIMIT', + 'f.datec' => '2021-11-24', + 'f.datef' => '2021-11-24', + 'f.date_valid' => '2021-11-24', + 'f.paye' => '1', + 'f.remise_percent' => '0', + 'f.remise_absolue' => '0', + 'f.remise' => '0', + 'f.total_tva' => '21', + 'f.total_ht' => '100', + 'f.total_ttc' => '121', + 'f.fk_statut' => '1', + 'f.fk_user_modif' => '', + 'f.fk_user_valid' => '', + 'f.fk_user_closing' => '', + 'f.fk_facture_source' => '', + 'f.fk_projet' => '', + 'f.fk_account' => '', + 'f.fk_currency' => 'EUR', + 'f.fk_cond_reglement' => '30D', + 'f.fk_mode_reglement' => 'VIR', + 'f.date_lim_reglement' => '2021-12-24', + 'f.note_public' => '', + 'f.note_private' => '', + 'f.model_pdf' => 'crabe', + 'f.multicurrency_code' => 'EUR', + 'f.multicurrency_tx' => '1', + 'f.multicurrency_total_ht' => '100', + 'f.multicurrency_total_tva' => '21', + 'f.multicurrency_total_ttc' => '121' + ); + $this->import_examplevalues_array[$r] = array_merge($import_sample, $import_extrafield_sample); + $this->import_updatekeys_array[$r] = array('f.ref' => 'Ref'); + $this->import_convertvalue_array[$r] = array( + 'f.fk_soc' => array( + 'rule' => 'fetchidfromref', + 'file' => '/societe/class/societe.class.php', + 'class' => 'Societe', + 'method' => 'fetch', + 'element' => 'ThirdParty' + ), + 'f.fk_projet' => array( + 'rule' => 'fetchidfromref', + 'file' => '/projet/class/project.class.php', + 'class' => 'Project', + 'method' => 'fetch', + 'element' => 'facture' + ), + 'f.fk_cond_reglement' => array( + 'rule' => 'fetchidfromcodeorlabel', + 'file' => '/compta/facture/class/paymentterm.class.php', + 'class' => 'PaymentTerm', + 'method' => 'fetch', + 'element' => 'c_payment_term' + ) + ); + + //Import Supplier Invoice Lines + $r++; + $this->import_code[$r] = $this->rights_class.'_'.$r; + $this->import_label[$r] = "InvoiceLine"; // Translation key + $this->import_icon[$r] = $this->picto; + $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon + $this->import_tables_array[$r] = array('fd' => MAIN_DB_PREFIX.'facturedet', 'extra' => MAIN_DB_PREFIX.'facturedet_extrafields'); + $this->import_fields_array[$r] = array( + 'fd.fk_facture' => 'InvoiceRef*', + 'fd.fk_parent_line' => 'FacParentLine', + 'fd.fk_product' => 'IdProduct', + 'fd.label' => 'Label', + 'fd.description' => 'LineDescription*', + 'fd.vat_src_code' => 'Vat Source Code', + 'fd.tva_tx' => 'LineVATRate*', + // localtax1_tx + // localtax1_type + // localtax2_tx + // localtax2_type + 'fd.qty' => 'LineQty', + 'fd.remise_percent' => 'Reduc. (%)', + // remise + // fk_remise_except + // subprice + // price + 'fd.total_ht' => 'LineTotalHT', + 'fd.total_tva' => 'LineTotalVAT', + // total_localtax1 + // total_localtax2 + 'fd.total_ttc' => 'LineTotalTTC', + 'fd.product_type' => 'TypeOfLineServiceOrProduct', + 'fd.date_start' => 'Start Date', + 'fd.date_end' => 'End Date', + // info_bits + // buy_price_ht + // fk_product_fournisseur_price + // specia_code + // rang + // fk_contract_line + 'fd.fk_unit' => 'Unit', + // fk_code_ventilation + // situation_percent + // fk_prev_id + // fk_user_author + // fk_user_modif + // ref_ext + ); + if (!empty($conf->multicurrency->enabled)) { + $this->import_fields_array[$r]['fd.multicurrency_code'] = 'Currency'; + $this->import_fields_array[$r]['fd.multicurrency_subprice'] = 'CurrencyRate'; + $this->import_fields_array[$r]['fd.multicurrency_total_ht'] = 'MulticurrencyAmountHT'; + $this->import_fields_array[$r]['fd.multicurrency_total_tva'] = 'MulticurrencyAmountVAT'; + $this->import_fields_array[$r]['fd.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC'; + } + // Add extra fields + $import_extrafield_sample = array(); + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_det' AND entity IN (0, ".$conf->entity.")"; + $resql = $this->db->query($sql); + if ($resql) { + while ($obj = $this->db->fetch_object($resql)) { + $fieldname = 'extra.'.$obj->name; + $fieldlabel = ucfirst($obj->label); + $this->import_fields_array[$r][$fieldname] = $fieldlabel.($obj->fieldrequired ? '*' : ''); + $import_extrafield_sample[$fieldname] = $fieldlabel; + } + } + // End add extra fields + $this->import_fieldshidden_array[$r] = array('extra.fk_object' => 'lastrowid-'.MAIN_DB_PREFIX.'facturedet'); + $this->import_regex_array[$r] = array( + 'fd.fk_product' => 'rowid@'.MAIN_DB_PREFIX.'product', + 'fd.multicurrency_code' => 'code@'.MAIN_DB_PREFIX.'multicurrency' + ); + $import_sample = array( + 'fd.fk_facture' => '(PROV00001)', + 'fd.fk_parent_line' => '', + 'fd.fk_product' => '', + 'fd.label' => '', + 'fd.description' => 'Test product', + 'fd.vat_src_code' => '', + 'fd.tva_tx' => '21', + // localtax1_tx + // localtax1_type + // localtax2_tx + // localtax2_type + 'fd.qty' => '1', + 'fd.remise_percent' => '0', + // remise + // fk_remise_except + // subprice + // price + 'fd.total_ht' => '100', + 'fd.total_tva' => '21', + // total_localtax1 + // total_localtax2 + 'fd.total_ttc' => '121', + 'fd.product_type' => '0', + 'fd.date_start' => '', + 'fd.date_end' => '', + // info_bits + // buy_price_ht + // fk_product_fournisseur_price + // specia_code + // rang + // fk_contract_line + 'fd.fk_unit' => '', + // fk_code_ventilation + // situation_percent + // fk_prev_id + // fk_user_author + // fk_user_modif + // ref_ext + 'fd.multicurrency_code' => 'EUR', + 'fd.multicurrency_tx' => '21', + 'fd.multicurrency_total_ht' => '100', + 'fd.multicurrency_total_tva' => '21', + 'fd.multicurrency_total_ttc' => '121' + ); + $this->import_examplevalues_array[$r] = array_merge($import_sample, $import_extrafield_sample); + $this->import_updatekeys_array[$r] = array( + 'fd.rowid' => 'Row Id', + 'fd.fk_facture' => 'Invoice Id' + ); + $this->import_convertvalue_array[$r] = array( + 'fd.fk_facture' => array( + 'rule' => 'fetchidfromref', + 'file' => '/compta/facture/class/facture.class.php', + 'class' => 'Facture', + 'method' => 'fetch', + 'element' => 'facture' + ), + 'fd.fk_projet' => array( + 'rule' => 'fetchidfromref', + 'file' => '/projet/class/project.class.php', + 'class' => 'Project', + 'method' => 'fetch', + 'element' => 'facture' + ), + ); + + // Exports //-------- $r = 1; diff --git a/htdocs/core/modules/modMultiCurrency.class.php b/htdocs/core/modules/modMultiCurrency.class.php index 73c58100ea5..28f2f7cdd16 100644 --- a/htdocs/core/modules/modMultiCurrency.class.php +++ b/htdocs/core/modules/modMultiCurrency.class.php @@ -286,7 +286,7 @@ class modMultiCurrency extends DolibarrModules $multicurrency = new MultiCurrency($this->db); - if (!$multicurrency->checkCodeAlreadyExists($conf->currency)) { + if (! $multicurrency->checkCodeAlreadyExists($conf->currency)) { $langs->loadCacheCurrencies(''); $multicurrency->code = $conf->currency; diff --git a/htdocs/core/modules/modWebhook.class.php b/htdocs/core/modules/modWebhook.class.php new file mode 100644 index 00000000000..fbcb5f81003 --- /dev/null +++ b/htdocs/core/modules/modWebhook.class.php @@ -0,0 +1,542 @@ + + * Copyright (C) 2018-2019 Nicolas ZABOURI + * Copyright (C) 2019-2020 Frédéric France + * Copyright (C) 2022 SuperAdmin + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \defgroup webhook Module Webhook + * \brief Webhook module descriptor. + * + * \file htdocs/webhook/core/modules/modWebhook.class.php + * \ingroup webhook + * \brief Description and activation file for module Webhook + */ +include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; + +/** + * Description and activation class for module Webhook + */ +class modWebhook extends DolibarrModules +{ + /** + * Constructor. Define names, constants, directories, boxes, permissions + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + global $langs, $conf; + $this->db = $db; + + // Id for module (must be unique). + // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). + $this->numero = 68305; // TODO Go on page https://wiki.dolibarr.org/index.php/List_of_modules_id to reserve an id number for your module + + // Key text used to identify module (for permissions, menus, etc...) + $this->rights_class = 'webhook'; + + // Family can be 'base' (core modules),'crm','financial','hr','projects','products','ecm','technic' (transverse modules),'interface' (link with external tools),'other','...' + // It is used to group modules by family in module setup page + $this->family = "interface"; + + // Module position in the family on 2 digits ('01', '10', '20', ...) + $this->module_position = '90'; + + // Gives the possibility for the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this) + //$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily"))); + // Module label (no space allowed), used if translation string 'ModuleWebhookName' not found (Webhook is name of module). + $this->name = preg_replace('/^mod/i', '', get_class($this)); + + // Module description, used if translation string 'ModuleWebhookDesc' not found (Webhook is name of module). + $this->description = "WebhookDescription"; + // Used only if file README.md and README-LL.md not found. + $this->descriptionlong = "WebhookDescription"; + + // Author + $this->editor_name = 'Editor name'; + $this->editor_url = 'https://www.example.com'; + + // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' + $this->version = 'development'; + // Url to the file with your last numberversion of this module + //$this->url_last_version = 'http://www.example.com/versionmodule.txt'; + + // Key used in llx_const table to save module status enabled/disabled (where WEBHOOK is value of property name of module in uppercase) + $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); + + // Name of image file used for this module. + // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue' + // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module' + // To use a supported fa-xxx css style of font awesome, use this->picto='xxx' + $this->picto = 'webhook'; + + // Define some features supported by module (triggers, login, substitutions, menus, css, etc...) + $this->module_parts = array( + // Set this to 1 if module has its own trigger directory (core/triggers) + 'triggers' => 1, + // Set this to 1 if module has its own login method file (core/login) + 'login' => 0, + // Set this to 1 if module has its own substitution function file (core/substitutions) + 'substitutions' => 0, + // Set this to 1 if module has its own menus handler directory (core/menus) + 'menus' => 0, + // Set this to 1 if module overwrite template dir (core/tpl) + 'tpl' => 0, + // Set this to 1 if module has its own barcode directory (core/modules/barcode) + 'barcode' => 0, + // Set this to 1 if module has its own models directory (core/modules/xxx) + 'models' => 1, + // Set this to 1 if module has its own printing directory (core/modules/printing) + 'printing' => 0, + // Set this to 1 if module has its own theme directory (theme) + 'theme' => 0, + // Set this to relative path of css file if module has its own css file + 'css' => array( + // '/webhook/css/webhook.css.php', + ), + // Set this to relative path of js file if module must load a js on all pages + 'js' => array( + // '/webhook/js/webhook.js.php', + ), + // Set here all hooks context managed by module. To find available hook context, make a "grep -r '>initHooks(' *" on source code. You can also set hook context to 'all' + 'hooks' => array( + // 'data' => array( + // 'hookcontext1', + // 'hookcontext2', + // ), + // 'entity' => '0', + ), + // Set this to 1 if features of module are opened to external users + 'moduleforexternal' => 0, + ); + + // Data directories to create when module is enabled. + // Example: this->dirs = array("/webhook/temp","/webhook/subdir"); + $this->dirs = array("/webhook/temp"); + + // Config pages. Put here list of php page, stored into webhook/admin directory, to use to setup module. + $this->config_page_url = array("webhook.php"); + + // Dependencies + // A condition to hide module + $this->hidden = false; + // List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...) + $this->depends = array(); + $this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) + $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) + + // The language file dedicated to your module + $this->langfiles = array("webhook"); + + // Prerequisites + $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module + + // Messages at activation + $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','MX'='textmx'...) + $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','MX'='textmx'...) + //$this->automatic_activation = array('FR'=>'WebhookWasAutomaticallyActivatedBecauseOfYourCountryChoice'); + //$this->always_enabled = true; // If true, can't be disabled + + // Constants + // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive) + // Example: $this->const=array(1 => array('WEBHOOK_MYNEWCONST1', 'chaine', 'myvalue', 'This is a constant to add', 1), + // 2 => array('WEBHOOK_MYNEWCONST2', 'chaine', 'myvalue', 'This is another constant to add', 0, 'current', 1) + // ); + $this->const = array(); + + // Some keys to add into the overwriting translation tables + /*$this->overwrite_translation = array( + 'en_US:ParentCompany'=>'Parent company or reseller', + 'fr_FR:ParentCompany'=>'Maison mère ou revendeur' + )*/ + + if (!isset($conf->webhook) || !isset($conf->webhook->enabled)) { + $conf->webhook = new stdClass(); + $conf->webhook->enabled = 0; + } + + // Array to add new pages in new tabs + $this->tabs = array(); + // Example: + // $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@webhook:$user->rights->webhook->read:/webhook/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1 + // $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@webhook:$user->rights->othermodule->read:/webhook/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key. + // $this->tabs[] = array('data'=>'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname + // + // Where objecttype can be + // 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member) + // 'contact' to add a tab in contact view + // 'contract' to add a tab in contract view + // 'group' to add a tab in group view + // 'intervention' to add a tab in intervention view + // 'invoice' to add a tab in customer invoice view + // 'invoice_supplier' to add a tab in supplier invoice view + // 'member' to add a tab in fundation member view + // 'opensurveypoll' to add a tab in opensurvey poll view + // 'order' to add a tab in customer order view + // 'order_supplier' to add a tab in supplier order view + // 'payment' to add a tab in payment view + // 'payment_supplier' to add a tab in supplier payment view + // 'product' to add a tab in product view + // 'propal' to add a tab in propal view + // 'project' to add a tab in project view + // 'stock' to add a tab in stock view + // 'thirdparty' to add a tab in third party view + // 'user' to add a tab in user view + + // Dictionaries + $this->dictionaries = array(); + /* Example: + $this->dictionaries=array( + 'langs'=>'webhook@webhook', + // List of tables we want to see into dictonnary editor + 'tabname'=>array(MAIN_DB_PREFIX."table1", MAIN_DB_PREFIX."table2", MAIN_DB_PREFIX."table3"), + // Label of tables + 'tablib'=>array("Table1", "Table2", "Table3"), + // Request to select fields + 'tabsql'=>array('SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table1 as f', 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table2 as f', 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table3 as f'), + // Sort order + 'tabsqlsort'=>array("label ASC", "label ASC", "label ASC"), + // List of fields (result of select to show dictionary) + 'tabfield'=>array("code,label", "code,label", "code,label"), + // List of fields (list of fields to edit a record) + 'tabfieldvalue'=>array("code,label", "code,label", "code,label"), + // List of fields (list of fields for insert) + 'tabfieldinsert'=>array("code,label", "code,label", "code,label"), + // Name of columns with primary key (try to always name it 'rowid') + 'tabrowid'=>array("rowid", "rowid", "rowid"), + // Condition to show each dictionary + 'tabcond'=>array($conf->webhook->enabled, $conf->webhook->enabled, $conf->webhook->enabled) + ); + */ + + // Boxes/Widgets + // Add here list of php file(s) stored in webhook/core/boxes that contains a class to show a widget. + $this->boxes = array( + // 0 => array( + // 'file' => 'webhookwidget1.php@webhook', + // 'note' => 'Widget provided by Webhook', + // 'enabledbydefaulton' => 'Home', + // ), + // ... + ); + + // Cronjobs (List of cron jobs entries to add when module is enabled) + // unit_frequency must be 60 for minute, 3600 for hour, 86400 for day, 604800 for week + $this->cronjobs = array( + // 0 => array( + // 'label' => 'MyJob label', + // 'jobtype' => 'method', + // 'class' => '/webhook/class/webhook_target.class.php', + // 'objectname' => 'Webhook_target', + // 'method' => 'doScheduledJob', + // 'parameters' => '', + // 'comment' => 'Comment', + // 'frequency' => 2, + // 'unitfrequency' => 3600, + // 'status' => 0, + // 'test' => '$conf->webhook->enabled', + // 'priority' => 50, + // ), + ); + // Example: $this->cronjobs=array( + // 0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'/dir/class/file.class.php', 'objectname'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>'$conf->webhook->enabled', 'priority'=>50), + // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24, 'status'=>0, 'test'=>'$conf->webhook->enabled', 'priority'=>50) + // ); + + // Permissions provided by this module + $this->rights = array(); + $r = 0; + // Add here entries to declare new permissions + /* BEGIN MODULEBUILDER PERMISSIONS */ + $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) + $this->rights[$r][1] = 'Read objects of Webhook'; // Permission label + $this->rights[$r][4] = 'webhook_target'; + $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->webhook->webhook_target->read) + $r++; + $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) + $this->rights[$r][1] = 'Create/Update objects of Webhook'; // Permission label + $this->rights[$r][4] = 'webhook_target'; + $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->webhook->webhook_target->write) + $r++; + $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) + $this->rights[$r][1] = 'Delete objects of Webhook'; // Permission label + $this->rights[$r][4] = 'webhook_target'; + $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->webhook->webhook_target->delete) + $r++; + /* END MODULEBUILDER PERMISSIONS */ + + // Main menu entries to add + $this->menu = array(); + $r = 0; + // Add here entries to declare new menus + /* BEGIN MODULEBUILDER TOPMENU */ + /*$this->menu[$r++] = array( + 'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'type'=>'top', // This is a Top menu entry + 'titre'=>'ModuleWebhookName', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth valignmiddle"'), + 'mainmenu'=>'webhook', + 'leftmenu'=>'', + 'url'=>'/webhook/webhookindex.php', + 'langs'=>'webhook@webhook', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>1000 + $r, + 'enabled'=>'$conf->webhook->enabled', // Define condition to show or hide menu entry. Use '$conf->webhook->enabled' if entry must be visible if module is enabled. + 'perms'=>'1', // Use 'perms'=>'$user->rights->webhook->webhook_target->read' if you want your menu with a permission rules + 'target'=>'', + 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both + );*/ + /* END MODULEBUILDER TOPMENU */ + /* BEGIN MODULEBUILDER LEFTMENU WEBHOOK_TARGET + $this->menu[$r++]=array( + 'fk_menu'=>'fk_mainmenu=webhook', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'type'=>'left', // This is a Left menu entry + 'titre'=>'Webhook_target', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth valignmiddle"'), + 'mainmenu'=>'webhook', + 'leftmenu'=>'webhook_target', + 'url'=>'/webhook/webhookindex.php', + 'langs'=>'webhook@webhook', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>1000+$r, + 'enabled'=>'$conf->webhook->enabled', // Define condition to show or hide menu entry. Use '$conf->webhook->enabled' if entry must be visible if module is enabled. + 'perms'=>'$user->rights->webhook->webhook_target->read', // Use 'perms'=>'$user->rights->webhook->level1->level2' if you want your menu with a permission rules + 'target'=>'', + 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both + ); + $this->menu[$r++]=array( + 'fk_menu'=>'fk_mainmenu=webhook,fk_leftmenu=webhook_target', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'type'=>'left', // This is a Left menu entry + 'titre'=>'List_Webhook_target', + 'mainmenu'=>'webhook', + 'leftmenu'=>'webhook_webhook_target_list', + 'url'=>'/webhook/webhook_target_list.php', + 'langs'=>'webhook@webhook', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>1000+$r, + 'enabled'=>'$conf->webhook->enabled', // Define condition to show or hide menu entry. Use '$conf->webhook->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'$user->rights->webhook->webhook_target->read', // Use 'perms'=>'$user->rights->webhook->level1->level2' if you want your menu with a permission rules + 'target'=>'', + 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both + ); + $this->menu[$r++]=array( + 'fk_menu'=>'fk_mainmenu=webhook,fk_leftmenu=webhook_target', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'type'=>'left', // This is a Left menu entry + 'titre'=>'New_Webhook_target', + 'mainmenu'=>'webhook', + 'leftmenu'=>'webhook_webhook_target_new', + 'url'=>'/webhook/webhook_target_card.php?action=create', + 'langs'=>'webhook@webhook', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>1000+$r, + 'enabled'=>'$conf->webhook->enabled', // Define condition to show or hide menu entry. Use '$conf->webhook->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'$user->rights->webhook->webhook_target->write', // Use 'perms'=>'$user->rights->webhook->level1->level2' if you want your menu with a permission rules + 'target'=>'', + 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both + ); + */ + + /*$this->menu[$r++]=array( + // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'fk_menu'=>'fk_mainmenu=webhook', + // This is a Left menu entry + 'type'=>'left', + 'titre'=>'List Webhook_target', + 'mainmenu'=>'webhook', + 'leftmenu'=>'webhook_webhook_target', + 'url'=>'/webhook/webhook_target_list.php', + // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'langs'=>'webhook@webhook', + 'position'=>1100+$r, + // Define condition to show or hide menu entry. Use '$conf->webhook->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'enabled'=>'$conf->webhook->enabled', + // Use 'perms'=>'$user->rights->webhook->level1->level2' if you want your menu with a permission rules + 'perms'=>'1', + 'target'=>'', + // 0=Menu for internal users, 1=external users, 2=both + 'user'=>2, + ); + $this->menu[$r++]=array( + // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'fk_menu'=>'fk_mainmenu=webhook,fk_leftmenu=webhook_webhook_target', + // This is a Left menu entry + 'type'=>'left', + 'titre'=>'New Webhook_target', + 'mainmenu'=>'webhook', + 'leftmenu'=>'webhook_webhook_target', + 'url'=>'/webhook/webhook_target_card.php?action=create', + // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'langs'=>'webhook@webhook', + 'position'=>1100+$r, + // Define condition to show or hide menu entry. Use '$conf->webhook->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'enabled'=>'$conf->webhook->enabled', + // Use 'perms'=>'$user->rights->webhook->level1->level2' if you want your menu with a permission rules + 'perms'=>'1', + 'target'=>'', + // 0=Menu for internal users, 1=external users, 2=both + 'user'=>2 + );*/ + + /* END MODULEBUILDER LEFTMENU WEBHOOK_TARGET */ + // Exports profiles provided by this module + $r = 1; + /* BEGIN MODULEBUILDER EXPORT WEBHOOK_TARGET */ + /* + $langs->load("webhook@webhook"); + $this->export_code[$r]=$this->rights_class.'_'.$r; + $this->export_label[$r]='Webhook_targetLines'; // Translation key (used only if key ExportDataset_xxx_z not found) + $this->export_icon[$r]='webhook_target@webhook'; + // Define $this->export_fields_array, $this->export_TypeFields_array and $this->export_entities_array + $keyforclass = 'Webhook_target'; $keyforclassfile='/webhook/class/webhook_target.class.php'; $keyforelement='webhook_target@webhook'; + include DOL_DOCUMENT_ROOT.'/core/commonfieldsinexport.inc.php'; + //$this->export_fields_array[$r]['t.fieldtoadd']='FieldToAdd'; $this->export_TypeFields_array[$r]['t.fieldtoadd']='Text'; + //unset($this->export_fields_array[$r]['t.fieldtoremove']); + //$keyforclass = 'Webhook_targetLine'; $keyforclassfile='/webhook/class/webhook_target.class.php'; $keyforelement='webhook_targetline@webhook'; $keyforalias='tl'; + //include DOL_DOCUMENT_ROOT.'/core/commonfieldsinexport.inc.php'; + $keyforselect='webhook_target'; $keyforaliasextra='extra'; $keyforelement='webhook_target@webhook'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; + //$keyforselect='webhook_targetline'; $keyforaliasextra='extraline'; $keyforelement='webhook_targetline@webhook'; + //include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; + //$this->export_dependencies_array[$r] = array('webhook_targetline'=>array('tl.rowid','tl.ref')); // To force to activate one or several fields if we select some fields that need same (like to select a unique key if we ask a field of a child to avoid the DISTINCT to discard them, or for computed field than need several other fields) + //$this->export_special_array[$r] = array('t.field'=>'...'); + //$this->export_examplevalues_array[$r] = array('t.field'=>'Example'); + //$this->export_help_array[$r] = array('t.field'=>'FieldDescHelp'); + $this->export_sql_start[$r]='SELECT DISTINCT '; + $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'webhook_target as t'; + //$this->export_sql_end[$r] =' LEFT JOIN '.MAIN_DB_PREFIX.'webhook_target_line as tl ON tl.fk_webhook_target = t.rowid'; + $this->export_sql_end[$r] .=' WHERE 1 = 1'; + $this->export_sql_end[$r] .=' AND t.entity IN ('.getEntity('webhook_target').')'; + $r++; */ + /* END MODULEBUILDER EXPORT WEBHOOK_TARGET */ + + // Imports profiles provided by this module + $r = 1; + /* BEGIN MODULEBUILDER IMPORT WEBHOOK_TARGET */ + /* + $langs->load("webhook@webhook"); + $this->import_code[$r]=$this->rights_class.'_'.$r; + $this->import_label[$r]='Webhook_targetLines'; // Translation key (used only if key ExportDataset_xxx_z not found) + $this->import_icon[$r]='webhook_target@webhook'; + $this->import_tables_array[$r] = array('t' => MAIN_DB_PREFIX.'webhook_webhook_target', 'extra' => MAIN_DB_PREFIX.'webhook_webhook_target_extrafields'); + $this->import_tables_creator_array[$r] = array('t' => 'fk_user_author'); // Fields to store import user id + $import_sample = array(); + $keyforclass = 'Webhook_target'; $keyforclassfile='/webhook/class/webhook_target.class.php'; $keyforelement='webhook_target@webhook'; + include DOL_DOCUMENT_ROOT.'/core/commonfieldsinimport.inc.php'; + $import_extrafield_sample = array(); + $keyforselect='webhook_target'; $keyforaliasextra='extra'; $keyforelement='webhook_target@webhook'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinimport.inc.php'; + $this->import_fieldshidden_array[$r] = array('extra.fk_object' => 'lastrowid-'.MAIN_DB_PREFIX.'webhook_webhook_target'); + $this->import_regex_array[$r] = array(); + $this->import_examplevalues_array[$r] = array_merge($import_sample, $import_extrafield_sample); + $this->import_updatekeys_array[$r] = array('t.ref' => 'Ref'); + $this->import_convertvalue_array[$r] = array( + 't.ref' => array( + 'rule'=>'getrefifauto', + 'class'=>(empty($conf->global->WEBHOOK_WEBHOOK_TARGET_ADDON) ? 'mod_webhook_target_standard' : $conf->global->WEBHOOK_WEBHOOK_TARGET_ADDON), + 'path'=>"/core/modules/commande/".(empty($conf->global->WEBHOOK_WEBHOOK_TARGET_ADDON) ? 'mod_webhook_target_standard' : $conf->global->WEBHOOK_WEBHOOK_TARGET_ADDON).'.php' + 'classobject'=>'Webhook_target', + 'pathobject'=>'/webhook/class/webhook_target.class.php', + ), + 't.fk_soc' => array('rule' => 'fetchidfromref', 'file' => '/societe/class/societe.class.php', 'class' => 'Societe', 'method' => 'fetch', 'element' => 'ThirdParty'), + 't.fk_user_valid' => array('rule' => 'fetchidfromref', 'file' => '/user/class/user.class.php', 'class' => 'User', 'method' => 'fetch', 'element' => 'user'), + 't.fk_mode_reglement' => array('rule' => 'fetchidfromcodeorlabel', 'file' => '/compta/paiement/class/cpaiement.class.php', 'class' => 'Cpaiement', 'method' => 'fetch', 'element' => 'cpayment'), + ); + $r++; */ + /* END MODULEBUILDER IMPORT WEBHOOK_TARGET */ + } + + /** + * Function called when module is enabled. + * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. + * It also creates data directories + * + * @param string $options Options when enabling module ('', 'noboxes') + * @return int 1 if OK, 0 if KO + */ + public function init($options = '') + { + global $conf, $langs; + + $result = $this->_load_tables('/install/mysql/tables/', 'webhook'); + //$result = $this->_load_tables('/webhook/sql/'); + if ($result < 0) { + return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default') + } + + // Create extrafields during init + //include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + //$extrafields = new ExtraFields($this->db); + //$result1=$extrafields->addExtraField('webhook_myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty', 0, 0, '', '', 1, '', 0, 0, '', '', 'webhook@webhook', '$conf->webhook->enabled'); + //$result2=$extrafields->addExtraField('webhook_myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project', 0, 0, '', '', 1, '', 0, 0, '', '', 'webhook@webhook', '$conf->webhook->enabled'); + //$result3=$extrafields->addExtraField('webhook_myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account', 0, 0, '', '', 1, '', 0, 0, '', '', 'webhook@webhook', '$conf->webhook->enabled'); + //$result4=$extrafields->addExtraField('webhook_myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1,'', 0, 0, '', '', 'webhook@webhook', '$conf->webhook->enabled'); + //$result5=$extrafields->addExtraField('webhook_myattr5', "New Attr 5 label", 'text', 1, 10, 'user', 0, 0, '', '', 1, '', 0, 0, '', '', 'webhook@webhook', '$conf->webhook->enabled'); + + // Permissions + $this->remove($options); + + $sql = array(); + + // Document templates + $moduledir = dol_sanitizeFileName('webhook'); + $myTmpObjects = array(); + $myTmpObjects['Webhook_target'] = array('includerefgeneration'=>0, 'includedocgeneration'=>0); + + foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { + if ($myTmpObjectKey == 'Webhook_target') { + continue; + } + if ($myTmpObjectArray['includerefgeneration']) { + $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/'.$moduledir.'/template_webhook_targets.odt'; + $dirodt = DOL_DATA_ROOT.'/doctemplates/'.$moduledir; + $dest = $dirodt.'/template_webhook_targets.odt'; + + if (file_exists($src) && !file_exists($dest)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + dol_mkdir($dirodt); + $result = dol_copy($src, $dest, 0, 0); + if ($result < 0) { + $langs->load("errors"); + $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); + return 0; + } + } + + $sql = array_merge($sql, array( + "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = 'standard_".strtolower($myTmpObjectKey)."' AND type = '".$this->db->escape(strtolower($myTmpObjectKey))."' AND entity = ".((int) $conf->entity), + "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('standard_".strtolower($myTmpObjectKey)."', '".$this->db->escape(strtolower($myTmpObjectKey))."', ".((int) $conf->entity).")", + "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = 'generic_".strtolower($myTmpObjectKey)."_odt' AND type = '".$this->db->escape(strtolower($myTmpObjectKey))."' AND entity = ".((int) $conf->entity), + "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('generic_".strtolower($myTmpObjectKey)."_odt', '".$this->db->escape(strtolower($myTmpObjectKey))."', ".((int) $conf->entity).")" + )); + } + } + + return $this->_init($sql, $options); + } + + /** + * Function called when module is disabled. + * Remove from database constants, boxes and permissions from Dolibarr database. + * Data directories are not deleted + * + * @param string $options Options when enabling module ('', 'noboxes') + * @return int 1 if OK, 0 if KO + */ + public function remove($options = '') + { + $sql = array(); + return $this->_remove($sql, $options); + } +} diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index f597f580b47..f83b6efa1ed 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -675,6 +675,9 @@ class pdf_standard extends ModelePDFMovement if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/oauth/github_oauthcallback.php b/htdocs/core/modules/oauth/github_oauthcallback.php index 496a2c988fa..5c24e23aafa 100644 --- a/htdocs/core/modules/oauth/github_oauthcallback.php +++ b/htdocs/core/modules/oauth/github_oauthcallback.php @@ -34,9 +34,12 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current - $action = GETPOST('action', 'aZ09'); $backtourl = GETPOST('backtourl', 'alpha'); +$keyforprovider = GETPOST('keyforprovider', 'aZ09'); +if (empty($keyforprovider) && !empty($_SESSION["oauthkeyforproviderbeforeoauthjump"]) && (GETPOST('code') || $action == 'delete')) { + $keyforprovider = $_SESSION["oauthkeyforproviderbeforeoauthjump"]; +} /** @@ -64,9 +67,11 @@ $serviceFactory->setHttpClient($httpClient); $storage = new DoliStorage($db, $conf); // Setup the credentials for the requests +$keyforparamid = 'OAUTH_GITHUB'.($keyforprovider ? '-'.$keyforprovider : '').'_ID'; +$keyforparamsecret = 'OAUTH_GITHUB'.($keyforprovider ? '-'.$keyforprovider : '').'_SECRET'; $credentials = new Credentials( - $conf->global->OAUTH_GITHUB_ID, - $conf->global->OAUTH_GITHUB_SECRET, + getDolGlobalString($keyforparamid), + getDolGlobalString($keyforparamsecret), $currentUri->getAbsoluteUri() ); @@ -81,13 +86,20 @@ if ($action != 'delete' && empty($requestedpermissionsarray)) { //var_dump($requestedpermissionsarray);exit; // Instantiate the Api service using the credentials, http client and storage mechanism for the token -$apiService = $serviceFactory->createService('GitHub', $credentials, $storage, $requestedpermissionsarray); +$apiService = $serviceFactory->createService('GitHub'.($keyforprovider ? '-'.$keyforprovider : ''), $credentials, $storage, $requestedpermissionsarray); // access type needed to have oauth provider refreshing token //$apiService->setAccessType('offline'); $langs->load("oauth"); +if (!getDolGlobalString($keyforparamid)) { + accessforbidden('Setup of service is not complete. Customer ID is missing'); +} +if (!getDolGlobalString($keyforparamsecret)) { + accessforbidden('Setup of service is not complete. Secret key is missing'); +} + /* * Actions @@ -140,14 +152,15 @@ if (!empty($_GET['code'])) { // We are coming from oauth provider page } catch (Exception $e) { print $e->getMessage(); } -} else // If entry on page with no parameter, we arrive here -{ +} else { // If entry on page with no parameter, we arrive here $_SESSION["backtourlsavedbeforeoauthjump"] = $backtourl; + $_SESSION["oauthkeyforproviderbeforeoauthjump"] = $keyforprovider; + $_SESSION['oauthstateanticsrf'] = $state; // This may create record into oauth_state before the header redirect. // Creation of record with state in this tables depend on the Provider used (see its constructor). if (GETPOST('state')) { - $url = $apiService->getAuthorizationUri(array('state'=>GETPOST('state'))); + $url = $apiService->getAuthorizationUri(array('state' => GETPOST('state'))); } else { $url = $apiService->getAuthorizationUri(); // Parameter state will be randomly generated } diff --git a/htdocs/core/modules/oauth/google_oauthcallback.php b/htdocs/core/modules/oauth/google_oauthcallback.php index 9fbc38ef156..2812c4f7163 100644 --- a/htdocs/core/modules/oauth/google_oauthcallback.php +++ b/htdocs/core/modules/oauth/google_oauthcallback.php @@ -40,6 +40,11 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai $action = GETPOST('action', 'aZ09'); $backtourl = GETPOST('backtourl', 'alpha'); +$keyforprovider = GETPOST('keyforprovider', 'aZ09'); +if (empty($keyforprovider) && !empty($_SESSION["oauthkeyforproviderbeforeoauthjump"]) && (GETPOST('code') || $action == 'delete')) { + // If we are coming from the Oauth page + $keyforprovider = $_SESSION["oauthkeyforproviderbeforeoauthjump"]; +} /** @@ -63,23 +68,25 @@ $httpClient = new \OAuth\Common\Http\Client\CurlClient(); //$httpClient->setCurlParameters($params); $serviceFactory->setHttpClient($httpClient); -// Dolibarr storage -$storage = new DoliStorage($db, $conf); - // Setup the credentials for the requests +$keyforparamid = 'OAUTH_GOOGLE'.($keyforprovider ? '-'.$keyforprovider : '').'_ID'; +$keyforparamsecret = 'OAUTH_GOOGLE'.($keyforprovider ? '-'.$keyforprovider : '').'_SECRET'; $credentials = new Credentials( - $conf->global->OAUTH_GOOGLE_ID, - $conf->global->OAUTH_GOOGLE_SECRET, + getDolGlobalString($keyforparamid), + getDolGlobalString($keyforparamsecret), $currentUri->getAbsoluteUri() ); $state = GETPOST('state'); +$statewithscopeonly = ''; +$statewithanticsrfonly = ''; $requestedpermissionsarray = array(); if ($state) { // 'state' parameter is standard to store a hash value and can be used to retrieve some parameters back $statewithscopeonly = preg_replace('/\-.*$/', '', $state); $requestedpermissionsarray = explode(',', $statewithscopeonly); // Example: 'userinfo_email,userinfo_profile,openid,email,profile,cloud_print'. + $statewithanticsrfonly = preg_replace('/^.*\-/', '', $state); } if ($action != 'delete' && empty($requestedpermissionsarray)) { print 'Error, parameter state is not defined'; @@ -88,6 +95,8 @@ if ($action != 'delete' && empty($requestedpermissionsarray)) { //var_dump($requestedpermissionsarray);exit; +// Dolibarr storage +$storage = new DoliStorage($db, $conf, $keyforprovider); // Instantiate the Api service using the credentials, http client and storage mechanism for the token // $requestedpermissionsarray contains list of scopes. @@ -101,6 +110,13 @@ $apiService->setAccessType('offline'); $langs->load("oauth"); +if (!getDolGlobalString($keyforparamid)) { + accessforbidden('Setup of service is not complete. Customer ID is missing'); +} +if (!getDolGlobalString($keyforparamsecret)) { + accessforbidden('Setup of service is not complete. Secret key is missing'); +} + /* * Actions @@ -117,7 +133,7 @@ if ($action == 'delete') { } if (GETPOST('code')) { // We are coming from oauth provider page. - dol_syslog("We are coming from the oauth provider page"); + dol_syslog("We are coming from the oauth provider page keyforprovider=".$keyforprovider); // We must validate that the $state is the same than the one into $_SESSION['oauthstateanticsrf'], return error if not. if (isset($_SESSION['oauthstateanticsrf']) && $state != $_SESSION['oauthstateanticsrf']) { @@ -174,8 +190,10 @@ if (GETPOST('code')) { // We are coming from oauth provider page. } } else { // If we enter this page without 'code' parameter, we arrive here. this is the case when we want to get the redirect - // to the OAuth provider login page + // to the OAuth provider login page. $_SESSION["backtourlsavedbeforeoauthjump"] = $backtourl; + $_SESSION["oauthkeyforproviderbeforeoauthjump"] = $keyforprovider; + $_SESSION['oauthstateanticsrf'] = $state; if (!preg_match('/^forlogin/', $state)) { $apiService->setApprouvalPrompt('force'); diff --git a/htdocs/core/modules/oauth/stripelive_oauthcallback.php b/htdocs/core/modules/oauth/stripelive_oauthcallback.php index 77ef3ebde1a..bf9656df783 100644 --- a/htdocs/core/modules/oauth/stripelive_oauthcallback.php +++ b/htdocs/core/modules/oauth/stripelive_oauthcallback.php @@ -34,9 +34,12 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current - $action = GETPOST('action', 'aZ09'); $backtourl = GETPOST('backtourl', 'alpha'); +$keyforprovider = GETPOST('keyforprovider', 'aZ09'); +if (empty($keyforprovider) && !empty($_SESSION["oauthkeyforproviderbeforeoauthjump"]) && (GETPOST('code') || $action == 'delete')) { + $keyforprovider = $_SESSION["oauthkeyforproviderbeforeoauthjump"]; +} /** @@ -64,9 +67,11 @@ $serviceFactory->setHttpClient($httpClient); $storage = new DoliStorage($db, $conf); // Setup the credentials for the requests +$keyforparamid = 'OAUTH_STRIPE_LIVE'.($keyforprovider ? '-'.$keyforprovider : '').'_ID'; +$keyforparamsecret = 'OAUTH_STRIPE_LIVE'.($keyforprovider ? '-'.$keyforprovider : '').'_SECRET'; $credentials = new Credentials( - $conf->global->OAUTH_STRIPE_LIVE_ID, - $conf->global->STRIPE_LIVE_SECRET_KEY, + getDolGlobalString($keyforparamid), + getDolGlobalString($keyforparamsecret), $currentUri->getAbsoluteUri() ); @@ -84,7 +89,8 @@ if (GETPOST('state')) { // Instantiate the Api service using the credentials, http client and storage mechanism for the token //$apiService = $serviceFactory->createService('StripeTest', $credentials, $storage, $requestedpermissionsarray); -$sql = "INSERT INTO ".MAIN_DB_PREFIX."oauth_token set service='StripeLive', entity=".$conf->entity; +$servicesuffix = ($keyforprovider ? '-'.$keyforprovider : ''); +$sql = "INSERT INTO ".MAIN_DB_PREFIX."oauth_token SET service = 'StripeLive".$db->escape($servicesuffix)."', entity = ".((int) $conf->entity); $db->query($sql); // access type needed to have oauth provider refreshing token @@ -92,6 +98,13 @@ $db->query($sql); $langs->load("oauth"); +if (!getDolGlobalString($keyforparamid)) { + accessforbidden('Setup of service is not complete. Customer ID is missing'); +} +if (!getDolGlobalString($keyforparamsecret)) { + accessforbidden('Setup of service is not complete. Secret key is missing'); +} + /* * Actions @@ -148,6 +161,8 @@ if (!empty($_GET['code'])) { // We are coming from oauth provider page } else // If entry on page with no parameter, we arrive here { $_SESSION["backtourlsavedbeforeoauthjump"] = $backtourl; + $_SESSION["oauthkeyforproviderbeforeoauthjump"] = $keyforprovider; + $_SESSION['oauthstateanticsrf'] = $state; // This may create record into oauth_state before the header redirect. // Creation of record with state in this tables depend on the Provider used (see its constructor). @@ -156,7 +171,7 @@ if (!empty($_GET['code'])) { // We are coming from oauth provider page } else { //$url = $apiService->getAuthorizationUri(); // Parameter state will be randomly generated //https://connect.stripe.com/oauth/authorize?response_type=code&client_id=ca_AX27ut70tJ1j6eyFCV3ObEXhNOo2jY6V&scope=read_write - $url = 'https://connect.stripe.com/oauth/authorize?response_type=code&client_id='.$conf->global->OAUTH_STRIPE_LIVE_ID.'&scope=read_write'; + $url = 'https://connect.stripe.com/oauth/authorize?response_type=code&client_id='.$conf->global->$keyforparamid.'&scope=read_write'; } // we go on oauth provider authorization page diff --git a/htdocs/core/modules/oauth/stripetest_oauthcallback.php b/htdocs/core/modules/oauth/stripetest_oauthcallback.php index a31f0f43db4..64d55fba760 100644 --- a/htdocs/core/modules/oauth/stripetest_oauthcallback.php +++ b/htdocs/core/modules/oauth/stripetest_oauthcallback.php @@ -34,9 +34,12 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current - $action = GETPOST('action', 'aZ09'); $backtourl = GETPOST('backtourl', 'alpha'); +$keyforprovider = GETPOST('keyforprovider', 'aZ09'); +if (empty($keyforprovider) && !empty($_SESSION["oauthkeyforproviderbeforeoauthjump"]) && (GETPOST('code') || $action == 'delete')) { + $keyforprovider = $_SESSION["oauthkeyforproviderbeforeoauthjump"]; +} /** @@ -64,9 +67,11 @@ $serviceFactory->setHttpClient($httpClient); $storage = new DoliStorage($db, $conf); // Setup the credentials for the requests +$keyforparamid = 'OAUTH_STRIPE_TEST'.($keyforprovider ? '-'.$keyforprovider : '').'_ID'; +$keyforparamsecret = 'OAUTH_STRIPE_TEST'.($keyforprovider ? '-'.$keyforprovider : '').'_SECRET'; $credentials = new Credentials( - $conf->global->OAUTH_STRIPE_TEST_ID, - $conf->global->STRIPE_TEST_SECRET_KEY, + getDolGlobalString($keyforparamid), + getDolGlobalString($keyforparamsecret), $currentUri->getAbsoluteUri() ); @@ -84,7 +89,8 @@ if (GETPOST('state')) { // Instantiate the Api service using the credentials, http client and storage mechanism for the token //$apiService = $serviceFactory->createService('StripeTest', $credentials, $storage, $requestedpermissionsarray); -$sql = "INSERT INTO ".MAIN_DB_PREFIX."oauth_token set service='StripeTest', entity=".$conf->entity; +$servicesuffix = ($keyforprovider ? '-'.$keyforprovider : ''); +$sql = "INSERT INTO ".MAIN_DB_PREFIX."oauth_token SET service = 'StripeTest".$db->escape($servicesuffix)."', entity = ".((int) $conf->entity); $db->query($sql); // access type needed to have oauth provider refreshing token @@ -92,6 +98,13 @@ $db->query($sql); $langs->load("oauth"); +if (!getDolGlobalString($keyforparamid)) { + accessforbidden('Setup of service is not complete. Customer ID is missing'); +} +if (!getDolGlobalString($keyforparamsecret)) { + accessforbidden('Setup of service is not complete. Secret key is missing'); +} + /* * Actions @@ -148,6 +161,8 @@ if (!empty($_GET['code'])) { // We are coming from oauth provider page } else // If entry on page with no parameter, we arrive here { $_SESSION["backtourlsavedbeforeoauthjump"] = $backtourl; + $_SESSION["oauthkeyforproviderbeforeoauthjump"] = $keyforprovider; + $_SESSION['oauthstateanticsrf'] = $state; // This may create record into oauth_state before the header redirect. // Creation of record with state in this tables depend on the Provider used (see its constructor). @@ -156,7 +171,7 @@ if (!empty($_GET['code'])) { // We are coming from oauth provider page } else { //$url = $apiService->getAuthorizationUri(); // Parameter state will be randomly generated //https://connect.stripe.com/oauth/authorize?response_type=code&client_id=ca_AX27ut70tJ1j6eyFCV3ObEXhNOo2jY6V&scope=read_write - $url = 'https://connect.stripe.com/oauth/authorize?response_type=code&client_id='.$conf->global->OAUTH_STRIPE_TEST_ID.'&scope=read_write'; + $url = 'https://connect.stripe.com/oauth/authorize?response_type=code&client_id='.$conf->global->$keyforparamid.'&scope=read_write'; } // we go on oauth provider authorization page diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index 090a45f4b3f..5d228da7d8c 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -177,7 +177,13 @@ class doc_generic_product_odt extends ModelePDFProduct $texte .= '
    '; } // Add input to upload a new template file. - $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; + $texte .= '
    '.$langs->trans("UploadNewTemplate"); + $maxfilesizearray = getMaxFileSizeArray(); + $maxmin = $maxfilesizearray['maxmin']; + if ($maxmin > 0) { + $texte .= ''; // MAX_FILE_SIZE must precede the field type=file + } + $texte .= ' '; $texte .= ''; $texte .= ''; $texte .= '
    '; diff --git a/htdocs/core/modules/product_batch/mod_lot_advanced.php b/htdocs/core/modules/product_batch/mod_lot_advanced.php index d56178697f5..0865ebc9a66 100644 --- a/htdocs/core/modules/product_batch/mod_lot_advanced.php +++ b/htdocs/core/modules/product_batch/mod_lot_advanced.php @@ -65,6 +65,9 @@ class mod_lot_advanced extends ModeleNumRefBatch $form = new Form($db); + // We get cursor rule + $mask = isset($conf->global->LOT_ADVANCED_MASK) ? $conf->global->LOT_ADVANCED_MASK : ''; + $texte = $langs->trans('GenericNumRefModelDesc')."
    \n"; $texte .= '
    '; $texte .= ''; @@ -80,13 +83,13 @@ class mod_lot_advanced extends ModeleNumRefBatch // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; // Option to enable custom masks per product $texte .= ''; - if ($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS) { + if (!empty($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS)) { $texte .= ''.img_picto($langs->trans("Enabled"), 'on').''; } else { $texte .= ''.img_picto($langs->trans("Disabled"), 'off').''; @@ -139,7 +142,7 @@ class mod_lot_advanced extends ModeleNumRefBatch require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // We get cursor rule - $mask = $conf->global->LOT_ADVANCED_MASK; + $mask = isset($conf->global->LOT_ADVANCED_MASK) ? $conf->global->LOT_ADVANCED_MASK : ''; if (!$mask) { $this->error = 'NotConfigured'; diff --git a/htdocs/core/modules/product_batch/mod_sn_advanced.php b/htdocs/core/modules/product_batch/mod_sn_advanced.php index 6ee931d51a9..46f803cb20f 100644 --- a/htdocs/core/modules/product_batch/mod_sn_advanced.php +++ b/htdocs/core/modules/product_batch/mod_sn_advanced.php @@ -65,6 +65,9 @@ class mod_sn_advanced extends ModeleNumRefBatch $form = new Form($db); + // We get cursor rule + $mask = isset($conf->global->SN_ADVANCED_MASK) ? $conf->global->SN_ADVANCED_MASK : ''; + $texte = $langs->trans('GenericNumRefModelDesc')."
    \n"; $texte .= ''; $texte .= ''; @@ -80,13 +83,13 @@ class mod_sn_advanced extends ModeleNumRefBatch // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; // Option to enable custom masks per product $texte .= ''; - if ($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS) { + if (!empty($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS)) { $texte .= ''.img_picto($langs->trans("Enabled"), 'on').''; } else { $texte .= ''.img_picto($langs->trans("Disabled"), 'off').''; @@ -139,7 +142,7 @@ class mod_sn_advanced extends ModeleNumRefBatch require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // We get cursor rule - $mask = $conf->global->SN_ADVANCED_MASK; + $mask = isset($conf->global->SN_ADVANCED_MASK) ? $conf->global->SN_ADVANCED_MASK : ''; if (!$mask) { $this->error = 'NotConfigured'; diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 69a7a3f6232..8bd8d030a37 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -40,10 +40,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; if (!empty($conf->propal->enabled)) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; } -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; } if (!empty($conf->commande->enabled)) { @@ -64,7 +64,7 @@ if (!empty($conf->ficheinter->enabled)) { if (!empty($conf->deplacement->enabled)) { require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; } -if (!empty($conf->agenda->enabled)) { +if (isModEnabled('agenda')) { require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; } @@ -522,7 +522,7 @@ class doc_generic_project_odt extends ModelePDFProjects // Load translation files required by the page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); - if ($conf->projet->dir_output) { + if ($conf->project->dir_output) { // If $object is id instead of object if (!is_object($object)) { $id = $object; @@ -536,7 +536,7 @@ class doc_generic_project_odt extends ModelePDFProjects $object->fetch_thirdparty(); - $dir = $conf->projet->dir_output; + $dir = $conf->project->dir_output; $objectref = dol_sanitizeFileName($object->ref); if (!preg_match('/specimen/i', $objectref)) { $dir .= "/".$objectref; @@ -575,9 +575,9 @@ class doc_generic_project_odt extends ModelePDFProjects //print "file=".$file; //print "conf->societe->dir_temp=".$conf->societe->dir_temp; - dol_mkdir($conf->projet->dir_temp); - if (!is_writable($conf->projet->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->projet->dir_temp; + dol_mkdir($conf->project->dir_temp); + if (!is_writable($conf->project->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->project->dir_temp; dol_syslog('Error in write_file: '.$this->error, LOG_ERR); return -1; } @@ -615,7 +615,7 @@ class doc_generic_project_odt extends ModelePDFProjects $odfHandler = new odf( $srctemplatepath, array( - 'PATH_TO_TMP' => $conf->projet->dir_temp, + 'PATH_TO_TMP' => $conf->project->dir_temp, 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. 'DELIMITER_LEFT' => '{', 'DELIMITER_RIGHT' => '}' @@ -826,7 +826,7 @@ class doc_generic_project_odt extends ModelePDFProjects // Replace tags of project files $listtasksfiles = $listlines->__get('tasksfiles'); - $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($object->ref).'/'.dol_sanitizeFileName($task->ref); + $upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($object->ref).'/'.dol_sanitizeFileName($task->ref); $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', 'name', SORT_ASC, 1); @@ -861,7 +861,7 @@ class doc_generic_project_odt extends ModelePDFProjects try { $listlines = $odfHandler->setSegment('projectfiles'); - $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($object->ref); + $upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($object->ref); $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', 'name', SORT_ASC, 1); foreach ($filearray as $filedetail) { diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index cf9e84a3deb..df013a2fad0 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -195,11 +195,11 @@ class pdf_baleine extends ModelePDFProjects // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); - if ($conf->projet->dir_output) { + if ($conf->project->dir_output) { //$nblines = count($object->lines); // This is set later with array of tasks $objectref = dol_sanitizeFileName($object->ref); - $dir = $conf->projet->dir_output; + $dir = $conf->project->dir_output; if (!preg_match('/specimen/i', $objectref)) { $dir .= "/".$objectref; } @@ -470,6 +470,9 @@ class pdf_baleine extends ModelePDFProjects if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index abd05f63651..fba5e02b098 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -242,11 +242,11 @@ class pdf_beluga extends ModelePDFProjects // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); - if ($conf->projet->dir_output) { + if ($conf->project->dir_output) { //$nblines = count($object->lines); // This is set later with array of tasks $objectref = dol_sanitizeFileName($object->ref); - $dir = $conf->projet->dir_output; + $dir = $conf->project->dir_output; if (!preg_match('/specimen/i', $objectref)) { $dir .= "/".$objectref; } @@ -743,6 +743,9 @@ class pdf_beluga extends ModelePDFProjects if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } } diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index cb7430c3011..9d118b2a555 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -195,11 +195,11 @@ class pdf_timespent extends ModelePDFProjects // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); - if ($conf->projet->dir_output) { + if ($conf->project->dir_output) { //$nblines = count($object->lines); // This is set later with array of tasks $objectref = dol_sanitizeFileName($object->ref); - $dir = $conf->projet->dir_output; + $dir = $conf->project->dir_output; if (!preg_match('/specimen/i', $objectref)) { $dir .= "/".$objectref; } @@ -473,6 +473,9 @@ class pdf_timespent extends ModelePDFProjects if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index fc83ab505d2..e26318b749c 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -41,10 +41,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; if (!empty($conf->propal->enabled)) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; } -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; } if (!empty($conf->commande->enabled)) { @@ -65,7 +65,7 @@ if (!empty($conf->ficheinter->enabled)) { if (!empty($conf->deplacement->enabled)) { require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; } -if (!empty($conf->agenda->enabled)) { +if (isModEnabled('agenda')) { require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; } @@ -133,8 +133,8 @@ class doc_generic_task_odt extends ModelePDFTask // Get source company $this->emetteur = $mysoc; - if (!$this->emetteur->pays_code) { - $this->emetteur->pays_code = substr($langs->defaultlang, -2); // By default, if was not defined + if (!$this->emetteur->country_code) { + $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined } } @@ -481,7 +481,7 @@ class doc_generic_task_odt extends ModelePDFTask // Load translation files required by the page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); - if ($conf->projet->dir_output) { + if ($conf->project->dir_output) { // If $object is id instead of object if (!is_object($object)) { $id = $object; @@ -496,7 +496,7 @@ class doc_generic_task_odt extends ModelePDFTask $project->fetch($object->fk_project); $project->fetch_thirdparty(); - $dir = $conf->projet->dir_output."/".$project->ref."/"; + $dir = $conf->project->dir_output."/".$project->ref."/"; $objectref = dol_sanitizeFileName($object->ref); if (!preg_match('/specimen/i', $objectref)) { $dir .= "/".$objectref; @@ -525,9 +525,9 @@ class doc_generic_task_odt extends ModelePDFTask //print "file=".$file; //print "conf->societe->dir_temp=".$conf->societe->dir_temp; - dol_mkdir($conf->projet->dir_temp); - if (!is_writable($conf->projet->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->projet->dir_temp; + dol_mkdir($conf->project->dir_temp); + if (!is_writable($conf->project->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->project->dir_temp; dol_syslog('Error in write_file: '.$this->error, LOG_ERR); return -1; } @@ -550,7 +550,7 @@ class doc_generic_task_odt extends ModelePDFTask $odfHandler = new odf( $srctemplatepath, array( - 'PATH_TO_TMP' => $conf->projet->dir_temp, + 'PATH_TO_TMP' => $conf->project->dir_temp, 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. 'DELIMITER_LEFT' => '{', 'DELIMITER_RIGHT' => '}' @@ -708,7 +708,7 @@ class doc_generic_task_odt extends ModelePDFTask // Replace tags of project files $listtasksfiles = $odfHandler->setSegment('tasksfiles'); - $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($project->ref).'/'.dol_sanitizeFileName($object->ref); + $upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($project->ref).'/'.dol_sanitizeFileName($object->ref); $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', 'name', SORT_ASC, 1); @@ -741,7 +741,7 @@ class doc_generic_task_odt extends ModelePDFTask try { $listlines = $odfHandler->setSegment('projectfiles'); - $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($object->ref); + $upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($object->ref); $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', 'name', SORT_ASC, 1); diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 39ffd92ac5e..6f91d676949 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -211,7 +211,13 @@ class doc_generic_proposal_odt extends ModelePDFPropales } } // Add input to upload a new template file. - $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; + $texte .= '
    '.$langs->trans("UploadNewTemplate"); + $maxfilesizearray = getMaxFileSizeArray(); + $maxmin = $maxfilesizearray['maxmin']; + if ($maxmin > 0) { + $texte .= ''; // MAX_FILE_SIZE must precede the field type=file + } + $texte .= ' '; $texte .= ''; $texte .= ''; $texte .= '
    '; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 511677d742b..177443153ce 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -726,6 +726,9 @@ class pdf_azur extends ModelePDFPropales if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 47af81d8aa2..1ed76728b92 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -850,6 +850,9 @@ class pdf_cyan extends ModelePDFPropales if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index 3e48aaf18bc..1976dea773f 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -173,7 +173,13 @@ class doc_generic_reception_odt extends ModelePdfReception $texte .= '
    '; } // Add input to upload a new template file. - $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; + $texte .= '
    '.$langs->trans("UploadNewTemplate"); + $maxfilesizearray = getMaxFileSizeArray(); + $maxmin = $maxfilesizearray['maxmin']; + if ($maxmin > 0) { + $texte .= ''; // MAX_FILE_SIZE must precede the field type=file + } + $texte .= ' '; $texte .= ''; $texte .= ''; $texte .= '
    '; diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 7d234e6bd95..61fab1ab02d 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -538,6 +538,9 @@ class pdf_squille extends ModelePdfReception $pagenb++; $pdf->setPage($pagenb); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index 3a62eb22937..a19c90215b0 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -169,7 +169,13 @@ class doc_generic_odt extends ModeleThirdPartyDoc $texte .= '
    '; } // Add input to upload a new template file. - $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; + $texte .= '
    '.$langs->trans("UploadNewTemplate"); + $maxfilesizearray = getMaxFileSizeArray(); + $maxmin = $maxfilesizearray['maxmin']; + if ($maxmin > 0) { + $texte .= ''; // MAX_FILE_SIZE must precede the field type=file + } + $texte .= ' '; $texte .= ''; $texte .= ''; $texte .= '
    '; diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php index f8733a8a8ff..c54e5f4f02a 100644 --- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php +++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php @@ -177,7 +177,13 @@ class doc_generic_stock_odt extends ModelePDFStock $texte .= '
    '; } // Add input to upload a new template file. - $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; + $texte .= '
    '.$langs->trans("UploadNewTemplate"); + $maxfilesizearray = getMaxFileSizeArray(); + $maxmin = $maxfilesizearray['maxmin']; + if ($maxmin > 0) { + $texte .= ''; // MAX_FILE_SIZE must precede the field type=file + } + $texte .= ' '; $texte .= ''; $texte .= ''; $texte .= '
    '; diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index ecbeccb5a61..3fd3917da2d 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -460,6 +460,9 @@ class pdf_standard extends ModelePDFStock if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php index 74b0ea032b9..c00bf34621e 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php @@ -22,9 +22,9 @@ */ /** - * \file htdocs/core/modules/expedition/doc/pdf_rouget.modules.php + * \file htdocs/core/modules/expedition/doc/pdf_eagle.modules.php * \ingroup expedition - * \brief Class file used to generate the dispatch slips for the Rouget model + * \brief Class file used to generate the dispatch slips for the Eagle model */ require_once DOL_DOCUMENT_ROOT . '/core/modules/stocktransfer/modules_stocktransfer.php'; diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index bd9e4d3f11a..5bff26a9d1d 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -26,9 +26,9 @@ */ /** - * \file htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php + * \file htdocs/core/modules/commande/doc/pdf_eagle_proforma.modules.php * \ingroup commande - * \brief File of Class to generate PDF orders with template Eratosthène + * \brief File of Class to generate PDF orders with template Eagle */ require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php'; @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; /** - * Class to generate PDF orders with template Eratosthene + * Class to generate PDF orders with template Eagle */ class pdf_eagle_proforma extends ModelePDFCommandes { diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index da8c1f4ac26..233d18ce229 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -777,6 +777,9 @@ class pdf_cornas extends ModelePDFSuppliersOrders if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == $pageposafter) { diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index c7dc161330c..5498800aefc 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -659,6 +659,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index 4e1027207a7..6919ffe69aa 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -420,6 +420,9 @@ class pdf_standard extends ModelePDFSuppliersPayments if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 6b47240016f..70ee5d75710 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -659,6 +659,9 @@ class pdf_aurore extends ModelePDFSupplierProposal if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php index d69da78aacc..cf358cae606 100644 --- a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php +++ b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php @@ -166,7 +166,13 @@ class doc_generic_ticket_odt extends ModelePDFTicket $texte .= '
    '; } // Add input to upload a new template file. - $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; + $texte .= '
    '.$langs->trans("UploadNewTemplate"); + $texte .= ' '; + $maxfilesizearray = getMaxFileSizeArray(); + $maxmin = $maxfilesizearray['maxmin']; + if ($maxmin > 0) { + $texte .= ''; // MAX_FILE_SIZE must precede the field type=file + } $texte .= ''; $texte .= ''; $texte .= '
    '; diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index a46503b6e2a..0c9f5263e09 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -197,7 +197,13 @@ class doc_generic_user_odt extends ModelePDFUser $texte .= '
    '; } // Add input to upload a new template file. - $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; + $texte .= '
    '.$langs->trans("UploadNewTemplate"); + $maxfilesizearray = getMaxFileSizeArray(); + $maxmin = $maxfilesizearray['maxmin']; + if ($maxmin > 0) { + $texte .= ''; // MAX_FILE_SIZE must precede the field type=file + } + $texte .= ' '; $texte .= ''; $texte .= ''; $texte .= '
    '; diff --git a/htdocs/core/tpl/ajax/fileupload_view.tpl.php b/htdocs/core/tpl/ajax/fileupload_view.tpl.php index 70182a17dbc..22f8d687db0 100644 --- a/htdocs/core/tpl/ajax/fileupload_view.tpl.php +++ b/htdocs/core/tpl/ajax/fileupload_view.tpl.php @@ -37,6 +37,13 @@ if (empty($conf) || !is_object($conf)) { trans('AddFiles'); ?> + 0) { + print ''; // MAX_FILE_SIZE must precede the field type=file + } + ?>
    '; } } print ''; // Output of last run - print ''; + print ''; if (!empty($obj->lastoutput)) { - print dol_trunc(nl2br($obj->lastoutput), 50); + print '
    '; + print dol_trunc(dolGetFirstLineOfText($obj->lastoutput, 2), 100); + print '
    '; } print ''; - print ''; + // Next run + print ''; if (!empty($obj->datenextrun)) { $datenextrun = $db->jdate($obj->datenextrun); if (empty($obj->status)) { diff --git a/htdocs/debugbar/class/DebugBar.php b/htdocs/debugbar/class/DebugBar.php index 15bb2360ed8..af824a64392 100644 --- a/htdocs/debugbar/class/DebugBar.php +++ b/htdocs/debugbar/class/DebugBar.php @@ -40,7 +40,7 @@ class DolibarrDebugBar extends DebugBar //$this->addCollector(new DolExceptionsCollector()); $this->addCollector(new DolQueryCollector()); $this->addCollector(new DolibarrCollector()); - if ($conf->syslog->enabled) { + if (isModEnabled('syslog')) { $this->addCollector(new DolLogsCollector()); } } diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index 382e78df8d3..dba3d0de437 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -43,7 +43,7 @@ if (!empty($conf->expedition_bon->enabled)) { if (!empty($conf->stock->enabled)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -328,7 +328,7 @@ if ($action == 'create') { // Create. Seems to no be used // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$expedition->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if (0) { // Do not change on shipment diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 2c43cd715a3..9edc080701b 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -106,6 +106,8 @@ class Delivery extends CommonObject */ public $model_pdf; + public $commande_id; + public $lines = array(); diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 960ff7e7b2d..30a3ec24c6c 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmargin.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -382,7 +382,7 @@ llxHeader('', $title, $help_url); $form = new Form($db); $formfile = new FormFile($db); $formcompany = new FormCompany($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -511,7 +511,7 @@ if ($action == 'create') { print ''; } - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print "".$langs->trans("Project").""; $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); print "\n"; @@ -639,7 +639,7 @@ if (!empty($id) && $action == 'edit') { print "".''.$langs->trans("Status").''.$object->getLibStatut(4).''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); $langs->load('projects'); @@ -700,7 +700,7 @@ if (!empty($id) && $action != 'edit') { $morehtmlref = '
    '; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($user->rights->don->creer) { diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 0ce92f44e1b..4c0811e70c9 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -974,7 +974,7 @@ class Don extends CommonObject public function info($id) { $sql = 'SELECT d.rowid, d.datec, d.fk_user_author, d.fk_user_valid,'; - $sql .= ' d.tms'; + $sql .= ' d.tms as datem'; $sql .= ' FROM '.MAIN_DB_PREFIX.'don as d'; $sql .= ' WHERE d.rowid = '.((int) $id); @@ -985,16 +985,9 @@ class Don extends CommonObject if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - if ($obj->fk_user_valid) { - $vuser = new User($this->db); - $vuser->fetch($obj->fk_user_valid); - $this->user_modification = $vuser; - } + + $this->user_creation_id = $obj->fk_user_author; + $this->user_validation_id = $obj->fk_user_valid; $this->date_creation = $this->db->jdate($obj->datec); $this->date_modification = $this->db->jdate($obj->tms); } diff --git a/htdocs/don/document.php b/htdocs/don/document.php index ab99ba3df1d..030ca5cb085 100644 --- a/htdocs/don/document.php +++ b/htdocs/don/document.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -99,7 +99,7 @@ if ($action == 'classin' && $user->rights->don->creer) { */ $form = new Form($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -129,7 +129,7 @@ if ($object->id) { $morehtmlref = '
    '; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($user->rights->don->creer) { diff --git a/htdocs/don/info.php b/htdocs/don/info.php index 0057bf87dce..f326972f782 100644 --- a/htdocs/don/info.php +++ b/htdocs/don/info.php @@ -25,7 +25,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -63,7 +63,7 @@ $help_url = 'EN:Module_Donations|FR:Module_Dons|ES:Módulo_Donaciones|DE:M llxHeader('', $title, $help_url); $form = new Form($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -77,7 +77,7 @@ $linkback = ''; // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($user->rights->don->creer) { diff --git a/htdocs/don/list.php b/htdocs/don/list.php index d7697dba43d..891f7e6877b 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -27,7 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -93,7 +93,7 @@ $fieldstosearchall = array( $donationstatic = new Don($db); $form = new Form($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $projectstatic = new Project($db); } @@ -219,7 +219,7 @@ if ($resql) { print ''; print ' '; print ''; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print ''; print ' '; print ''; @@ -249,7 +249,7 @@ if ($resql) { } print_liste_field_titre("Name", $_SERVER["PHP_SELF"], "d.lastname", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "d.datedon", "", $param, '', $sortfield, $sortorder, 'center '); - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); print_liste_field_titre("Project", $_SERVER["PHP_SELF"], "d.fk_projet", "", $param, "", $sortfield, $sortorder); } @@ -280,7 +280,7 @@ if ($resql) { } print "".$donationstatic->getFullName($langs).""; print ''.dol_print_date($db->jdate($objp->datedon), 'day').''; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print ""; if ($objp->pid) { $projectstatic->id = $objp->pid; diff --git a/htdocs/don/note.php b/htdocs/don/note.php index 1629aa0f28f..8e1b5192ee2 100644 --- a/htdocs/don/note.php +++ b/htdocs/don/note.php @@ -29,7 +29,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -84,7 +84,7 @@ $help_url = 'EN:Module_Donations|FR:Module_Dons|ES:Módulo_Donaciones|DE:M llxHeader('', $title, $help_url); $form = new Form($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -100,7 +100,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref = '
    '; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($user->rights->don->creer) { diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index d8d1da60e24..d70f5c863d7 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -569,7 +569,7 @@ class EcmFiles extends CommonObject $line = new EcmfilesLine(); $line->id = $obj->rowid; - $line->ref = $obj->ref; + $line->ref = $obj->rowid; $line->label = $obj->label; $line->share = $obj->share; $line->entity = $obj->entity; diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 3b906883c00..1fcdac35b0f 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -325,7 +325,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { if (!empty($conf->commande->enabled)) { $rowspan++; $sectionauto[] = array('position'=>50, 'level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders"))); } - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { $rowspan++; $sectionauto[] = array('position'=>60, 'level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices"))); } if (!empty($conf->supplier_proposal->enabled)) { @@ -347,9 +347,9 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { $langs->load("compta"); $rowspan++; $sectionauto[] = array('position'=>120, 'level'=>1, 'module'=>'salaries', 'test'=>$conf->salaries->enabled, 'label'=>$langs->trans("Salaries"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Salaries"))); } - if (!empty($conf->projet->enabled)) { - $rowspan++; $sectionauto[] = array('position'=>130, 'level'=>1, 'module'=>'project', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects"))); - $rowspan++; $sectionauto[] = array('position'=>140, 'level'=>1, 'module'=>'project_task', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Tasks"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Tasks"))); + if (!empty($conf->project->enabled)) { + $rowspan++; $sectionauto[] = array('position'=>130, 'level'=>1, 'module'=>'project', 'test'=>$conf->project->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects"))); + $rowspan++; $sectionauto[] = array('position'=>140, 'level'=>1, 'module'=>'project_task', 'test'=>$conf->project->enabled, 'label'=>$langs->trans("Tasks"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Tasks"))); } if (!empty($conf->ficheinter->enabled)) { $langs->load("interventions"); diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index 42b8efba42f..27a76d2ae6e 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -128,7 +128,7 @@ if (!empty($conf->contrat->enabled)) { if (!empty($conf->commande->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders"))); } -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices"))); } if (!empty($conf->supplier_proposal->enabled)) { @@ -143,8 +143,8 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU if (!empty($conf->tax->enabled)) { $langs->load("compta"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions"))); } -if (!empty($conf->projet->enabled)) { - $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects"))); +if (!empty($conf->project->enabled)) { + $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>$conf->project->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects"))); } if (!empty($conf->ficheinter->enabled)) { $langs->load("interventions"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions"))); diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index a0a1db6056e..ab94be999cb 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -615,7 +615,7 @@ class EmailCollector extends CommonObject */ public function info($id) { - $sql = 'SELECT rowid, date_creation as datec, tms as datem,'; + $sql = 'SELECT rowid, date_creation as datec, tms as datem,'; $sql .= ' fk_user_creat, fk_user_modif'; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; $sql .= ' WHERE t.rowid = '.((int) $id); @@ -624,27 +624,11 @@ class EmailCollector extends CommonObject if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - - if ($obj->fk_user_valid) { - $vuser = new User($this->db); - $vuser->fetch($obj->fk_user_valid); - $this->user_validation = $vuser; - } - - if ($obj->fk_user_cloture) { - $cluser = new User($this->db); - $cluser->fetch($obj->fk_user_cloture); - $this->user_cloture = $cluser; - } + $this->user_creation_id = $obj->fk_user_creat; + $this->user_modification_id = $obj->fk_user_modif; $this->date_creation = $this->db->jdate($obj->datec); - $this->date_modification = $this->db->jdate($obj->datem); - $this->date_validation = $this->db->jdate($obj->datev); + $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem); } $this->db->free($result); diff --git a/htdocs/emailcollector/class/emailcollectoraction.class.php b/htdocs/emailcollector/class/emailcollectoraction.class.php index 5ce35541a16..37bd93926cb 100644 --- a/htdocs/emailcollector/class/emailcollectoraction.class.php +++ b/htdocs/emailcollector/class/emailcollectoraction.class.php @@ -271,9 +271,9 @@ class EmailCollectorAction extends CommonObject public function fetch($id, $ref = null) { $result = $this->fetchCommon($id, $ref); - if ($result > 0 && !empty($this->table_element_line)) { - $this->fetchLines(); - } + // if ($result > 0 && !empty($this->table_element_line)) { + // $this->fetchLinesCommon(); + // } return $result; } @@ -484,27 +484,11 @@ class EmailCollectorAction extends CommonObject if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - - if ($obj->fk_user_valid) { - $vuser = new User($this->db); - $vuser->fetch($obj->fk_user_valid); - $this->user_validation = $vuser; - } - - if ($obj->fk_user_cloture) { - $cluser = new User($this->db); - $cluser->fetch($obj->fk_user_cloture); - $this->user_cloture = $cluser; - } + $this->user_creation_id = $obj->fk_user_creat; + $this->user_modification_id = $obj->fk_user_modif; $this->date_creation = $this->db->jdate($obj->datec); - $this->date_modification = $this->db->jdate($obj->datem); - $this->date_validation = $this->db->jdate($obj->datev); + $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem); } $this->db->free($result); diff --git a/htdocs/emailcollector/class/emailcollectorfilter.class.php b/htdocs/emailcollector/class/emailcollectorfilter.class.php index ec42ce53a34..6386ee3c27f 100644 --- a/htdocs/emailcollector/class/emailcollectorfilter.class.php +++ b/htdocs/emailcollector/class/emailcollectorfilter.class.php @@ -458,27 +458,11 @@ class EmailCollectorFilter extends CommonObject if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - - if ($obj->fk_user_valid) { - $vuser = new User($this->db); - $vuser->fetch($obj->fk_user_valid); - $this->user_validation = $vuser; - } - - if ($obj->fk_user_cloture) { - $cluser = new User($this->db); - $cluser->fetch($obj->fk_user_cloture); - $this->user_cloture = $cluser; - } + $this->user_creation_id = $obj->fk_user_creat; + $this->user_modification_id = $obj->fk_user_modif; $this->date_creation = $this->db->jdate($obj->datec); - $this->date_modification = $this->db->jdate($obj->datem); - $this->date_validation = $this->db->jdate($obj->datev); + $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem); } $this->db->free($result); diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 292b55d0dc9..3df55ff48f3 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -107,7 +107,7 @@ class ConferenceOrBooth extends ActionComm 'ref' => array('type'=>'integer', 'label'=>'Ref', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'csslist'=>'tdoverflowmax125', 'help'=>"Help text", 'showoncombobox'=>'1',), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:t.usage_organize_event=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:t.usage_organize_event=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'), 'note' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1), 'fk_action' => array('type'=>'sellist:c_actioncomm:libelle:id::module LIKE (\'%@eventorganization\')', 'label'=>'Format', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>1, 'css'=>'width300'), 'datep' => array('type'=>'datetime', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'2',), @@ -679,14 +679,11 @@ class ConferenceOrBooth extends ActionComm if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } + $this->user_creation_id = $obj->fk_user_creat; + $this->user_modification_id = $obj->fk_user_modif; $this->date_creation = $this->db->jdate($obj->datec); - $this->date_modification = $this->db->jdate($obj->datem); + $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem); } $this->db->free($result); diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 533c9f4e8c0..3dae278d3a1 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -104,7 +104,7 @@ class ConferenceOrBoothAttendee extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'comment'=>"Reference of object"), 'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'position'=>20, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'position'=>20, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'), 'email' => array('type'=>'mail', 'label'=>'EmailAttendee', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'autofocusoncreate'=>1, 'searchall'=>1), 'firstname' => array('type'=>'varchar(100)', 'label'=>'Firstname', 'enabled'=>'1', 'position'=>31, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'searchall'=>1), 'lastname' => array('type'=>'varchar(100)', 'label'=>'Lastname', 'enabled'=>'1', 'position'=>32, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'searchall'=>1), @@ -947,27 +947,11 @@ class ConferenceOrBoothAttendee extends CommonObject if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - - if ($obj->fk_user_valid) { - $vuser = new User($this->db); - $vuser->fetch($obj->fk_user_valid); - $this->user_validation = $vuser; - } - - if ($obj->fk_user_cloture) { - $cluser = new User($this->db); - $cluser->fetch($obj->fk_user_cloture); - $this->user_cloture = $cluser; - } + $this->user_creation_id = $obj->fk_user_creat; + $this->user_modification_id = $obj->fk_user_modif; $this->date_creation = $this->db->jdate($obj->datec); - $this->date_modification = $this->db->jdate($obj->datem); - $this->date_validation = $this->db->jdate($obj->datev); + $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem); } $this->db->free($result); diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 0d14811ef67..0d5991bb0ac 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -299,7 +299,7 @@ if (!empty($withproject)) { print ''; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print ''.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, Categorie::TYPE_PROJECT, 1); print ""; diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index 67cb2c659ee..57f2a76c042 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -282,7 +282,7 @@ if (!empty($withproject)) { print ''; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print ''.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, Categorie::TYPE_PROJECT, 1); print ""; @@ -392,7 +392,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/eventorganization/conferenceorbooth_document.php b/htdocs/eventorganization/conferenceorbooth_document.php index 742585ffb16..739e6f81036 100644 --- a/htdocs/eventorganization/conferenceorbooth_document.php +++ b/htdocs/eventorganization/conferenceorbooth_document.php @@ -257,7 +257,7 @@ if (!empty($withproject)) { print ''; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print ''.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, Categorie::TYPE_PROJECT, 1); print ""; diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 6d42d881ab8..958d1ab897d 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -382,7 +382,7 @@ if ($projectid > 0) { print ''; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print ''.$langs->trans("Categories").''; print $form->showCategories($project->id, Categorie::TYPE_PROJECT, 1); print ""; diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index c60c0418d43..b02edfc4a34 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -327,7 +327,7 @@ if (!empty($withproject)) { print ''; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print ''.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print ""; diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 878b1baf992..972e546255f 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; -if ($conf->categorie->enabled) { +if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -510,7 +510,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { print ''; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print ''.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print ""; diff --git a/htdocs/eventorganization/conferenceorboothattendee_note.php b/htdocs/eventorganization/conferenceorboothattendee_note.php index b8fb87d39fa..4c5b2f394a9 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_note.php +++ b/htdocs/eventorganization/conferenceorboothattendee_note.php @@ -151,7 +151,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/eventorganization/core/actions_massactions_mail.inc.php b/htdocs/eventorganization/core/actions_massactions_mail.inc.php index cda9274e6d6..a446c04ca9a 100644 --- a/htdocs/eventorganization/core/actions_massactions_mail.inc.php +++ b/htdocs/eventorganization/core/actions_massactions_mail.inc.php @@ -31,7 +31,7 @@ // $parameters, $object, $action must be defined for the hook. // $permissiontoread, $permissiontoadd, $permissiontodelete, $permissiontoclose may be defined -// $uploaddir may be defined (example to $conf->projet->dir_output."/";) +// $uploaddir may be defined (example to $conf->project->dir_output."/";) // $toselect may be defined // $diroutputmassaction may be defined diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index d341f293827..0508c51dfae 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -56,7 +56,7 @@ if (!empty($conf->propal->enabled)) { if (!empty($conf->productbatch->enabled)) { require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -429,10 +429,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { + if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -815,7 +815,7 @@ if (empty($action)) { $form = new Form($db); $formfile = new FormFile($db); $formproduct = new FormProduct($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -902,7 +902,7 @@ if ($action == 'create') { print ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $projectid = GETPOST('projectid', 'int') ?GETPOST('projectid', 'int') : 0; if (empty($projectid) && !empty($object->fk_project)) { $projectid = $object->fk_project; @@ -982,7 +982,7 @@ if ($action == 'create') { print "\n"; // Other attributes - $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'cols' => '3', 'socid' => $socid); + $parameters = array('objectsrc' => isset($objectsrc) ? $objectsrc : '', 'colspan' => ' colspan="3"', 'cols' => '3', 'socid' => $socid); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $expe, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -1178,7 +1178,7 @@ if ($action == 'create') { // Qty already shipped print ''; - $quantityDelivered = $object->expeditions[$line->id]; + $quantityDelivered = isset($object->expeditions[$line->id]) ? $object->expeditions[$line->id] : ''; print $quantityDelivered; print ''; print ''.$unit_order.''; @@ -1188,14 +1188,18 @@ if ($action == 'create') { if ($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $quantityToBeDelivered = 0; } else { - $quantityToBeDelivered = $quantityAsked - $quantityDelivered; + if (is_numeric($quantityDelivered)) { + $quantityToBeDelivered = $quantityAsked - $quantityDelivered; + } else { + $quantityToBeDelivered = $quantityAsked; + } } $warehouseObject = null; if (count($warehousePicking) == 1 || !($line->fk_product > 0) || empty($conf->stock->enabled)) { // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection print ''; //ship from preselected location - $stock = + $product->stock_warehouse[$warehouse_id]->real; // Convert to number + $stock = + (isset($product->stock_warehouse[$warehouse_id]->real) ? $product->stock_warehouse[$warehouse_id]->real : 0); // Convert to number $deliverableQty = min($quantityToBeDelivered, $stock); if ($deliverableQty < 0) { $deliverableQty = 0; @@ -1571,7 +1575,8 @@ if ($action == 'create') { } } - // Line extrafield + // Display lines for extrafields of the Shipment line + // $line is a 'Order line' if (!empty($extrafields)) { //var_dump($line); $colspan = 5; @@ -1580,6 +1585,7 @@ if ($action == 'create') { $srcLine = new OrderLine($db); $srcLine->id = $line->id; $srcLine->fetch_optionals(); // fetch extrafields also available in orderline + $expLine->array_options = array_merge($expLine->array_options, $srcLine->array_options); print $expLine->showOptionals($extrafields, 'edit', array('style'=>'class="drag drop oddeven"', 'colspan'=>$colspan), $indiceAsked, '', 1); @@ -1716,7 +1722,7 @@ if ($action == 'create') { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if (0) { // Do not change on shipment @@ -2098,7 +2104,7 @@ if ($action == 'create') { //if ($filter) $sql.= $filter; $sql .= " ORDER BY obj.fk_product"; - dol_syslog("get list of shipment lines", LOG_DEBUG); + dol_syslog("expedition/card.php get list of shipment lines", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); @@ -2414,7 +2420,8 @@ if ($action == 'create') { } print ""; - // Display lines extrafields + // Display lines extrafields. + // $line is a line of shipment if (!empty($extrafields)) { $colspan = 6; if ($origin && $origin_id > 0) { @@ -2477,7 +2484,7 @@ if ($action == 'create') { // TODO add alternative status // 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order) if ($object->statut == Expedition::STATUS_CLOSED && $user->rights->expedition->creer) { - if (!empty($conf->facture->enabled) && !empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? + if (isModEnabled('facture') && !empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? print dolGetButtonAction('', $langs->trans('ClassifyUnbilled'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, ''); } else { print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, ''); @@ -2496,7 +2503,7 @@ if ($action == 'create') { } // Create bill - if (!empty($conf->facture->enabled) && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED)) { + if (isModEnabled('facture') && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED)) { if ($user->rights->facture->creer) { // TODO show button only if (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) // If we do that, we must also make this option official. @@ -2514,7 +2521,7 @@ if ($action == 'create') { if ($user->rights->expedition->creer && $object->statut > 0 && !$object->billed) { $label = "Close"; $paramaction = 'classifyclosed'; // = Transferred/Received // Label here should be "Close" or "ClassifyBilled" if we decided to make bill on shipments instead of orders - if (!empty($conf->facture->enabled) && !empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? + if (isModEnabled('facture') && !empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? $label = "ClassifyBilled"; $paramaction = 'classifybilled'; } diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 5b033fc11f7..2de87f93666 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -759,7 +759,7 @@ class Expedition extends CommonObject // line without batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record. - $result = $mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr", $numref)); + $result = $mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr", $numref), '', '', '', '', 0, '', 1); if ($result < 0) { $error++; @@ -772,7 +772,7 @@ class Expedition extends CommonObject // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record. // Note: ->fk_origin_stock = id into table llx_product_batch (may be rename into llx_product_stock_batch in another version) - $result = $mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr", $numref), '', $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch, $obj->fk_origin_stock); + $result = $mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr", $numref), '', $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch, $obj->fk_origin_stock, '', 1); if ($result < 0) { $error++; $this->error = $mouvS->error; @@ -781,6 +781,12 @@ class Expedition extends CommonObject } } } + + // If some stock lines are now 0, we can remove entry into llx_product_stock, but only if there is no child lines into llx_product_batch (detail of batch, because we can imagine + // having a lot1/qty=X and lot2/qty=-X, so 0 but we must not loose repartition of different lot. + $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_stock WHERE reel = 0 AND rowid NOT IN (SELECT fk_product_stock FROM ".MAIN_DB_PREFIX."product_batch as pb)"; + $resql = $this->db->query($sql); + // We do not test error, it can fails if there is child in batch details } else { $this->db->rollback(); $this->error = $this->db->error(); @@ -927,7 +933,7 @@ class Expedition extends CommonObject return -1; } - if ($conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT) { + if (!empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT)) { $product = new Product($this->db); $product->fetch($fk_product); @@ -1244,7 +1250,7 @@ class Expedition extends CommonObject $mouvS->origin = null; // get lot/serial $lotArray = null; - if ($conf->productbatch->enabled) { + if (isModEnabled('productbatch')) { $lotArray = $shipmentlinebatch->fetchAll($obj->expeditiondet_id); if (!is_array($lotArray)) { $error++; @@ -2781,7 +2787,7 @@ class ExpeditionLigne extends CommonObjectLine $this->db->begin(); // delete batch expedition line - if ($conf->productbatch->enabled) { + if (isModEnabled('productbatch')) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."expeditiondet_batch"; $sql .= " WHERE fk_expeditiondet = ".((int) $this->id); diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 944f76266d2..669c6f8e56d 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -149,7 +149,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if (0) { // Do not change on shipment diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php index 68336e8dbf6..d0729879017 100644 --- a/htdocs/expedition/document.php +++ b/htdocs/expedition/document.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -123,7 +123,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if (0) { // Do not change on shipment diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php index d8d70b3cc49..e391d5be180 100644 --- a/htdocs/expedition/note.php +++ b/htdocs/expedition/note.php @@ -27,7 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -110,7 +110,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if (0) { // Do not change on shipment diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 2919a42bdb7..a64e6c2b761 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -227,7 +227,7 @@ if (empty($reshook)) { $form = new Form($db); $formfile = new FormFile($db); $formproduct = new FormProduct($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -287,7 +287,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$soc->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 818b3d564a6..47eefb01be9 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004-2020 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2015-2021 Alexandre Spangaro + * Copyright (C) 2015-2022 Alexandre Spangaro * Copyright (C) 2017 Ferran Marcet * Copyright (C) 2018 Frédéric France * @@ -117,7 +117,7 @@ $permissiontoadd = $user->rights->expensereport->creer; // Used by the include o $upload_dir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($object->ref); -$projectRequired = $conf->projet->enabled && ! empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED); +$projectRequired = $conf->project->enabled && ! empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED); $fileRequired = !empty($conf->global->EXPENSEREPORT_FILE_IS_REQUIRED); if ($object->id > 0) { @@ -138,7 +138,7 @@ $candelete = 0; if (!empty($user->rights->expensereport->supprimer)) { $candelete = 1; } -if ($object->statut == ExpenseReport::STATUS_DRAFT && $user->rights->expensereport->write && in_array($object->fk_user_author, $childids)) { +if ($object->statut == ExpenseReport::STATUS_DRAFT && $user->hasRight('expensereport', 'write') && in_array($object->fk_user_author, $childids)) { $candelete = 1; } @@ -1467,6 +1467,8 @@ if ($action == 'create') { } // Public note + $note_public = GETPOSTISSET('note_public') ? GETPOST('note_public', 'restricthtml') : ''; + print ''; print ''.$langs->trans('NotePublic').''; print ''; @@ -1476,6 +1478,8 @@ if ($action == 'create') { print ''; // Private note + $note_private = GETPOSTISSET('note_private') ? GETPOST('note_private', 'restricthtml') : ''; + if (empty($user->socid)) { print ''; print ''.$langs->trans('NotePrivate').''; @@ -1624,6 +1628,8 @@ if ($action == 'create') { print dol_get_fiche_head($head, 'card', $langs->trans("ExpenseReport"), -1, 'trip'); + $formconfirm = ''; + // Clone confirmation if ($action == 'clone') { // Create an array for form @@ -1691,7 +1697,7 @@ if ($action == 'create') { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -1923,6 +1929,7 @@ if ($action == 'create') { // List of payments already done $nbcols = 3; + $nbrows = 0; if (!empty($conf->banque->enabled)) { $nbrows++; $nbcols++; @@ -2055,7 +2062,7 @@ if ($action == 'create') { print ''.$langs->trans('LineNb').''; //print ''.$langs->trans('Piece').''; print ''.$langs->trans('Date').''; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print ''.$langs->trans('Project').''; } print ''.$langs->trans('Type').''; @@ -2100,7 +2107,7 @@ if ($action == 'create') { print ''.dol_print_date($db->jdate($line->date), 'day').''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print ''; if ($line->fk_project > 0) { $projecttmp->id = $line->fk_project; @@ -2261,7 +2268,7 @@ if ($action == 'create') { if ($action == 'editline' && $line->rowid == GETPOST('rowid', 'int')) { // Add line with link to add new file or attach line to an existing file $colspan = 11; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $colspan++; } if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { @@ -2336,7 +2343,7 @@ if ($action == 'create') { print ''; // Select project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print ''; $formproject->select_projects(-1, $line->fk_project, 'fk_project', 0, 0, $projectRequired ? 0 : 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth300'); print ''; @@ -2409,7 +2416,7 @@ if ($action == 'create') { if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { $colspan++; } - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $colspan++; } if ($action != 'editline') { @@ -2486,7 +2493,7 @@ if ($action == 'create') { print ''; print ''; print ''.$langs->trans('Date').''; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print ''.$form->textwithpicto($langs->trans('Project'), $langs->trans("ClosedProjectsAreHidden")).''; } print ''.$langs->trans('Type').''; @@ -2515,7 +2522,7 @@ if ($action == 'create') { print ''; // Select project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print ''; $formproject->select_projects(-1, $fk_project, 'fk_project', 0, 0, $projectRequired ? 0 : 1, -1, 0, 0, 0, '', 0, 0, 'maxwidth300'); print ''; diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 4f001238134..f06e83f4c40 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -883,9 +883,9 @@ if ($step == 4 && $datatoexport) { if (isset($objexport->array_export_fields[0][$code])) { $list .= ($list ? ', ' : ''); if (isset($array_filtervalue[$code]) && preg_match('/^\s*[<>]/', $array_filtervalue[$code])) { - $list .= $langs->trans($objexport->array_export_fields[0][$code]).(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] : ''); + $list .= ''.$langs->trans($objexport->array_export_fields[0][$code]).''.(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] : ''); } else { - $list .= $langs->trans($objexport->array_export_fields[0][$code])."='".(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] : '')."'"; + $list .= ''.$langs->trans($objexport->array_export_fields[0][$code])."='".(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] : '')."'"; } } } @@ -1163,9 +1163,9 @@ if ($step == 5 && $datatoexport) { if (isset($objexport->array_export_fields[0][$code])) { $list .= ($list ? ', ' : ''); if (isset($array_filtervalue[$code]) && preg_match('/^\s*[<>]/', $array_filtervalue[$code])) { - $list .= $langs->trans($objexport->array_export_fields[0][$code]).(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] : ''); + $list .= ''.$langs->trans($objexport->array_export_fields[0][$code]).''.(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] : ''); } else { - $list .= $langs->trans($objexport->array_export_fields[0][$code])."='".(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] : '')."'"; + $list .= ''.$langs->trans($objexport->array_export_fields[0][$code])."='".(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] : '')."'"; } } } diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 1a289e61e2e..3f644b074bd 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -178,7 +178,6 @@ if ($action == 'add') { $newinter->entity = $object->entity; $newinter->duree = $object->duree; - $newinter->datei = $object->date; $newinter->description = $object->description; $newinter->note_private = $object->note_private; @@ -245,7 +244,7 @@ $companystatic = new Societe($db); if (!empty($conf->contrat->enabled)) { $contratstatic = new Contrat($db); } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $projectstatic = new Project($db); } @@ -273,7 +272,7 @@ if ($action == 'create') { print dol_get_fiche_head(); $rowspan = 4; - if (!empty($conf->projet->enabled) && $object->fk_project > 0) { + if (!empty($conf->project->enabled) && $object->fk_project > 0) { $rowspan++; } if (!empty($conf->contrat->enabled) && $object->fk_contrat > 0) { @@ -315,7 +314,7 @@ if ($action == 'create') { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); print "".$langs->trans("Project").""; $projectid = GETPOST('projectid') ?GETPOST('projectid') : $object->fk_project; @@ -485,7 +484,7 @@ if ($action == 'create') { $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; @@ -804,7 +803,7 @@ if ($action == 'create') { if (!empty($conf->contrat->enabled)) { print_liste_field_titre("Contract", $_SERVER['PHP_SELF'], "f.fk_contrat", "", "", 'width="100px"', $sortfield, $sortorder, 'left '); } - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print_liste_field_titre("Project", $_SERVER['PHP_SELF'], "f.fk_project", "", "", 'width="100px"', $sortfield, $sortorder, 'left '); } print_liste_field_titre("Duration", $_SERVER['PHP_SELF'], 'f.duree', '', '', 'width="50px"', $sortfield, $sortorder, 'right '); @@ -843,7 +842,7 @@ if ($action == 'create') { } print ''; } - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print ''; if ($objp->fk_project > 0) { $projectstatic->fetch($objp->fk_project); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 6e2bee75e6e..d03cb11a7e0 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -36,11 +36,11 @@ require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/fichinter/modules_fichinter.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } -if ($conf->contrat->enabled) { +if (isModEnabled('contrat')) { require_once DOL_DOCUMENT_ROOT."/core/class/html.formcontract.class.php"; require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"; } @@ -787,7 +787,7 @@ $formfile = new FormFile($db); if (!empty($conf->contrat->enabled)) { $formcontract = new FormContract($db); } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -908,7 +908,7 @@ if ($action == 'create') { print ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); $langs->load("project"); @@ -928,7 +928,7 @@ if ($action == 'create') { } // Contract - if ($conf->contrat->enabled) { + if (isModEnabled('contrat')) { $langs->load("contracts"); print ''.$langs->trans("Contract").''; $numcontrat = $formcontract->select_contract($soc->id, GETPOST('contratid', 'int'), 'contratid', 0, 1, 1); @@ -1062,9 +1062,7 @@ if ($action == 'create') { print ''; } } elseif ($id > 0 || !empty($ref)) { - /* - * Affichage en mode visu - */ + // View mode $object->fetch($id, $ref); $object->fetch_thirdparty(); @@ -1161,7 +1159,7 @@ if ($action == 'create') { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->ficheinter->creer) { @@ -1201,7 +1199,7 @@ if ($action == 'create') { print '
    '; print '
    '; - print ''; + print '
    '; if (!empty($conf->global->FICHINTER_USE_PLANNED_AND_DONE_DATES)) { // Date Start @@ -1230,7 +1228,7 @@ if ($action == 'create') { print ''; print ''; @@ -1435,7 +1433,7 @@ if ($action == 'create') { // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('np_desc', $objp->description, '', 164, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_DETAILS, ROWS_2, '90%'); + $doleditor = new DolEditor('np_desc', $objp->description, '', 164, 'dolibarr_details', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_DETAILS'), ROWS_2, '90%'); $doleditor->Create(); $objectline = new FichinterLigne($db); @@ -1659,7 +1657,7 @@ if ($action == 'create') { } // Invoicing - if (!empty($conf->facture->enabled) && $object->statut > Fichinter::STATUS_DRAFT) { + if (isModEnabled('facture') && $object->statut > Fichinter::STATUS_DRAFT) { $langs->load("bills"); if ($object->statut < Fichinter::STATUS_BILLED) { if ($user->rights->facture->creer) { diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index ac0f47ee4b3..b9f0264ad46 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -40,7 +40,7 @@ class Fichinter extends CommonObject public $fields = array( 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>15), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>20), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>20), 'fk_contrat' =>array('type'=>'integer', 'label'=>'Fk contrat', 'enabled'=>'$conf->contrat->enabled', 'visible'=>-1, 'position'=>25), 'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>30), 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>35), @@ -1473,9 +1473,19 @@ class FichinterLigne extends CommonObjectLine */ public $fk_fichinter; - public $desc; // Description ligne - public $datei; // Date intervention - public $duration; // Duree de l'intervention + public $desc; // Description ligne + + /** + * @var int Date of intervention + */ + public $date; // Date intervention + /** + * @var int Date of intervention + * @deprecated + */ + public $datei; // Date intervention + + public $duration; // Duration of intervention public $rang = 0; /** diff --git a/htdocs/fichinter/contact.php b/htdocs/fichinter/contact.php index f2f50963287..ef6ffc80881 100644 --- a/htdocs/fichinter/contact.php +++ b/htdocs/fichinter/contact.php @@ -123,7 +123,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->ficheinter->creer) { diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php index 7fdcaa151a0..d0dd326df07 100644 --- a/htdocs/fichinter/document.php +++ b/htdocs/fichinter/document.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -123,7 +123,7 @@ if ($object->id) { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index 0f0fc0acc99..7e0bf6f7f44 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -89,7 +89,6 @@ $sql .= " GROUP BY f.fk_statut"; $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); - $i = 0; $total = 0; $totalinprocess = 0; @@ -97,38 +96,28 @@ if ($resql) { $vals = array(); $bool = false; // -1=Canceled, 0=Draft, 1=Validated, 2=Accepted/On process, 3=Closed (Sent/Received, billed or not) - while ($i < $num) { - $row = $db->fetch_row($resql); - if ($row) { - //if ($row[1]!=-1 && ($row[1]!=3 || $row[2]!=1)) - { - $bool = (!empty($row[2]) ?true:false); - if (!isset($vals[$row[1].$bool])) { - $vals[$row[1].$bool] = 0; - } - $vals[$row[1].$bool] += $row[0]; - $totalinprocess += $row[0]; + if ($num>0) { + while ($row = $db->fetch_row($resql)) { + if (!isset($vals[$row[1]])) { + $vals[$row[1]] = 0; } + $vals[$row[1]] += $row[0]; + $totalinprocess += $row[0]; + $total += $row[0]; } - $i++; } $db->free($resql); - include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; print '
    '; print '
    '; print $form->editfieldkey("Description", 'description', $object->description, $object, $user->rights->ficheinter->creer, 'textarea'); print ''; - print $form->editfieldval("Description", 'description', $object->description, $object, $user->rights->ficheinter->creer, 'textarea:8:80'); + print $form->editfieldval("Description", 'description', $object->description, $object, $user->rights->ficheinter->creer, 'textarea:8'); print '
    '; print ''."\n"; - $listofstatus = array(0, 1, 3); - $bool = false; + $listofstatus = array(Fichinter::STATUS_DRAFT, Fichinter::STATUS_VALIDATED); + if (!empty($conf->global->FICHINTER_CLASSIFY_BILLED)) $listofstatus[] = Fichinter::STATUS_BILLED; + foreach ($listofstatus as $status) { - $dataseries[] = array($fichinterstatic->LibStatut($status, $bool, 1), (isset($vals[$status.$bool]) ? (int) $vals[$status.$bool] : 0)); - if ($status == 3 && !$bool) { - $bool = true; - } else { - $bool = false; - } + $dataseries[] = array($fichinterstatic->LibStatut($status, 1), (isset($vals[$status]) ? (int) $vals[$status] : 0)); if ($status == Fichinter::STATUS_DRAFT) { $colorseries[$status] = '-'.$badgeStatus0; @@ -139,10 +128,8 @@ if ($resql) { if ($status == Fichinter::STATUS_BILLED) { $colorseries[$status] = $badgeStatus4; } - if ($status == Fichinter::STATUS_CLOSED) { - $colorseries[$status] = $badgeStatus6; - } } + if ($conf->use_javascript_ajax) { print ''; } - $bool = false; foreach ($listofstatus as $status) { if (!$conf->use_javascript_ajax) { print ''; - print ''; - print ''; + print ''; print "\n"; - if ($status == 3 && !$bool) { - $bool = true; - } else { - $bool = false; - } } } //if ($totalinprocess != $total) diff --git a/htdocs/fichinter/info.php b/htdocs/fichinter/info.php index e5eea9f846c..589f1901cd6 100644 --- a/htdocs/fichinter/info.php +++ b/htdocs/fichinter/info.php @@ -28,7 +28,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -78,7 +78,7 @@ $morehtmlref = '
    '; // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index dcf6681df0e..ef71f01e228 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } if (!empty($conf->contrat->enabled)) { @@ -43,7 +43,7 @@ if (!empty($conf->contrat->enabled)) { // Load translation files required by the page $langs->loadLangs(array('companies', 'bills', 'interventions')); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); } if (!empty($conf->contrat->enabled)) { @@ -68,22 +68,17 @@ $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', $optioncss = GETPOST('optioncss', 'alpha'); $socid = GETPOST('socid', 'int'); -// Security check -$id = GETPOST('id', 'int'); -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'ficheinter', $id, 'fichinter'); - $diroutputmassaction = $conf->ficheinter->dir_output.'/temp/massgeneration/'.$user->id; +// Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); -if (empty($page) || $page == -1) { +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; -} // If $page is not defined, or '' or -1 +} $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -100,7 +95,7 @@ $hookmanager->initHooks(array('interventionlist')); $extrafields = new ExtraFields($db); -// fetch optionals attributes and labels +// Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); @@ -125,7 +120,7 @@ $arrayfields = array( 'f.ref'=>array('label'=>'Ref', 'checked'=>1), 'f.ref_client'=>array('label'=>'RefCustomer', 'checked'=>1), 's.nom'=>array('label'=>'ThirdParty', 'checked'=>1), - 'pr.ref'=>array('label'=>'Project', 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1)), + 'pr.ref'=>array('label'=>'Project', 'checked'=>1, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1)), 'c.ref'=>array('label'=>'Contract', 'checked'=>1, 'enabled'=>(empty($conf->contrat->enabled) ? 0 : 1)), 'f.description'=>array('label'=>'Description', 'checked'=>1), 'f.datec'=>array('label'=>'DateCreation', 'checked'=>0, 'position'=>500), @@ -143,13 +138,24 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +// Security check +$id = GETPOST('id', 'int'); +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'ficheinter', $id, 'fichinter'); + +$permissiontoread = $user->rights->ficheinter->lire; +$permissiontodelete = $user->rights->ficheinter->supprimer; + /* * Actions */ if (GETPOST('cancel', 'alpha')) { - $action = 'list'; $massaction = ''; + $action = 'list'; + $massaction = ''; } if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; @@ -181,8 +187,6 @@ if (empty($reshook)) { // Mass actions $objectclass = 'Fichinter'; $objectlabel = 'Interventions'; - $permissiontoread = $user->rights->ficheinter->lire; - $permissiontodelete = $user->rights->ficheinter->supprimer; $uploaddir = $conf->ficheinter->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -193,21 +197,25 @@ if (empty($reshook)) { * View */ -$now = dol_now(); $form = new Form($db); $formfile = new FormFile($db); $objectstatic = new Fichinter($db); $companystatic = new Societe($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $projetstatic = new Project($db); } if (!empty($conf->contrat->enabled)) { $contratstatic = new Contrat($db); } +$now = dol_now(); + +$help_url = ''; $title = $langs->trans("ListOfInterventions"); -llxHeader('', $title); +$morejs = array(); +$morecss = array(); + $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields @@ -226,7 +234,7 @@ if (empty($conf->global->FICHINTER_DISABLE_DETAILS) && $atleastonefieldinlines) $sql .= " fd.rowid as lineid, fd.description as descriptiondetail, fd.date as dp, fd.duree,"; } $sql .= " s.nom as name, s.rowid as socid, s.client, s.fournisseur, s.email, s.status as thirdpartystatus"; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $sql .= ", pr.rowid as projet_id, pr.ref as projet_ref, pr.title as projet_title"; } if (!empty($conf->contrat->enabled)) { @@ -243,7 +251,7 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as pr on f.fk_projet = pr.rowid"; } if (!empty($conf->contrat->enabled)) { @@ -305,473 +313,541 @@ if ($sall) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; // Add GroupBy from hooks $parameters = array('all' => $all, 'fieldstosearchall' => $fieldstosearchall); $reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; -$sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $result = $db->query($sql); - $nbtotalofrecords = $db->num_rows($result); - if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 + /* This old and fast method to get and count full list returns all record so use a high amount of memory. */ + $resql = $db->query($sql); + $nbtotalofrecords = $db->num_rows($resql); + /* The fast and low memory method to get and count full list converts the sql into a sql count */ + /*$sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $resql = $db->query($sqlforcount); + if ($resql) { + $objforcount = $db->fetch_object($resql); + $nbtotalofrecords = $objforcount->nbtotalofrecords; + } else { + dol_print_error($db); + }*/ + + if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 $page = 0; $offset = 0; } + $db->free($resql); } -$sql .= $db->plimit($limit + 1, $offset); -//print $sql; +// Complete request and execute it with limit +$sql .= $db->order($sortfield, $sortorder); +if ($limit) { + $sql .= $db->plimit($limit + 1, $offset); +} $resql = $db->query($sql); -if ($resql) { - $num = $db->num_rows($resql); +if (!$resql) { + dol_print_error($db); + exit; +} - $arrayofselected = is_array($toselect) ? $toselect : array(); +$num = $db->num_rows($resql); - if ($socid > 0) { - $soc = new Societe($db); - $soc->fetch($socid); - if (empty($search_company)) { - $search_company = $soc->name; - } - } - $param = ''; - if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { - $param .= '&contextpage='.urlencode($contextpage); - } - if ($limit > 0 && $limit != $conf->liste_limit) { - $param .= '&limit='.urlencode($limit); - } - if ($sall) { - $param .= "&sall=".urlencode($sall); - } - if ($socid) { - $param .= "&socid=".urlencode($socid); - } - if ($search_ref) { - $param .= "&search_ref=".urlencode($search_ref); - } - if ($search_ref_client) { - $param .= "&search_ref_client=".urlencode($search_ref_client); - } - if ($search_company) { - $param .= "&search_company=".urlencode($search_company); - } - if ($search_desc) { - $param .= "&search_desc=".urlencode($search_desc); - } - if ($search_status != '' && $search_status > -1) { - $param .= "&search_status=".urlencode($search_status); - } - if ($show_files) { - $param .= '&show_files='.urlencode($show_files); - } - if ($optioncss != '') { - $param .= '&optioncss='.urlencode($optioncss); - } - // Add $param from extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; +// Direct jump if only one record found +if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { + $obj = $db->fetch_object($resql); + $id = $obj->rowid; + header("Location: ".dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$id); + exit; +} - // List of mass actions available - $arrayofmassactions = array( - 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), - 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), - //'presend'=>$langs->trans("SendByMail"), - ); - if ($user->rights->ficheinter->supprimer) { - $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); - } - if (in_array($massaction, array('presend', 'predelete'))) { - $arrayofmassactions = array(); - } - $massactionbutton = $form->selectMassAction('', $arrayofmassactions); - $newcardbutton = ''; +// Output page +// -------------------------------------------------------------------- - $url = DOL_URL_ROOT.'/fichinter/card.php?action=create'; - if (!empty($socid)) { - $url .= '&socid='.$socid; - } - $newcardbutton = dolGetButtonTitle($langs->trans('NewIntervention'), '', 'fa fa-plus-circle', $url, '', $user->rights->ficheinter->creer); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); - // Lines of title fields - print '
    '."\n"; - if ($optioncss != '') { - print ''; - } - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit, 0, 0, 1); +$arrayofselected = is_array($toselect) ? $toselect : array(); - $topicmail = "Information"; - $modelmail = "intervention"; - $objecttmp = new Fichinter($db); - $trackid = 'int'.$object->id; - include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; +if ($socid > 0) { + $soc = new Societe($db); + $soc->fetch($socid); + if (empty($search_company)) { + $search_company = $soc->name; + } +} - if ($sall) { - foreach ($fieldstosearchall as $key => $val) { - $fieldstosearchall[$key] = $langs->trans($val); - } - print '
    '.$langs->trans("FilterOnInto", $sall).join(', ', $fieldstosearchall).'
    '; - } +$param = ''; +if (!empty($mode)) { + $param .= '&mode='.urlencode($mode); +} +if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + $param .= '&contextpage='.urlencode($contextpage); +} +if ($limit > 0 && $limit != $conf->liste_limit) { + $param .= '&limit='.urlencode($limit); +} +if ($sall) { + $param .= "&sall=".urlencode($sall); +} +if ($socid) { + $param .= "&socid=".urlencode($socid); +} +if ($search_ref) { + $param .= "&search_ref=".urlencode($search_ref); +} +if ($search_ref_client) { + $param .= "&search_ref_client=".urlencode($search_ref_client); +} +if ($search_company) { + $param .= "&search_company=".urlencode($search_company); +} +if ($search_desc) { + $param .= "&search_desc=".urlencode($search_desc); +} +if ($search_status != '' && $search_status > -1) { + $param .= "&search_status=".urlencode($search_status); +} +if ($show_files) { + $param .= '&show_files='.urlencode($show_files); +} +if ($optioncss != '') { + $param .= '&optioncss='.urlencode($optioncss); +} +// Add $param from extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; +// Add $param from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook +$param .= $hookmanager->resPrint; - $moreforfilter = ''; +// List of mass actions available +$arrayofmassactions = array( + 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + //'presend'=>$langs->trans("SendByMail"), +); +if (!empty($permissiontodelete)) { + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); +} +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { + $arrayofmassactions = array(); +} +$massactionbutton = $form->selectMassAction('', $arrayofmassactions); - $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; - } - if (!empty($moreforfilter)) { - print '
    '; - print $moreforfilter; - print '
    '; - } +print ''."\n"; +if ($optioncss != '') { + print ''; +} +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; - if ($massactionbutton) { - $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); - } +$newcardbutton = ''; +$url = DOL_URL_ROOT.'/fichinter/card.php?action=create'; +if (!empty($socid)) { + $url .= '&socid='.$socid; +} +$newcardbutton = dolGetButtonTitle($langs->trans('NewIntervention'), '', 'fa fa-plus-circle', $url, '', $user->rights->ficheinter->creer); - print '
    '; - print '
    '.$langs->trans("Statistics").' - '.$langs->trans("Interventions").'
    '; @@ -159,21 +146,15 @@ if ($resql) { print '
    '.$fichinterstatic->LibStatut($status, $bool, 0).''.(isset($vals[$status.$bool]) ? $vals[$status.$bool] : 0).' '; - print $fichinterstatic->LibStatut($status, $bool, 3); + print ''.$fichinterstatic->LibStatut($status, 0).''.(isset($vals[$status]) ? $vals[$status] : 0).' '; + print $fichinterstatic->LibStatut($status, 3); print ''; print '
    '."\n"; +print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); - print ''; - if (!empty($arrayfields['f.ref']['checked'])) { - print ''; - } - if (!empty($arrayfields['f.ref_client']['checked'])) { - print ''; - } - if (!empty($arrayfields['s.nom']['checked'])) { - print ''; - } - if (!empty($arrayfields['pr.ref']['checked'])) { - print ''; - } - if (!empty($arrayfields['c.ref']['checked'])) { - print ''; - } - if (!empty($arrayfields['f.description']['checked'])) { - print ''; - } - // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; +$topicmail = "Information"; +$modelmail = "intervention"; +$objecttmp = new Fichinter($db); +$trackid = 'int'.$object->id; +include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; - // 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; - if (!empty($arrayfields['f.datec']['checked'])) { - // Date creation - print ''; +if ($sall) { + foreach ($fieldstosearchall as $key => $val) { + $fieldstosearchall[$key] = $langs->trans($val); } - if (!empty($arrayfields['f.tms']['checked'])) { - // Date modification - print ''; - } - if (!empty($arrayfields['f.note_public']['checked'])) { - // Note public - print ''; - } - if (!empty($arrayfields['f.note_private']['checked'])) { - // Note private - print ''; - } - // Status - if (!empty($arrayfields['f.fk_statut']['checked'])) { - print ''; - } - // Fields of detail line - if (!empty($arrayfields['fd.description']['checked'])) { - print ''; - } - if (!empty($arrayfields['fd.date']['checked'])) { - print ''; - } - if (!empty($arrayfields['fd.duree']['checked'])) { - print ''; + print '
    '.$langs->trans("FilterOnInto", $sall).join(', ', $fieldstosearchall).'
    '; +} + +$moreforfilter = ''; + +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook +if (empty($reshook)) { + $moreforfilter .= $hookmanager->resPrint; +} else { + $moreforfilter = $hookmanager->resPrint; +} + +if (!empty($moreforfilter)) { + print '
    '; + print $moreforfilter; + print '
    '; +} + +$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); + +print '
    '; +print '
    '; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - $tmp = $objectstatic->LibStatut(0); // To load $this->statuts_short - $liststatus = $objectstatic->statuts_short; - if (empty($conf->global->FICHINTER_CLASSIFY_BILLED)) { - unset($liststatus[2]); // Option deprecated. In a future, billed must be managed with a dedicated field to 0 or 1 - } - print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 1); - print '   
    '."\n"; + +// Fields title search +// -------------------------------------------------------------------- +print ''; +// Action column +if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print ''; +} +if (!empty($arrayfields['f.ref']['checked'])) { + print ''; +} +if (!empty($arrayfields['f.ref_client']['checked'])) { + print ''; +} +if (!empty($arrayfields['s.nom']['checked'])) { + print ''; +} +if (!empty($arrayfields['pr.ref']['checked'])) { + print ''; +} +if (!empty($arrayfields['c.ref']['checked'])) { + print ''; +} +if (!empty($arrayfields['f.description']['checked'])) { + print ''; +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; + +// Fields from hook +$parameters = array('arrayfields'=>$arrayfields); +$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +if (!empty($arrayfields['f.datec']['checked'])) { + // Date creation + print ''; +} +if (!empty($arrayfields['f.tms']['checked'])) { + // Date modification + print ''; +} +if (!empty($arrayfields['f.note_public']['checked'])) { + // Note public + print ''; +} +if (!empty($arrayfields['f.note_private']['checked'])) { + // Note private + print ''; +} +// Status +if (!empty($arrayfields['f.fk_statut']['checked'])) { + print ''; +} +// Fields of detail line +if (!empty($arrayfields['fd.description']['checked'])) { + print ''; +} +if (!empty($arrayfields['fd.date']['checked'])) { + print ''; +} +if (!empty($arrayfields['fd.duree']['checked'])) { + print ''; +} +// Action column +if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { print ''; +} +print ''."\n"; - print "\n"; +$totalarray = array(); +$totalarray['nbfield'] = 0; + +// Fields title label +// -------------------------------------------------------------------- +print ''; +if (!empty($arrayfields['f.ref']['checked'])) { + print_liste_field_titre($arrayfields['f.ref']['label'], $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['f.ref_client']['checked'])) { + print_liste_field_titre($arrayfields['f.ref_client']['label'], $_SERVER["PHP_SELF"], "f.ref_client", "", $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['s.nom']['checked'])) { + print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['pr.ref']['checked'])) { + print_liste_field_titre($arrayfields['pr.ref']['label'], $_SERVER["PHP_SELF"], "pr.ref", "", $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['c.ref']['checked'])) { + print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], "c.ref", "", $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['f.description']['checked'])) { + print_liste_field_titre($arrayfields['f.description']['label'], $_SERVER["PHP_SELF"], "f.description", "", $param, '', $sortfield, $sortorder); +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; +// 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['f.datec']['checked'])) { + print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER["PHP_SELF"], "f.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap '); +} +if (!empty($arrayfields['f.tms']['checked'])) { + print_liste_field_titre($arrayfields['f.tms']['label'], $_SERVER["PHP_SELF"], "f.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap '); +} +if (!empty($arrayfields['f.note_public']['checked'])) { + print_liste_field_titre($arrayfields['f.note_public']['label'], $_SERVER["PHP_SELF"], "f.note_public", "", $param, '', $sortfield, $sortorder, 'center nowrap '); +} +if (!empty($arrayfields['f.note_private']['checked'])) { + print_liste_field_titre($arrayfields['f.note_private']['label'], $_SERVER["PHP_SELF"], "f.note_private", "", $param, '', $sortfield, $sortorder, 'center nowrap '); +} +if (!empty($arrayfields['f.fk_statut']['checked'])) { + print_liste_field_titre($arrayfields['f.fk_statut']['label'], $_SERVER["PHP_SELF"], "f.fk_statut", "", $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['fd.description']['checked'])) { + print_liste_field_titre($arrayfields['fd.description']['label'], $_SERVER["PHP_SELF"], ''); +} +if (!empty($arrayfields['fd.date']['checked'])) { + print_liste_field_titre($arrayfields['fd.date']['label'], $_SERVER["PHP_SELF"], "fd.date", "", $param, '', $sortfield, $sortorder, 'center '); +} +if (!empty($arrayfields['fd.duree']['checked'])) { + print_liste_field_titre($arrayfields['fd.duree']['label'], $_SERVER["PHP_SELF"], "fd.duree", "", $param, '', $sortfield, $sortorder, 'right '); +} +print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); +print "\n"; + + +// Loop on record +// -------------------------------------------------------------------- +$total = 0; +$i = 0; +$savnbfield = $totalarray['nbfield']; +$totalarray = array(); +$totalarray['nbfield'] = 0; +$totalarray['val'] = array(); +$totalarray['val']['fd.duree'] = 0; +$imaxinloop = ($limit ? min($num, $limit) : $num); +while ($i < $imaxinloop) { + $obj = $db->fetch_object($resql); + if (empty($obj)) { + break; // Should not happen + } + + // Store properties in $object + //$object->setVarsFromFetchObj($obj); + + $objectstatic->id = $obj->rowid; + $objectstatic->ref = $obj->ref; + $objectstatic->ref_client = $obj->ref_client; + $objectstatic->statut = $obj->status; + $objectstatic->status = $obj->status; + + $companystatic->name = $obj->name; + $companystatic->id = $obj->socid; + $companystatic->client = $obj->client; + $companystatic->fournisseur = $obj->fournisseur; + $companystatic->email = $obj->email; + $companystatic->status = $obj->thirdpartystatus; + + print ''; - print ''; if (!empty($arrayfields['f.ref']['checked'])) { - print_liste_field_titre($arrayfields['f.ref']['label'], $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder); + print "\n"; + if (!$i) { + $totalarray['nbfield']++; + } } if (!empty($arrayfields['f.ref_client']['checked'])) { - print_liste_field_titre($arrayfields['f.ref_client']['label'], $_SERVER["PHP_SELF"], "f.ref_client", "", $param, '', $sortfield, $sortorder); + // Customer ref + print ''; + if (!$i) { + $totalarray['nbfield']++; + } } if (!empty($arrayfields['s.nom']['checked'])) { - print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } } if (!empty($arrayfields['pr.ref']['checked'])) { - print_liste_field_titre($arrayfields['pr.ref']['label'], $_SERVER["PHP_SELF"], "pr.ref", "", $param, '', $sortfield, $sortorder); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } } if (!empty($arrayfields['c.ref']['checked'])) { - print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], "c.ref", "", $param, '', $sortfield, $sortorder); + print ''; + } + if (!$i) { + $totalarray['nbfield']++; + } } if (!empty($arrayfields['f.description']['checked'])) { - print_liste_field_titre($arrayfields['f.description']['label'], $_SERVER["PHP_SELF"], "f.description", "", $param, '', $sortfield, $sortorder); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } } + // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; - // 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 + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; + // Fields from hook + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; + // Date creation if (!empty($arrayfields['f.datec']['checked'])) { - print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER["PHP_SELF"], "f.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap '); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } } + // Date modification if (!empty($arrayfields['f.tms']['checked'])) { - print_liste_field_titre($arrayfields['f.tms']['label'], $_SERVER["PHP_SELF"], "f.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap '); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } } + // Note public if (!empty($arrayfields['f.note_public']['checked'])) { - print_liste_field_titre($arrayfields['f.note_public']['label'], $_SERVER["PHP_SELF"], "f.note_public", "", $param, '', $sortfield, $sortorder, 'center nowrap '); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } } + // Note private if (!empty($arrayfields['f.note_private']['checked'])) { - print_liste_field_titre($arrayfields['f.note_private']['label'], $_SERVER["PHP_SELF"], "f.note_private", "", $param, '', $sortfield, $sortorder, 'center nowrap '); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } } + // Status if (!empty($arrayfields['f.fk_statut']['checked'])) { - print_liste_field_titre($arrayfields['f.fk_statut']['label'], $_SERVER["PHP_SELF"], "f.fk_statut", "", $param, '', $sortfield, $sortorder, 'right '); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } } + // Fields of detail of line if (!empty($arrayfields['fd.description']['checked'])) { - print_liste_field_titre($arrayfields['fd.description']['label'], $_SERVER["PHP_SELF"], ''); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } } if (!empty($arrayfields['fd.date']['checked'])) { - print_liste_field_titre($arrayfields['fd.date']['label'], $_SERVER["PHP_SELF"], "fd.date", "", $param, '', $sortfield, $sortorder, 'center '); + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } } if (!empty($arrayfields['fd.duree']['checked'])) { - print_liste_field_titre($arrayfields['fd.duree']['label'], $_SERVER["PHP_SELF"], "fd.duree", "", $param, '', $sortfield, $sortorder, 'right '); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['type'][$totalarray['nbfield']] = 'duration'; + } + $totalarray['val']['fd.duree'] += $obj->duree; } - print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); - print "\n"; - - $total = 0; - $i = 0; - $totalarray = array(); - $totalarray['nbfield'] = 0; - $totalarray['val'] = array(); - $totalarray['val']['fd.duree'] = 0; - while ($i < min($num, $limit)) { - $obj = $db->fetch_object($resql); - - $objectstatic->id = $obj->rowid; - $objectstatic->ref = $obj->ref; - $objectstatic->ref_client = $obj->ref_client; - $objectstatic->statut = $obj->status; - $objectstatic->status = $obj->status; - - $companystatic->name = $obj->name; - $companystatic->id = $obj->socid; - $companystatic->client = $obj->client; - $companystatic->fournisseur = $obj->fournisseur; - $companystatic->email = $obj->email; - $companystatic->status = $obj->thirdpartystatus; - - print ''; - - if (!empty($arrayfields['f.ref']['checked'])) { - print "\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - if (!empty($arrayfields['f.ref_client']['checked'])) { - // Customer ref - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - if (!empty($arrayfields['s.nom']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - if (!empty($arrayfields['pr.ref']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - if (!empty($arrayfields['c.ref']['checked'])) { - print ''; - } - if (!$i) { - $totalarray['nbfield']++; - } - } - if (!empty($arrayfields['f.description']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; - // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); - $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - // Date creation - if (!empty($arrayfields['f.datec']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Date modification - if (!empty($arrayfields['f.tms']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Note public - if (!empty($arrayfields['f.note_public']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Note private - if (!empty($arrayfields['f.note_private']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Status - if (!empty($arrayfields['f.fk_statut']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Fields of detail of line - if (!empty($arrayfields['fd.description']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - if (!empty($arrayfields['fd.date']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - if (!empty($arrayfields['fd.duree']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['type'][$totalarray['nbfield']] = 'duration'; - } - $totalarray['val']['fd.duree'] += $obj->duree; - } - // Action column + // Action column + if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { print ''; - if (!$i) { - $totalarray['nbfield']++; - } - - print "\n"; - - $total += $obj->duree; - $i++; + } + if (!$i) { + $totalarray['nbfield']++; } + print ''."\n"; + + $total += $obj->duree; + $i++; +} - // Show total line - include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; +// Show total line +include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; - $db->free($resql); +// If no record found +if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''; +} - $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; +$db->free($resql); - print '
    '; + $searchpicto = $form->showFilterButtons('left'); + print $searchpicto; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + $tmp = $objectstatic->LibStatut(0); // To load $this->statuts_short + $liststatus = $objectstatic->statuts_short; + if (empty($conf->global->FICHINTER_CLASSIFY_BILLED)) { + unset($liststatus[2]); // Option deprecated. In a future, billed must be managed with a dedicated field to 0 or 1 } + print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 1); + print '   '; $searchpicto = $form->showFilterButtons(); print $searchpicto; print '
    "; + + print ''; + // Picto + Ref + print ''; + // Warning + $warnornote = ''; + //if ($obj->fk_statut == 1 && $db->jdate($obj->dfv) < ($now - $conf->fichinter->warning_delay)) $warnornote.=img_warning($langs->trans("Late")); + if (!empty($obj->note_private)) { + $warnornote .= ($warnornote ? ' ' : ''); + $warnornote .= ''; + $warnornote .= ''.img_picto($langs->trans("ViewPrivateNote"), 'object_generic').''; + $warnornote .= ''; + } + if ($warnornote) { + print ''; + } + + // Other picto tool + print '
    '; + print $objectstatic->getNomUrl(1); + print ''; + print $warnornote; + print ''; + $filename = dol_sanitizeFileName($obj->ref); + $filedir = $conf->ficheinter->dir_output.'/'.dol_sanitizeFileName($obj->ref); + $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid; + print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); + print '
    '; + + print "
    '; + print $obj->ref_client; + print ''; + print $companystatic->getNomUrl(1, '', 44); + print ''; + $projetstatic->id = $obj->projet_id; + $projetstatic->ref = $obj->projet_ref; + $projetstatic->title = $obj->projet_title; + if ($projetstatic->id > 0) { + print $projetstatic->getNomUrl(1, ''); + } + print ''; + $contratstatic->id = $obj->contrat_id; + $contratstatic->ref = $obj->contrat_ref; + $contratstatic->ref_customer = $obj->contrat_ref_customer; + $contratstatic->ref_supplier = $obj->contrat_ref_supplier; + if ($contratstatic->id > 0) { + print $contratstatic->getNomUrl(1, ''); + print ''.dol_trunc(dolGetFirstLineOfText(dol_string_nohtmltag($obj->description, 1)), 48).''; + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); + print ''; + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); + print ''; + print dol_escape_htmltag($obj->note_public); + print ''; + print dol_escape_htmltag($obj->note_private); + print ''.$objectstatic->getLibStatut(5).''.dol_trunc(dolGetFirstLineOfText(dol_string_nohtmltag($obj->descriptiondetail, 1)), 48).''.dol_print_date($db->jdate($obj->dp), 'dayhour')."'.convertSecondToTime($obj->duree, 'allhourmin').'
    "; - - print ''; - // Picto + Ref - print ''; - // Warning - $warnornote = ''; - //if ($obj->fk_statut == 1 && $db->jdate($obj->dfv) < ($now - $conf->fichinter->warning_delay)) $warnornote.=img_warning($langs->trans("Late")); - if (!empty($obj->note_private)) { - $warnornote .= ($warnornote ? ' ' : ''); - $warnornote .= ''; - $warnornote .= ''.img_picto($langs->trans("ViewPrivateNote"), 'object_generic').''; - $warnornote .= ''; - } - if ($warnornote) { - print ''; - } - - // Other picto tool - print '
    '; - print $objectstatic->getNomUrl(1); - print ''; - print $warnornote; - print ''; - $filename = dol_sanitizeFileName($obj->ref); - $filedir = $conf->ficheinter->dir_output.'/'.dol_sanitizeFileName($obj->ref); - $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid; - print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); - print '
    '; - - print "
    '; - print $obj->ref_client; - print ''; - print $companystatic->getNomUrl(1, '', 44); - print ''; - $projetstatic->id = $obj->projet_id; - $projetstatic->ref = $obj->projet_ref; - $projetstatic->title = $obj->projet_title; - if ($projetstatic->id > 0) { - print $projetstatic->getNomUrl(1, ''); - } - print ''; - $contratstatic->id = $obj->contrat_id; - $contratstatic->ref = $obj->contrat_ref; - $contratstatic->ref_customer = $obj->contrat_ref_customer; - $contratstatic->ref_supplier = $obj->contrat_ref_supplier; - if ($contratstatic->id > 0) { - print $contratstatic->getNomUrl(1, ''); - print ''.dol_trunc(dolGetFirstLineOfText(dol_string_nohtmltag($obj->description, 1)), 48).''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); - print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); - print ''; - print dol_escape_htmltag($obj->note_public); - print ''; - print dol_escape_htmltag($obj->note_private); - print ''.$objectstatic->getLibStatut(5).''.dol_trunc(dolGetFirstLineOfText(dol_string_nohtmltag($obj->descriptiondetail, 1)), 48).''.dol_print_date($db->jdate($obj->dp), 'dayhour')."'.convertSecondToTime($obj->duree, 'allhourmin').''; if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined $selected = 0; @@ -781,37 +857,52 @@ if ($resql) { print ''; } print '
    '.$langs->trans("NoRecordFound").'
    '."\n"; - print '
    '; +$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; - print "\n"; +print ''."\n"; +print '
    '."\n"; +print ''."\n"; + +if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; } + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; + $formfile = new FormFile($db); + // Show list of available documents $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; $urlsource .= str_replace('&', '&', $param); @@ -821,10 +912,8 @@ if ($resql) { $delallowed = $user->rights->ficheinter->creer; print $formfile->showdocuments('massfilesarea_interventions', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); -} else { - dol_print_error($db); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/fichinter/note.php b/htdocs/fichinter/note.php index 579760cf55f..be5f67da555 100644 --- a/htdocs/fichinter/note.php +++ b/htdocs/fichinter/note.php @@ -27,7 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -88,7 +88,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index c2962836fa2..e5b7c62aae4 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -294,8 +294,9 @@ $suburi = strstr($uri, '/'); // $suburi contains url without domain:port if ($suburi == '/') { $suburi = ''; // If $suburi is /, it is now '' } -define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...) - +if (!defined('DOL_URL_ROOT')) { + define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...) +} //print DOL_MAIN_URL_ROOT.'-'.DOL_URL_ROOT."\n"; // Define prefix MAIN_DB_PREFIX diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 8ad44d198a8..fb89cd2c455 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -70,7 +70,7 @@ $extrafields = new ExtraFields($db); $extrafields->fetch_name_optionals_label($object->table_element); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('suppliercard', 'globalcard')); +$hookmanager->initHooks(array('thirdpartysupplier', 'globalcard')); // Security check $result = restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid', 0); @@ -147,6 +147,7 @@ if (empty($reshook)) { if (!$error) { $result = $object->insertExtraFields('COMPANY_MODIFY'); if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); $error++; } } @@ -170,6 +171,7 @@ if ($id > 0 && empty($object->id)) { $res = $object->fetch($id); if ($object->id <= 0) { dol_print_error($db, $object->error); + exit(-1); } } @@ -881,7 +883,7 @@ if ($object->id > 0) { } // Add action - if (!empty($conf->agenda->enabled) && !empty($conf->global->MAIN_REPEATTASKONEACHTAB) && $object->status == 1) { + if (isModEnabled('agenda') && !empty($conf->global->MAIN_REPEATTASKONEACHTAB) && $object->status == 1) { if ($user->rights->agenda->myactions->create) { print dolGetButtonAction('', $langs->trans('AddAction'), 'default', DOL_URL_ROOT.'/comm/action/card.php?action=create&socid='.$object->id, ''); } else { diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index 418d8fa6600..17146eecd35 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -473,7 +473,6 @@ class SupplierInvoices extends DolibarrApi $paiement->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching $paiement->paiementid = $payment_mode_id; $paiement->paiementcode = dol_getIdFromCode($this->db, $payment_mode_id, 'c_paiement', 'id', 'code', 1); - $paiement->oper = $paiement->paiementcode; // For backward compatibility $paiement->num_payment = $num_payment; $paiement->note_public = $comment; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 1d0e370355f..f134f04e618 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -218,7 +218,7 @@ class CommandeFournisseur extends CommonOrder 'ref' =>array('type'=>'varchar(255)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'showoncombobox'=>1, 'position'=>25, 'searchall'=>1), 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>35), 'ref_supplier' =>array('type'=>'varchar(255)', 'label'=>'RefOrderSupplierShort', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'searchall'=>1), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>45), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>45), 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>60), 'date_approve' =>array('type'=>'datetime', 'label'=>'DateApprove', 'enabled'=>1, 'visible'=>-1, 'position'=>62), 'date_approve2' =>array('type'=>'datetime', 'label'=>'DateApprove2', 'enabled'=>1, 'visible'=>3, 'position'=>64), @@ -856,6 +856,9 @@ class CommandeFournisseur extends CommonOrder if (!empty($this->total_ttc)) { $label .= '
    '.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); } + if (!empty($this->date)) { + $label .= '
    '.$langs->trans('Date').': '.dol_print_date($this->date, 'day'); + } if (!empty($this->delivery_date)) { $label .= '
    '.$langs->trans('DeliveryDate').': '.dol_print_date($this->delivery_date, 'dayhour'); } diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index 5bfafff57b5..27c991e5896 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -75,7 +75,7 @@ class CommandeFournisseurDispatch extends CommonObjectLine public $fk_product; /** - * @var int ID + * @var int ID. Should be named fk_origin_line ? */ public $fk_commandefourndet; diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index 9464c06bd4c..31bc37b6e1a 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -195,7 +195,7 @@ class FactureFournisseurRec extends CommonInvoice 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>80), 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>210), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>85), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>85), 'fk_account' =>array('type'=>'integer', 'label'=>'Fk account', 'enabled'=>'$conf->banque->enabled', 'visible'=>-1, 'position'=>175), 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'Fk cond reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>90), 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'Fk mode reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>95), @@ -564,7 +564,7 @@ class FactureFournisseurRec extends CommonInvoice $sql .= ', f.vat_src_code, f.localtax1, f.localtax2'; $sql .= ', f.total_tva, f.total_ht, f.total_ttc'; $sql .= ', f.fk_user_author, f.fk_user_modif'; - $sql .= ', f.fk_projet, f.fk_account'; + $sql .= ', f.fk_projet as fk_project, f.fk_account'; $sql .= ', f.fk_mode_reglement, p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; $sql .= ', f.fk_cond_reglement, c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc'; $sql .= ', f.date_lim_reglement'; @@ -610,7 +610,7 @@ class FactureFournisseurRec extends CommonInvoice $this->total_ttc = $obj->total_ttc; $this->user_author = $obj->fk_user_author; $this->user_modif = $obj->fk_user_modif; - $this->fk_project = $obj->fk_projet; + $this->fk_project = $obj->fk_project; $this->fk_account = $obj->fk_account; $this->mode_reglement_id = $obj->fk_mode_reglement; $this->mode_reglement_code = $obj->mode_reglement_code; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 948e1c01deb..df10ed07632 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -297,7 +297,7 @@ class FactureFournisseur extends CommonInvoice 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>130), 'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>135), 'fk_facture_source' =>array('type'=>'integer', 'label'=>'Fk facture source', 'enabled'=>1, 'visible'=>-1, 'position'=>140), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>145), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>145), 'fk_account' =>array('type'=>'integer', 'label'=>'Account', 'enabled'=>'$conf->banque->enabled', 'visible'=>-1, 'position'=>150), 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'PaymentTerm', 'enabled'=>1, 'visible'=>-1, 'position'=>155), 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'PaymentMode', 'enabled'=>1, 'visible'=>-1, 'position'=>160), @@ -443,7 +443,8 @@ class FactureFournisseur extends CommonInvoice $this->entity = $_facrec->entity; // Invoice created in same entity than template // Fields coming from GUI (priority on template). TODO Value of template should be used as default value on GUI so we can use here always value from GUI - $this->fk_projet = GETPOST('projectid', 'int') > 0 ? ((int) GETPOST('projectid', 'int')) : $_facrec->fk_projet; + $this->fk_project = GETPOST('projectid', 'int') > 0 ? ((int) GETPOST('projectid', 'int')) : $_facrec->fk_projet; + $this->fk_projet = $this->fk_project; $this->note_public = GETPOST('note_public', 'restricthtml') ? GETPOST('note_public', 'restricthtml') : $_facrec->note_public; $this->note_private = GETPOST('note_private', 'restricthtml') ? GETPOST('note_private', 'restricthtml') : $_facrec->note_private; $this->model_pdf = GETPOST('model', 'alpha') ? GETPOST('model', 'alpha') : $_facrec->model_pdf; diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index d113eadd8a7..690558fc9ad 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/productfournisseurprice.class.php'; /** @@ -256,9 +257,10 @@ class ProductFournisseur extends Product * @param string $desc_fourn Custom description for product_fourn_price * @param string $barcode Barcode * @param int $fk_barcode_type Barcode type + * @param array $options Extrafields of product fourn price * @return int <0 if KO, >=0 if OK */ - public function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges = 0, $remise_percent = 0, $remise = 0, $newnpr = 0, $delivery_time_days = 0, $supplier_reputation = '', $localtaxes_array = array(), $newdefaultvatcode = '', $multicurrency_buyprice = 0, $multicurrency_price_base_type = 'HT', $multicurrency_tx = 1, $multicurrency_code = '', $desc_fourn = '', $barcode = '', $fk_barcode_type = '') + public function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges = 0, $remise_percent = 0, $remise = 0, $newnpr = 0, $delivery_time_days = 0, $supplier_reputation = '', $localtaxes_array = array(), $newdefaultvatcode = '', $multicurrency_buyprice = 0, $multicurrency_price_base_type = 'HT', $multicurrency_tx = 1, $multicurrency_code = '', $desc_fourn = '', $barcode = '', $fk_barcode_type = '', $options = array()) { // phpcs:enable global $conf, $langs; @@ -407,7 +409,21 @@ class ProductFournisseur extends Product $sql .= ", packaging = ".(empty($packaging) ? 1 : $packaging); } $sql .= " WHERE rowid = ".((int) $this->product_fourn_price_id); - //print $sql;exit; + + if (!$error) { + if (!empty($options) && is_array($options)) { + $productfournisseurprice = new ProductFournisseurPrice($this->db); + $res = $productfournisseurprice->fetch($this->product_fourn_price_id); + if ($res > 0) { + foreach ($options as $key=>$value) { + $productfournisseurprice->array_options[$key] = $value; + } + $res = $productfournisseurprice->update($user); + if ($res < 0) $error++; + } + } + } + // TODO Add price_base_type and price_ttc dol_syslog(get_class($this).'::update_buyprice update knowing id of line = product_fourn_price_id = '.$this->product_fourn_price_id, LOG_DEBUG); @@ -493,6 +509,20 @@ class ProductFournisseur extends Product $error++; } + if (!$error) { + if (!empty($options) && is_array($options)) { + $productfournisseurprice = new ProductFournisseurPrice($this->db); + $res = $productfournisseurprice->fetch($this->product_fourn_price_id); + if ($res > 0) { + foreach ($options as $key=>$value) { + $productfournisseurprice->array_options[$key] = $value; + } + $res = $productfournisseurprice->update($user); + if ($res < 0) $error++; + } + } + } + if (!$error && empty($conf->global->PRODUCT_PRICE_SUPPLIER_NO_LOG)) { // Add record into log table // $this->product_fourn_price_id must be set diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 6ab316edb56..19a630871fc 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -49,7 +49,7 @@ if (!empty($conf->supplier_proposal->enabled)) { if (!empty($conf->product->enabled)) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -160,7 +160,7 @@ $permissiontoadd = $usercancreate; // Used by the include of actions_addupdatede // Project permission $caneditproject = false; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $caneditproject = empty($conf->global->SUPPLIER_ORDER_FORBID_EDIT_PROJECT) || ($object->statut == CommandeFournisseur::STATUS_DRAFT && preg_match('/^[\(]?PROV/i', $object->ref)); } @@ -1534,7 +1534,7 @@ $form = new Form($db); $formfile = new FormFile($db); $formorder = new FormOrder($db); $productstatic = new Product($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -1746,7 +1746,7 @@ if ($action == 'create') { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); $langs->load('projects'); @@ -2034,7 +2034,7 @@ if ($action == 'create') { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($usercancreate) { @@ -2080,7 +2080,7 @@ if ($action == 'create') { // Date if ($object->methode_commande_id > 0) { print ''.$langs->trans("Date").''; - print $object->date_commande ? dol_print_date($object->date_commande, $usehourmin) : ''; + print $object->date_commande ? dol_print_date($object->date_commande, $usehourmin ? 'dayhour' : 'day') : ''; if ($object->hasDelay() && !empty($object->date_delivery) && !empty($object->date_commande)) { print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); } @@ -2301,17 +2301,17 @@ if ($action == 'create') { if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) { // Multicurrency Amount HT print ''.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).''; - print ''.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; // Multicurrency Amount VAT print ''.$form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0).''; - print ''.price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; // Multicurrency Amount TTC print ''.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).''; - print ''.price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; } @@ -2321,27 +2321,29 @@ if ($action == 'create') { $alert = ' '.img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->supplier_order_min_amount)); } print ''.$langs->trans("AmountHT").''; - print ''.price($object->total_ht, '', $langs, 1, -1, -1, $conf->currency).$alert.''; + print ''.price($object->total_ht, '', $langs, 1, -1, -1, $conf->currency).$alert.''; print ''; // Total VAT - print ''.$langs->trans("AmountVAT").''.price($object->total_tva, '', $langs, 1, -1, -1, $conf->currency).''; + print ''.$langs->trans("AmountVAT").''; + print ''.price($object->total_tva, '', $langs, 1, -1, -1, $conf->currency).''; print ''; // Amount Local Taxes if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { //Localtax1 print ''.$langs->transcountry("AmountLT1", $mysoc->country_code).''; - print ''.price($object->total_localtax1, '', $langs, 1, -1, -1, $conf->currency).''; + print ''.price($object->total_localtax1, '', $langs, 1, -1, -1, $conf->currency).''; print ''; } if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { //Localtax2 print ''.$langs->transcountry("AmountLT2", $mysoc->country_code).''; - print ''.price($object->total_localtax2, '', $langs, 1, -1, -1, $conf->currency).''; + print ''.price($object->total_localtax2, '', $langs, 1, -1, -1, $conf->currency).''; print ''; } // Total TTC - print ''.$langs->trans("AmountTTC").''.price($object->total_ttc, '', $langs, 1, -1, -1, $conf->currency).''; + print ''.$langs->trans("AmountTTC").''; + print ''.price($object->total_ttc, '', $langs, 1, -1, -1, $conf->currency).''; print ''; print ''; @@ -2573,7 +2575,7 @@ if ($action == 'create') { } // Create bill - //if (! empty($conf->facture->enabled)) + //if (isModEnabled('facture')) //{ if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && ($object->statut >= 2 && $object->statut != 7 && $object->billed != 1)) { // statut 2 means approved, 7 means canceled if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { @@ -2584,7 +2586,7 @@ if ($action == 'create') { // Classify billed manually (need one invoice if module invoice is on, no condition on invoice if not) if ($usercancreate && $object->statut >= 2 && $object->statut != 7 && $object->billed != 1) { // statut 2 means approved - if (empty($conf->facture->enabled)) { + if (!isModEnabled('facture')) { print '
    '.$langs->trans("ClassifyBilled").''; } else { if (!empty($object->linkedObjectsIds['invoice_supplier'])) { diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php index e521caf1080..f05251993a7 100644 --- a/htdocs/fourn/commande/contact.php +++ b/htdocs/fourn/commande/contact.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -135,7 +135,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 362741e1641..7b352a01abc 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -553,7 +553,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index d54d5553efb..ca43b69fd5e 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -131,7 +131,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php index 6c64672ee84..771a6faf23f 100644 --- a/htdocs/fourn/commande/info.php +++ b/htdocs/fourn/commande/info.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -139,7 +139,7 @@ $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_ // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { @@ -201,7 +201,7 @@ if ($permok) { print '
    '; -if (!empty($conf->agenda->enabled)) { +if (isModEnabled('agenda')) { if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { print ''.$langs->trans("AddAction").''; } else { diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index cc8bae4d907..22c4921b5b1 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -209,6 +209,12 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); $error = 0; +$permissiontoread = ($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire); +$permissiontoadd = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); +$permissiontodelete = ($user->rights->fournisseur->commande->supprimer || $user->rights->supplier_order->supprimer); +$permissiontovalidate = $permissiontoadd; +$permissiontoapprove = ($user->rights->fournisseur->commande->approuver || $user->rights->supplier_order->approuver); + /* * Actions @@ -302,9 +308,6 @@ if (empty($reshook)) { // Mass actions $objectclass = 'CommandeFournisseur'; $objectlabel = 'SupplierOrders'; - $permissiontoread = $user->rights->fournisseur->commande->lire; - $permissiontodelete = $user->rights->fournisseur->commande->supprimer; - $permissiontovalidate = $user->rights->fournisseur->commande->creer; $uploaddir = $conf->fournisseur->commande->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; @@ -321,7 +324,7 @@ if (empty($reshook)) { $result = $objecttmp->valid($user); if ($result >= 0) { // If we have permission, and if we don't need to provide the idwarehouse, we go directly on approved step - if (empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE) && $user->rights->fournisseur->commande->approuver && !(!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $objecttmp->hasProductsOrServices(1))) { + if (empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE) && $permissiontoapprove && !(!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $objecttmp->hasProductsOrServices(1))) { $result = $objecttmp->approve($user); setEventMessages($langs->trans("SupplierOrderValidatedAndApproved"), array($objecttmp->ref)); } else { @@ -1096,7 +1099,7 @@ if ($resql) { ); if ($permissiontovalidate) { - if ($user->rights->fournisseur->commande->approuver && empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE)) { + if ($permissiontoapprove && empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE)) { $arrayofmassactions['prevalidate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("ValidateAndApprove"); } else { $arrayofmassactions['prevalidate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"); @@ -1106,7 +1109,7 @@ if ($resql) { if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { $arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisSupplier"); } - if ($user->rights->fournisseur->commande->supprimer) { + if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (in_array($massaction, array('presend', 'predelete', 'createbills'))) { @@ -1119,7 +1122,7 @@ if ($resql) { $url .= '&socid='.((int) $socid); $url .= '&backtopage='.urlencode(DOL_URL_ROOT.'/fourn/commande/list.php?socid='.((int) $socid)); } - $newcardbutton = dolGetButtonTitle($langs->trans('NewSupplierOrderShort'), '', 'fa fa-plus-circle', $url, '', ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)); + $newcardbutton = dolGetButtonTitle($langs->trans('NewSupplierOrderShort'), '', 'fa fa-plus-circle', $url, '', $permissitiontoadd); // Lines of title fields print '
    '; @@ -1532,7 +1535,9 @@ if ($resql) { $totalarray = array('nbfield' => 0, 'val' => array(), 'pos' => array()); $totalarray['val']['cf.total_ht'] = 0; $totalarray['val']['cf.total_ttc'] = 0; - while ($i < min($num, $limit)) { + + $imaxinloop = ($limit ? min($num, $limit) : $num); + while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); $notshippable = 0; @@ -1855,6 +1860,17 @@ if ($resql) { // Show total line include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + // If no record found + if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''.$langs->trans("NoRecordFound").''; + } + $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); @@ -1876,8 +1892,8 @@ if ($resql) { $urlsource .= str_replace('&', '&', $param); $filedir = $diroutputmassaction; - $genallowed = ($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire); - $delallowed = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); + $genallowed = $permissiontoread; + $delallowed = $permissiontoadd; print $formfile->showdocuments('massfilesarea_supplier_order', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); } else { diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php index 1c67c03d727..d2c7398a98c 100644 --- a/htdocs/fourn/commande/note.php +++ b/htdocs/fourn/commande/note.php @@ -28,7 +28,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -106,7 +106,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index 502d0d124ce..e996f29b3c8 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture-rec.class.php require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; -if (! empty($conf->projet->enabled)) { +if (! empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; } require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; @@ -185,10 +185,10 @@ if (empty($reshook)) { } if (! $error) { - $object->titre = GETPOST('title', 'nohtml'); // deprecated - $object->title = GETPOST('title', 'nohtml'); + $object->titre = GETPOST('title', 'alphanohtml'); // deprecated + $object->title = GETPOST('title', 'alphanohtml'); $object->fk_project = GETPOST('projectid', 'int'); - $object->ref_supplier = GETPOST('ref_supplier', 'nohtml'); + $object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml'); $object->note_private = GETPOST('note_private', 'restricthtml'); $object->note_public = GETPOST('note_public', 'restricthtml'); @@ -869,7 +869,7 @@ llxHeader('', $langs->trans("RepeatableSupplierInvoice"), $help_url); $form = new Form($db); $formother = new FormOther($db); -if (! empty($conf->projet->enabled)) { +if (! empty($conf->project->enabled)) { $formproject = new FormProjets($db); } $companystatic = new Societe($db); @@ -898,7 +898,7 @@ if ($action == 'create') { print dol_get_fiche_head(null, '', '', 0); $rowspan = 4; - if (! empty($conf->projet->enabled)) $rowspan++; + if (! empty($conf->project->enabled)) $rowspan++; if ($object->fk_account > 0) $rowspan++; print ''; @@ -986,7 +986,7 @@ if ($action == 'create') { print ""; // Project - if (! empty($conf->projet->enabled) && is_object($object->thirdparty) && $object->thirdparty->id > 0) { + if (! empty($conf->project->enabled) && is_object($object->thirdparty) && $object->thirdparty->id > 0) { $projectid = GETPOST('projectid') ? GETPOST('projectid') : $object->fk_project; $langs->load('projects'); print ''; - print ''; + print ''; print ''; // Multicurrency Amount VAT print ''; - print ''; + print ''; print ''; // Multicurrency Amount TTC print ''; - print ''; + print ''; print ''; } // Amount - print ''; - print ''; + print ''; + print ''; + + // VAT + print ''; + print ''; // Amount Local Taxes //TODO: Place into a function to control showing by country or study better option if ($societe->localtax1_assuj == "1") { //Localtax1 print ''; - print ''; + print ''; print ''; } if ($societe->localtax2_assuj == "1") { //Localtax2 print ''; - print ''; + print ''; print ''; } - print ''; + print ''; + print ''; + print ''; print '
    ' . $langs->trans('Project') . ''; @@ -1135,7 +1135,7 @@ if ($action == 'create') { $morehtmlref .= '
    ' . $langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project - if (! empty($conf->projet->enabled)) { + if (! empty($conf->project->enabled)) { $langs->load('projects'); $morehtmlref .= '
    ' . $langs->trans('Project') . ' '; if ($usercancreate) { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index f9250d255ca..c2fc4e8511a 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -8,10 +8,10 @@ * Copyright (C) 2013-2015 Philippe Grand * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2016 Marcos García - * Copyright (C) 2016-2021 Alexandre Spangaro + * Copyright (C) 2016-2022 Alexandre Spangaro * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2019 Ferran Marcet - * Copyright (C) 2022 Gauthier VERDOL + * Copyright (C) 2022 Gauthier VERDOL * * 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 @@ -49,7 +49,7 @@ if (!empty($conf->product->enabled)) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -747,10 +747,10 @@ if (empty($reshook)) { $result = $object->fetch(GETPOST('fac_replacement', 'int')); $object->fetch_thirdparty(); - $object->ref = GETPOST('ref', 'nohtml'); + $object->ref = GETPOST('ref', 'alphanohtml'); $object->ref_supplier = GETPOST('ref_supplier', 'alpha'); $object->socid = GETPOST('socid', 'int'); - $object->libelle = GETPOST('label', 'nohtml'); + $object->libelle = GETPOST('label', 'alphanohtml'); $object->date = $dateinvoice; $object->date_echeance = $datedue; $object->note_public = GETPOST('note_public', 'restricthtml'); @@ -812,11 +812,11 @@ if (empty($reshook)) { $tmpproject = GETPOST('projectid', 'int'); // Creation facture - $object->ref = GETPOST('ref', 'nohtml'); - $object->ref_supplier = GETPOST('ref_supplier', 'nohtml'); + $object->ref = GETPOST('ref', 'alphanohtml'); + $object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml'); $object->socid = GETPOST('socid', 'int'); - $object->libelle = GETPOST('label', 'nohtml'); - $object->label = GETPOST('label', 'nohtml'); + $object->libelle = GETPOST('label', 'alphanohtml'); + $object->label = GETPOST('label', 'alphanohtml'); $object->date = $dateinvoice; $object->date_echeance = $datedue; $object->note_public = GETPOST('note_public', 'restricthtml'); @@ -903,13 +903,13 @@ if (empty($reshook)) { if (!$error) { $object->socid = GETPOST('socid', 'int'); - $object->type = GETPOST('type'); - $object->ref = GETPOST('ref'); + $object->type = GETPOST('type', 'alphanohtml'); + $object->ref = GETPOST('ref', 'alphanohtml'); $object->date = $dateinvoice; $object->note_public = trim(GETPOST('note_public', 'restricthtml')); $object->note_private = trim(GETPOST('note_private', 'restricthtml')); - $object->ref_supplier = GETPOST('ref_supplier', 'nohtml'); - $object->model_pdf = GETPOST('model'); + $object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml'); + $object->model_pdf = GETPOST('model', 'alphanohtml'); $object->fk_project = GETPOST('projectid', 'int'); $object->cond_reglement_id = (GETPOST('type') == 3 ? 1 : GETPOST('cond_reglement_id')); $object->mode_reglement_id = GETPOST('mode_reglement_id', 'int'); @@ -962,12 +962,12 @@ if (empty($reshook)) { // Creation invoice $object->socid = GETPOST('socid', 'int'); - $object->type = GETPOST('type'); - $object->ref = GETPOST('ref', 'nohtml'); - $object->ref_supplier = GETPOST('ref_supplier', 'nohtml'); + $object->type = GETPOST('type', 'alphanohtml'); + $object->ref = GETPOST('ref', 'alphanohtml'); + $object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml'); $object->socid = GETPOST('socid', 'int'); - $object->libelle = GETPOST('label', 'nohtml'); // deprecated - $object->label = GETPOST('label', 'nohtml'); + $object->libelle = GETPOST('label', 'alphanohtml'); // deprecated + $object->label = GETPOST('label', 'alphanohtml'); $object->date = $dateinvoice; $object->date_echeance = $datedue; $object->note_public = GETPOST('note_public', 'restricthtml'); @@ -1888,7 +1888,7 @@ $form = new Form($db); $formfile = new FormFile($db); $bankaccountstatic = new Account($db); $paymentstatic = new PaiementFourn($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -2405,7 +2405,7 @@ if ($action == 'create') { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); $langs->load('projects'); @@ -2861,7 +2861,7 @@ if ($action == 'create') { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($usercancreate) { @@ -3169,23 +3169,28 @@ if ($action == 'create') { if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT print '
    '.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).''.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
    '.$form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0).''.price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''.price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
    '.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).''.price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''.price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
    '.$langs->trans('AmountHT').''.price($object->total_ht, 1, $langs, 0, -1, -1, $conf->currency).'
    '.$langs->trans('AmountVAT').''.price($object->total_tva, 1, $langs, 0, -1, -1, $conf->currency); + print '
    '.$langs->trans('AmountHT').''.price($object->total_ht, 1, $langs, 0, -1, -1, $conf->currency).'
    '.$langs->trans('AmountVAT').''; if (GETPOST('calculationrule')) { $calculationrule = GETPOST('calculationrule', 'alpha'); } else { @@ -3203,25 +3208,28 @@ if ($action == 'create') { $s .= ' / '; $s .= ''.$langs->trans("Mode2").''; print '
    '; - print '         '; print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc", $calculationrulenum).'
    '.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('', 'help'), '', 3, '', 0, 'recalculate'); + print '       '; print '
    '; } + print price($object->total_tva, 1, $langs, 0, -1, -1, $conf->currency); print '
    '.$langs->transcountry("AmountLT1", $societe->country_code).''.price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency).''.price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency).'
    '.$langs->transcountry("AmountLT2", $societe->country_code).''.price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency).''.price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency).'
    '.$langs->trans('AmountTTC').''.price($object->total_ttc, 1, $langs, 0, -1, -1, $conf->currency).'
    '.$langs->trans('AmountTTC').''.price($object->total_ttc, 1, $langs, 0, -1, -1, $conf->currency).'
    '; @@ -3236,7 +3244,7 @@ if ($action == 'create') { } $nbrows = 9; $nbcols = 3; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $nbrows++; } if (!empty($conf->banque->enabled)) { diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index faa852d7984..85885ae866e 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -138,7 +138,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 5b7d797a02f..d2f7181856a 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -116,7 +116,7 @@ if ($object->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php index 0cbf0f17512..0f932c27bae 100644 --- a/htdocs/fourn/facture/info.php +++ b/htdocs/fourn/facture/info.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -82,7 +82,7 @@ if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0 $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/fourn/facture/list-rec.php b/htdocs/fourn/facture/list-rec.php index 7da3a224d4f..f876462e15f 100644 --- a/htdocs/fourn/facture/list-rec.php +++ b/htdocs/fourn/facture/list-rec.php @@ -248,7 +248,7 @@ llxHeader('', $langs->trans("RepeatableSupplierInvoices"), $help_url); $form = new Form($db); $formother = new FormOther($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } $companystatic = new Societe($db); diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index 59902947cef..682d92b4515 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -30,7 +30,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -110,7 +110,7 @@ if ($object->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { diff --git a/htdocs/fourn/paiement/document.php b/htdocs/fourn/paiement/document.php index e1b0ce6f581..a8a41b3fde6 100644 --- a/htdocs/fourn/paiement/document.php +++ b/htdocs/fourn/paiement/document.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index 2665f987a10..a89b25c2201 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -33,10 +33,6 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; $langs->loadLangs(array("products", "suppliers")); -if (!$user->rights->produit->lire && !$user->rights->service->lire) { - accessforbidden(); -} - $sref = GETPOST('sref', 'alphanohtml'); $sRefSupplier = GETPOST('srefsupplier'); $snom = GETPOST('snom', 'alphanohtml'); @@ -72,13 +68,15 @@ $catid = GETPOST('catid', 'intcomma'); $hookmanager->initHooks(array('supplierpricelist')); $extrafields = new ExtraFields($db); +if (empty($user->rights->produit->lire) && empty($user->rights->service->lire)) { + accessforbidden(); +} +$permissiontoadd = ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire')); /* - * ACTIONS - * - * Put here all code to do according to value of "action" parameter + * Actions */ if (GETPOST('cancel', 'alpha')) { @@ -228,7 +226,11 @@ if ($resql) { if ($optioncss != '') { $param .= '&optioncss='.$optioncss; } - print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords); + + $newcardbutton = ''; + $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/list.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); + + print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton); if (!empty($catid)) { print "
    "; @@ -358,6 +360,12 @@ if ($resql) { } $db->free($resql); + // If no record found + if ($num == 0) { + $colspan = 8; + print ''.$langs->trans("NoRecordFound").''; + } + print "
    "; print '
    '; diff --git a/htdocs/holiday/document.php b/htdocs/holiday/document.php index 25646e78046..a4b9bcfcfdb 100644 --- a/htdocs/holiday/document.php +++ b/htdocs/holiday/document.php @@ -6,7 +6,7 @@ * Copyright (C) 2005 Simon TOSSER * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2022 Frédéric France * * 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 @@ -124,8 +124,6 @@ $title = $langs->trans("Leave").' - '.$langs->trans("Files"); llxHeader('', $title); -$edit = false; - if ($object->id) { $valideur = new User($db); $valideur->fetch($object->fk_validator); @@ -176,51 +174,25 @@ if ($object->id) { $starthalfday = ($object->halfday == -1 || $object->halfday == 2) ? 'afternoon' : 'morning'; $endhalfday = ($object->halfday == 1 || $object->halfday == 2) ? 'morning' : 'afternoon'; - if (!$edit) { - print ''; - print ''; - print $form->textwithpicto($langs->trans('DateDebCP'), $langs->trans("FirstDayOfHoliday")); - print ''; - print ''.dol_print_date($object->date_debut, 'day'); - print '     '; - print ''.$langs->trans($listhalfday[$starthalfday]).''; - print ''; - print ''; - } else { - print ''; - print ''; - print $form->textwithpicto($langs->trans('DateDebCP'), $langs->trans("FirstDayOfHoliday")); - print ''; - print ''; - print $form->selectDate($object->date_debut, 'date_debut_'); - print '     '; - print $form->selectarray('starthalfday', $listhalfday, (GETPOST('starthalfday') ?GETPOST('starthalfday') : $starthalfday)); - print ''; - print ''; - } + print ''; + print ''; + print $form->textwithpicto($langs->trans('DateDebCP'), $langs->trans("FirstDayOfHoliday")); + print ''; + print ''.dol_print_date($object->date_debut, 'day'); + print '     '; + print ''.$langs->trans($listhalfday[$starthalfday]).''; + print ''; + print ''; - if (!$edit) { - print ''; - print ''; - print $form->textwithpicto($langs->trans('DateFinCP'), $langs->trans("LastDayOfHoliday")); - print ''; - print ''.dol_print_date($object->date_fin, 'day'); - print '     '; - print ''.$langs->trans($listhalfday[$endhalfday]).''; - print ''; - print ''; - } else { - print ''; - print ''; - print $form->textwithpicto($langs->trans('DateFinCP'), $langs->trans("LastDayOfHoliday")); - print ''; - print ''; - print $form->selectDate($object->date_fin, 'date_fin_'); - print '     '; - print $form->selectarray('endhalfday', $listhalfday, (GETPOST('endhalfday') ?GETPOST('endhalfday') : $endhalfday)); - print ''; - print ''; - } + print ''; + print ''; + print $form->textwithpicto($langs->trans('DateFinCP'), $langs->trans("LastDayOfHoliday")); + print ''; + print ''.dol_print_date($object->date_fin, 'day'); + print '     '; + print ''.$langs->trans($listhalfday[$endhalfday]).''; + print ''; + print ''; // Nb days consumed print ''; @@ -247,17 +219,10 @@ if ($object->id) { } // Description - if (!$edit) { - print ''; - print ''.$langs->trans('DescCP').''; - print ''.nl2br($object->description).''; - print ''; - } else { - print ''; - print ''.$langs->trans('DescCP').''; - print ''; - print ''; - } + print ''; + print ''.$langs->trans('DescCP').''; + print ''.nl2br($object->description).''; + print ''; print ''.$langs->trans("NbOfAttachedFiles").''.count($filearray).''; print ''.$langs->trans("TotalSizeOfAttachedFiles").''.dol_print_size($totalsize, 1, 1).''; @@ -274,8 +239,7 @@ if ($object->id) { print ''."\n"; print ''; - if (! empty($object->fk_user_create)) - { + if (! empty($object->fk_user_create)) { $userCreate=new User($db); $userCreate->fetch($object->fk_user_create); print ''; @@ -284,19 +248,10 @@ if ($object->id) { print ''; } - if (!$edit) { - print ''; - print ''; - print ''; - print ''; - } else { - print ''; - print ''; - print ''; - print ''; - } + print ''; + print ''; + print ''; + print ''; print ''; print ''; diff --git a/htdocs/hrm/admin/admin_hrm.php b/htdocs/hrm/admin/admin_hrm.php index 810c0da870d..6763fb43f8e 100644 --- a/htdocs/hrm/admin/admin_hrm.php +++ b/htdocs/hrm/admin/admin_hrm.php @@ -109,7 +109,7 @@ foreach ($list as $key) { // Value print ''; } diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index 2a2c4e4b3dd..326ced8b9c8 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -395,7 +395,7 @@ class Establishment extends CommonObject */ public function info($id) { - $sql = 'SELECT e.rowid, e.ref, e.datec, e.fk_user_author, e.tms, e.fk_user_mod, e.entity'; + $sql = 'SELECT e.rowid, e.ref, e.datec, e.fk_user_author, e.tms as datem, e.fk_user_mod, e.entity'; $sql .= ' FROM '.MAIN_DB_PREFIX.'establishment as e'; $sql .= ' WHERE e.rowid = '.((int) $id); @@ -407,19 +407,10 @@ class Establishment extends CommonObject $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - $this->date_creation = $this->db->jdate($obj->datec); - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - if ($obj->fk_user_mod) { - $muser = new User($this->db); - $muser->fetch($obj->fk_user_mod); - $this->user_modification = $muser; - - $this->date_modification = $this->db->jdate($obj->tms); - } + $this->user_creation_id = $obj->fk_user_author; + $this->user_modification_id = $obj->fk_user_mod; + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem); } $this->db->free($result); } else { diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index 8050eb08ec9..77403631725 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -878,27 +878,11 @@ class Evaluation extends CommonObject if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - - if ($obj->fk_user_valid) { - $vuser = new User($this->db); - $vuser->fetch($obj->fk_user_valid); - $this->user_validation = $vuser; - } - - if ($obj->fk_user_cloture) { - $cluser = new User($this->db); - $cluser->fetch($obj->fk_user_cloture); - $this->user_cloture = $cluser; - } + $this->user_creation_id = $obj->fk_user_creat; + $this->user_modification_id = $obj->fk_user_modif; $this->date_creation = $this->db->jdate($obj->datec); - $this->date_modification = $this->db->jdate($obj->datem); - $this->date_validation = $this->db->jdate($obj->datev); + $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem); } $this->db->free($result); diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index 0ca56d84e60..8fd7d3b177a 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -850,27 +850,11 @@ class Evaluationline extends CommonObject if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - - if ($obj->fk_user_valid) { - $vuser = new User($this->db); - $vuser->fetch($obj->fk_user_valid); - $this->user_validation = $vuser; - } - - if ($obj->fk_user_cloture) { - $cluser = new User($this->db); - $cluser->fetch($obj->fk_user_cloture); - $this->user_cloture = $cluser; - } + $this->user_creation_id = $obj->fk_user_creat; + $this->user_modification_id = $obj->fk_user_modif; $this->date_creation = $this->db->jdate($obj->datec); - $this->date_modification = $this->db->jdate($obj->datem); - $this->date_validation = $this->db->jdate($obj->datev); + $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem); } $this->db->free($result); diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index c7f2e1a5f6b..c21335f2df5 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -108,7 +108,7 @@ class Job extends CommonObject 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>21, 'notnull'=>0, 'visible'=>1,), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>2,), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>2,), - 'deplacement' => array('type'=>'select', 'required'=> 1,'label'=> 'deplacement', 'enabled'=> 1, 'position'=> 90, 'notnull'=> 1, 'visible'=> 1, 'arrayofkeyval'=> array(0 =>"No", 1=>"Yes"), 'default'=>0), + 'deplacement' => array('type'=>'select', 'required'=> 1,'label'=> 'NeedBusinessTravels', 'enabled'=> 1, 'position'=> 90, 'notnull'=> 1, 'visible'=> 1, 'arrayofkeyval'=> array(0 =>"No", 1=>"Yes"), 'default'=>0), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>0,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>71, 'notnull'=>0, 'visible'=>0,), 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',), @@ -884,27 +884,11 @@ class Job extends CommonObject if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - - if ($obj->fk_user_valid) { - $vuser = new User($this->db); - $vuser->fetch($obj->fk_user_valid); - $this->user_validation = $vuser; - } - - if ($obj->fk_user_cloture) { - $cluser = new User($this->db); - $cluser->fetch($obj->fk_user_cloture); - $this->user_cloture = $cluser; - } + $this->user_creation_id = $obj->fk_user_creat; + $this->user_modification_id = $obj->fk_user_modif; $this->date_creation = $this->db->jdate($obj->datec); - $this->date_modification = $this->db->jdate($obj->datem); - $this->date_validation = $this->db->jdate($obj->datev); + $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem); } $this->db->free($result); diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index f83fa5901d8..9416907b8ed 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -930,27 +930,11 @@ class Position extends CommonObject if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - if ($obj->fk_user_valid) { - $vuser = new User($this->db); - $vuser->fetch($obj->fk_user_valid); - $this->user_validation = $vuser; - } - - if ($obj->fk_user_cloture) { - $cluser = new User($this->db); - $cluser->fetch($obj->fk_user_cloture); - $this->user_cloture = $cluser; - } - - $this->date_creation = $this->db->jdate($obj->datec); - $this->date_modification = $this->db->jdate($obj->datem); - $this->date_validation = $this->db->jdate($obj->datev); + $this->user_creation_id = $obj->fk_user_creat; + $this->user_modification_id = $obj->fk_user_modif; + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem); } $this->db->free($result); diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index ececc70b4f1..c2e8833955b 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -119,7 +119,7 @@ class Skill extends CommonObject 'required_level' => array('type'=>'integer', 'label'=>'requiredLevel', 'enabled'=>'1', 'position'=>50, 'notnull'=>1, 'visible'=>0,), 'date_validite' => array('type'=>'integer', 'label'=>'date_validite', 'enabled'=>'1', 'position'=>52, 'notnull'=>1, 'visible'=>0,), 'temps_theorique' => array('type'=>'double(24,8)', 'label'=>'temps_theorique', 'enabled'=>'1', 'position'=>54, 'notnull'=>1, 'visible'=>0,), - 'skill_type' => array('type'=>'integer', 'label'=>'SkillType', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'knowHow', '1'=>'HowToBe', '9'=>'knowledge'), 'default'=>0), + 'skill_type' => array('type'=>'integer', 'label'=>'SkillType', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'css'=>'minwidth200', 'arrayofkeyval'=>array('0'=>'TypeKnowHow', '1'=>'TypeHowToBe', '9'=>'TypeKnowledge'), 'default'=>0), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>0,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>71, 'notnull'=>0, 'visible'=>0,), ); @@ -924,27 +924,11 @@ class Skill extends CommonObject if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - - if ($obj->fk_user_valid) { - $vuser = new User($this->db); - $vuser->fetch($obj->fk_user_valid); - $this->user_validation = $vuser; - } - - if ($obj->fk_user_cloture) { - $cluser = new User($this->db); - $cluser->fetch($obj->fk_user_cloture); - $this->user_cloture = $cluser; - } + $this->user_creation_id = $obj->fk_user_creat; + $this->user_modification_id = $obj->fk_user_modif; $this->date_creation = $this->db->jdate($obj->datec); - $this->date_modification = $this->db->jdate($obj->datem); - $this->date_validation = $this->db->jdate($obj->datev); + $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem); } $this->db->free($result); @@ -1123,9 +1107,9 @@ class Skill extends CommonObject global $langs; $result = ''; switch ($code) { - case 0 : $result = $langs->trans("knowHow"); break; //"Savoir Faire" - case 1 : $result = $langs->trans("HowToBe"); break; // "Savoir être" - case 9 : $result = $langs->trans("knowledge"); break; //"Savoir" + case 0 : $result = $langs->trans("TypeKnowHow"); break; //"Savoir Faire" + case 1 : $result = $langs->trans("TypeHowToBe"); break; // "Savoir être" + case 9 : $result = $langs->trans("TypeKnowledge"); break; //"Savoir" } return $result; } diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index ac91e2ef21a..3c24ca78415 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -838,27 +838,11 @@ class Skilldet extends CommonObject if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - - if ($obj->fk_user_valid) { - $vuser = new User($this->db); - $vuser->fetch($obj->fk_user_valid); - $this->user_validation = $vuser; - } - - if ($obj->fk_user_cloture) { - $cluser = new User($this->db); - $cluser->fetch($obj->fk_user_cloture); - $this->user_cloture = $cluser; - } + $this->user_creation_id = $obj->fk_user_creat; + $this->user_modification_id = $obj->fk_user_modif; $this->date_creation = $this->db->jdate($obj->datec); - $this->date_modification = $this->db->jdate($obj->datem); - $this->date_validation = $this->db->jdate($obj->datev); + $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem); } $this->db->free($result); diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index aa1d70b430f..6e2413c4f5f 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -414,15 +414,15 @@ class SkillRank extends CommonObject if (count($filter) > 0) { foreach ($filter as $key => $value) { if ($key == 't.rowid') { - $sqlwhere[] = $key.'='.$value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { - $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; + $sqlwhere[] = $key." = ".((int) $value); + } elseif ($key != 'customsql' && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; } elseif (strpos($value, '%') === false) { - $sqlwhere[] = $key.' IN ('.$this->db->sanitize($this->db->escape($value)).')'; + $sqlwhere[] = $key." IN (".$this->db->sanitize($this->db->escape($value)).")"; } else { - $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; + $sqlwhere[] = $key." LIKE '%".$this->db->escape($value)."%'"; } } } @@ -877,27 +877,11 @@ class SkillRank extends CommonObject if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - - if ($obj->fk_user_valid) { - $vuser = new User($this->db); - $vuser->fetch($obj->fk_user_valid); - $this->user_validation = $vuser; - } - - if ($obj->fk_user_cloture) { - $cluser = new User($this->db); - $cluser->fetch($obj->fk_user_cloture); - $this->user_cloture = $cluser; - } + $this->user_creation_id = $obj->fk_user_creat; + $this->user_modification_id = $obj->fk_user_modif; $this->date_creation = $this->db->jdate($obj->datec); - $this->date_modification = $this->db->jdate($obj->datem); - $this->date_validation = $this->db->jdate($obj->datev); + $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem); } $this->db->free($result); diff --git a/htdocs/hrm/establishment/info.php b/htdocs/hrm/establishment/info.php index b1f7057f6a5..afbd480e928 100644 --- a/htdocs/hrm/establishment/info.php +++ b/htdocs/hrm/establishment/info.php @@ -147,7 +147,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php index 87a09043a62..8d2d234dd43 100644 --- a/htdocs/hrm/evaluation_agenda.php +++ b/htdocs/hrm/evaluation_agenda.php @@ -198,7 +198,7 @@ if ($object->id > 0) { print '
    '; - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { print ''.$langs->trans("AddAction").''; } else { @@ -208,7 +208,7 @@ if ($object->id > 0) { print '
    '; - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { $param = '&id='.$object->id.'&socid='.$socid; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); diff --git a/htdocs/hrm/evaluation_contact.php b/htdocs/hrm/evaluation_contact.php index 61af793b28a..0cc25901302 100644 --- a/htdocs/hrm/evaluation_contact.php +++ b/htdocs/hrm/evaluation_contact.php @@ -139,7 +139,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index 466741153c4..cc584b2e8d4 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -208,7 +208,7 @@ $now = dol_now(); //$help_url="EN:Module_Evaluation|FR:Module_Evaluation_FR|ES:Módulo_Evaluation"; $help_url = ''; -$title = $langs->trans("List").' '.$langs->trans('Evaluations'); +$title = $langs->trans('Evaluations'); $morejs = array(); $morecss = array(); diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index c573b78ed51..1160ee0fc14 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -343,11 +343,11 @@ if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitme $sql.= " rp.rowid as jobid, rp.ref as jobref, rp.label"; $sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as rp ON rc.fk_recruitmentjobposition = rp.rowid"; - if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) { + if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE rc.entity IN (".getEntity($staticrecruitmentcandidature->element).")"; - if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) { + if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND rp.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php index 0d966e67416..b8008f009ea 100644 --- a/htdocs/hrm/job_agenda.php +++ b/htdocs/hrm/job_agenda.php @@ -189,14 +189,14 @@ if ($object->id > 0) { } - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { $newcardbutton = ''; $newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); } } - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { $param = '&id='.$object->id.'&socid='.$socid; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); diff --git a/htdocs/hrm/job_card.php b/htdocs/hrm/job_card.php index 29493aa9cbd..a9ec4f77121 100644 --- a/htdocs/hrm/job_card.php +++ b/htdocs/hrm/job_card.php @@ -21,8 +21,8 @@ /** * \file job_card.php - * \ingroup hrm - * \brief Page to create/edit/view job + * \ingroup hrm + * \brief Page to create/edit/view job */ diff --git a/htdocs/hrm/job_contact.php b/htdocs/hrm/job_contact.php index 67da8ecfd91..76f6e73d690 100644 --- a/htdocs/hrm/job_contact.php +++ b/htdocs/hrm/job_contact.php @@ -139,7 +139,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index 33f4ea46305..53cb43ad080 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -208,7 +208,7 @@ $now = dol_now(); //$help_url="EN:Module_Job|FR:Module_Job_FR|ES:Módulo_Job"; $help_url = ''; -$title = $langs->trans("ListOf", $langs->transnoentities('Jobs')); +$title = $langs->trans("JobsPosition"); $morejs = array(); $morecss = array(); diff --git a/htdocs/hrm/lib/hrm_job.lib.php b/htdocs/hrm/lib/hrm_job.lib.php index 723aaf14af5..6a948b00439 100644 --- a/htdocs/hrm/lib/hrm_job.lib.php +++ b/htdocs/hrm/lib/hrm_job.lib.php @@ -40,7 +40,7 @@ function jobPrepareHead($object) $head = array(); $head[$h][0] = DOL_URL_ROOT."/hrm/job_card.php?id=".$object->id; - $head[$h][1] = $langs->trans("JobCard"); + $head[$h][1] = $langs->trans("JobPosition"); $head[$h][2] = 'job_card'; $h++; diff --git a/htdocs/hrm/lib/hrm_position.lib.php b/htdocs/hrm/lib/hrm_position.lib.php index da9a7b3123a..37eaa3c5684 100644 --- a/htdocs/hrm/lib/hrm_position.lib.php +++ b/htdocs/hrm/lib/hrm_position.lib.php @@ -31,7 +31,7 @@ * @param Position $object Position * @return array Array of tabs */ -function PositionCardPrepareHead($object) +function positionCardPrepareHead($object) { global $db, $langs, $conf; @@ -41,7 +41,7 @@ function PositionCardPrepareHead($object) $head = array(); $head[$h][0] = dol_buildpath("/hrm/position_card.php", 1).'?id='.$object->id; - $head[$h][1] = $langs->trans("PositionCard"); + $head[$h][1] = $langs->trans("EmployeePosition"); $head[$h][2] = 'position'; $h++; diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php index fda60a29259..ccbfabb985b 100644 --- a/htdocs/hrm/position_agenda.php +++ b/htdocs/hrm/position_agenda.php @@ -141,7 +141,7 @@ if ($object->id > 0) { if (!empty($conf->notification->enabled)) { $langs->load("mails"); } - $head = PositionCardPrepareHead($object); + $head = positionCardPrepareHead($object); print dol_get_fiche_head($head, 'agenda', $langs->trans("Agenda"), -1, $object->picto); @@ -197,7 +197,7 @@ if ($object->id > 0) { print '
    '; - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { print ''.$langs->trans("AddAction").''; } else { @@ -207,7 +207,7 @@ if ($object->id > 0) { print '
    '; - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { $param = '&id='.$object->id.'&socid='.$socid; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); diff --git a/htdocs/hrm/position_card.php b/htdocs/hrm/position_card.php index 6e751a9005a..746e1265a0b 100644 --- a/htdocs/hrm/position_card.php +++ b/htdocs/hrm/position_card.php @@ -171,18 +171,18 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php'; } -DisplayPositionCard($object); + +displayPositionCard($object); + /** * Show the card of a position * * @param Position $object Position object - * * @return void */ -function DisplayPositionCard(&$object) +function displayPositionCard(&$object) { - global $user, $langs, $db, $conf, $extrafields, $hookmanager, $action, $permissiontoadd, $permissiontodelete; $id = $object->id; @@ -245,7 +245,7 @@ function DisplayPositionCard(&$object) $res = $object->fetch_optionals(); - $head = PositionCardPrepareHead($object); + $head = positionCardPrepareHead($object); print dol_get_fiche_head($head, 'position', $langs->trans("Workstation"), -1, $object->picto); $formconfirm = ''; diff --git a/htdocs/hrm/position_contact.php b/htdocs/hrm/position_contact.php index a7246e3a82b..56029f790a7 100644 --- a/htdocs/hrm/position_contact.php +++ b/htdocs/hrm/position_contact.php @@ -125,7 +125,7 @@ if ($object->id) { /* * Show tabs */ - $head = PositionCardPrepareHead($object); + $head = positionCardPrepareHead($object); print dol_get_fiche_head($head, 'contact', '', -1, $object->picto); @@ -139,7 +139,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/hrm/position_document.php b/htdocs/hrm/position_document.php index 845f846a212..eb4ac0e68ce 100644 --- a/htdocs/hrm/position_document.php +++ b/htdocs/hrm/position_document.php @@ -113,7 +113,7 @@ if ($object->id) { /* * Show tabs */ - $head = PositionCardPrepareHead($object); + $head = positionCardPrepareHead($object); print dol_get_fiche_head($head, 'document', $langs->trans("Document"), -1, $object->picto); diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index f193783cb42..e9eb83e12e4 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -208,7 +208,7 @@ $now = dol_now(); //$help_url="EN:Module_Position|FR:Module_Position_FR|ES:Módulo_Position"; $help_url = ''; -$title = $langs->trans("ListOf", $langs->trans('Positions')); +$title = $langs->trans('EmployeePositions'); $morejs = array(); $morecss = array(); diff --git a/htdocs/hrm/position_note.php b/htdocs/hrm/position_note.php index 1eea4b82676..99d6581247f 100644 --- a/htdocs/hrm/position_note.php +++ b/htdocs/hrm/position_note.php @@ -96,7 +96,7 @@ llxHeader('', $langs->trans('Position'), $help_url); if ($id > 0 || !empty($ref)) { $object->fetch_thirdparty(); - $head = PositionCardPrepareHead($object); + $head = positionCardPrepareHead($object); print dol_get_fiche_head($head, 'note', $langs->trans("Notes"), -1, $object->picto); diff --git a/htdocs/hrm/skill_agenda.php b/htdocs/hrm/skill_agenda.php index d73271a4f26..e1947741bde 100644 --- a/htdocs/hrm/skill_agenda.php +++ b/htdocs/hrm/skill_agenda.php @@ -191,7 +191,7 @@ if ($object->id > 0) { print '
    '; - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { print ''.$langs->trans("AddAction").''; } else { @@ -201,7 +201,7 @@ if ($object->id > 0) { print '
    '; - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { $param = '&id='.$object->id.'&socid='.$socid; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); diff --git a/htdocs/hrm/skill_contact.php b/htdocs/hrm/skill_contact.php index d8fecd74610..5f284c4e72c 100644 --- a/htdocs/hrm/skill_contact.php +++ b/htdocs/hrm/skill_contact.php @@ -139,7 +139,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index 9c5a4740c15..65a3cac0ecf 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -208,7 +208,7 @@ $now = dol_now(); //$help_url="EN:Module_Skill|FR:Module_Skill_FR|ES:Módulo_Skill"; $help_url = ''; -$title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("Skills")); +$title = $langs->trans("Skills"); $morejs = array(); $morecss = array(); diff --git a/htdocs/hrm/skill_tab.php b/htdocs/hrm/skill_tab.php index faa8fa57f8e..b2ac9e6bce1 100644 --- a/htdocs/hrm/skill_tab.php +++ b/htdocs/hrm/skill_tab.php @@ -217,7 +217,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $linkback = '' . $langs->trans("BackToList") . ''; $morehtmlref = '
    '; - $morehtmlref.= $object->label; + if (isset($object->label)) $morehtmlref.= $object->label; $morehtmlref .= '
    '; dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref, '&objecttype='.$objecttype); @@ -317,6 +317,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; print ''; print ''; + print ''; print '
    '; print '
    '.$langs->trans('ReviewedByCP').''.$valideur->getNomUrl(-1).'
    '.$langs->trans('ReviewedByCP').''; - print $form->select_dolusers($object->fk_user, "valideur", 1, ($user->admin ? '' : array($user->id))); // By default, hierarchical parent - print '
    '.$langs->trans('ReviewedByCP').''.$valideur->getNomUrl(-1).'
    '.$langs->trans('DateCreation').''; - print ''; + print ''; print '
    '; print ''; @@ -336,6 +337,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; print ''; print ''; + print ''; print ''; } print '
    '; diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 05d1dd89a88..51a50c6376c 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -135,12 +135,12 @@ $confirm = GETPOST('confirm', 'alpha'); $step = (GETPOST('step') ? GETPOST('step') : 1); $import_name = GETPOST('import_name'); $hexa = GETPOST('hexa'); -$importmodelid = GETPOST('importmodelid'); +$importmodelid = GETPOST('importmodelid', 'int'); $excludefirstline = (GETPOST('excludefirstline') ? GETPOST('excludefirstline') : 2); $endatlinenb = (GETPOST('endatlinenb') ? GETPOST('endatlinenb') : ''); $updatekeys = (GETPOST('updatekeys', 'array') ? GETPOST('updatekeys', 'array') : array()); -$separator = (GETPOST('separator', 'nohtml') ? GETPOST('separator', 'nohtml') : (!empty($conf->global->IMPORT_CSV_SEPARATOR_TO_USE) ? $conf->global->IMPORT_CSV_SEPARATOR_TO_USE : ',')); -$enclosure = (GETPOST('enclosure', 'nohtml') ? GETPOST('enclosure', 'nohtml') : '"'); +$separator = (GETPOST('separator', 'alphanohtml') ? GETPOST('separator', 'alphanohtml', 3) : ''); +$enclosure = (GETPOST('enclosure', 'nohtml') ? GETPOST('enclosure', 'nohtml') : '"'); // We must use 'nohtml' and not 'alphanohtml' because we must accept " $separator_used = str_replace('\t', "\t", $separator); $objimport = new Import($db); @@ -167,6 +167,7 @@ if (empty($array_match_file_to_database)) { } } + /* * Actions */ @@ -462,7 +463,6 @@ if ($step == 2 && $datatoimport) { print ''; print ''; - print ''; print '
    '; @@ -492,9 +492,9 @@ if ($step == 2 && $datatoimport) { print '
    '; // Action button print ''; print '
    ' . $langs->trans('AddSkill') . '
    '; print ''; print img_picto('', 'download', 'class="paddingright opacitymedium"'); - print $langs->trans("DownloadEmptyExample"); + print $langs->trans("DownloadEmptyExampleShort"); print ''; - print $form->textwithpicto('', $langs->trans("StarAreMandatory")); + print $form->textwithpicto('', $langs->trans("DownloadEmptyExample").'.
    '.$langs->trans("StarAreMandatory")); print '
    '; @@ -583,9 +583,9 @@ if ($step == 3 && $datatoimport) { print ''; print ''; print img_picto('', 'download', 'class="paddingright opacitymedium"'); - print $langs->trans("DownloadEmptyExample"); + print $langs->trans("DownloadEmptyExampleShort"); print ''; - print $form->textwithpicto('', $langs->trans("StarAreMandatory")); + print $form->textwithpicto('', $langs->trans("DownloadEmptyExample").'.
    '.$langs->trans("StarAreMandatory")); print '
    '; @@ -600,12 +600,10 @@ if ($step == 3 && $datatoimport) { } - print '
    '; + print '

    '; - print ''; + print ''; print ''; - print ''; - print ''; print ''; print ''; @@ -624,6 +622,11 @@ if ($step == 3 && $datatoimport) { // Input file name box print '
    '; + $maxfilesizearray = getMaxFileSizeArray(); + $maxmin = $maxfilesizearray['maxmin']; + if ($maxmin > 0) { + $texte .= ''; // MAX_FILE_SIZE must precede the field type=file + } print '     '; $out = (empty($conf->global->MAIN_UPLOAD_DOC) ? ' disabled' : ''); print ''; @@ -740,8 +743,8 @@ if ($step == 3 && $datatoimport) { if ($step == 4 && $datatoimport) { //var_dump($_SESSION["dol_array_match_file_to_database_select"]); $serialized_array_match_file_to_database = isset($_SESSION["dol_array_match_file_to_database_select"]) ? $_SESSION["dol_array_match_file_to_database_select"] : ''; - $array_match_file_to_database = array(); $fieldsarray = explode(',', $serialized_array_match_file_to_database); + $array_match_file_to_database = array(); // Same than $fieldsarray but with mapped value only (col1 => 's.fielda', col2 => 's.fieldb'...) foreach ($fieldsarray as $elem) { $tabelem = explode('=', $elem, 2); $key = $tabelem[0]; @@ -750,9 +753,42 @@ if ($step == 4 && $datatoimport) { $array_match_file_to_database[$key] = $val; } } + + //var_dump($serialized_array_match_file_to_database); + //var_dump($fieldsarray); + //var_dump($array_match_file_to_database); + $model = $format; $list = $objmodelimport->liste_modeles($db); + if (empty($separator)) { + $separator = (empty($conf->global->IMPORT_CSV_SEPARATOR_TO_USE) ? ',' : $conf->global->IMPORT_CSV_SEPARATOR_TO_USE); + } + + // The separator has been defined, if it is a unique char, we check it is valid by reading the source file + if ($model == 'csv' && strlen($separator) == 1 && !GETPOSTISSET('separator')) { + // Count the char in first line of file. + $fh = fopen($conf->import->dir_temp.'/'.$filetoimport, 'r'); + if ($fh) { + $sline = fgets($fh, 1000000); + fclose($fh); + $nboccurence = substr_count($sline, $separator); + $nboccurencea = substr_count($sline, ','); + $nboccurenceb = substr_count($sline, ';'); + //var_dump($nboccurence." ".$nboccurencea." ".$nboccurenceb);exit; + if ($nboccurence == 0) { + if ($nboccurencea > 2) { + $separator = ','; + } elseif ($nboccurenceb > 2) { + $separator = ';'; + } + } + } + } + + // The value to use + $separator_used = str_replace('\t', "\t", $separator); + // Create classe to use for import $dir = DOL_DOCUMENT_ROOT."/core/modules/import/"; $file = "import_".$model.".modules.php"; @@ -823,20 +859,15 @@ if ($step == 4 && $datatoimport) { } // We found the key of targets that is at position pos $array_match_file_to_database[$pos] = $key; - if ($serialized_array_match_file_to_database) { - $serialized_array_match_file_to_database .= ','; - } - $serialized_array_match_file_to_database .= ($pos.'='.$key); break; } } $pos++; } - // Save the match array in session. We now will use the array in session. - $_SESSION["dol_array_match_file_to_database_select"] = $serialized_array_match_file_to_database; } $array_match_database_to_file = array_flip($array_match_file_to_database); - + //var_dump($array_match_database_to_file); + //var_dump($_SESSION["dol_array_match_file_to_database_select"]); $fieldstarget_tmp = array(); $arraykeysfieldtarget = array_keys($fieldstarget); @@ -845,9 +876,9 @@ if ($step == 4 && $datatoimport) { $isrequired = preg_match('/\*$/', $label); if (!empty($isrequired)) { $newlabel = substr($label, 0, -1); - $fieldstarget_tmp[$key] = array("label"=>$newlabel,"required"=>true); + $fieldstarget_tmp[$key] = array("label"=>$newlabel, "required"=>true); } else { - $fieldstarget_tmp[$key] = array("label"=>$label,"required"=>false); + $fieldstarget_tmp[$key] = array("label"=>$label, "required"=>false); } if (!empty($array_match_database_to_file[$key])) { $fieldstarget_tmp[$key]["imported"] = true; @@ -947,7 +978,7 @@ if ($step == 4 && $datatoimport) { if ($model == 'csv') { print ''.$langs->trans("CsvOptions").''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -956,10 +987,10 @@ if ($step == 4 && $datatoimport) { print ''; print ''; print $langs->trans("Separator").' : '; - print ''; + print ''; print '    '.$langs->trans("Enclosure").' : '; - print ' '; - print ''; + print ' '; + print ''; print ''; print ''; } @@ -986,7 +1017,7 @@ if ($step == 4 && $datatoimport) { // List of source fields print ''."\n"; - print '
    '; + print ''; print ''; print ''; print ''; @@ -998,6 +1029,7 @@ if ($step == 4 && $datatoimport) { print ''; print ''; + // Import profile to use/load print '
    '; print ''; $s = $langs->trans("SelectImportFieldsSource", '{s1}'); @@ -1057,9 +1089,14 @@ if ($step == 4 && $datatoimport) { $optionsall = array(); foreach ($fieldstarget as $code => $line) { //var_dump($line); - $labeltoshow = $langs->trans($line["label"]); - $optionsall[$code] = array('label'=>$labeltoshow, 'required'=>(empty($line["required"]) ? 0 : 1), 'position'=>!empty($line['position']) ? $line['position'] : 0); - // TODO Get type from an new array into module descriptor. + + $tmparray = explode('|', $line["label"]); // If label of field is several translation keys separated with | + $labeltoshow = ''; + foreach ($tmparray as $tmpkey => $tmpval) { + $labeltoshow .= ($labeltoshow ? ' '.$langs->trans('or').' ' : '').$langs->transnoentities($tmpval); + } + $optionsall[$code] = array('labelkey'=>$line['label'], 'labelkeyarray'=>$tmparray, 'label'=>$labeltoshow, 'required'=>(empty($line["required"]) ? 0 : 1), 'position'=>!empty($line['position']) ? $line['position'] : 0); + // TODO Get type from a new array into module descriptor. //$picto = 'email'; $picto = ''; if ($picto) { @@ -1075,13 +1112,19 @@ if ($step == 4 && $datatoimport) { //var_dump($fieldstarget); //var_dump($optionsall); //exit; - /* - var_dump($_SESSION['dol_array_match_file_to_database']); - var_dump($_SESSION['dol_array_match_file_to_database_select']); - var_dump($optionsall); - var_dump($fieldssource); - var_dump($fieldstarget); - */ + + //var_dump($_SESSION['dol_array_match_file_to_database']); + //var_dump($_SESSION['dol_array_match_file_to_database_select']); + //exit; + //var_dump($optionsall); + //var_dump($fieldssource); + //var_dump($fieldstarget); + + $modetoautofillmapping = 'session'; // Use setup in session + if ($initialloadofstep4) { + $modetoautofillmapping = 'guess'; + } + //var_dump($modetoautofillmapping); print ''; foreach ($fieldssource as $code => $line) { // $fieldssource is an array code=column num, line=content on first line for column in source file. @@ -1091,9 +1134,6 @@ if ($step == 4 && $datatoimport) { print ''; $entity = (!empty($objimport->array_import_entities[0][$code]) ? $objimport->array_import_entities[0][$code] : $objimport->array_import_icon[0]); - $tablealias = preg_replace('/(\..*)$/i', '', $code); - $tablename = !empty($objimport->array_import_tables[0][$tablealias]) ? $objimport->array_import_tables[0][$tablealias] : ""; - $entityicon = !empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity; // $entityicon must string name of picto of the field like 'project', 'company', 'contact', 'modulename', ... $entitylang = $entitytolang[$entity] ? $entitytolang[$entity] : $objimport->array_import_label[0]; // $entitylang must be a translation key to describe object the field is related to, like 'Company', 'Contact', 'MyModyle', ... @@ -1101,23 +1141,19 @@ if ($step == 4 && $datatoimport) { print ''; print '"; + $selectforline .= ''; + $selectforline .= ajax_combobox('selectorderimport_'.($i+1)); + print $selectforline; + + print ''; + + // Tooltip at end of line print ''; print ''; $i++; } @@ -1240,47 +1284,9 @@ if ($step == 4 && $datatoimport) { print ''; - // List of not imported fields - /* - print ''; - - print ''; - print ''; - */ + // Lines for remark + print ''; + print ''; print '
    => '; - $modetoautofillmapping = 'session'; // Use setup in session - if ($initialloadofstep4) { - $modetoautofillmapping = 'guess'; - } //var_dump($_SESSION['dol_array_match_file_to_database_select']); - //var_dump($modetoautofillmapping); //var_dump($_SESSION['dol_array_match_file_to_database']); - //var_dump($modetoautofillmapping); - print ''; if (!empty($line["imported"])) { - print ''; + $selectforline .= ''; } else { - print ''; + $selectforline .= ''; } $j = 0; + $codeselectedarray = array(); foreach ($optionsall as $tmpcode => $tmpval) { // Loop on each entry to add into each combo list. $label = ''; if (!empty($tmpval['picto'])) { @@ -1127,112 +1163,120 @@ if ($step == 4 && $datatoimport) { $label .= $tmpval['label']; $label .= $tmpval['required'] ? '*' : ''; - // If we must guess how to fill the preselected value, and we can't because input value are not string - if ($modetoautofillmapping == 'guess' && $j == 0 && is_numeric($tmpval)) { - $modetoautofillmapping = 'orderoftargets'; + $tablealias = preg_replace('/(\..*)$/i', '', $tmpcode); + $tablename = !empty($objimport->array_import_tables[0][$tablealias]) ? $objimport->array_import_tables[0][$tablealias] : ""; + + $htmltext = ''; + + $filecolumn = ($i + 1); + // Source field info + if (empty($objimport->array_import_convertvalue[0][$tmpcode])) { // If source file does not need convertion + $filecolumntoshow = num2Alpha($i); + } else { + if ($objimport->array_import_convertvalue[0][$tmpcode]['rule'] == 'fetchidfromref') { + $htmltext .= $langs->trans("DataComeFromIdFoundFromRef", $filecolumn, $langs->transnoentitiesnoconv($entitylang)).'
    '; + } + if ($objimport->array_import_convertvalue[0][$tmpcode]['rule'] == 'fetchidfromcodeid') { + $htmltext .= $langs->trans("DataComeFromIdFoundFromCodeId", $filecolumn, $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$code]['dict'])).'
    '; + } + } + // Source required + $example = !empty($objimport->array_import_examplevalues[0][$tmpcode])?$objimport->array_import_examplevalues[0][$tmpcode]:""; + // Example + if (empty($objimport->array_import_convertvalue[0][$tmpcode])) { // If source file does not need convertion + if ($example) { + $htmltext .= $langs->trans("SourceExample").': '.str_replace('"', '', $example).'
    '; + } + } else { + if ($objimport->array_import_convertvalue[0][$tmpcode]['rule'] == 'fetchidfromref') { + $htmltext .= $langs->trans("SourceExample").': '.$langs->transnoentitiesnoconv("ExampleAnyRefFoundIntoElement", $entitylang).($example ? ' ('.$langs->transnoentitiesnoconv("Example").': '.$example.')' : '').'
    '; + } elseif ($objimport->array_import_convertvalue[0][$tmpcode]['rule'] == 'fetchidfromcodeid') { + $htmltext .= $langs->trans("SourceExample").': '.$langs->trans("ExampleAnyCodeOrIdFoundIntoDictionary", $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$code]['dict'])).($example ? ' ('.$langs->transnoentitiesnoconv("Example").': '.$example.')' : '').'
    '; + } elseif ($example) { + $htmltext .= $langs->trans("SourceExample").': '.str_replace('"', '', $example).'
    '; + } + } + // Format control rule + if (!empty($objimport->array_import_regex[0][$tmpcode])) { + $htmltext .= $langs->trans("FormatControlRule").': '.str_replace('"', '', $objimport->array_import_regex[0][$tmpcode]).'
    '; } - print '
    '; - $filecolumn = ($i + 1); + // Source field info $htmltext = ''.$langs->trans("FieldSource").'
    '; - if ($filecolumn > count($fieldssource)) { - $htmltext .= $langs->trans("DataComeFromNoWhere").'
    '; - } else { - if (empty($objimport->array_import_convertvalue[0][$code])) { // If source file does not need convertion - $filecolumntoshow = num2Alpha($i); - $htmltext .= $langs->trans("DataComeFromFileFieldNb", $filecolumntoshow).'
    '; - } else { - if ($objimport->array_import_convertvalue[0][$code]['rule'] == 'fetchidfromref') { - $htmltext .= $langs->trans("DataComeFromIdFoundFromRef", $filecolumn, $langs->transnoentitiesnoconv($entitylang)).'
    '; - } - if ($objimport->array_import_convertvalue[0][$code]['rule'] == 'fetchidfromcodeid') { - $htmltext .= $langs->trans("DataComeFromIdFoundFromCodeId", $filecolumn, $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$code]['dict'])).'
    '; - } - } - } - // Source required - $example = !empty($objimport->array_import_examplevalues[0][$code])?$objimport->array_import_examplevalues[0][$code]:""; - // Example - if (empty($objimport->array_import_convertvalue[0][$code])) { // If source file does not need convertion - if ($example) { - $htmltext .= $langs->trans("SourceExample").': '.$example.'
    '; - } - } else { - if ($objimport->array_import_convertvalue[0][$code]['rule'] == 'fetchidfromref') { - $htmltext .= $langs->trans("SourceExample").': '.$langs->transnoentitiesnoconv("ExampleAnyRefFoundIntoElement", $entitylang).($example ? ' ('.$langs->transnoentitiesnoconv("Example").': '.$example.')' : '').'
    '; - } elseif ($objimport->array_import_convertvalue[0][$code]['rule'] == 'fetchidfromcodeid') { - $htmltext .= $langs->trans("SourceExample").': '.$langs->trans("ExampleAnyCodeOrIdFoundIntoDictionary", $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$code]['dict'])).($example ? ' ('.$langs->transnoentitiesnoconv("Example").': '.$example.')' : '').'
    '; - } elseif ($example) { - $htmltext .= $langs->trans("SourceExample").': '.$example.'
    '; - } - } - // Format control rule - if (!empty($objimport->array_import_regex[0][$code])) { - $htmltext .= $langs->trans("FormatControlRule").': '.$objimport->array_import_regex[0][$code].'
    '; - } - $htmltext .= '
    '; - // Target field info - $htmltext .= ''.$langs->trans("FieldTarget").'
    '; - //$htmltext .= $langs->trans("SourceRequired").': '.yn($line["label"]).'
    '; - if (empty($objimport->array_import_convertvalue[0][$code])) { // If source file does not need convertion - $htmltext .= $langs->trans("DataIsInsertedInto").'
    '; - } else { - if ($objimport->array_import_convertvalue[0][$code]['rule'] == 'fetchidfromref') { - $htmltext .= $langs->trans("DataIDSourceIsInsertedInto").'
    '; - } - if ($objimport->array_import_convertvalue[0][$code]['rule'] == 'fetchidfromcodeid') { - $htmltext .= $langs->trans("DataCodeIDSourceIsInsertedInto").'
    '; - } - } - $htmltext .= $langs->trans("FieldTitle").": ".$langs->trans($fieldstarget[$arraykeysfieldtarget[$code-1]]["label"])."
    "; - $htmltext .= $langs->trans("Table")." -> ".$langs->trans("Field").': '.$tablename." -> ".preg_replace('/^.*\./', '', $code)."
    "; - print $form->textwithpicto($more, $htmltext); + $filecolumntoshow = num2Alpha($i); + $htmltext .= $langs->trans("DataComeFromFileFieldNb", $filecolumntoshow).'
    '; + + print $form->textwithpicto('', $htmltext); + + print '
    '.$langs->trans("NotUsedFields").'
    '; - - print "\n\n"; - print '\n"; - print "\n"; - - print ''; - $i = 0; - while ($i < $nbofnotimportedfields) { - // Print empty cells - show_elem('', '', 'none', $var, 'nostyle'); - $i++; - } - print '
    '.$langs->trans("Remark").'
    '; print '
    '; @@ -1291,6 +1297,19 @@ if ($step == 4 && $datatoimport) { print 'var previousselectedvalueimport = "0";'."\n"; print 'var previousselectedlabelimport = "0";'."\n"; print 'var arrayofselectedvalues = [];'."\n"; + print 'var arrayoftargetfields = [];'."\n"; + print 'var arrayoftargetmandatoryfields = [];'."\n"; + + // Loop on $fieldstarget (seems sorted by 'position') to store php array into javascript array + $tmpi = 0; + foreach ($fieldstarget as $key => $val) { + print "arrayoftargetfields[".$tmpi."] = '".dol_escape_js($langs->trans($val['label']))."'; "; + if ($val['required']) { + print "arrayoftargetmandatoryfields[".$tmpi."] = '".dol_escape_js($key)."'; "; + } + $tmpi++; + } + print "\n"; print '$(document).ready(function () {'."\n"; @@ -1311,18 +1330,21 @@ if ($step == 4 && $datatoimport) { print ' console.log("Remove the disabled flag everywhere");'."\n"; print ' $("select.targetselectchange").not($( this )).find(\'option\').prop("disabled", false);'."\n"; // Enable all options print ' arrayofselectedvalues = [];'."\n"; + print ' $("select.targetselectchange").each(function(){'."\n"; print ' id = $(this).attr(\'id\')'."\n"; print ' value = $(this).val()'."\n"; - //print ' console.log("a selected value has been found for component "+id+" = "+value);'."\n"; + print ' console.log("a selected value has been found for component "+id+" = "+value);'."\n"; print ' arrayofselectedvalues.push(value);'."\n"; print ' });'."\n"; - print ' console.log("List of all selected values");'."\n"; + + print ' console.log("List of all selected values arrayofselectedvalues");'."\n"; print ' console.log(arrayofselectedvalues);'."\n"; print ' console.log("Set the option to disabled for every entry that is currently selected somewhere else (so into arrayofselectedvalues)");'."\n"; - print ' $.each( arrayofselectedvalues, function( key, value ) {'."\n"; // Loop on each selected value + + print ' $.each(arrayofselectedvalues, function(key, value) {'."\n"; // Loop on each selected value print ' if (value != -1) {'."\n"; - //print ' console.log("Process key="+key+" value="+value+" to disable.");'."\n"; + print ' console.log("Process key="+key+" value="+value+" to disable.");'."\n"; print ' $("select.targetselectchange").find(\'option[value="\'+value+\'"]:not(:selected)\').prop("disabled", true);'."\n"; // Set to disabled except if currently selected print ' }'."\n"; print ' });'."\n"; @@ -1332,12 +1354,13 @@ if ($step == 4 && $datatoimport) { print 'function saveSelection() {'."\n"; //print ' console.log(arrayofselectedvalues);'."\n"; print ' arrayselectedfields = [];'."\n"; - print ' arrayselectedfields.push("0");'."\n"; + print ' arrayselectedfields.push(0);'."\n"; + print ' $.each( arrayofselectedvalues, function( key, value ) {'."\n"; print ' if (value != -1) {'."\n"; - print ' arrayselectedfields.push(value);'."\n"; + print ' arrayselectedfields.push(value);'."\n"; print ' } else {'."\n"; - print ' arrayselectedfields.push(0);'."\n"; + print ' arrayselectedfields.push(0);'."\n"; print ' }'."\n"; print ' });'."\n"; @@ -1347,9 +1370,32 @@ if ($step == 4 && $datatoimport) { print " url: '".dol_escape_js($_SERVER["PHP_SELF"])."?action=saveselectorder&token=".newToken()."',\n"; print " data: 'selectorder='+arrayselectedfields.toString(),\n"; print " success: function(){\n"; - print " console.log('Select order saved');\n"; + print " console.log('The selected fields have been saved into '+arrayselectedfields.toString());\n"; print " },\n"; print ' });'."\n"; + + // Now we loop on all target fields that are mandatory to show if they are not mapped yet. + print ' console.log("arrayselectedfields");'; + print ' console.log(arrayselectedfields);'; + print ' console.log("arrayoftargetmandatoryfields");'; + print ' console.log(arrayoftargetmandatoryfields);'; + print " listtoshow = '';"; + print " nbelement = arrayoftargetmandatoryfields.length + for (let i = 0; i < nbelement; i++) { + if (arrayoftargetmandatoryfields[i] && ! arrayselectedfields.includes(arrayoftargetmandatoryfields[i])) { + console.log(arrayoftargetmandatoryfields[i]+' not mapped'); + listtoshow = listtoshow + (listtoshow ? ', ' : '') + '' + arrayoftargetfields[i] + '*'; + } + } + console.log(listtoshow); + if (listtoshow) { + listtoshow = '".dol_escape_js(img_warning($langs->trans("MandatoryTargetFieldsNotMapped")).' '.$langs->trans("MandatoryTargetFieldsNotMapped")).": ' + listtoshow; + $('#div-mandatory-target-fields-not-mapped').html(listtoshow); + } else { + $('#div-mandatory-target-fields-not-mapped').html('".dol_escape_js($langs->trans("AllTargetMandatoryFieldsAreMapped"))."'); + } + "; + print '};'."\n"; // If we make a change on a selectbox @@ -1422,14 +1468,19 @@ if ($step == 4 && $datatoimport) { print ''; print ''; + $nameofimportprofile = str_replace(' ', '-', $langs->trans("ImportProfile").' '.$titleofmodule.' '.dol_print_date(dol_now('gmt'), 'dayxcard')); + if (is_object($objimport) && !empty($objimport->model_name)) { + $nameofimportprofile = $objimport->model_name; + } + print ''; - print ''; + print ''; print ''; $arrayvisibility = array('private'=>$langs->trans("Private"), 'all'=>$langs->trans("Everybody")); print $form->selectarray('visibility', $arrayvisibility, 'private'); print ''; print ''; - print ''; + print ''; print ''; // List of existing import profils @@ -1459,7 +1510,7 @@ if ($step == 4 && $datatoimport) { print $langs->trans("Everybody"); } else { $tmpuser->fetch($obj->fk_user); - print $tmpuser->getNomUrl(1); + print $tmpuser->getNomUrl(-1); } print ''; print ''; @@ -1748,9 +1799,9 @@ if ($step == 5 && $datatoimport) { } //print $code.'-'.$label; $alias = preg_replace('/(\..*)$/i', '', $label); - $listfields[$i] = $langs->trans("Column").' '.num2Alpha($code - 1).' -> '.$label; + $listfields[$i] = ''.$langs->trans("Column").' '.num2Alpha($code - 1).' -> '.$label.''; } - print count($listfields) ? (join(',  ', $listfields)) : $langs->trans("Error"); + print count($listfields) ? (join(', ', $listfields)) : $langs->trans("Error"); print ''; print ''; @@ -1854,16 +1905,17 @@ if ($step == 5 && $datatoimport) { // Show OK if (!count($arrayoferrors) && !count($arrayofwarnings)) { - print '
    '.img_picto($langs->trans("OK"), 'tick').' '.$langs->trans("NoError").'


    '; - print '
    '; + print '
    '; + print '
    '; + print '
    '.$langs->trans("ResultOfSimulationNoError").'
    '; print $langs->trans("NbInsert", empty($obj->nbinsert) ? 0 : $obj->nbinsert).'
    '; print $langs->trans("NbUpdate", empty($obj->nbupdate) ? 0 : $obj->nbupdate).'
    '; print '
    '; print '
    '; } else { print '
    '; - print '
    '; - print $langs->trans("NbOfLinesOK", $nbok).'
    '; + print '
    '; + print $langs->trans("NbOfLinesOK", $nbok).'...
    '; print '
    '; print '
    '; } @@ -1879,9 +1931,9 @@ if ($step == 5 && $datatoimport) { print $langs->trans("TooMuchErrors", (count($arrayoferrors) - $nboferrors))."
    "; break; } - print '* '.$langs->trans("Line").' '.$key.'
    '; + print '* '.$langs->trans("Line").' '.dol_escape_htmltag($key).'
    '; foreach ($val as $i => $err) { - print '     > '.$err['lib'].'
    '; + print '     > '.dol_escape_htmltag($err['lib']).'
    '; } } print ''; @@ -1899,9 +1951,9 @@ if ($step == 5 && $datatoimport) { print $langs->trans("TooMuchWarnings", (count($arrayofwarnings) - $nbofwarnings))."
    "; break; } - print ' * '.$langs->trans("Line").' '.$key.'
    '; + print ' * '.$langs->trans("Line").' '.dol_escape_htmltag($key).'
    '; foreach ($val as $i => $err) { - print '     > '.$err['lib'].'
    '; + print '     > '.dol_escape_htmltag($err['lib']).'
    '; } } print ''; @@ -2249,10 +2301,10 @@ if ($step == 6 && $datatoimport) { // Show result print '
    '; - print '
    '; + print '
    '; print $langs->trans("NbOfLinesImported", $nbok).'
    '; print $langs->trans("NbInsert", empty($obj->nbinsert) ? 0 : $obj->nbinsert).'
    '; - print $langs->trans("NbUpdate", empty($obj->nbupdate) ? 0 : $obj->nbupdate).'

    '; + print $langs->trans("NbUpdate", empty($obj->nbupdate) ? 0 : $obj->nbupdate).'
    '; print '
    '; print '
    '; print $langs->trans("FileWasImported", $importid).'
    '; diff --git a/htdocs/includes/OAuth/Common/Storage/DoliStorage.php b/htdocs/includes/OAuth/Common/Storage/DoliStorage.php index b2a79dc4751..8bd15b7602e 100644 --- a/htdocs/includes/OAuth/Common/Storage/DoliStorage.php +++ b/htdocs/includes/OAuth/Common/Storage/DoliStorage.php @@ -29,257 +29,280 @@ use OAuth\Common\Storage\Exception\TokenNotFoundException; use OAuth\Common\Storage\Exception\AuthorizationStateNotFoundException; use DoliDB; +/** + * Class to manage storage of OAUTH2 in Dolibarr + */ class DoliStorage implements TokenStorageInterface { - /** - * @var DoliDB Database handler - */ - protected $db; + /** + * @var DoliDB Database handler + */ + protected $db; - /** - * @var object|TokenInterface - */ - protected $tokens; + /** + * @var object|TokenInterface + */ + protected $tokens; - /** - * @var string Error code (or message) - */ - public $error; - /** - * @var string[] Several error codes (or messages) - */ - public $errors = array(); + /** + * @var string Error code (or message) + */ + public $error; + /** + * @var string[] Several error codes (or messages) + */ + public $errors = array(); - private $conf; - private $key; - private $stateKey; + private $conf; + private $key; + private $stateKey; + private $keyforprovider; - /** - * @param Conf $conf - * @param string $key - * @param string $stateKey - */ - public function __construct(DoliDB $db, $conf) - { - $this->db = $db; - $this->conf = $conf; - $this->tokens = array(); - $this->states = array(); - //$this->key = $key; - //$this->stateKey = $stateKey; - } - /** - * {@inheritDoc} - */ - public function retrieveAccessToken($service) - { - if ($this->hasAccessToken($service)) { - return $this->tokens[$service]; - } + /** + * @param DoliDB $db Database handler + * @param Conf $conf Conf object + * @param string $keyforprovider Key to manage several providers of the same type. For example 'abc' will be added to 'Google' to defined storage key. + */ + public function __construct(DoliDB $db, $conf, $keyforprovider = '') + { + $this->db = $db; + $this->conf = $conf; + $this->keyforprovider = $keyforprovider; + $this->tokens = array(); + $this->states = array(); + //$this->key = $key; + //$this->stateKey = $stateKey; + } - throw new TokenNotFoundException('Token not found in db, are you sure you stored it?'); - } + /** + * {@inheritDoc} + */ + public function retrieveAccessToken($service) + { + dol_syslog("retrieveAccessToken service=".$service); - /** - * {@inheritDoc} - */ - public function storeAccessToken($service, TokenInterface $token) - { - //var_dump("storeAccessToken"); - //var_dump($token); - dol_syslog("storeAccessToken"); - - $serializedToken = serialize($token); - $this->tokens[$service] = $token; + if ($this->hasAccessToken($service)) { + return $this->tokens[$service]; + } - if (!is_array($this->tokens)) { - $this->tokens = array(); - } - $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."oauth_token"; - $sql.= " WHERE service='".$this->db->escape($service)."' AND entity=1"; - $resql = $this->db->query($sql); - if (! $resql) - { - dol_print_error($this->db); - } - $obj = $this->db->fetch_array($resql); - if ($obj) { - // update - $sql = "UPDATE ".MAIN_DB_PREFIX."oauth_token"; - $sql.= " SET token='".$this->db->escape($serializedToken)."'"; - $sql.= " WHERE rowid='".$obj['rowid']."'"; - $resql = $this->db->query($sql); - } else { - // save - $sql = "INSERT INTO ".MAIN_DB_PREFIX."oauth_token (service, token, entity)"; - $sql.= " VALUES ('".$this->db->escape($service)."', '".$this->db->escape($serializedToken)."', 1)"; - $resql = $this->db->query($sql); - } - //print $sql; - - // allow chaining - return $this; - } + throw new TokenNotFoundException('Token not found in db, are you sure you stored it?'); + } - /** - * {@inheritDoc} - */ - public function hasAccessToken($service) - { - // get from db - dol_syslog("hasAccessToken service=".$service); - $sql = "SELECT token FROM ".MAIN_DB_PREFIX."oauth_token"; - $sql.= " WHERE service='".$this->db->escape($service)."'"; - $resql = $this->db->query($sql); - if (! $resql) - { - dol_print_error($this->db); - } - $result = $this->db->fetch_array($resql); - $token = unserialize($result['token']); - - $this->tokens[$service] = $token; + /** + * {@inheritDoc} + */ + public function storeAccessToken($service, TokenInterface $token) + { + global $conf; - return is_array($this->tokens) - && isset($this->tokens[$service]) - && $this->tokens[$service] instanceof TokenInterface; - } + //var_dump("storeAccessToken"); + //var_dump($token); + dol_syslog("storeAccessToken service=".$service); - /** - * {@inheritDoc} - */ - public function clearToken($service) - { - // TODO - // get previously saved tokens - //$tokens = $this->retrieveAccessToken($service); + $serializedToken = serialize($token); + $this->tokens[$service] = $token; - //if (is_array($tokens) && array_key_exists($service, $tokens)) { - // unset($tokens[$service]); + if (!is_array($this->tokens)) { + $this->tokens = array(); + } + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."oauth_token"; + $sql .= " WHERE service = '".$this->db->escape($service.($this->keyforprovider?'-'.$this->keyforprovider:''))."'"; + $sql .= " AND entity IN (".getEntity('oauth_token').")"; + $resql = $this->db->query($sql); + if (! $resql) { + dol_print_error($this->db); + } + $obj = $this->db->fetch_array($resql); + if ($obj) { + // update + $sql = "UPDATE ".MAIN_DB_PREFIX."oauth_token"; + $sql.= " SET token = '".$this->db->escape($serializedToken)."'"; + $sql.= " WHERE rowid = ".((int) $obj['rowid']); + $resql = $this->db->query($sql); + } else { + // save + $sql = "INSERT INTO ".MAIN_DB_PREFIX."oauth_token (service, token, entity)"; + $sql.= " VALUES ('".$this->db->escape($service.($this->keyforprovider?'-'.$this->keyforprovider:''))."', '".$this->db->escape($serializedToken)."', ".((int) $conf->entity).")"; + $resql = $this->db->query($sql); + } + //print $sql; - $sql = "DELETE FROM ".MAIN_DB_PREFIX."oauth_token"; - $sql.= " WHERE service='".$this->db->escape($service)."'"; - $resql = $this->db->query($sql); - //} + // allow chaining + return $this; + } - // allow chaining - return $this; - } + /** + * {@inheritDoc} + */ + public function hasAccessToken($service) + { + // get from db + dol_syslog("hasAccessToken service=".$service); - /** - * {@inheritDoc} - */ - public function clearAllTokens() - { - // TODO - $this->conf->remove($this->key); + $sql = "SELECT token FROM ".MAIN_DB_PREFIX."oauth_token"; + $sql .= " WHERE service = '".$this->db->escape($service.($this->keyforprovider?'-'.$this->keyforprovider:''))."'"; + $sql .= " AND entity IN (".getEntity('oauth_token').")"; + $resql = $this->db->query($sql); + if (! $resql) { + dol_print_error($this->db); + } + $result = $this->db->fetch_array($resql); + $token = unserialize($result['token']); - // allow chaining - return $this; - } + $this->tokens[$service] = $token; - /** - * {@inheritDoc} - */ - public function retrieveAuthorizationState($service) - { - if ($this->hasAuthorizationState($service)) { - return $this->states[$service]; + return is_array($this->tokens) + && isset($this->tokens[$service]) + && $this->tokens[$service] instanceof TokenInterface; + } - } + /** + * {@inheritDoc} + */ + public function clearToken($service) + { + dol_syslog("clearToken service=".$service); - throw new AuthorizationStateNotFoundException('State not found in db, are you sure you stored it?'); - } + // TODO + // get previously saved tokens + //$tokens = $this->retrieveAccessToken($service); - /** - * {@inheritDoc} - */ - public function storeAuthorizationState($service, $state) - { - // TODO save or update + //if (is_array($tokens) && array_key_exists($service, $tokens)) { + // unset($tokens[$service]); - if (!is_array($states)) { - $states = array(); - } + $sql = "DELETE FROM ".MAIN_DB_PREFIX."oauth_token"; + $sql .= " WHERE service = '".$this->db->escape($service.($this->keyforprovider?'-'.$this->keyforprovider:''))."'"; + $sql .= " AND entity IN (".getEntity('oauth_token').")"; + $resql = $this->db->query($sql); + //} - $states[$service] = $state; - $this->states[$service] = $state; + // allow chaining + return $this; + } - $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."oauth_state"; - $sql.= " WHERE service='".$this->db->escape($service)."' AND entity=1"; - $resql = $this->db->query($sql); - if (! $resql) - { - dol_print_error($this->db); - } - $obj = $this->db->fetch_array($resql); - if ($obj) { - // update - $sql = "UPDATE ".MAIN_DB_PREFIX."oauth_state"; - $sql.= " SET state='".$this->db->escape($state)."'"; - $sql.= " WHERE rowid='".$obj['rowid']."'"; - $resql = $this->db->query($sql); - } else { - // save - $sql = "INSERT INTO ".MAIN_DB_PREFIX."oauth_state (service, state, entity)"; - $sql.= " VALUES ('".$this->db->escape($service)."', '".$this->db->escape($state)."', 1)"; - $resql = $this->db->query($sql); - } + /** + * {@inheritDoc} + */ + public function clearAllTokens() + { + // TODO + $this->conf->remove($this->key); - // allow chaining - return $this; - } + // allow chaining + return $this; + } - /** - * {@inheritDoc} - */ - public function hasAuthorizationState($service) - { - // get state from db - dol_syslog("get state from db"); - $sql = "SELECT state FROM ".MAIN_DB_PREFIX."oauth_state"; - $sql.= " WHERE service='".$this->db->escape($service)."'"; - $resql = $this->db->query($sql); - $result = $this->db->fetch_array($resql); - $states[$service] = $result['state']; - $this->states[$service] = $states[$service]; + /** + * {@inheritDoc} + */ + public function retrieveAuthorizationState($service) + { + if ($this->hasAuthorizationState($service)) { + return $this->states[$service]; + } - return is_array($states) - && isset($states[$service]) - && null !== $states[$service]; - } + dol_syslog('State not found in db, are you sure you stored it?', LOG_WARNING); + throw new AuthorizationStateNotFoundException('State not found in db, are you sure you stored it?'); + } - /** - * {@inheritDoc} - */ - public function clearAuthorizationState($service) - { - // TODO - // get previously saved tokens - //$states = $this->conf->get($this->stateKey); + /** + * {@inheritDoc} + */ + public function storeAuthorizationState($service, $state) + { + global $conf; - if (is_array($states) && array_key_exists($service, $states)) { - unset($states[$service]); + // TODO save or update - // Replace the stored tokens array - //$this->conf->set($this->stateKey, $states); - } + dol_syslog("storeAuthorizationState service=".$service); - // allow chaining - return $this; - } + if (!isset($this->states) || !is_array($this->states)) { + $this->states = array(); + } - /** - * {@inheritDoc} - */ - public function clearAllAuthorizationStates() - { - // TODO - //$this->conf->remove($this->stateKey); + //$states[$service] = $state; + $this->states[$service] = $state; - // allow chaining - return $this; - } + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."oauth_state"; + $sql .= " WHERE service = '".$this->db->escape($service.($this->keyforprovider?'-'.$this->keyforprovider:''))."'"; + $sql .= " AND entity IN (".getEntity('oauth_token').")"; + $resql = $this->db->query($sql); + if (! $resql) { + dol_print_error($this->db); + } + $obj = $this->db->fetch_array($resql); + if ($obj) { + // update + $sql = "UPDATE ".MAIN_DB_PREFIX."oauth_state"; + $sql.= " SET state = '".$this->db->escape($state)."'"; + $sql.= " WHERE rowid = ".((int) $obj['rowid']); + $resql = $this->db->query($sql); + } else { + // save + $sql = "INSERT INTO ".MAIN_DB_PREFIX."oauth_state (service, state, entity)"; + $sql.= " VALUES ('".$this->db->escape($service.($this->keyforprovider?'-'.$this->keyforprovider:''))."', '".$this->db->escape($state)."', ".((int) $conf->entity).")"; + $resql = $this->db->query($sql); + } + // allow chaining + return $this; + } + + /** + * {@inheritDoc} + */ + public function hasAuthorizationState($service) + { + // get state from db + dol_syslog("hasAuthorizationState service=".$service); + + $sql = "SELECT state FROM ".MAIN_DB_PREFIX."oauth_state"; + $sql .= " WHERE service = '".$this->db->escape($service.($this->keyforprovider?'-'.$this->keyforprovider:''))."'"; + $sql .= " AND entity IN (".getEntity('oauth_token').")"; + + $resql = $this->db->query($sql); + + $result = $this->db->fetch_array($resql); + + $states = array(); + $states[$service] = $result['state']; + $this->states[$service] = $states[$service]; + + return is_array($states) + && isset($states[$service]) + && null !== $states[$service]; + } + + /** + * {@inheritDoc} + */ + public function clearAuthorizationState($service) + { + // TODO + // get previously saved tokens + //$states = $this->conf->get($this->stateKey); + + if (is_array($this->states) && array_key_exists($service, $this->states)) { + unset($this->states[$service]); + + // Replace the stored tokens array + //$this->conf->set($this->stateKey, $states); + } + + // allow chaining + return $this; + } + + /** + * {@inheritDoc} + */ + public function clearAllAuthorizationStates() + { + // TODO + //$this->conf->remove($this->stateKey); + + // allow chaining + return $this; + } } diff --git a/htdocs/includes/restler/framework/Luracast/Restler/CommentParser.php b/htdocs/includes/restler/framework/Luracast/Restler/CommentParser.php index 6b8b9178f6b..ce148874d02 100644 --- a/htdocs/includes/restler/framework/Luracast/Restler/CommentParser.php +++ b/htdocs/includes/restler/framework/Luracast/Restler/CommentParser.php @@ -19,505 +19,504 @@ use Luracast\Restler\Data\Text; */ class CommentParser { - /** - * name for the embedded data - * - * @var string - */ - public static $embeddedDataName = 'properties'; - /** - * Regular Expression pattern for finding the embedded data and extract - * the inner information. It is used with preg_match. - * - * @var string - */ - public static $embeddedDataPattern - = '/```(\w*)[\s]*(([^`]*`{0,2}[^`]+)*)```/ms'; - /** - * Pattern will have groups for the inner details of embedded data - * this index is used to locate the data portion. - * - * @var int - */ - public static $embeddedDataIndex = 2; - /** - * Delimiter used to split the array data. - * - * When the name portion is of the embedded data is blank auto detection - * will be used and if URLEncodedFormat is detected as the data format - * the character specified will be used as the delimiter to find split - * array data. - * - * @var string - */ - public static $arrayDelimiter = ','; + /** + * name for the embedded data + * + * @var string + */ + public static $embeddedDataName = 'properties'; + /** + * Regular Expression pattern for finding the embedded data and extract + * the inner information. It is used with preg_match. + * + * @var string + */ + public static $embeddedDataPattern + = '/```(\w*)[\s]*(([^`]*`{0,2}[^`]+)*)```/ms'; + /** + * Pattern will have groups for the inner details of embedded data + * this index is used to locate the data portion. + * + * @var int + */ + public static $embeddedDataIndex = 2; + /** + * Delimiter used to split the array data. + * + * When the name portion is of the embedded data is blank auto detection + * will be used and if URLEncodedFormat is detected as the data format + * the character specified will be used as the delimiter to find split + * array data. + * + * @var string + */ + public static $arrayDelimiter = ','; - /** - * @var array annotations that support array value - */ - public static $allowsArrayValue = array( - 'choice' => true, - 'select' => true, - 'properties' => true, - ); + /** + * @var array annotations that support array value + */ + public static $allowsArrayValue = array( + 'choice' => true, + 'select' => true, + 'properties' => true, + ); - /** - * character sequence used to escape \@ - */ - const escapedAtChar = '\\@'; + /** + * character sequence used to escape \@ + */ + const escapedAtChar = '\\@'; - /** - * character sequence used to escape end of comment - */ - const escapedCommendEnd = '{@*}'; + /** + * character sequence used to escape end of comment + */ + const escapedCommendEnd = '{@*}'; - /** - * Instance of Restler class injected at runtime. - * - * @var Restler - */ - public $restler; - /** - * Comment information is parsed and stored in to this array. - * - * @var array - */ - private $_data = array(); + /** + * Instance of Restler class injected at runtime. + * + * @var Restler + */ + public $restler; + /** + * Comment information is parsed and stored in to this array. + * + * @var array + */ + private $_data = array(); - /** - * Parse the comment and extract the data. - * - * @static - * - * @param $comment - * @param bool $isPhpDoc - * - * @return array associative array with the extracted values - */ - public static function parse($comment, $isPhpDoc = true) - { - $p = new self(); - if (empty($comment)) { - return $p->_data; - } + /** + * Parse the comment and extract the data. + * + * @static + * + * @param $comment + * @param bool $isPhpDoc + * + * @return array associative array with the extracted values + */ + public static function parse($comment, $isPhpDoc = true) + { + $p = new self(); + if (empty($comment)) { + return $p->_data; + } - if ($isPhpDoc) { - $comment = self::removeCommentTags($comment); - } + if ($isPhpDoc) { + $comment = self::removeCommentTags($comment); + } - $p->extractData($comment); - return $p->_data; + $p->extractData($comment); + return $p->_data; + } - } + /** + * Removes the comment tags from each line of the comment. + * + * @static + * + * @param string $comment PhpDoc style comment + * + * @return string comments with out the tags + */ + public static function removeCommentTags($comment) + { + $pattern = '/(^\/\*\*)|(^\s*\**[ \/]?)|\s(?=@)|\s\*\//m'; + return preg_replace($pattern, '', $comment); + } - /** - * Removes the comment tags from each line of the comment. - * - * @static - * - * @param string $comment PhpDoc style comment - * - * @return string comments with out the tags - */ - public static function removeCommentTags($comment) - { - $pattern = '/(^\/\*\*)|(^\s*\**[ \/]?)|\s(?=@)|\s\*\//m'; - return preg_replace($pattern, '', $comment); - } + /** + * Extracts description and long description, uses other methods to get + * parameters. + * + * @param $comment + * + * @return array + */ + private function extractData($comment) + { + //to use @ as part of comment we need to + $comment = str_replace( + array(self::escapedCommendEnd, self::escapedAtChar), + array('*/', '@'), + $comment); - /** - * Extracts description and long description, uses other methods to get - * parameters. - * - * @param $comment - * - * @return array - */ - private function extractData($comment) - { - //to use @ as part of comment we need to - $comment = str_replace( - array(self::escapedCommendEnd, self::escapedAtChar), - array('*/', '@'), - $comment); + $description = array(); + $longDescription = array(); + $params = array(); - $description = array(); - $longDescription = array(); - $params = array(); + $mode = 0; // extract short description; + $comments = preg_split("/(\r?\n)/", $comment); + // remove first blank line; + array_shift($comments); + $addNewline = false; + foreach ($comments as $line) { + $line = trim($line); + $newParam = false; + if (empty($line)) { + if ($mode == 0) { + $mode++; + } else { + $addNewline = true; + } + continue; + } elseif ($line[0] == '@') { + $mode = 2; + $newParam = true; + } + switch ($mode) { + case 0 : + $description[] = $line; + if (count($description) > 3) { + // if more than 3 lines take only first line + $longDescription = $description; + $description[] = array_shift($longDescription); + $mode = 1; + } elseif (substr($line, -1) == '.') { + $mode = 1; + } + break; + case 1 : + if ($addNewline) { + $line = ' ' . $line; + } + $longDescription[] = $line; + break; + case 2 : + $newParam + ? $params[] = $line + : $params[count($params) - 1] .= ' ' . $line; + } + $addNewline = false; + } + $description = implode(' ', $description); + $longDescription = implode(' ', $longDescription); + $description = preg_replace('/\s+/msu', ' ', $description); + $longDescription = preg_replace('/\s+/msu', ' ', $longDescription); + list($description, $d1) + = $this->parseEmbeddedData($description); + list($longDescription, $d2) + = $this->parseEmbeddedData($longDescription); + $this->_data = compact('description', 'longDescription'); + $d2 += $d1; + if (!empty($d2)) { + $this->_data[self::$embeddedDataName] = $d2; + } + foreach ($params as $key => $line) { + list(, $param, $value) = preg_split('/\@|\s/', $line, 3) + + array('', '', ''); + list($value, $embedded) = $this->parseEmbeddedData($value); + $value = array_filter(preg_split('/\s+/msu', $value), 'strlen'); + $this->parseParam($param, $value, $embedded); + } + return $this->_data; + } - $mode = 0; // extract short description; - $comments = preg_split("/(\r?\n)/", $comment); - // remove first blank line; - array_shift($comments); - $addNewline = false; - foreach ($comments as $line) { - $line = trim($line); - $newParam = false; - if (empty ($line)) { - if ($mode == 0) { - $mode++; - } else { - $addNewline = true; - } - continue; - } elseif ($line[0] == '@') { - $mode = 2; - $newParam = true; - } - switch ($mode) { - case 0 : - $description[] = $line; - if (count($description) > 3) { - // if more than 3 lines take only first line - $longDescription = $description; - $description[] = array_shift($longDescription); - $mode = 1; - } elseif (substr($line, -1) == '.') { - $mode = 1; - } - break; - case 1 : - if ($addNewline) { - $line = ' ' . $line; - } - $longDescription[] = $line; - break; - case 2 : - $newParam - ? $params[] = $line - : $params[count($params) - 1] .= ' ' . $line; - } - $addNewline = false; - } - $description = implode(' ', $description); - $longDescription = implode(' ', $longDescription); - $description = preg_replace('/\s+/msu', ' ', $description); - $longDescription = preg_replace('/\s+/msu', ' ', $longDescription); - list($description, $d1) - = $this->parseEmbeddedData($description); - list($longDescription, $d2) - = $this->parseEmbeddedData($longDescription); - $this->_data = compact('description', 'longDescription'); - $d2 += $d1; - if (!empty($d2)) { - $this->_data[self::$embeddedDataName] = $d2; - } - foreach ($params as $key => $line) { - list(, $param, $value) = preg_split('/\@|\s/', $line, 3) - + array('', '', ''); - list($value, $embedded) = $this->parseEmbeddedData($value); - $value = array_filter(preg_split('/\s+/msu', $value), 'strlen'); - $this->parseParam($param, $value, $embedded); - } - return $this->_data; - } + /** + * Parse parameters that begin with (at) + * + * @param $param + * @param array $value + * @param array $embedded + */ + private function parseParam($param, array $value, array $embedded) + { + $data = &$this->_data; + $allowMultiple = false; + switch ($param) { + case 'param' : + case 'property' : + case 'property-read' : + case 'property-write' : + $value = $this->formatParam($value); + $allowMultiple = true; + break; + case 'var' : + $value = $this->formatVar($value); + break; + case 'return' : + $value = $this->formatReturn($value); + break; + case 'class' : + $data = &$data[$param]; + list ($param, $value) = $this->formatClass($value); + break; + case 'access' : + $value = reset($value); + break; + case 'expires' : + case 'status' : + $value = intval(reset($value)); + break; + case 'throws' : + $value = $this->formatThrows($value); + $allowMultiple = true; + break; + case 'author': + $value = $this->formatAuthor($value); + $allowMultiple = true; + break; + case 'header' : + case 'link': + case 'example': + case 'todo': + $allowMultiple = true; + //don't break, continue with code for default: + default : + $value = implode(' ', $value); + } + if (!empty($embedded)) { + if (is_string($value)) { + $value = array('description' => $value); + } + $value[self::$embeddedDataName] = $embedded; + } + if (empty($data[$param])) { + if ($allowMultiple) { + $data[$param] = array( + $value + ); + } else { + $data[$param] = $value; + } + } elseif ($allowMultiple) { + $data[$param][] = $value; + } elseif ($param == 'param') { + $arr = array( + $data[$param], + $value + ); + $data[$param] = $arr; + } else { + if (!is_string($value) && isset($value[self::$embeddedDataName]) + && isset($data[$param][self::$embeddedDataName]) + ) { + $value[self::$embeddedDataName] + += $data[$param][self::$embeddedDataName]; + } + if (!is_array($data[$param])) { + $data[$param] = array('description' => (string) $data[$param]); + } + if (is_array($value)) { + $data[$param] = $value + $data[$param]; + } + } + } - /** - * Parse parameters that begin with (at) - * - * @param $param - * @param array $value - * @param array $embedded - */ - private function parseParam($param, array $value, array $embedded) - { - $data = &$this->_data; - $allowMultiple = false; - switch ($param) { - case 'param' : - case 'property' : - case 'property-read' : - case 'property-write' : - $value = $this->formatParam($value); - $allowMultiple = true; - break; - case 'var' : - $value = $this->formatVar($value); - break; - case 'return' : - $value = $this->formatReturn($value); - break; - case 'class' : - $data = &$data[$param]; - list ($param, $value) = $this->formatClass($value); - break; - case 'access' : - $value = reset($value); - break; - case 'expires' : - case 'status' : - $value = intval(reset($value)); - break; - case 'throws' : - $value = $this->formatThrows($value); - $allowMultiple = true; - break; - case 'author': - $value = $this->formatAuthor($value); - $allowMultiple = true; - break; - case 'header' : - case 'link': - case 'example': - case 'todo': - $allowMultiple = true; - //don't break, continue with code for default: - default : - $value = implode(' ', $value); - } - if (!empty($embedded)) { - if (is_string($value)) { - $value = array('description' => $value); - } - $value[self::$embeddedDataName] = $embedded; - } - if (empty ($data[$param])) { - if ($allowMultiple) { - $data[$param] = array( - $value - ); - } else { - $data[$param] = $value; - } - } elseif ($allowMultiple) { - $data[$param][] = $value; - } elseif ($param == 'param') { - $arr = array( - $data[$param], - $value - ); - $data[$param] = $arr; - } else { - if (!is_string($value) && isset($value[self::$embeddedDataName]) - && isset($data[$param][self::$embeddedDataName]) - ) { - $value[self::$embeddedDataName] - += $data[$param][self::$embeddedDataName]; - } - if (!is_array($data[$param])) { - $data[$param] = array('description' => (string)$data[$param]); - } - if (is_array($value)) { - $data[$param] = $value + $data[$param]; - } - } - } + /** + * Parses the inline php doc comments and embedded data. + * + * @param $subject + * + * @return array + * @throws Exception + */ + private function parseEmbeddedData($subject) + { + $data = array(); - /** - * Parses the inline php doc comments and embedded data. - * - * @param $subject - * - * @return array - * @throws Exception - */ - private function parseEmbeddedData($subject) - { - $data = array(); + //parse {@pattern } tags specially + while (preg_match('|(?s-m)({@pattern (/.+/[imsxuADSUXJ]*)})|', $subject, $matches)) { + $subject = str_replace($matches[0], '', $subject); + $data['pattern'] = $matches[2]; + } + while (preg_match('/{@(\w+)\s?([^}]*)}/ms', $subject, $matches)) { + $name = $matches[1]; + $value = $matches[2]; + $subject = str_replace($matches[0], '', $subject); + if ($name == 'pattern') { + throw new Exception('Inline pattern tag should follow {@pattern /REGEX_PATTERN_HERE/} format and can optionally include PCRE modifiers following the ending `/`'); + } elseif (isset(static::$allowsArrayValue[$name])) { + $value = explode(static::$arrayDelimiter, $value); + } elseif ($value == 'true' || $value == 'false') { + $value = $value == 'true'; + } elseif ($value == '') { + $value = true; + } elseif ($name == 'required') { + $value = explode(static::$arrayDelimiter, $value); + } + if (defined('Luracast\\Restler\\UI\\HtmlForm::'.$name)) { + $value = constant($value); + } + $data[$name] = $value; + } - //parse {@pattern } tags specially - while (preg_match('|(?s-m)({@pattern (/.+/[imsxuADSUXJ]*)})|', $subject, $matches)) { - $subject = str_replace($matches[0], '', $subject); - $data['pattern'] = $matches[2]; - } - while (preg_match('/{@(\w+)\s?([^}]*)}/ms', $subject, $matches)) { - $name = $matches[1]; - $value = $matches[2]; - $subject = str_replace($matches[0], '', $subject); - if ($name == 'pattern') { - throw new Exception('Inline pattern tag should follow {@pattern /REGEX_PATTERN_HERE/} format and can optionally include PCRE modifiers following the ending `/`'); - } elseif (isset(static::$allowsArrayValue[$name])) { - $value = explode(static::$arrayDelimiter, $value); - } elseif ($value == 'true' || $value == 'false') { - $value = $value == 'true'; - } elseif ($value == '') { - $value = true; - } elseif ($name == 'required') { - $value = explode(static::$arrayDelimiter, $value); - } - if (defined('Luracast\\Restler\\UI\\HtmlForm::'.$name)) { - $value = constant($value); - } - $data[$name] = $value; - } + while (preg_match(self::$embeddedDataPattern, $subject, $matches)) { + $subject = str_replace($matches[0], '', $subject); + $str = $matches[self::$embeddedDataIndex]; + if (isset($this->restler) + && self::$embeddedDataIndex > 1 + && !empty($name) + ) { + $extension = $name; + $formatMap = $this->restler->getFormatMap(); + if (isset($formatMap[$extension])) { + /** + * @var \Luracast\Restler\Format\iFormat + */ + $format = $formatMap[$extension]; + $format = new $format(); + $data = $format->decode($str); + } + } else { // auto detect + if ($str[0] == '{') { + $d = json_decode($str, true); + if (json_last_error() != JSON_ERROR_NONE) { + throw new Exception('Error parsing embedded JSON data' + . " $str"); + } + $data = $d + $data; + } else { + parse_str($str, $d); + //clean up + $d = array_filter($d); + foreach ($d as $key => $val) { + $kt = trim($key); + if ($kt != $key) { + unset($d[$key]); + $key = $kt; + $d[$key] = $val; + } + if (is_string($val)) { + if ($val == 'true' || $val == 'false') { + $d[$key] = $val == 'true' ? true : false; + } else { + $val = explode(self::$arrayDelimiter, $val); + if (count($val) > 1) { + $d[$key] = $val; + } else { + $d[$key] = + preg_replace('/\s+/msu', ' ', + $d[$key]); + } + } + } + } + $data = $d + $data; + } + } + } + return array($subject, $data); + } - while (preg_match(self::$embeddedDataPattern, $subject, $matches)) { - $subject = str_replace($matches[0], '', $subject); - $str = $matches[self::$embeddedDataIndex]; - if (isset ($this->restler) - && self::$embeddedDataIndex > 1 - && !empty ($name) - ) { - $extension = $name; - $formatMap = $this->restler->getFormatMap(); - if (isset ($formatMap[$extension])) { - /** - * @var \Luracast\Restler\Format\iFormat - */ - $format = $formatMap[$extension]; - $format = new $format(); - $data = $format->decode($str); - } - } else { // auto detect - if ($str[0] == '{') { - $d = json_decode($str, true); - if (json_last_error() != JSON_ERROR_NONE) { - throw new Exception('Error parsing embedded JSON data' - . " $str"); - } - $data = $d + $data; - } else { - parse_str($str, $d); - //clean up - $d = array_filter($d); - foreach ($d as $key => $val) { - $kt = trim($key); - if ($kt != $key) { - unset($d[$key]); - $key = $kt; - $d[$key] = $val; - } - if (is_string($val)) { - if ($val == 'true' || $val == 'false') { - $d[$key] = $val == 'true' ? true : false; - } else { - $val = explode(self::$arrayDelimiter, $val); - if (count($val) > 1) { - $d[$key] = $val; - } else { - $d[$key] = - preg_replace('/\s+/msu', ' ', - $d[$key]); - } - } - } - } - $data = $d + $data; - } - } - } - return array($subject, $data); - } + private function formatThrows(array $value) + { + $code = 500; + $exception = 'Exception'; + if (count($value) > 1) { + $v1 = $value[0]; + $v2 = $value[1]; + if (is_numeric($v1)) { + $code = $v1; + $exception = $v2; + array_shift($value); + array_shift($value); + } elseif (is_numeric($v2)) { + $code = $v2; + $exception = $v1; + array_shift($value); + array_shift($value); + } else { + $exception = $v1; + array_shift($value); + } + } elseif (count($value) && isset($value[0]) && is_numeric($value[0])) { + $code = $value[0]; + array_shift($value); + } + $message = implode(' ', $value); + if (!isset(RestException::$codes[$code])) { + $code = 500; + } elseif (empty($message)) { + $message = RestException::$codes[$code]; + } + return compact('code', 'message', 'exception'); + } - private function formatThrows(array $value) - { - $code = 500; - $exception = 'Exception'; - if (count($value) > 1) { - $v1 = $value[0]; - $v2 = $value[1]; - if (is_numeric($v1)) { - $code = $v1; - $exception = $v2; - array_shift($value); - array_shift($value); - } elseif (is_numeric($v2)) { - $code = $v2; - $exception = $v1; - array_shift($value); - array_shift($value); - } else { - $exception = $v1; - array_shift($value); - } - } elseif (count($value) && is_numeric($value[0])) { - $code = $value[0]; - array_shift($value); - } - $message = implode(' ', $value); - if (!isset(RestException::$codes[$code])) { - $code = 500; - } elseif (empty($message)) { - $message = RestException::$codes[$code]; - } - return compact('code', 'message', 'exception'); - } + private function formatClass(array $value) + { + $param = array_shift($value); - private function formatClass(array $value) - { - $param = array_shift($value); + if (empty($param)) { + $param = 'Unknown'; + } + $value = implode(' ', $value); + return array( + ltrim($param, '\\'), + array('description' => $value) + ); + } - if (empty($param)) { - $param = 'Unknown'; - } - $value = implode(' ', $value); - return array( - ltrim($param, '\\'), - array('description' => $value) - ); - } + private function formatAuthor(array $value) + { + $r = array(); + $email = end($value); + if ($email[0] == '<') { + $email = substr($email, 1, -1); + array_pop($value); + $r['email'] = $email; + } + $r['name'] = implode(' ', $value); + return $r; + } - private function formatAuthor(array $value) - { - $r = array(); - $email = end($value); - if ($email[0] == '<') { - $email = substr($email, 1, -1); - array_pop($value); - $r['email'] = $email; - } - $r['name'] = implode(' ', $value); - return $r; - } + private function formatReturn(array $value) + { + $data = explode('|', array_shift($value)); + $r = array( + 'type' => count($data) == 1 ? $data[0] : $data + ); + $r['description'] = implode(' ', $value); + return $r; + } - private function formatReturn(array $value) - { - $data = explode('|', array_shift($value)); - $r = array( - 'type' => count($data) == 1 ? $data[0] : $data - ); - $r['description'] = implode(' ', $value); - return $r; - } + private function formatParam(array $value) + { + $r = array(); + $data = array_shift($value); + if (empty($data)) { + $r['type'] = 'mixed'; + } elseif ($data[0] == '$') { + $r['name'] = substr($data, 1); + $r['type'] = 'mixed'; + } else { + $data = explode('|', $data); + $r['type'] = count($data) == 1 ? $data[0] : $data; - private function formatParam(array $value) - { - $r = array(); - $data = array_shift($value); - if (empty($data)) { - $r['type'] = 'mixed'; - } elseif ($data[0] == '$') { - $r['name'] = substr($data, 1); - $r['type'] = 'mixed'; - } else { - $data = explode('|', $data); - $r['type'] = count($data) == 1 ? $data[0] : $data; + $data = array_shift($value); + if (!empty($data) && $data[0] == '$') { + $r['name'] = substr($data, 1); + } + } + if (isset($r['type']) && is_string($r['type']) && Text::endsWith($r['type'], '[]')) { + $r[static::$embeddedDataName]['type'] = substr($r['type'], 0, -2); + $r['type'] = 'array'; + } + if ($value) { + $r['description'] = implode(' ', $value); + } + return $r; + } - $data = array_shift($value); - if (!empty($data) && $data[0] == '$') { - $r['name'] = substr($data, 1); - } - } - if (isset($r['type']) && is_string($r['type']) && Text::endsWith($r['type'], '[]')) { - $r[static::$embeddedDataName]['type'] = substr($r['type'], 0, -2); - $r['type'] = 'array'; - } - if ($value) { - $r['description'] = implode(' ', $value); - } - return $r; - } - - private function formatVar(array $value) - { - $r = array(); - $data = array_shift($value); - if (empty($data)) { - $r['type'] = 'mixed'; - } elseif ($data[0] == '$') { - $r['name'] = substr($data, 1); - $r['type'] = 'mixed'; - } else { - $data = explode('|', $data); - $r['type'] = count($data) == 1 ? $data[0] : $data; - } - if (isset($r['type']) && Text::endsWith($r['type'], '[]')) { - $r[static::$embeddedDataName]['type'] = substr($r['type'], 0, -2); - $r['type'] = 'array'; - } - if ($value) { - $r['description'] = implode(' ', $value); - } - return $r; - } + private function formatVar(array $value) + { + $r = array(); + $data = array_shift($value); + if (empty($data)) { + $r['type'] = 'mixed'; + } elseif ($data[0] == '$') { + $r['name'] = substr($data, 1); + $r['type'] = 'mixed'; + } else { + $data = explode('|', $data); + $r['type'] = count($data) == 1 ? $data[0] : $data; + } + if (isset($r['type']) && Text::endsWith($r['type'], '[]')) { + $r[static::$embeddedDataName]['type'] = substr($r['type'], 0, -2); + $r['type'] = 'array'; + } + if ($value) { + $r['description'] = implode(' ', $value); + } + return $r; + } } diff --git a/htdocs/index.php b/htdocs/index.php index 5593eaffacf..6ada359cee6 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -145,7 +145,6 @@ $boxstatFromHook = ''; $langs->loadLangs(array('commercial', 'bills', 'orders', 'contracts')); // Dolibarr Working Board with weather - if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $showweather = (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO == 2) ? 1 : 0; @@ -156,21 +155,21 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { require_once DOL_DOCUMENT_ROOT.'/core/class/workboardresponse.class.php'; // Number of actions to do (late) - if (!empty($conf->agenda->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_AGENDA) && $user->rights->agenda->myactions->read) { + if (isModEnabled('agenda') && empty($conf->global->MAIN_DISABLE_BLOCK_AGENDA) && $user->rights->agenda->myactions->read) { include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; $board = new ActionComm($db); $dashboardlines[$board->element] = $board->load_board($user); } // Number of project opened - if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && $user->rights->projet->lire) { + if (!empty($conf->project->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && $user->rights->projet->lire) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $board = new Project($db); $dashboardlines[$board->element] = $board->load_board($user); } // Number of tasks to do (late) - if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && empty($conf->global->PROJECT_HIDE_TASKS) && $user->rights->projet->lire) { + if (!empty($conf->project->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && empty($conf->global->PROJECT_HIDE_TASKS) && $user->rights->projet->lire) { include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; $board = new Task($db); $dashboardlines[$board->element] = $board->load_board($user); @@ -229,7 +228,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { } // Number of invoices customers (paid) - if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->rights->facture->lire) { + if (isModEnabled('facture') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->rights->facture->lire) { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $board = new Facture($db); $dashboardlines[$board->element] = $board->load_board($user); diff --git a/htdocs/install/mysql/data/llx_accounting_abc.sql b/htdocs/install/mysql/data/llx_accounting_abc.sql index 847cbf68790..7c8deec073c 100644 --- a/htdocs/install/mysql/data/llx_accounting_abc.sql +++ b/htdocs/install/mysql/data/llx_accounting_abc.sql @@ -5,7 +5,7 @@ -- Copyright (C) 2004 Guillaume Delecourt -- Copyright (C) 2005-2009 Regis Houssin -- Copyright (C) 2007 Patrick Raguin --- Copyright (C) 2011-2018 Alexandre Spangaro +-- Copyright (C) 2011-2022 Alexandre Spangaro -- Copyright (C) 2015-2017 Juanjo Menent -- Copyright (C) 2018 Abbes bahfir -- Copyright (C) 2020 Udo Tamm @@ -114,9 +114,8 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 84, 'EC-SUPERCIAS', 'Plan de cuentas Ecuador', 1); --- Description of chart of account LU PCN-LUXEMBURG -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (140, 'PCN-LUXEMBURG', 'Plan comptable normalisé Luxembourgeois', 1); - +-- Description of chart of account LU PCN2020-LUXEMBURG +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (140, 'PCN2020-LUXEMBURG', 'Plan comptable normalisé 2020 Luxembourgeois', 1); -- Description of chart of account RO RO-BASE INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (188, 'RO-BASE', 'Plan de conturi romanesc', 1); diff --git a/htdocs/install/mysql/data/llx_accounting_account_lu.sql b/htdocs/install/mysql/data/llx_accounting_account_lu.sql index 673062de802..831ac6b8f08 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_lu.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_lu.sql @@ -1,1147 +1,767 @@ -- Descriptif plan comptable LU PCN --- ID 11000 - 12999 +-- ID 17000 - 18999 -- ADD 14000000 to rowid # Do no remove this comment -- -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11000,'PCN-LUXEMBURG','CAPIT','1','','Capital ou dotation des succursales et comptes de l''exploitant','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11001,'PCN-LUXEMBURG','CAPIT','101',11000,'Capital souscrit (Sociétés de capitaux - Montant total)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11002,'PCN-LUXEMBURG','CAPIT','102',11000,'Capital souscrit non appelé (Sociétés de capitaux)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11003,'PCN-LUXEMBURG','CAPIT','103',11000,'Capital souscrit appelé et non versé (Sociétés de capitaux)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11004,'PCN-LUXEMBURG','CAPIT','104',11000,'Capital des entreprises commerçants personnes physiques et des sociétés de personnes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11005,'PCN-LUXEMBURG','CAPIT','1041',11004,'Commerçants personnes physiques','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11006,'PCN-LUXEMBURG','CAPIT','1042',11004,'Sociétés de personnes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11007,'PCN-LUXEMBURG','CAPIT','105',11000,'Dotation des succursales','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11008,'PCN-LUXEMBURG','CAPIT','106',11000,'Comptes de l’exploitant ou des co-exploitants','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11009,'PCN-LUXEMBURG','CAPIT','1061',11008,'Prélèvements privés de l’exploitant ou des coexploitants','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11010,'PCN-LUXEMBURG','CAPIT','10611',11009,'Prélèvements en numéraire (train de vie)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11011,'PCN-LUXEMBURG','CAPIT','10612',11009,'Prélèvements en nature de marchandises, de produits finis et services (au prix de revient)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11012,'PCN-LUXEMBURG','CAPIT','10613',11009,'Part personnelle des frais de maladie','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11013,'PCN-LUXEMBURG','CAPIT','10614',11009,'Primes d’assurances privées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11014,'PCN-LUXEMBURG','CAPIT','106141',11013,'Vie','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11015,'PCN-LUXEMBURG','CAPIT','106142',11013,'Accident','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11016,'PCN-LUXEMBURG','CAPIT','106143',11013,'Incendie','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11017,'PCN-LUXEMBURG','CAPIT','106144',11013,'Responsabilité civile','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11018,'PCN-LUXEMBURG','CAPIT','106145',11013,'Multirisques','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11019,'PCN-LUXEMBURG','CAPIT','106148',11013,'Autres primes d’assurances privées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11020,'PCN-LUXEMBURG','CAPIT','10615',11009,'Cotisations','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11021,'PCN-LUXEMBURG','CAPIT','106151',11020,'Assurances sociales (assurance dépendance)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11022,'PCN-LUXEMBURG','CAPIT','106152',11020,'Allocations familiales','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11023,'PCN-LUXEMBURG','CAPIT','106153',11020,'Cotisations pour mutuelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11024,'PCN-LUXEMBURG','CAPIT','106154',11020,'Caisse de décès, médicochirurgicale, Prestaplus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11025,'PCN-LUXEMBURG','CAPIT','106158',11020,'Autres cotisations','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11026,'PCN-LUXEMBURG','CAPIT','10616',11009,'Prélèvements en nature (quote-part privée dans les frais généraux)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11027,'PCN-LUXEMBURG','CAPIT','106161',11026,'Salaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11028,'PCN-LUXEMBURG','CAPIT','106162',11026,'Loyer','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11029,'PCN-LUXEMBURG','CAPIT','106163',11026,'Chauffage, gaz, électricité','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11030,'PCN-LUXEMBURG','CAPIT','106164',11026,'Eau','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11031,'PCN-LUXEMBURG','CAPIT','106165',11026,'Téléphone','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11032,'PCN-LUXEMBURG','CAPIT','106166',11026,'Voiture','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11033,'PCN-LUXEMBURG','CAPIT','106168',11026,'Autres prélèvements en nature','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11034,'PCN-LUXEMBURG','CAPIT','10617',11009,'Acquisitions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11035,'PCN-LUXEMBURG','CAPIT','106171',11034,'Mobilier privé','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11036,'PCN-LUXEMBURG','CAPIT','106172',11034,'Voiture privée','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11037,'PCN-LUXEMBURG','CAPIT','106173',11034,'Titres privés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11038,'PCN-LUXEMBURG','CAPIT','106174',11034,'Immeubles privés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11039,'PCN-LUXEMBURG','CAPIT','106178',11034,'Autres acquisitions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11040,'PCN-LUXEMBURG','CAPIT','10618',11009,'Impôts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11041,'PCN-LUXEMBURG','CAPIT','106181',11040,'Impôt sur le revenu payé','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11042,'PCN-LUXEMBURG','CAPIT','106182',11040,'Impôt sur la fortune payé','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11043,'PCN-LUXEMBURG','CAPIT','106183',11040,'Impôt commercial - arriérés payés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11044,'PCN-LUXEMBURG','CAPIT','106188',11040,'Autres impôts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11045,'PCN-LUXEMBURG','CAPIT','10619',11009,'Prélèvements privés particuliers','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11046,'PCN-LUXEMBURG','CAPIT','106191',11045,'Réparations aux immeubles privés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11047,'PCN-LUXEMBURG','CAPIT','106192',11045,'Placements sur comptes financiers privés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11048,'PCN-LUXEMBURG','CAPIT','106193',11045,'Remboursements de dettes privées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11049,'PCN-LUXEMBURG','CAPIT','106194',11045,'Dons et dotations aux enfants','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11050,'PCN-LUXEMBURG','CAPIT','106195',11045,'Droits de succession et droits de mutation par décès','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11051,'PCN-LUXEMBURG','CAPIT','106198',11045,'Autres prélèvements privés particuliers','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11052,'PCN-LUXEMBURG','CAPIT','1062',11008,'Suppléments d’apports privés de l’exploitant ou des coexploitants','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11053,'PCN-LUXEMBURG','CAPIT','10621',11052,'Héritage ou donation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11054,'PCN-LUXEMBURG','CAPIT','10622',11052,'Avoirs privés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11055,'PCN-LUXEMBURG','CAPIT','10623',11052,'Emprunts privés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11056,'PCN-LUXEMBURG','CAPIT','10624',11052,'Cessions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11057,'PCN-LUXEMBURG','CAPIT','106241',11056,'Mobilier privé','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11058,'PCN-LUXEMBURG','CAPIT','106242',11056,'Voiture privée','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11059,'PCN-LUXEMBURG','CAPIT','106243',11056,'Titres privés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11060,'PCN-LUXEMBURG','CAPIT','106244',11056,'Immeubles privés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11061,'PCN-LUXEMBURG','CAPIT','106248',11056,'Autres cessions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11062,'PCN-LUXEMBURG','CAPIT','10625',11052,'Loyers encaissés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11063,'PCN-LUXEMBURG','CAPIT','10626',11052,'Salaires ou rentes touchés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11064,'PCN-LUXEMBURG','CAPIT','10627',11052,'Allocations familiales reçues','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11065,'PCN-LUXEMBURG','CAPIT','10628',11052,'Remboursements d’impôts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11066,'PCN-LUXEMBURG','CAPIT','106281',11065,'Impôt sur le revenu','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11067,'PCN-LUXEMBURG','CAPIT','106283',11065,'Impôt sur la fortune','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11068,'PCN-LUXEMBURG','CAPIT','106284',11065,'Impôt commercial','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11069,'PCN-LUXEMBURG','CAPIT','106288',11065,'Autres remboursements d’impôts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11070,'PCN-LUXEMBURG','CAPIT','10629',11052,'Quote-part professionnelle de frais privés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11071,'PCN-LUXEMBURG','CAPIT','11','','Primes d’émission et primes assimilées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11072,'PCN-LUXEMBURG','CAPIT','111',11071,'Primes d’émission','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11073,'PCN-LUXEMBURG','CAPIT','112',11071,'Primes de fusion','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11074,'PCN-LUXEMBURG','CAPIT','113',11071,'Primes d’apport','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11075,'PCN-LUXEMBURG','CAPIT','114',11071,'Primes de conversion d’obligations en actions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11076,'PCN-LUXEMBURG','CAPIT','115',11071,'Apport en capitaux propres non rémunéré par des titres («Capital contribution»)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11077,'PCN-LUXEMBURG','CAPIT','12','','Réserves de réévaluation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11078,'PCN-LUXEMBURG','CAPIT','121',11077,'Réserves de réévaluation en application de la juste valeur','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11079,'PCN-LUXEMBURG','CAPIT','122',11077,'Réserves de mise en équivalence (Participations valorisées suivant l’art. 58)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11080,'PCN-LUXEMBURG','CAPIT','123',11077,'Plus-values sur écarts de conversion immunisées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11081,'PCN-LUXEMBURG','CAPIT','128',11077,'Autres réserves de réévaluation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11082,'PCN-LUXEMBURG','CAPIT','13','','Réserves','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11083,'PCN-LUXEMBURG','CAPIT','131',11082,'Réserve légale','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11084,'PCN-LUXEMBURG','CAPIT','132',11082,'Réserve pour actions propres ou parts propres','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11085,'PCN-LUXEMBURG','CAPIT','133',11082,'Réserves statutaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11086,'PCN-LUXEMBURG','CAPIT','138',11082,'Autres réserves','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11087,'PCN-LUXEMBURG','CAPIT','1381',11086,'Réserve pour l’impôt sur la fortune','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11088,'PCN-LUXEMBURG','CAPIT','1382',11086,'Autres réserves indisponibles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11089,'PCN-LUXEMBURG','CAPIT','1383',11086,'Autres réserves disponibles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11090,'PCN-LUXEMBURG','CAPIT','14','','Résultats','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11091,'PCN-LUXEMBURG','CAPIT','141',11090,'Résultats reportés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11092,'PCN-LUXEMBURG','CAPIT','142',11090,'Résultat de l’exercice','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11093,'PCN-LUXEMBURG','CAPIT','15','','Acomptes sur dividendes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11094,'PCN-LUXEMBURG','CAPIT','16','','Subventions d’investissement en capital','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11095,'PCN-LUXEMBURG','CAPIT','161',11094,'Terrains et constructions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11096,'PCN-LUXEMBURG','CAPIT','162',11094,'Installations techniques et machines','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11097,'PCN-LUXEMBURG','CAPIT','163',11094,'Autres installations, outillage, mobilier et matériel roulant','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11098,'PCN-LUXEMBURG','CAPIT','168',11094,'Autres subventions d’investissement en capital','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11099,'PCN-LUXEMBURG','CAPIT','17','','Plus-values immunisées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11100,'PCN-LUXEMBURG','CAPIT','171',11099,'Plus-values immunisées à réinvestir','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11101,'PCN-LUXEMBURG','CAPIT','172',11099,'Plus-values immunisées réinvesties','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11102,'PCN-LUXEMBURG','CAPIT','18','','Provisions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11103,'PCN-LUXEMBURG','CAPIT','181',11102,'Provisions pour pensions et obligations similaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11104,'PCN-LUXEMBURG','CAPIT','182',11102,'Provisions pour impôts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11105,'PCN-LUXEMBURG','CAPIT','1821',11104,'Provisions pour impôt sur le revenu des collectivités','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11106,'PCN-LUXEMBURG','CAPIT','1822',11104,'Provisions pour impôt commercial','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11107,'PCN-LUXEMBURG','CAPIT','1823',11104,'Provisions pour impôt sur la fortune','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11108,'PCN-LUXEMBURG','CAPIT','1828',11104,'Autres provisions pour impôts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11109,'PCN-LUXEMBURG','CAPIT','183',11102,'Provisions pour impôts différés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11110,'PCN-LUXEMBURG','CAPIT','188',11102,'Autres provisions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11111,'PCN-LUXEMBURG','CAPIT','1881',11110,'Provisions d’exploitation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11112,'PCN-LUXEMBURG','CAPIT','1882',11110,'Provisions financières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11113,'PCN-LUXEMBURG','CAPIT','1883',11110,'Provisions exceptionnelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11114,'PCN-LUXEMBURG','CAPIT','19','','Dettes financières et dettes assimilées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11115,'PCN-LUXEMBURG','CAPIT','191',11114,'Dettes subordonnées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11116,'PCN-LUXEMBURG','CAPIT','1911',11115,'dont la durée résiduelle est inférieure ou égale à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11117,'PCN-LUXEMBURG','CAPIT','19111',11116,'Montant principal','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11118,'PCN-LUXEMBURG','CAPIT','19112',11116,'Intérêts courus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11119,'PCN-LUXEMBURG','CAPIT','1912',11115,'dont la durée résiduelle est supérieure à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11120,'PCN-LUXEMBURG','CAPIT','19121',11119,'Montant principal','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11121,'PCN-LUXEMBURG','CAPIT','19122',11119,'Intérêts courus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11122,'PCN-LUXEMBURG','CAPIT','192',11114,'Emprunts obligataires convertibles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11123,'PCN-LUXEMBURG','CAPIT','1921',11122,'dont la durée résiduelle est inférieure ou égale à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11124,'PCN-LUXEMBURG','CAPIT','19211',11123,'Montant principal','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11125,'PCN-LUXEMBURG','CAPIT','19212',11123,'Intérêts courus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11126,'PCN-LUXEMBURG','CAPIT','1922',11122,'dont la durée résiduelle est supérieure à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11127,'PCN-LUXEMBURG','CAPIT','19221',11126,'Montant principal','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11128,'PCN-LUXEMBURG','CAPIT','19222',11126,'Intérêts courus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11129,'PCN-LUXEMBURG','CAPIT','193',11114,'Emprunts obligataires non convertibles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11130,'PCN-LUXEMBURG','CAPIT','1931',11129,'dont la durée résiduelle est inférieure ou égale à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11131,'PCN-LUXEMBURG','CAPIT','19311',11130,'Montant principal','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11132,'PCN-LUXEMBURG','CAPIT','19312',11130,'Intérêts courus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11133,'PCN-LUXEMBURG','CAPIT','1932',11129,'dont la durée résiduelle est supérieure à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11134,'PCN-LUXEMBURG','CAPIT','19321',11133,'Montant principal','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11135,'PCN-LUXEMBURG','CAPIT','19322',11133,'Intérêts courus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11136,'PCN-LUXEMBURG','CAPIT','194',11114,'Dettes envers des établissements de crédit','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11137,'PCN-LUXEMBURG','CAPIT','1941',11136,'dont la durée résiduelle est inférieure ou égale à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11138,'PCN-LUXEMBURG','CAPIT','19411',11137,'Montant principal','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11139,'PCN-LUXEMBURG','CAPIT','19412',11137,'Intérêts courus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11140,'PCN-LUXEMBURG','CAPIT','1942',11136,'dont la durée résiduelle est supérieure à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11141,'PCN-LUXEMBURG','CAPIT','19421',11140,'Montant principal','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11142,'PCN-LUXEMBURG','CAPIT','19422',11140,'Intérêts courus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11143,'PCN-LUXEMBURG','CAPIT','195',11114,'Dettes de leasing financier','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11144,'PCN-LUXEMBURG','CAPIT','1951',11143,'dont la durée résiduelle est inférieure ou égale à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11145,'PCN-LUXEMBURG','CAPIT','1952',11143,'dont la durée résiduelle est supérieure à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11146,'PCN-LUXEMBURG','CAPIT','198',11114,'Autres emprunts et dettes assimilées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11147,'PCN-LUXEMBURG','CAPIT','1981',11146,'dont la durée résiduelle est inférieure ou égale à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11148,'PCN-LUXEMBURG','CAPIT','19811',11147,'Autres emprunts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11149,'PCN-LUXEMBURG','CAPIT','19812',11147,'Rentes viagères capitalisées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11150,'PCN-LUXEMBURG','CAPIT','19813',11147,'Autres dettes assimilées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11151,'PCN-LUXEMBURG','CAPIT','19814',11147,'Intérêts courus sur autres emprunts et dettes assimilées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11152,'PCN-LUXEMBURG','CAPIT','1982',11146,'dont la durée résiduelle est supérieure à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11153,'PCN-LUXEMBURG','CAPIT','19821',11152,'Autres emprunts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11154,'PCN-LUXEMBURG','CAPIT','19822',11152,'Rentes viagères capitalisées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11155,'PCN-LUXEMBURG','CAPIT','19823',11152,'Autres dettes assimilées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11156,'PCN-LUXEMBURG','CAPIT','19824',11152,'Intérêts courus sur autres emprunts et dettes assimilées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11157,'PCN-LUXEMBURG','IMMO','2','','Frais d’établissement et frais assimilés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11158,'PCN-LUXEMBURG','IMMO','201',11157,'Frais de constitution','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11159,'PCN-LUXEMBURG','IMMO','202',11157,'Frais de premier établissement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11160,'PCN-LUXEMBURG','IMMO','2021',11159,'Frais de prospection','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11161,'PCN-LUXEMBURG','IMMO','2022',11159,'Frais de publicité','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11162,'PCN-LUXEMBURG','IMMO','203',11157,'Frais d’augmentation de capital et d’opérations diverses (fusions, scissions, transformations)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11163,'PCN-LUXEMBURG','IMMO','204',11157,'Frais d’émission d’emprunts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11164,'PCN-LUXEMBURG','IMMO','208',11157,'Autres frais assimilés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11165,'PCN-LUXEMBURG','IMMO','21','','Immobilisations incorporelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11166,'PCN-LUXEMBURG','IMMO','211',11165,'Frais de recherche et de développement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11167,'PCN-LUXEMBURG','IMMO','212',11165,'Concessions, brevets, licences, marques ainsi que droits et valeurs similaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11168,'PCN-LUXEMBURG','IMMO','2121',11167,'Acquis à titre onéreux (Actifs incorporels non produits)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11169,'PCN-LUXEMBURG','IMMO','21211',11168,'Concessions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11170,'PCN-LUXEMBURG','IMMO','21212',11168,'Brevets','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11171,'PCN-LUXEMBURG','IMMO','21213',11168,'Licences informatiques (logiciels et progiciels informatiques)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11172,'PCN-LUXEMBURG','IMMO','21214',11168,'Marques et franchises','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11173,'PCN-LUXEMBURG','IMMO','21215',11168,'Droits et valeurs similaires acquis à titre onéreux','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11174,'PCN-LUXEMBURG','IMMO','212151',11173,'Droits d’auteur et de reproduction','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11175,'PCN-LUXEMBURG','IMMO','212152',11173,'Droits d’émission','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11176,'PCN-LUXEMBURG','IMMO','212158',11173,'Autres droits et valeurs similaires acquis à titre onéreux','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11177,'PCN-LUXEMBURG','IMMO','2122',11167,'Créés par l’entreprise elle-même (Actifs incorporels produits)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11178,'PCN-LUXEMBURG','IMMO','21221',11177,'Concessions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11179,'PCN-LUXEMBURG','IMMO','21222',11177,'Brevets','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11180,'PCN-LUXEMBURG','IMMO','21223',11177,'Licences informatiques (logiciels et progiciels informatiques)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11181,'PCN-LUXEMBURG','IMMO','21224',11177,'Marques et franchises','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11182,'PCN-LUXEMBURG','IMMO','21225',11177,'Droits et valeurs similaires créés par l’entreprise elle-même','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11183,'PCN-LUXEMBURG','IMMO','212251',11182,'Droits d’auteur et de reproduction','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11184,'PCN-LUXEMBURG','IMMO','212252',11182,'Droits d’émission','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11185,'PCN-LUXEMBURG','IMMO','212258',11182,'Autres droits et valeurs similaires créés par l’entreprise elle-même','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11186,'PCN-LUXEMBURG','IMMO','213',11165,'Fonds de commerce, dans la mesure où il a été acquis à titre onéreux','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11187,'PCN-LUXEMBURG','IMMO','214',11165,'Acomptes versés et immobilisations incorporelles en cours','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11188,'PCN-LUXEMBURG','IMMO','2141',11187,'Frais de recherche et de développement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11189,'PCN-LUXEMBURG','IMMO','2142',11187,'Concessions, brevets, licences, marques ainsi que droits et valeurs similaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11190,'PCN-LUXEMBURG','IMMO','2143',11187,'Fonds de commerce','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11191,'PCN-LUXEMBURG','IMMO','22','','Immobilisations corporelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11192,'PCN-LUXEMBURG','IMMO','221',11191,'Terrains et constructions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11193,'PCN-LUXEMBURG','IMMO','2211',11192,'Terrains','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11194,'PCN-LUXEMBURG','IMMO','22111',11193,'Terrains nus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11195,'PCN-LUXEMBURG','IMMO','22112',11193,'Terrains aménagés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11196,'PCN-LUXEMBURG','IMMO','22113',11193,'Sous-sols et sursols','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11197,'PCN-LUXEMBURG','IMMO','22114',11193,'Terrains de gisement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11198,'PCN-LUXEMBURG','IMMO','22115',11193,'Terrains bâtis','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11199,'PCN-LUXEMBURG','IMMO','22118',11193,'Autres terrains','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11200,'PCN-LUXEMBURG','IMMO','2212',11192,'Agencements et aménagements de terrains','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11201,'PCN-LUXEMBURG','IMMO','22121',11200,'Agencements et aménagements de terrains nus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11202,'PCN-LUXEMBURG','IMMO','22122',11200,'Agencements et aménagements de terrains aménagés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11203,'PCN-LUXEMBURG','IMMO','22123',11200,'Agencements et aménagements de sous-sols et sursols','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11204,'PCN-LUXEMBURG','IMMO','22124',11200,'Agencements et aménagements de terrains de gisement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11205,'PCN-LUXEMBURG','IMMO','22125',11200,'Agencements et aménagements de terrains bâtis','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11206,'PCN-LUXEMBURG','IMMO','22128',11200,'Agencements et aménagements d’autres terrains','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11207,'PCN-LUXEMBURG','IMMO','2213',11192,'Constructions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11208,'PCN-LUXEMBURG','IMMO','22131',11207,'Constructions sur sol propre','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11209,'PCN-LUXEMBURG','IMMO','22132',11207,'Constructions sur sol d’autrui','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11210,'PCN-LUXEMBURG','IMMO','222',11191,'Installations techniques et machines','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11211,'PCN-LUXEMBURG','IMMO','2221',11210,'Installations techniques','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11212,'PCN-LUXEMBURG','IMMO','2222',11210,'Machines','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11213,'PCN-LUXEMBURG','IMMO','223',11191,'Autres installations, outillage, mobilier et matériel roulant','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11214,'PCN-LUXEMBURG','IMMO','2231',11213,'Equipement de transport et de manutention','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11215,'PCN-LUXEMBURG','IMMO','2232',11213,'Véhicules de transport','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11216,'PCN-LUXEMBURG','IMMO','2233',11213,'Outillage','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11217,'PCN-LUXEMBURG','IMMO','2234',11213,'Mobilier','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11218,'PCN-LUXEMBURG','IMMO','2235',11213,'Matériel informatique (hardware)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11219,'PCN-LUXEMBURG','IMMO','2236',11213,'Cheptel','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11220,'PCN-LUXEMBURG','IMMO','2237',11213,'Emballages récupérables','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11221,'PCN-LUXEMBURG','IMMO','2238',11213,'Autres installations','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11222,'PCN-LUXEMBURG','IMMO','224',11191,'Acomptes versés et immobilisations corporelles en cours','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11223,'PCN-LUXEMBURG','IMMO','2241',11222,'Terrains et constructions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11224,'PCN-LUXEMBURG','IMMO','22411',11223,'Terrains','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11225,'PCN-LUXEMBURG','IMMO','22412',11223,'Agencements et aménagements de terrains','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11226,'PCN-LUXEMBURG','IMMO','22413',11223,'Constructions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11227,'PCN-LUXEMBURG','IMMO','2242',11222,'Installations techniques et machines','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11228,'PCN-LUXEMBURG','IMMO','2243',11222,'Autres installations, outillage, mobilier et matériel roulant','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11229,'PCN-LUXEMBURG','IMMO','23','','Immobilisations financières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11230,'PCN-LUXEMBURG','IMMO','231',11229,'Parts dans des entreprises liées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11231,'PCN-LUXEMBURG','IMMO','232',11229,'Créances sur des entreprises liées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11232,'PCN-LUXEMBURG','IMMO','233',11229,'Parts dans des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11233,'PCN-LUXEMBURG','IMMO','234',11229,'Créances sur des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11234,'PCN-LUXEMBURG','IMMO','235',11229,'Titres ayant le caractère d’immobilisations','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11235,'PCN-LUXEMBURG','IMMO','2351',11234,'Titres immobilisés (droit de propriété)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11236,'PCN-LUXEMBURG','IMMO','23511',11235,'Actions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11237,'PCN-LUXEMBURG','IMMO','23518',11235,'Autres titres immobilisés (droit de propriété)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11238,'PCN-LUXEMBURG','IMMO','2352',11234,'Titres immobilisés (droit de créance)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11239,'PCN-LUXEMBURG','IMMO','23521',11238,'Obligations','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11240,'PCN-LUXEMBURG','IMMO','23528',11238,'Autres titres immobilisés (droit de créance)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11241,'PCN-LUXEMBURG','IMMO','2358',11234,'Autres titres ayant le caractère d’immobilisations','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11242,'PCN-LUXEMBURG','IMMO','236',11229,'Prêts et créances immobilisées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11243,'PCN-LUXEMBURG','IMMO','2361',11242,'Prêts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11244,'PCN-LUXEMBURG','IMMO','23611',11243,'Prêts participatifs','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11245,'PCN-LUXEMBURG','IMMO','23612',11243,'Prêts aux associés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11246,'PCN-LUXEMBURG','IMMO','23613',11243,'Prêts au personnel','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11247,'PCN-LUXEMBURG','IMMO','23618',11243,'Autres prêts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11248,'PCN-LUXEMBURG','IMMO','2362',11242,'Dépôts et cautionnements versés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11249,'PCN-LUXEMBURG','IMMO','23621',11248,'Dépôts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11250,'PCN-LUXEMBURG','IMMO','23622',11248,'Cautionnements','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11251,'PCN-LUXEMBURG','IMMO','2363',11242,'Créances immobilisées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11252,'PCN-LUXEMBURG','IMMO','237',11229,'Actions propres ou parts propres','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11253,'PCN-LUXEMBURG','STOCK','3','','Matières premières et consommables','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11254,'PCN-LUXEMBURG','STOCK','301',11253,'Matières premières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11255,'PCN-LUXEMBURG','STOCK','302',11253,'Matières consommables','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11256,'PCN-LUXEMBURG','STOCK','303',11253,'Fournitures consommables','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11257,'PCN-LUXEMBURG','STOCK','3031',11256,'Combustibles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11258,'PCN-LUXEMBURG','STOCK','3032',11256,'Produits d’entretien','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11259,'PCN-LUXEMBURG','STOCK','3033',11256,'Fournitures d’atelier et d’usine','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11260,'PCN-LUXEMBURG','STOCK','3034',11256,'Fournitures de magasin','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11261,'PCN-LUXEMBURG','STOCK','3035',11256,'Fournitures de bureau1','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11262,'PCN-LUXEMBURG','STOCK','3036',11256,'Carburants','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11263,'PCN-LUXEMBURG','STOCK','3037',11256,'Lubrifiants','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11264,'PCN-LUXEMBURG','STOCK','3038',11256,'Autres fournitures consommables','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11265,'PCN-LUXEMBURG','STOCK','304',11253,'Emballages','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11266,'PCN-LUXEMBURG','STOCK','3041',11265,'Emballages non-récupérables','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11267,'PCN-LUXEMBURG','STOCK','3042',11265,'Emballages récupérables','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11268,'PCN-LUXEMBURG','STOCK','3043',11265,'Emballages à usage mixte','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11269,'PCN-LUXEMBURG','STOCK','305',11253,'Approvisionnements','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11270,'PCN-LUXEMBURG','STOCK','31','','Produits en cours de fabrication et commandes en cours','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11271,'PCN-LUXEMBURG','STOCK','311',11270,'Produits en cours de fabrication','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11272,'PCN-LUXEMBURG','STOCK','312',11270,'Commandes en cours – Produits','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11273,'PCN-LUXEMBURG','STOCK','313',11270,'Commandes en cours – Prestations de services','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11274,'PCN-LUXEMBURG','STOCK','314',11270,'Immeubles en construction','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11275,'PCN-LUXEMBURG','STOCK','32','','Produits finis et marchandises','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11276,'PCN-LUXEMBURG','STOCK','321',11275,'Produits finis','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11277,'PCN-LUXEMBURG','STOCK','322',11275,'Produits intermédiaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11278,'PCN-LUXEMBURG','STOCK','323',11275,'Produits résiduels','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11279,'PCN-LUXEMBURG','STOCK','3231',11278,'Déchets','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11280,'PCN-LUXEMBURG','STOCK','3232',11278,'Rebuts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11281,'PCN-LUXEMBURG','STOCK','3233',11278,'Matières de récupération','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11282,'PCN-LUXEMBURG','STOCK','326',11275,'Marchandises','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11283,'PCN-LUXEMBURG','STOCK','327',11275,'Marchandises en voie d’acheminement, mises en dépôt ou données en consignation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11284,'PCN-LUXEMBURG','STOCK','33','','Terrains et immeubles destinés à la revente','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11285,'PCN-LUXEMBURG','STOCK','331',11284,'Terrains','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11286,'PCN-LUXEMBURG','STOCK','332',11284,'Immeubles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11287,'PCN-LUXEMBURG','STOCK','3321',11286,'Immeubles acquis','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11288,'PCN-LUXEMBURG','STOCK','3322',11286,'Immeubles construits','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11289,'PCN-LUXEMBURG','STOCK','34','','Acomptes versés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11290,'PCN-LUXEMBURG','STOCK','341',11289,'Acomptes versés sur matières premières et consommables','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11291,'PCN-LUXEMBURG','STOCK','342',11289,'Acomptes versés sur produits en cours de fabrication et commandes en cours','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11292,'PCN-LUXEMBURG','STOCK','343',11289,'Acomptes versés sur produits finis et marchandises','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11293,'PCN-LUXEMBURG','STOCK','344',11289,'Acomptes versés sur terrains et immeubles destinés à la revente','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11294,'PCN-LUXEMBURG','THIRDPARTY','4','','Créances résultant de ventes et prestations de services','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11295,'PCN-LUXEMBURG','THIRDPARTY','401',11294,'Créances dont la durée résiduelle est inférieure ou égale à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11296,'PCN-LUXEMBURG','THIRDPARTY','4011',11295,'Clients','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11297,'PCN-LUXEMBURG','THIRDPARTY','4012',11295,'Clients – Effets à recevoir','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11298,'PCN-LUXEMBURG','THIRDPARTY','4013',11295,'Clients douteux ou litigieux','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11299,'PCN-LUXEMBURG','THIRDPARTY','4014',11295,'Clients – Factures à établir','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11300,'PCN-LUXEMBURG','THIRDPARTY','4015',11295,'Clients créditeurs','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11301,'PCN-LUXEMBURG','THIRDPARTY','4019',11295,'Corrections de valeur','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11302,'PCN-LUXEMBURG','THIRDPARTY','402',11294,'Créances dont la durée résiduelle est supérieure à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11303,'PCN-LUXEMBURG','THIRDPARTY','4021',11302,'Clients','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11304,'PCN-LUXEMBURG','THIRDPARTY','4022',11302,'Clients – Effets à recevoir','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11305,'PCN-LUXEMBURG','THIRDPARTY','4023',11302,'Clients douteux ou litigieux','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11306,'PCN-LUXEMBURG','THIRDPARTY','4024',11302,'Clients – Factures à établir','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11307,'PCN-LUXEMBURG','THIRDPARTY','4025',11302,'Clients créditeurs','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11308,'PCN-LUXEMBURG','THIRDPARTY','4029',11302,'Corrections de valeur','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11309,'PCN-LUXEMBURG','THIRDPARTY','41','','Créances sur des entreprises liées et sur des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11310,'PCN-LUXEMBURG','THIRDPARTY','411',11309,'Créances sur des entreprises liées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11311,'PCN-LUXEMBURG','THIRDPARTY','4111',11310,'Créances dont la durée résiduelle est inférieure ou égale à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11312,'PCN-LUXEMBURG','THIRDPARTY','41111',11311,'Ventes de marchandises et de prestations de services','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11313,'PCN-LUXEMBURG','THIRDPARTY','41112',11311,'Prêts et avances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11314,'PCN-LUXEMBURG','THIRDPARTY','41113',11311,'Intérêts courus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11315,'PCN-LUXEMBURG','THIRDPARTY','41114',11311,'Dividendes à recevoir','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11316,'PCN-LUXEMBURG','THIRDPARTY','41118',11311,'Autres créances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11317,'PCN-LUXEMBURG','THIRDPARTY','41119',11311,'Corrections de valeur','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11318,'PCN-LUXEMBURG','THIRDPARTY','4112',11310,'Créances dont la durée résiduelle est supérieure à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11319,'PCN-LUXEMBURG','THIRDPARTY','41121',11318,'Ventes de marchandises et de prestations de services','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11320,'PCN-LUXEMBURG','THIRDPARTY','41122',11318,'Prêts et avances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11321,'PCN-LUXEMBURG','THIRDPARTY','41123',11318,'Intérêts courus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11322,'PCN-LUXEMBURG','THIRDPARTY','41124',11318,'Dividendes à recevoir','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11323,'PCN-LUXEMBURG','THIRDPARTY','41128',11318,'Autres créances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11324,'PCN-LUXEMBURG','THIRDPARTY','41129',11318,'Corrections de valeur','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11325,'PCN-LUXEMBURG','THIRDPARTY','412',11309,'Créances sur des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11326,'PCN-LUXEMBURG','THIRDPARTY','4121',11325,'Créances dont la durée résiduelle est inférieure ou égale à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11327,'PCN-LUXEMBURG','THIRDPARTY','41211',11326,'Ventes de marchandises et de prestations de services','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11328,'PCN-LUXEMBURG','THIRDPARTY','41212',11326,'Prêts et avances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11329,'PCN-LUXEMBURG','THIRDPARTY','41213',11326,'Intérêts courus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11330,'PCN-LUXEMBURG','THIRDPARTY','41214',11326,'Dividendes à recevoir','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11331,'PCN-LUXEMBURG','THIRDPARTY','41218',11326,'Autres créances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11332,'PCN-LUXEMBURG','THIRDPARTY','41219',11326,'Corrections de valeur','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11333,'PCN-LUXEMBURG','THIRDPARTY','4122',11325,'Créances dont la durée résiduelle est supérieure à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11334,'PCN-LUXEMBURG','THIRDPARTY','41221',11333,'Ventes de marchandises et de prestations de services','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11335,'PCN-LUXEMBURG','THIRDPARTY','41222',11333,'Prêts et avances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11336,'PCN-LUXEMBURG','THIRDPARTY','41223',11333,'Intérêts courus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11337,'PCN-LUXEMBURG','THIRDPARTY','41224',11333,'Dividendes à recevoir','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11338,'PCN-LUXEMBURG','THIRDPARTY','41228',11333,'Autres créances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11339,'PCN-LUXEMBURG','THIRDPARTY','41229',11333,'Corrections de valeur','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11340,'PCN-LUXEMBURG','THIRDPARTY','42','','Autres créances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11341,'PCN-LUXEMBURG','THIRDPARTY','421',11340,'Autres créances dont la durée résiduelle est inférieure ou égale à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11342,'PCN-LUXEMBURG','THIRDPARTY','4211',11341,'Personnel – Avances et acomptes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11343,'PCN-LUXEMBURG','THIRDPARTY','42111',11342,'Avances et acomptes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11344,'PCN-LUXEMBURG','THIRDPARTY','42119',11342,'Corrections de valeur','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11345,'PCN-LUXEMBURG','THIRDPARTY','4212',11341,'Créances sur associés ou actionnaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11346,'PCN-LUXEMBURG','THIRDPARTY','42121',11345,'Montant principal','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11347,'PCN-LUXEMBURG','THIRDPARTY','42122',11345,'Intérêts courus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11348,'PCN-LUXEMBURG','THIRDPARTY','42129',11345,'Corrections de valeur sur créances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11349,'PCN-LUXEMBURG','THIRDPARTY','4213',11341,'Etat – Subventions à recevoir','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11350,'PCN-LUXEMBURG','THIRDPARTY','42131',11349,'Subventions d’investissement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11351,'PCN-LUXEMBURG','THIRDPARTY','42132',11349,'Subventions d’exploitation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11352,'PCN-LUXEMBURG','THIRDPARTY','42138',11349,'Autres subventions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11353,'PCN-LUXEMBURG','THIRDPARTY','4214',11341,'Administration des Contributions Directes (ACD)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11354,'PCN-LUXEMBURG','THIRDPARTY','4215',11341,'Administration des Douanes et Accises (ADA)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11355,'PCN-LUXEMBURG','THIRDPARTY','4216',11341,'Administration de l’Enregistrement et des Domaines (AED)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11356,'PCN-LUXEMBURG','THIRDPARTY','42161',11355,'Taxe sur la valeur ajoutée – TVA','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11357,'PCN-LUXEMBURG','THIRDPARTY','421611',11356,'TVA en amont','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11358,'PCN-LUXEMBURG','THIRDPARTY','421612',11356,'TVA à recevoir','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11359,'PCN-LUXEMBURG','THIRDPARTY','421613',11356,'TVA acomptes versés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11360,'PCN-LUXEMBURG','THIRDPARTY','421618',11356,'TVA – Autres créances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11361,'PCN-LUXEMBURG','THIRDPARTY','42162',11355,'Impôts indirects','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11362,'PCN-LUXEMBURG','THIRDPARTY','421621',11361,'Droits d’enregistrement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11363,'PCN-LUXEMBURG','THIRDPARTY','421622',11361,'Taxe d’abonnement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11364,'PCN-LUXEMBURG','THIRDPARTY','421623',11361,'Droits d’hypothèques','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11365,'PCN-LUXEMBURG','THIRDPARTY','421624',11361,'Droits de timbre','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11366,'PCN-LUXEMBURG','THIRDPARTY','421628',11361,'Autres impôts indirects','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11367,'PCN-LUXEMBURG','THIRDPARTY','42168',11355,'AED – Autres créances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11368,'PCN-LUXEMBURG','THIRDPARTY','4217',11341,'Créances sur la sécurité sociale et autres organismes sociaux','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11369,'PCN-LUXEMBURG','THIRDPARTY','42171',11368,'Centre Commun de Sécurité Sociale','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11370,'PCN-LUXEMBURG','THIRDPARTY','42172',11368,'Mutualité des employeurs','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11371,'PCN-LUXEMBURG','THIRDPARTY','42178',11368,'Autres organismes sociaux','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11372,'PCN-LUXEMBURG','THIRDPARTY','4218',11341,'Créances diverses','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11373,'PCN-LUXEMBURG','THIRDPARTY','42181',11372,'Impôts étrangers','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11374,'PCN-LUXEMBURG','THIRDPARTY','421811',11373,'TVA étrangères','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11375,'PCN-LUXEMBURG','THIRDPARTY','421818',11373,'Autres impôts étrangers','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11376,'PCN-LUXEMBURG','THIRDPARTY','42188',11372,'Autres créances diverses','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11377,'PCN-LUXEMBURG','THIRDPARTY','42189',11372,'Corrections de valeur','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11378,'PCN-LUXEMBURG','THIRDPARTY','422',11340,'Autres créances dont la durée résiduelle est supérieure à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11379,'PCN-LUXEMBURG','THIRDPARTY','4221',11378,'Personnel – Avances et acomptes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11380,'PCN-LUXEMBURG','THIRDPARTY','42211',11379,'Avances et acomptes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11381,'PCN-LUXEMBURG','THIRDPARTY','42219',11379,'Corrections de valeur','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11382,'PCN-LUXEMBURG','THIRDPARTY','4222',11378,'Associés ou actionnaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11383,'PCN-LUXEMBURG','THIRDPARTY','42221',11382,'Montant principal','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11384,'PCN-LUXEMBURG','THIRDPARTY','42222',11382,'Intérêts courus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11385,'PCN-LUXEMBURG','THIRDPARTY','42229',11382,'Corrections de valeur sur créances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11386,'PCN-LUXEMBURG','THIRDPARTY','4223',11378,'Etat – Subventions à recevoir','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11387,'PCN-LUXEMBURG','THIRDPARTY','42231',11386,'Subventions d’investissement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11388,'PCN-LUXEMBURG','THIRDPARTY','42232',11386,'Subventions d’exploitation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11389,'PCN-LUXEMBURG','THIRDPARTY','42238',11386,'Autres subventions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11390,'PCN-LUXEMBURG','THIRDPARTY','4224',11378,'Administration des Contributions Directes (ACD)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11391,'PCN-LUXEMBURG','THIRDPARTY','4225',11378,'Administration des Douanes et Accises (ADA)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11392,'PCN-LUXEMBURG','THIRDPARTY','4226',11378,'Administration de l’Enregistrement et des Domaines (AED)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11393,'PCN-LUXEMBURG','THIRDPARTY','42261',11392,'Taxe sur la valeur ajoutée – TVA','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11394,'PCN-LUXEMBURG','THIRDPARTY','422611',11393,'TVA en amont','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11395,'PCN-LUXEMBURG','THIRDPARTY','422612',11393,'TVA à recevoir','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11396,'PCN-LUXEMBURG','THIRDPARTY','422613',11393,'TVA acomptes versés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11397,'PCN-LUXEMBURG','THIRDPARTY','422618',11393,'TVA – Autres créances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11398,'PCN-LUXEMBURG','THIRDPARTY','42262',11392,'Impôts indirects','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11399,'PCN-LUXEMBURG','THIRDPARTY','422621',11398,'Droits d’enregistrement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11400,'PCN-LUXEMBURG','THIRDPARTY','422622',11398,'Taxe d’abonnement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11401,'PCN-LUXEMBURG','THIRDPARTY','422623',11398,'Droits d’hypothèques','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11402,'PCN-LUXEMBURG','THIRDPARTY','422624',11398,'Droits de timbre','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11403,'PCN-LUXEMBURG','THIRDPARTY','422628',11398,'Autres impôts indirects','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11404,'PCN-LUXEMBURG','THIRDPARTY','4227',11378,'Créances sur la sécurité sociale et autres organismes sociaux','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11405,'PCN-LUXEMBURG','THIRDPARTY','42271',11404,'Centre Commun de Sécurité Sociale','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11406,'PCN-LUXEMBURG','THIRDPARTY','42272',11404,'Mutualité des employeurs','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11407,'PCN-LUXEMBURG','THIRDPARTY','42278',11404,'Autres organismes sociaux','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11408,'PCN-LUXEMBURG','THIRDPARTY','4228',11378,'Créances diverses','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11409,'PCN-LUXEMBURG','THIRDPARTY','42281',11408,'Impôts étrangers','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11410,'PCN-LUXEMBURG','THIRDPARTY','422811',11409,'TVA étrangères','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11411,'PCN-LUXEMBURG','THIRDPARTY','422818',11409,'Autres impôts étrangers','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11412,'PCN-LUXEMBURG','THIRDPARTY','42288',11408,'Autres créances diverses','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11413,'PCN-LUXEMBURG','THIRDPARTY','42289',11408,'Corrections de valeur sur autres créances diverses','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11414,'PCN-LUXEMBURG','THIRDPARTY','43','','Acomptes reçus sur commandes pour autant qu’ils ne sont pas déduits des stocks de façon distincte','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11415,'PCN-LUXEMBURG','THIRDPARTY','431',11414,'Acomptes reçus dont la durée résiduelle est inférieure ou égale à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11416,'PCN-LUXEMBURG','THIRDPARTY','432',11414,'Acomptes reçus dont la durée résiduelle est supérieure à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11417,'PCN-LUXEMBURG','THIRDPARTY','44','','Dettes sur achats et prestations de services et dettes représentées par des effets de commerce','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11418,'PCN-LUXEMBURG','THIRDPARTY','441',11417,'Dettes sur achats et prestations de services','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11419,'PCN-LUXEMBURG','THIRDPARTY','4411',11418,'Dettes sur achats et prestations de services dont la durée résiduelle est inférieure ou égale à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11420,'PCN-LUXEMBURG','THIRDPARTY','44111',11419,'Fournisseurs','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11421,'PCN-LUXEMBURG','THIRDPARTY','44112',11419,'Fournisseurs – Factures non parvenues','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11422,'PCN-LUXEMBURG','THIRDPARTY','44113',11419,'Fournisseurs débiteurs','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11423,'PCN-LUXEMBURG','THIRDPARTY','441131',11422,'Fournisseurs – Avances et acomptes versés sur commandes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11424,'PCN-LUXEMBURG','THIRDPARTY','441132',11422,'Fournisseurs – Créances pour emballages et matériel à rendre','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11425,'PCN-LUXEMBURG','THIRDPARTY','441133',11422,'Fournisseurs – Autres avoirs','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11426,'PCN-LUXEMBURG','THIRDPARTY','441134',11422,'Rabais, remises, ristournes à obtenir et autres avoirs non encore reçus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11427,'PCN-LUXEMBURG','THIRDPARTY','4412',11418,'Dettes sur achats et prestations de services dont la durée résiduelle est supérieure à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11428,'PCN-LUXEMBURG','THIRDPARTY','44121',11427,'Fournisseurs','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11429,'PCN-LUXEMBURG','THIRDPARTY','44122',11427,'Fournisseurs – Factures non parvenues','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11430,'PCN-LUXEMBURG','THIRDPARTY','44123',11427,'Fournisseurs débiteurs','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11431,'PCN-LUXEMBURG','THIRDPARTY','441231',11430,'Fournisseurs – Avances et acomptes versés sur commandes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11432,'PCN-LUXEMBURG','THIRDPARTY','441232',11430,'Fournisseurs – Créances pour emballages et matériel à rendre','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11433,'PCN-LUXEMBURG','THIRDPARTY','441233',11430,'Fournisseurs – Autres avoirs','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11434,'PCN-LUXEMBURG','THIRDPARTY','441234',11430,'Rabais, remises, ristournes à obtenir et autres avoirs non encore reçus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11435,'PCN-LUXEMBURG','THIRDPARTY','442',11417,'Dettes représentées par des effets de commerce','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11436,'PCN-LUXEMBURG','THIRDPARTY','4421',11435,'Dettes représentées par des effets de commerce dont la durée résiduelle est inférieure ou égale à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11437,'PCN-LUXEMBURG','THIRDPARTY','4422',11435,'Dettes représentées par des effets de commerce dont la durée résiduelle est supérieure à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11438,'PCN-LUXEMBURG','THIRDPARTY','45','','Dettes envers des entreprises liées et des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11439,'PCN-LUXEMBURG','THIRDPARTY','451',11438,'Dettes envers des entreprises liées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11440,'PCN-LUXEMBURG','THIRDPARTY','4511',11439,'Dettes envers des entreprises liées dont la durée résiduelle est inférieure ou égale à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11441,'PCN-LUXEMBURG','THIRDPARTY','45111',11440,'Ventes de marchandises et de prestations de services','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11442,'PCN-LUXEMBURG','THIRDPARTY','45112',11440,'Prêts et avances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11443,'PCN-LUXEMBURG','THIRDPARTY','45113',11440,'Intérêts courus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11444,'PCN-LUXEMBURG','THIRDPARTY','45114',11440,'Dividendes à payer','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11445,'PCN-LUXEMBURG','THIRDPARTY','45118',11440,'Autres dettes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11446,'PCN-LUXEMBURG','THIRDPARTY','4512',11439,'Dettes envers des entreprises liées dont la durée résiduelle est supérieure à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11447,'PCN-LUXEMBURG','THIRDPARTY','45121',11446,'Ventes de marchandises et de prestations de services','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11448,'PCN-LUXEMBURG','THIRDPARTY','45122',11446,'Prêts et avances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11449,'PCN-LUXEMBURG','THIRDPARTY','45123',11446,'Intérêts courus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11450,'PCN-LUXEMBURG','THIRDPARTY','45124',11446,'Dividendes à payer','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11451,'PCN-LUXEMBURG','THIRDPARTY','45128',11446,'Autres dettes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11452,'PCN-LUXEMBURG','THIRDPARTY','452',11438,'Dettes envers des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11453,'PCN-LUXEMBURG','THIRDPARTY','4521',11452,'Dettes envers des entreprises avec lesquelles la société a un lien de participation dont la durée résiduelle est inférieure ou égale à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11454,'PCN-LUXEMBURG','THIRDPARTY','45211',11453,'Ventes de marchandises et de prestations de services','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11455,'PCN-LUXEMBURG','THIRDPARTY','45212',11453,'Prêts et avances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11456,'PCN-LUXEMBURG','THIRDPARTY','45213',11453,'Intérêts courus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11457,'PCN-LUXEMBURG','THIRDPARTY','45214',11453,'Dividendes à payer','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11458,'PCN-LUXEMBURG','THIRDPARTY','45218',11453,'Autres dettes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11459,'PCN-LUXEMBURG','THIRDPARTY','4522',11452,'Dettes envers des entreprises avec lesquelles la société a un lien de participation dont la durée résiduelle est supérieure à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11460,'PCN-LUXEMBURG','THIRDPARTY','45221',11459,'Ventes de marchandises et de prestations de services','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11461,'PCN-LUXEMBURG','THIRDPARTY','45222',11459,'Prêts et avances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11462,'PCN-LUXEMBURG','THIRDPARTY','45223',11459,'Intérêts courus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11463,'PCN-LUXEMBURG','THIRDPARTY','45224',11459,'Dividendes à payer','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11464,'PCN-LUXEMBURG','THIRDPARTY','45228',11459,'Autres dettes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11465,'PCN-LUXEMBURG','THIRDPARTY','46','','Dettes fiscales et dettes envers la sécurité sociale','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11466,'PCN-LUXEMBURG','THIRDPARTY','461',11465,'Dettes fiscales','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11467,'PCN-LUXEMBURG','THIRDPARTY','4611',11466,'Administrations communales','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11468,'PCN-LUXEMBURG','THIRDPARTY','46111',11467,'Impôts communaux','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11469,'PCN-LUXEMBURG','THIRDPARTY','46112',11467,'Taxes communales','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11470,'PCN-LUXEMBURG','THIRDPARTY','4612',11466,'Administration des Contributions Directes (ACD)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11471,'PCN-LUXEMBURG','THIRDPARTY','46121',11470,'Impôt sur le revenu des collectivités','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11472,'PCN-LUXEMBURG','THIRDPARTY','461211',11471,'Impôt sur le revenu des collectivités – charge fiscale estimée','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11473,'PCN-LUXEMBURG','THIRDPARTY','461212',11471,'Impôt sur le revenu des collectivités – dette fiscale à payer','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11474,'PCN-LUXEMBURG','THIRDPARTY','46122',11470,'Impôt commercial','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11475,'PCN-LUXEMBURG','THIRDPARTY','461221',11474,'Impôt commercial – charge fiscale estimée','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11476,'PCN-LUXEMBURG','THIRDPARTY','461222',11474,'Impôt commercial – dette fiscale à payer','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11477,'PCN-LUXEMBURG','THIRDPARTY','46123',11470,'Impôt sur la fortune','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11478,'PCN-LUXEMBURG','THIRDPARTY','461231',11477,'Impôt sur la fortune – charge fiscale estimée','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11479,'PCN-LUXEMBURG','THIRDPARTY','461232',11477,'Impôt sur la fortune – dette fiscale à payer','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11480,'PCN-LUXEMBURG','THIRDPARTY','46124',11470,'Retenue d’impôt sur traitements et salaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11481,'PCN-LUXEMBURG','THIRDPARTY','46125',11470,'Retenue d’impôt sur revenus de capitaux mobiliers','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11482,'PCN-LUXEMBURG','THIRDPARTY','46126',11470,'Retenue d’impôt sur les tantièmes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11483,'PCN-LUXEMBURG','THIRDPARTY','46128',11470,'ACD – Autres dettes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11484,'PCN-LUXEMBURG','THIRDPARTY','4613',11466,'Administration des Douanes et Accises (ADA)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11485,'PCN-LUXEMBURG','THIRDPARTY','46131',11484,'Taxe sur les véhicules automoteurs','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11486,'PCN-LUXEMBURG','THIRDPARTY','46132',11484,'Droits d’accises et taxe de consommation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11487,'PCN-LUXEMBURG','THIRDPARTY','46138',11484,'ADA – Autres dettes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11488,'PCN-LUXEMBURG','THIRDPARTY','4614',11466,'Administration de l’Enregistrement et des Domaines (AED)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11489,'PCN-LUXEMBURG','THIRDPARTY','46141',11488,'Taxe sur la valeur ajoutée – TVA','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11490,'PCN-LUXEMBURG','THIRDPARTY','461411',11489,'TVA en aval','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11491,'PCN-LUXEMBURG','THIRDPARTY','461412',11489,'TVA due','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11492,'PCN-LUXEMBURG','THIRDPARTY','461413',11489,'TVA acomptes reçus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11493,'PCN-LUXEMBURG','THIRDPARTY','461418',11489,'TVA – Autres dettes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11494,'PCN-LUXEMBURG','THIRDPARTY','46142',11488,'Impôts indirects','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11495,'PCN-LUXEMBURG','THIRDPARTY','461421',11494,'Droits d’enregistrement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11496,'PCN-LUXEMBURG','THIRDPARTY','461422',11494,'Taxe d’abonnement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11497,'PCN-LUXEMBURG','THIRDPARTY','461423',11494,'Droits d’hypothèques','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11498,'PCN-LUXEMBURG','THIRDPARTY','461424',11494,'Droits de timbre','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11499,'PCN-LUXEMBURG','THIRDPARTY','461428',11494,'Autres impôts indirects','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11500,'PCN-LUXEMBURG','THIRDPARTY','4615',11466,'Administrations fiscales étrangères','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11501,'PCN-LUXEMBURG','THIRDPARTY','462',11465,'Dettes au titre de la sécurité sociale','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11502,'PCN-LUXEMBURG','THIRDPARTY','4621',11501,'Centre Commun de Sécurité Sociale','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11503,'PCN-LUXEMBURG','THIRDPARTY','4622',11501,'Organismes de sécurité sociale étrangers','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11504,'PCN-LUXEMBURG','THIRDPARTY','4628',11501,'Autres organismes sociaux','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11505,'PCN-LUXEMBURG','THIRDPARTY','47','','Autres dettes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11506,'PCN-LUXEMBURG','THIRDPARTY','471',11505,'Autres dettes dont la durée résiduelle est inférieure ou égale à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11507,'PCN-LUXEMBURG','THIRDPARTY','4711',11506,'Dépôts et cautionnements reçus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11508,'PCN-LUXEMBURG','THIRDPARTY','47111',11507,'Dépôts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11509,'PCN-LUXEMBURG','THIRDPARTY','47112',11507,'Cautionnements','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11510,'PCN-LUXEMBURG','THIRDPARTY','47113',11507,'Intérêts courus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11511,'PCN-LUXEMBURG','THIRDPARTY','4712',11506,'Dettes envers associés et actionnaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11512,'PCN-LUXEMBURG','THIRDPARTY','47121',11511,'Montant principal','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11513,'PCN-LUXEMBURG','THIRDPARTY','47122',11511,'Intérêts courus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11514,'PCN-LUXEMBURG','THIRDPARTY','4713',11506,'Dettes envers administrateurs, gérants et commissaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11515,'PCN-LUXEMBURG','THIRDPARTY','4714',11506,'Dettes envers le personnel','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11516,'PCN-LUXEMBURG','THIRDPARTY','47141',11515,'Personnel – Rémunérations dues','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11517,'PCN-LUXEMBURG','THIRDPARTY','47142',11515,'Personnel – Dépôts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11518,'PCN-LUXEMBURG','THIRDPARTY','47143',11515,'Personnel – Oppositions, saisies','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11519,'PCN-LUXEMBURG','THIRDPARTY','47148',11515,'Personnel – Autres','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11520,'PCN-LUXEMBURG','THIRDPARTY','4715',11506,'Etat – Droits d’émission à restituer','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11521,'PCN-LUXEMBURG','THIRDPARTY','4718',11506,'Autres dettes diverses','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11522,'PCN-LUXEMBURG','THIRDPARTY','472',11505,'Autres dettes dont la durée résiduelle est supérieure à un an','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11523,'PCN-LUXEMBURG','THIRDPARTY','4721',11522,'Dépôts et cautionnements reçus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11524,'PCN-LUXEMBURG','THIRDPARTY','47211',11523,'Dépôts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11525,'PCN-LUXEMBURG','THIRDPARTY','47212',11523,'Cautionnements','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11526,'PCN-LUXEMBURG','THIRDPARTY','47213',11523,'Intérêts courus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11527,'PCN-LUXEMBURG','THIRDPARTY','4722',11522,'Dettes envers associés et actionnaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11528,'PCN-LUXEMBURG','THIRDPARTY','47221',11527,'Montant principal','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11529,'PCN-LUXEMBURG','THIRDPARTY','47222',11527,'Intérêts courus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11530,'PCN-LUXEMBURG','THIRDPARTY','4723',11522,'Dettes envers administrateurs, gérants et commissaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11531,'PCN-LUXEMBURG','THIRDPARTY','4724',11522,'Dettes envers le personnel','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11532,'PCN-LUXEMBURG','THIRDPARTY','47241',11531,'Personnel – Rémunérations dues','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11533,'PCN-LUXEMBURG','THIRDPARTY','47242',11531,'Personnel – Dépôts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11534,'PCN-LUXEMBURG','THIRDPARTY','47243',11531,'Personnel – Oppositions, saisies','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11535,'PCN-LUXEMBURG','THIRDPARTY','47248',11531,'Personnel – Autres','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11536,'PCN-LUXEMBURG','THIRDPARTY','4726',11522,'Etat – Droits d’émission à restituer','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11537,'PCN-LUXEMBURG','THIRDPARTY','4728',11522,'Autres dettes diverses','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11538,'PCN-LUXEMBURG','THIRDPARTY','48','','Comptes de régularisation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11539,'PCN-LUXEMBURG','THIRDPARTY','481',11538,'Charges à reporter','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11540,'PCN-LUXEMBURG','THIRDPARTY','482',11538,'Produits à reporter','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11541,'PCN-LUXEMBURG','THIRDPARTY','483',11538,'Etat – droits d’émission alloués','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11542,'PCN-LUXEMBURG','THIRDPARTY','484',11538,'Comptes transitoires ou d’attente – Actif','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11543,'PCN-LUXEMBURG','THIRDPARTY','485',11538,'Comptes transitoires ou d’attente – Passif','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11544,'PCN-LUXEMBURG','THIRDPARTY','486',11538,'Comptes de liaison – Actif','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11545,'PCN-LUXEMBURG','THIRDPARTY','487',11538,'Comptes de liaison – Passif','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11546,'PCN-LUXEMBURG','FINAN','5','','Valeurs mobilières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11547,'PCN-LUXEMBURG','FINAN','501',11546,'Parts dans des entreprises liées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11548,'PCN-LUXEMBURG','FINAN','502',11546,'Parts dans des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11549,'PCN-LUXEMBURG','FINAN','503',11546,'Actions propres ou parts propres','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11550,'PCN-LUXEMBURG','FINAN','508',11546,'Autres valeurs mobilières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11551,'PCN-LUXEMBURG','FINAN','5081',11550,'Actions – Titres cotés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11552,'PCN-LUXEMBURG','FINAN','5082',11550,'Actions – Titres non cotés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11553,'PCN-LUXEMBURG','FINAN','5083',11550,'Obligations et autres titres de créance émis par la société et rachetés par elle','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11554,'PCN-LUXEMBURG','FINAN','5084',11550,'Obligations – Titres cotés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11555,'PCN-LUXEMBURG','FINAN','5085',11550,'Obligations – Titres non cotés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11556,'PCN-LUXEMBURG','FINAN','5088',11550,'Autres valeurs mobilières diverses','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11557,'PCN-LUXEMBURG','FINAN','51','','Avoirs en banques, avoirs en comptes de chèques postaux, chèques et encaisse','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11558,'PCN-LUXEMBURG','FINAN','511',11557,'Chèques à encaisser','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11559,'PCN-LUXEMBURG','FINAN','512',11557,'Valeurs à l’encaissement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11560,'PCN-LUXEMBURG','FINAN','513',11557,'Banques','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11561,'PCN-LUXEMBURG','FINAN','5131',11560,'Banques comptes courants','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11562,'PCN-LUXEMBURG','FINAN','5132',11560,'Banques comptes à terme','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11563,'PCN-LUXEMBURG','FINAN','514',11557,'Compte chèque postal','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11564,'PCN-LUXEMBURG','FINAN','516',11557,'Caisse','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11565,'PCN-LUXEMBURG','FINAN','517',11557,'Virements internes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11566,'PCN-LUXEMBURG','FINAN','518',11557,'Autres avoirs','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11567,'PCN-LUXEMBURG','EXPENSE','6','','Consommation de marchandises et de matières premières et consommables','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11568,'PCN-LUXEMBURG','EXPENSE','601',11567,'Matières premières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11569,'PCN-LUXEMBURG','EXPENSE','602',11567,'Matières consommables','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11570,'PCN-LUXEMBURG','EXPENSE','603',11567,'Fournitures consommables','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11571,'PCN-LUXEMBURG','EXPENSE','6031',11570,'Combustibles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11572,'PCN-LUXEMBURG','EXPENSE','60311',11571,'Solides','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11573,'PCN-LUXEMBURG','EXPENSE','60312',11571,'Liquides','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11574,'PCN-LUXEMBURG','EXPENSE','60313',11571,'Gaz comprimé','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11575,'PCN-LUXEMBURG','EXPENSE','6032',11570,'Produits d’entretien','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11576,'PCN-LUXEMBURG','EXPENSE','6033',11570,'Fournitures d’atelier et d’usine','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11577,'PCN-LUXEMBURG','EXPENSE','6034',11570,'Fournitures de magasin','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11578,'PCN-LUXEMBURG','EXPENSE','6035',11570,'Fournitures de bureau','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11579,'PCN-LUXEMBURG','EXPENSE','6036',11570,'Carburants','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11580,'PCN-LUXEMBURG','EXPENSE','6037',11570,'Lubrifiants','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11581,'PCN-LUXEMBURG','EXPENSE','6038',11570,'Autres fournitures consommables','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11582,'PCN-LUXEMBURG','EXPENSE','604',11567,'Emballages','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11583,'PCN-LUXEMBURG','EXPENSE','6041',11582,'Emballages non récupérables','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11584,'PCN-LUXEMBURG','EXPENSE','6042',11582,'Emballages récupérables','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11585,'PCN-LUXEMBURG','EXPENSE','6043',11582,'Emballages à usage mixte','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11586,'PCN-LUXEMBURG','EXPENSE','605',11567,'Approvisionnements','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11587,'PCN-LUXEMBURG','EXPENSE','606',11567,'Achats de biens destinés à la revente','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11588,'PCN-LUXEMBURG','EXPENSE','6061',11587,'Terrains','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11589,'PCN-LUXEMBURG','EXPENSE','6062',11587,'Immeubles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11590,'PCN-LUXEMBURG','EXPENSE','6063',11587,'Marchandises','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11591,'PCN-LUXEMBURG','EXPENSE','607',11567,'Variation des stocks','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11592,'PCN-LUXEMBURG','EXPENSE','6071',11591,'Variation des stocks de matières premières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11593,'PCN-LUXEMBURG','EXPENSE','6072',11591,'Variation des stocks de matières consommables','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11594,'PCN-LUXEMBURG','EXPENSE','6073',11591,'Variation des stocks de fournitures consommables','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11595,'PCN-LUXEMBURG','EXPENSE','6074',11591,'Variation des stocks d’emballages','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11596,'PCN-LUXEMBURG','EXPENSE','6075',11591,'Variation des stocks d’approvisionnements','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11597,'PCN-LUXEMBURG','EXPENSE','6076',11591,'Variation des stocks de biens destinés à la revente','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11598,'PCN-LUXEMBURG','EXPENSE','608',11567,'Achats non stockés et achats incorporés aux ouvrages et produits','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11599,'PCN-LUXEMBURG','EXPENSE','6081',11598,'Achats non stockés de matières et fournitures','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11600,'PCN-LUXEMBURG','EXPENSE','60811',11599,'Fournitures non stockables','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11601,'PCN-LUXEMBURG','EXPENSE','608111',11600,'Eau','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11602,'PCN-LUXEMBURG','EXPENSE','608112',11600,'Electricité','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11603,'PCN-LUXEMBURG','EXPENSE','608113',11600,'Gaz de canalisation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11604,'PCN-LUXEMBURG','EXPENSE','60812',11599,'Fournitures d’entretien et de petit équipement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11605,'PCN-LUXEMBURG','EXPENSE','60813',11599,'Fournitures administratives','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11606,'PCN-LUXEMBURG','EXPENSE','60814',11599,'Carburants','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11607,'PCN-LUXEMBURG','EXPENSE','60815',11599,'Lubrifiants','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11608,'PCN-LUXEMBURG','EXPENSE','60816',11599,'Vêtements professionnels','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11609,'PCN-LUXEMBURG','EXPENSE','60818',11599,'Autres matières et fournitures non stockées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11610,'PCN-LUXEMBURG','EXPENSE','6082',11598,'Achats incorporés aux ouvrages et produits','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11611,'PCN-LUXEMBURG','EXPENSE','60821',11610,'Achats d’études et prestations de services (incorporés aux ouvrages et produits)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11612,'PCN-LUXEMBURG','EXPENSE','608211',11611,'Travail à façon','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11613,'PCN-LUXEMBURG','EXPENSE','608212',11611,'Recherche et développement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11614,'PCN-LUXEMBURG','EXPENSE','608213',11611,'Frais d’architectes et d’ingénieurs','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11615,'PCN-LUXEMBURG','EXPENSE','60822',11610,'Achats de matériel, équipements, pièces détachées et travaux (incorporés aux ouvrages et produits)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11616,'PCN-LUXEMBURG','EXPENSE','60828',11610,'Autres achats d’études et de prestations de services','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11617,'PCN-LUXEMBURG','EXPENSE','609',11567,'Rabais, remises et ristournes obtenus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11618,'PCN-LUXEMBURG','EXPENSE','6091',11617,'Matières premières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11619,'PCN-LUXEMBURG','EXPENSE','6092',11617,'Matières consommables','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11620,'PCN-LUXEMBURG','EXPENSE','6093',11617,'Fournitures consommables','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11621,'PCN-LUXEMBURG','EXPENSE','6094',11617,'Emballages','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11622,'PCN-LUXEMBURG','EXPENSE','6095',11617,'Approvisionnements','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11623,'PCN-LUXEMBURG','EXPENSE','6096',11617,'Achats de biens destinés à la revente','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11624,'PCN-LUXEMBURG','EXPENSE','6098',11617,'Achats non stockés et achats incorporés aux ouvrages et produits','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11625,'PCN-LUXEMBURG','EXPENSE','6099',11617,'Rabais, remises et ristournes non affectés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11626,'PCN-LUXEMBURG','EXPENSE','61','','Autres charges externes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11627,'PCN-LUXEMBURG','EXPENSE','611',11626,'Loyers et charges locatives','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11628,'PCN-LUXEMBURG','EXPENSE','6111',11627,'Locations immobilières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11629,'PCN-LUXEMBURG','EXPENSE','61111',11628,'Terrains','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11630,'PCN-LUXEMBURG','EXPENSE','61112',11628,'Bâtiments','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11631,'PCN-LUXEMBURG','EXPENSE','6112',11627,'Locations mobilières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11632,'PCN-LUXEMBURG','EXPENSE','61121',11631,'Installations techniques et machines','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11633,'PCN-LUXEMBURG','EXPENSE','61122',11631,'Autres installations, outillages et machines','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11634,'PCN-LUXEMBURG','EXPENSE','61123',11631,'Matériel roulant','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11635,'PCN-LUXEMBURG','EXPENSE','6113',11627,'Charges locatives et de copropriété','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11636,'PCN-LUXEMBURG','EXPENSE','6114',11627,'Leasing immobilier','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11637,'PCN-LUXEMBURG','EXPENSE','61141',11636,'Terrains','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11638,'PCN-LUXEMBURG','EXPENSE','61142',11636,'Bâtiments','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11639,'PCN-LUXEMBURG','EXPENSE','6115',11627,'Leasing mobilier','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11640,'PCN-LUXEMBURG','EXPENSE','61151',11639,'Installations techniques et machines','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11641,'PCN-LUXEMBURG','EXPENSE','61152',11639,'Autres installations, outillages et machines','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11642,'PCN-LUXEMBURG','EXPENSE','61153',11639,'Matériel roulant','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11643,'PCN-LUXEMBURG','EXPENSE','6116',11627,'Malis sur emballages','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11644,'PCN-LUXEMBURG','EXPENSE','612',11626,'Sous-traitance, entretiens et réparations','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11645,'PCN-LUXEMBURG','EXPENSE','6121',11644,'Sous-traitance générale (non incorporée directement aux ouvrages, travaux et produits)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11646,'PCN-LUXEMBURG','EXPENSE','6122',11644,'Entretien et réparations','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11647,'PCN-LUXEMBURG','EXPENSE','61221',11646,'Sur installations techniques et machines','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11648,'PCN-LUXEMBURG','EXPENSE','61222',11646,'Sur autres installations, outillages et machines','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11649,'PCN-LUXEMBURG','EXPENSE','61223',11646,'Sur matériel roulant','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11650,'PCN-LUXEMBURG','EXPENSE','6123',11644,'Contrats de maintenance','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11651,'PCN-LUXEMBURG','EXPENSE','6124',11644,'Etudes et recherches (non incorporées dans les produits)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11652,'PCN-LUXEMBURG','EXPENSE','613',11626,'Rémunérations d’intermédiaires et honoraires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11653,'PCN-LUXEMBURG','EXPENSE','6131',11652,'Commissions et courtages','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11654,'PCN-LUXEMBURG','EXPENSE','61311',11653,'Commissions et courtages sur achats','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11655,'PCN-LUXEMBURG','EXPENSE','61312',11653,'Commissions et courtages sur ventes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11656,'PCN-LUXEMBURG','EXPENSE','61313',11653,'Rémunérations des transitaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11657,'PCN-LUXEMBURG','EXPENSE','6132',11652,'Traitement informatique','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11658,'PCN-LUXEMBURG','EXPENSE','6133',11652,'Services bancaires et assimilés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11659,'PCN-LUXEMBURG','EXPENSE','61331',11658,'Frais sur titres (achat, vente, garde)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11660,'PCN-LUXEMBURG','EXPENSE','61332',11658,'Commissions et frais sur émission d’emprunts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11661,'PCN-LUXEMBURG','EXPENSE','61333',11658,'Frais de compte','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11662,'PCN-LUXEMBURG','EXPENSE','61334',11658,'Frais sur cartes de crédit','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11663,'PCN-LUXEMBURG','EXPENSE','61335',11658,'Frais sur effets','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11664,'PCN-LUXEMBURG','EXPENSE','61336',11658,'Rémunérations d’affacturage','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11665,'PCN-LUXEMBURG','EXPENSE','61337',11658,'Location de coffres','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11666,'PCN-LUXEMBURG','EXPENSE','61338',11658,'Autres frais et commissions bancaires (hors intérêts et frais assimilés)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11667,'PCN-LUXEMBURG','EXPENSE','6134',11652,'Honoraires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11668,'PCN-LUXEMBURG','EXPENSE','61341',11667,'Honoraires juridiques','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11669,'PCN-LUXEMBURG','EXPENSE','61342',11667,'Honoraires comptables et d’audit','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11670,'PCN-LUXEMBURG','EXPENSE','61343',11667,'Honoraires fiscaux','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11671,'PCN-LUXEMBURG','EXPENSE','61348',11667,'Autres honoraires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11672,'PCN-LUXEMBURG','EXPENSE','6135',11652,'Frais d’actes et de contentieux','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11673,'PCN-LUXEMBURG','EXPENSE','6136',11652,'Frais de recrutement de personnel','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11674,'PCN-LUXEMBURG','EXPENSE','6138',11652,'Autres rémunérations d’intermédiaires et honoraires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11675,'PCN-LUXEMBURG','EXPENSE','614',11626,'Primes d’assurance','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11676,'PCN-LUXEMBURG','EXPENSE','6141',11675,'Assurances sur biens de l’actif','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11677,'PCN-LUXEMBURG','EXPENSE','61411',11676,'Bâtiments','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11678,'PCN-LUXEMBURG','EXPENSE','61412',11676,'Véhicules','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11679,'PCN-LUXEMBURG','EXPENSE','61413',11676,'Installations','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11680,'PCN-LUXEMBURG','EXPENSE','61418',11676,'Sur autres biens de l’actif','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11681,'PCN-LUXEMBURG','EXPENSE','6142',11675,'Assurances sur biens pris en location','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11682,'PCN-LUXEMBURG','EXPENSE','6143',11675,'Assurance-transport','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11683,'PCN-LUXEMBURG','EXPENSE','61431',11682,'Sur achats','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11684,'PCN-LUXEMBURG','EXPENSE','61432',11682,'Sur ventes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11685,'PCN-LUXEMBURG','EXPENSE','61438',11682,'Sur autres biens','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11686,'PCN-LUXEMBURG','EXPENSE','6144',11675,'Assurance risque d’exploitation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11687,'PCN-LUXEMBURG','EXPENSE','6145',11675,'Assurance insolvabilité clients','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11688,'PCN-LUXEMBURG','EXPENSE','6146',11675,'Assurance responsabilité civile','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11689,'PCN-LUXEMBURG','EXPENSE','6148',11675,'Autres assurances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11690,'PCN-LUXEMBURG','EXPENSE','615',11626,'Frais de marketing et de communication','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11691,'PCN-LUXEMBURG','EXPENSE','6151',11690,'Frais de marketing et de publicité','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11692,'PCN-LUXEMBURG','EXPENSE','61511',11691,'Annonces et insertions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11693,'PCN-LUXEMBURG','EXPENSE','61512',11691,'Echantillons','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11694,'PCN-LUXEMBURG','EXPENSE','61513',11691,'Foires et expositions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11695,'PCN-LUXEMBURG','EXPENSE','61514',11691,'Cadeaux à la clientèle','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11696,'PCN-LUXEMBURG','EXPENSE','61515',11691,'Catalogues et imprimés et publications','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11697,'PCN-LUXEMBURG','EXPENSE','61516',11691,'Dons courants','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11698,'PCN-LUXEMBURG','EXPENSE','61517',11691,'Sponsoring','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11699,'PCN-LUXEMBURG','EXPENSE','61518',11691,'Autres achats de services publicitaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11700,'PCN-LUXEMBURG','EXPENSE','6152',11690,'Frais de déplacements et de représentation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11701,'PCN-LUXEMBURG','EXPENSE','61521',11700,'Voyages et déplacements','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11702,'PCN-LUXEMBURG','EXPENSE','615211',11701,'Direction (respectivement exploitant et associés)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11703,'PCN-LUXEMBURG','EXPENSE','615212',11701,'Personnel','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11704,'PCN-LUXEMBURG','EXPENSE','61522',11700,'Frais de déménagement de l’entreprise','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11705,'PCN-LUXEMBURG','EXPENSE','61523',11700,'Missions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11706,'PCN-LUXEMBURG','EXPENSE','61524',11700,'Réceptions et frais de représentation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11707,'PCN-LUXEMBURG','EXPENSE','6153',11690,'Frais postaux et frais de télécommunications','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11708,'PCN-LUXEMBURG','EXPENSE','61531',11707,'Timbres','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11709,'PCN-LUXEMBURG','EXPENSE','61532',11707,'Téléphone et autres frais de télécommunication','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11710,'PCN-LUXEMBURG','EXPENSE','61538',11707,'Autres frais postaux (location de boîtes postales, etc.)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11711,'PCN-LUXEMBURG','EXPENSE','616',11626,'Transports de biens et transports collectifs du personnel','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11712,'PCN-LUXEMBURG','EXPENSE','6161',11711,'Transports sur achats','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11713,'PCN-LUXEMBURG','EXPENSE','6162',11711,'Transports sur ventes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11714,'PCN-LUXEMBURG','EXPENSE','6163',11711,'Transports entre établissements ou chantiers','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11715,'PCN-LUXEMBURG','EXPENSE','6164',11711,'Transports administratifs','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11716,'PCN-LUXEMBURG','EXPENSE','6165',11711,'Transports collectifs du personnel','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11717,'PCN-LUXEMBURG','EXPENSE','6168',11711,'Autres transports','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11718,'PCN-LUXEMBURG','EXPENSE','617',11626,'Personnel extérieur à l’entreprise','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11719,'PCN-LUXEMBURG','EXPENSE','6171',11718,'Personnel intérimaire','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11720,'PCN-LUXEMBURG','EXPENSE','6172',11718,'Personnel prêté à l’entreprise','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11721,'PCN-LUXEMBURG','EXPENSE','618',11626,'Charges externes diverses','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11722,'PCN-LUXEMBURG','EXPENSE','6181',11721,'Documentation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11723,'PCN-LUXEMBURG','EXPENSE','61811',11722,'Documentation générale','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11724,'PCN-LUXEMBURG','EXPENSE','61812',11722,'Documentation technique','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11725,'PCN-LUXEMBURG','EXPENSE','6182',11721,'Frais de colloques, séminaires, conférences','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11726,'PCN-LUXEMBURG','EXPENSE','6183',11721,'Elimination des déchets industriels','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11727,'PCN-LUXEMBURG','EXPENSE','6184',11721,'Elimination de déchets non industriels','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11728,'PCN-LUXEMBURG','EXPENSE','6185',11721,'Evacuation des eaux usées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11729,'PCN-LUXEMBURG','EXPENSE','6186',11721,'Frais de surveillance','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11730,'PCN-LUXEMBURG','EXPENSE','6187',11721,'Cotisations aux associations professionnelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11731,'PCN-LUXEMBURG','EXPENSE','6188',11721,'Autres charges externes diverses','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11732,'PCN-LUXEMBURG','EXPENSE','619',11626,'Rabais, remises et ristournes obtenus sur autres charges externes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11733,'PCN-LUXEMBURG','EXPENSE','62','','Frais de personnel','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11734,'PCN-LUXEMBURG','EXPENSE','621',11733,'Rémunérations des salariés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11735,'PCN-LUXEMBURG','EXPENSE','6211',11734,'Salaires bruts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11736,'PCN-LUXEMBURG','EXPENSE','62111',11735,'Salaires de base','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11737,'PCN-LUXEMBURG','EXPENSE','62112',11735,'Suppléments pour travail','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11738,'PCN-LUXEMBURG','EXPENSE','621121',11737,'Dimanche','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11739,'PCN-LUXEMBURG','EXPENSE','621122',11737,'Jours fériés légaux','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11740,'PCN-LUXEMBURG','EXPENSE','621123',11737,'Heures supplémentaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11741,'PCN-LUXEMBURG','EXPENSE','621128',11737,'Autres suppléments','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11742,'PCN-LUXEMBURG','EXPENSE','62113',11735,'Primes de ménage','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11743,'PCN-LUXEMBURG','EXPENSE','62114',11735,'Gratifications, primes et commissions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11744,'PCN-LUXEMBURG','EXPENSE','62115',11735,'Avantages en nature','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11745,'PCN-LUXEMBURG','EXPENSE','62116',11735,'Indemnités de licenciement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11746,'PCN-LUXEMBURG','EXPENSE','62117',11735,'Trimestre de faveur','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11747,'PCN-LUXEMBURG','EXPENSE','6218',11734,'Autres avantages','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11748,'PCN-LUXEMBURG','EXPENSE','6219',11734,'Remboursements sur salaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11749,'PCN-LUXEMBURG','EXPENSE','62191',11748,'Remboursements mutualité','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11750,'PCN-LUXEMBURG','EXPENSE','62192',11748,'Remboursements pour congé politique, sportif, culturel, éducatif et mandats sociaux','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11751,'PCN-LUXEMBURG','EXPENSE','62193',11748,'Remboursements trimestre de faveur','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11752,'PCN-LUXEMBURG','EXPENSE','622',11733,'Autre personnel','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11753,'PCN-LUXEMBURG','EXPENSE','6221',11752,'Etudiants','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11754,'PCN-LUXEMBURG','EXPENSE','6222',11752,'Salaires occasionnels','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11755,'PCN-LUXEMBURG','EXPENSE','6228',11752,'Autre personnel temporaire','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11756,'PCN-LUXEMBURG','EXPENSE','623',11733,'Charges sociales (part patronale)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11757,'PCN-LUXEMBURG','EXPENSE','6231',11756,'Charges sociales salariés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11758,'PCN-LUXEMBURG','EXPENSE','62311',11757,'Caisse Nationale de Santé','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11759,'PCN-LUXEMBURG','EXPENSE','62312',11757,'Caisse Nationale d’Assurance-Pension','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11760,'PCN-LUXEMBURG','EXPENSE','62318',11757,'Cotisations patronales complémentaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11761,'PCN-LUXEMBURG','EXPENSE','6232',11756,'Assurance accidents du travail','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11762,'PCN-LUXEMBURG','EXPENSE','6233',11756,'Service de santé au travail','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11763,'PCN-LUXEMBURG','EXPENSE','6238',11756,'Autres charges sociales patronales','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11764,'PCN-LUXEMBURG','EXPENSE','6239',11756,'Remboursements de charges sociales','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11765,'PCN-LUXEMBURG','EXPENSE','624',11733,'Pensions complémentaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11766,'PCN-LUXEMBURG','EXPENSE','6241',11765,'Primes à des fonds de pensions extérieurs','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11767,'PCN-LUXEMBURG','EXPENSE','6242',11765,'Dotation aux provisions pour pensions complémentaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11768,'PCN-LUXEMBURG','EXPENSE','6243',11765,'Retenue d’impôt sur pension complémentaire','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11769,'PCN-LUXEMBURG','EXPENSE','6244',11765,'Prime d’assurance insolvabilité','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11770,'PCN-LUXEMBURG','EXPENSE','6245',11765,'Pensions complémentaires versées par l’employeur','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11771,'PCN-LUXEMBURG','EXPENSE','628',11733,'Autres charges sociales','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11772,'PCN-LUXEMBURG','EXPENSE','6281',11771,'Médecine du travail','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11773,'PCN-LUXEMBURG','EXPENSE','6288',11771,'Autres charges sociales diverses','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11774,'PCN-LUXEMBURG','EXPENSE','63','','Dotations aux corrections de valeur des éléments d’actif non financiers','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11775,'PCN-LUXEMBURG','EXPENSE','631',11774,'Dotations aux corrections de valeur sur frais d’établissement et frais assimilés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11776,'PCN-LUXEMBURG','EXPENSE','6311',11775,'Frais de constitution','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11777,'PCN-LUXEMBURG','EXPENSE','6312',11775,'Frais de premier établissement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11778,'PCN-LUXEMBURG','EXPENSE','6313',11775,'Frais d’augmentation de capital et d’opérations diverses','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11779,'PCN-LUXEMBURG','EXPENSE','6314',11775,'Frais d’émission d’emprunts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11780,'PCN-LUXEMBURG','EXPENSE','6318',11775,'Autres frais assimilés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11781,'PCN-LUXEMBURG','EXPENSE','632',11774,'Dotations aux corrections de valeur sur immobilisations incorporelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11782,'PCN-LUXEMBURG','EXPENSE','6321',11781,'Frais de recherche et de développement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11783,'PCN-LUXEMBURG','EXPENSE','6322',11781,'Concessions, brevets, licences, marques ainsi que droits et valeurs similaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11784,'PCN-LUXEMBURG','EXPENSE','6323',11781,'Fonds de commerce dans la mesure où il a été acquis à titre onéreux','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11785,'PCN-LUXEMBURG','EXPENSE','6324',11781,'Acomptes versés et immobilisations incorporelles en cours','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11786,'PCN-LUXEMBURG','EXPENSE','633',11774,'Dotations aux corrections de valeur sur immobilisations corporelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11787,'PCN-LUXEMBURG','EXPENSE','6331',11786,'Terrains et constructions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11788,'PCN-LUXEMBURG','EXPENSE','63311',11787,'Terrains','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11789,'PCN-LUXEMBURG','EXPENSE','63312',11787,'Agencements et aménagements de terrains','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11790,'PCN-LUXEMBURG','EXPENSE','63313',11787,'Constructions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11791,'PCN-LUXEMBURG','EXPENSE','6332',11786,'Installations techniques et machines','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11792,'PCN-LUXEMBURG','EXPENSE','6333',11786,'Autres installations, outillage, mobilier et matériel roulant','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11793,'PCN-LUXEMBURG','EXPENSE','6334',11786,'Acomptes versés et immobilisations corporelles en cours','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11794,'PCN-LUXEMBURG','EXPENSE','634',11774,'Dotations aux corrections de valeur sur stocks','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11795,'PCN-LUXEMBURG','EXPENSE','6341',11794,'Matières premières et consommables','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11796,'PCN-LUXEMBURG','EXPENSE','6342',11794,'Produits en cours de fabrication et commandes en cours','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11797,'PCN-LUXEMBURG','EXPENSE','6343',11794,'Produits finis et marchandises','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11798,'PCN-LUXEMBURG','EXPENSE','6344',11794,'Terrains et immeubles destinés à la revente','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11799,'PCN-LUXEMBURG','EXPENSE','6345',11794,'Acomptes versés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11800,'PCN-LUXEMBURG','EXPENSE','635',11774,'Dotations aux corrections de valeur sur créances de l’actif circulant','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11801,'PCN-LUXEMBURG','EXPENSE','6351',11800,'Créances résultant de ventes et prestations de services','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11802,'PCN-LUXEMBURG','EXPENSE','6352',11800,'Créances sur des entreprises liées et des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11803,'PCN-LUXEMBURG','EXPENSE','6353',11800,'Autres créances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11804,'PCN-LUXEMBURG','EXPENSE','64','','Autres charges d’exploitation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11805,'PCN-LUXEMBURG','EXPENSE','641',11804,'Redevances pour concessions, brevets, licences, marques, droits et valeurs similaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11806,'PCN-LUXEMBURG','EXPENSE','6411',11805,'Concessions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11807,'PCN-LUXEMBURG','EXPENSE','6412',11805,'Brevets','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11808,'PCN-LUXEMBURG','EXPENSE','6413',11805,'Licences informatiques','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11809,'PCN-LUXEMBURG','EXPENSE','6414',11805,'Marques et franchises','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11810,'PCN-LUXEMBURG','EXPENSE','6415',11805,'Droits et valeurs similaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11811,'PCN-LUXEMBURG','EXPENSE','64151',11810,'Droits d’auteur et de reproduction','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11812,'PCN-LUXEMBURG','EXPENSE','64158',11810,'Autres droits et valeurs similaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11813,'PCN-LUXEMBURG','EXPENSE','642',11804,'Indemnités','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11814,'PCN-LUXEMBURG','EXPENSE','643',11804,'Jetons de présence','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11815,'PCN-LUXEMBURG','EXPENSE','644',11804,'Tantièmes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11816,'PCN-LUXEMBURG','EXPENSE','645',11804,'Pertes sur créances irrécouvrables','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11817,'PCN-LUXEMBURG','EXPENSE','6451',11816,'Créances résultant de ventes et de prestations de services','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11818,'PCN-LUXEMBURG','EXPENSE','6452',11816,'Créances sur des entreprises liées et sur des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11819,'PCN-LUXEMBURG','EXPENSE','6453',11816,'Autres créances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11820,'PCN-LUXEMBURG','EXPENSE','646',11804,'Impôts, taxes et versements assimilés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11821,'PCN-LUXEMBURG','EXPENSE','6461',11820,'Impôt foncier','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11822,'PCN-LUXEMBURG','EXPENSE','6462',11820,'TVA non déductible','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11823,'PCN-LUXEMBURG','EXPENSE','6463',11820,'Droits sur les marchandises en provenance de l’étranger','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11824,'PCN-LUXEMBURG','EXPENSE','64631',11823,'Droits d’accises et taxe de consommation sur marchandises en provenance de l’étranger','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11825,'PCN-LUXEMBURG','EXPENSE','64632',11823,'Droits de douane','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11826,'PCN-LUXEMBURG','EXPENSE','64633',11823,'Montants compensatoires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11827,'PCN-LUXEMBURG','EXPENSE','6464',11820,'Droits d’accises à la production et taxe de consommation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11828,'PCN-LUXEMBURG','EXPENSE','6465',11820,'Droits d’enregistrement et de timbre, droits d’hypothèques','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11829,'PCN-LUXEMBURG','EXPENSE','64651',11828,'Droits d’enregistrement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11830,'PCN-LUXEMBURG','EXPENSE','64652',11828,'Taxe d’abonnement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11831,'PCN-LUXEMBURG','EXPENSE','64653',11828,'Droits d’hypothèques','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11832,'PCN-LUXEMBURG','EXPENSE','64654',11828,'Droits de timbre','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11833,'PCN-LUXEMBURG','EXPENSE','64658',11828,'Autres droits d’enregistrement et de timbre, droits d’hypothèques','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11834,'PCN-LUXEMBURG','EXPENSE','6466',11820,'Taxes sur les véhicules','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11835,'PCN-LUXEMBURG','EXPENSE','6467',11820,'Taxe de cabaretage','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11836,'PCN-LUXEMBURG','EXPENSE','6468',11820,'Autres droits et impôts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11837,'PCN-LUXEMBURG','EXPENSE','6469',11820,'Dotations aux provisions pour impôts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11838,'PCN-LUXEMBURG','EXPENSE','647',11804,'Dotations aux plus-values immunisées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11839,'PCN-LUXEMBURG','EXPENSE','648',11804,'Autres charges d’exploitation diverses','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11840,'PCN-LUXEMBURG','EXPENSE','649',11804,'Dotations aux provisions d’exploitation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11841,'PCN-LUXEMBURG','EXPENSE','65','','Charges financières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11842,'PCN-LUXEMBURG','EXPENSE','651',11841,'Dotations aux corrections de valeur et ajustements pour juste valeur sur immobilisations financières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11843,'PCN-LUXEMBURG','EXPENSE','6511',11842,'Dotations aux corrections de valeur sur immobilisations financières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11844,'PCN-LUXEMBURG','EXPENSE','65111',11843,'Parts dans des entreprises liées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11845,'PCN-LUXEMBURG','EXPENSE','65112',11843,'Créances sur des entreprises liées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11846,'PCN-LUXEMBURG','EXPENSE','65113',11843,'Parts dans des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11847,'PCN-LUXEMBURG','EXPENSE','65114',11843,'Créances sur des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11848,'PCN-LUXEMBURG','EXPENSE','65115',11843,'Titres ayant le caractère d’immobilisations','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11849,'PCN-LUXEMBURG','EXPENSE','65116',11843,'Prêts et créances immobilisées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11850,'PCN-LUXEMBURG','EXPENSE','65117',11843,'Actions propres ou parts propres','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11851,'PCN-LUXEMBURG','EXPENSE','6512',11842,'Ajustements pour juste valeur sur immobilisations financières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11852,'PCN-LUXEMBURG','EXPENSE','653',11841,'Dotations aux corrections de valeur et ajustements pour juste valeur sur éléments financiers de l’actif circulant','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11853,'PCN-LUXEMBURG','EXPENSE','6531',11852,'Dotations aux corrections de valeur sur valeurs mobilières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11854,'PCN-LUXEMBURG','EXPENSE','65311',11853,'Parts dans des entreprises liées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11855,'PCN-LUXEMBURG','EXPENSE','65312',11853,'Parts dans des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11856,'PCN-LUXEMBURG','EXPENSE','65313',11853,'Actions propres ou parts propres','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11857,'PCN-LUXEMBURG','EXPENSE','65318',11853,'Autres valeurs mobilières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11858,'PCN-LUXEMBURG','EXPENSE','6532',11852,'Dotations aux corrections de valeur sur créances sur des entreprises liées et sur des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11859,'PCN-LUXEMBURG','EXPENSE','6533',11852,'Dotations aux corrections de valeur sur autres créances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11860,'PCN-LUXEMBURG','EXPENSE','6534',11852,'Ajustements pour juste valeur sur éléments financiers de l’actif circulant','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11861,'PCN-LUXEMBURG','EXPENSE','654',11841,'Moins-values de cession de valeurs mobilières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11862,'PCN-LUXEMBURG','EXPENSE','6541',11861,'Parts dans des entreprises liées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11863,'PCN-LUXEMBURG','EXPENSE','6542',11861,'Parts dans des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11864,'PCN-LUXEMBURG','EXPENSE','6543',11861,'Actions propres ou parts propres','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11865,'PCN-LUXEMBURG','EXPENSE','6548',11861,'Autres valeurs mobilières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11866,'PCN-LUXEMBURG','EXPENSE','655',11841,'Intérêts et escomptes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11867,'PCN-LUXEMBURG','EXPENSE','6551',11866,'Intérêts des dettes financières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11868,'PCN-LUXEMBURG','EXPENSE','65511',11867,'Intérêts des dettes subordonnées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11869,'PCN-LUXEMBURG','EXPENSE','65512',11867,'Intérêts des emprunts obligataires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11870,'PCN-LUXEMBURG','EXPENSE','6552',11866,'Intérêts bancaires et assimilés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11871,'PCN-LUXEMBURG','EXPENSE','65521',11870,'Intérêts bancaires sur comptes courants','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11872,'PCN-LUXEMBURG','EXPENSE','65522',11870,'Intérêts bancaires sur opérations de financement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11873,'PCN-LUXEMBURG','EXPENSE','65523',11870,'Intérêts sur leasings financiers','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11874,'PCN-LUXEMBURG','EXPENSE','6553',11866,'Intérêts sur dettes commerciales','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11875,'PCN-LUXEMBURG','EXPENSE','6554',11866,'Intérêts sur des entreprises liées et sur des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11876,'PCN-LUXEMBURG','EXPENSE','6555',11866,'Escomptes et frais sur effets','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11877,'PCN-LUXEMBURG','EXPENSE','6556',11866,'Escomptes accordés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11878,'PCN-LUXEMBURG','EXPENSE','6558',11866,'Intérêts sur autres emprunts et dettes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11879,'PCN-LUXEMBURG','EXPENSE','656',11841,'Pertes de change','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11880,'PCN-LUXEMBURG','EXPENSE','657',11841,'Quote-part de perte dans les entreprises collectives (autres que les sociétés de capitaux)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11881,'PCN-LUXEMBURG','EXPENSE','658',11841,'Autres charges financières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11882,'PCN-LUXEMBURG','EXPENSE','659',11841,'Dotations aux provisions financières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11883,'PCN-LUXEMBURG','EXPENSE','66','','Charges exceptionnelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11884,'PCN-LUXEMBURG','EXPENSE','661',11883,'Dotations aux corrections de valeur exceptionnelles sur immobilisations incorporelles et corporelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11885,'PCN-LUXEMBURG','EXPENSE','6611',11884,'Sur immobilisations incorporelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11886,'PCN-LUXEMBURG','EXPENSE','6612',11884,'Sur immobilisations corporelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11887,'PCN-LUXEMBURG','EXPENSE','662',11883,'Dotations aux corrections de valeur exceptionnelles sur éléments de l’actif circulant','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11888,'PCN-LUXEMBURG','EXPENSE','6621',11887,'Sur stocks','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11889,'PCN-LUXEMBURG','EXPENSE','6622',11887,'Sur créances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11890,'PCN-LUXEMBURG','EXPENSE','663',11883,'Valeur comptable des immobilisations incorporelles et corporelles cédées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11891,'PCN-LUXEMBURG','EXPENSE','6631',11890,'Immobilisations incorporelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11892,'PCN-LUXEMBURG','EXPENSE','6632',11890,'Immobilisations corporelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11893,'PCN-LUXEMBURG','EXPENSE','664',11883,'Valeur comptable des immobilisations financières cédées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11894,'PCN-LUXEMBURG','EXPENSE','6641',11893,'Parts dans des entreprises liées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11895,'PCN-LUXEMBURG','EXPENSE','6642',11893,'Créances sur des entreprises liées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11896,'PCN-LUXEMBURG','EXPENSE','6643',11893,'Parts dans des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11897,'PCN-LUXEMBURG','EXPENSE','6644',11893,'Créances sur des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11898,'PCN-LUXEMBURG','EXPENSE','6645',11893,'Titres ayant le caractère d’immobilisations','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11899,'PCN-LUXEMBURG','EXPENSE','6646',11893,'Prêts et créances immobilisées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11900,'PCN-LUXEMBURG','EXPENSE','6647',11893,'Actions propres ou parts propres','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11901,'PCN-LUXEMBURG','EXPENSE','665',11883,'Valeur comptable des créances de l’actif circulant financier cédées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11902,'PCN-LUXEMBURG','EXPENSE','6651',11901,'ur des entreprises liées et sur des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11903,'PCN-LUXEMBURG','EXPENSE','6652',11901,'Sur autres créances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11904,'PCN-LUXEMBURG','EXPENSE','668',11883,'Autres charges exceptionnelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11905,'PCN-LUXEMBURG','EXPENSE','6681',11904,'Pénalités sur marchés et dédits payés sur achats et ventes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11906,'PCN-LUXEMBURG','EXPENSE','6682',11904,'Amendes et pénalités fiscales, sociales et pénales','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11907,'PCN-LUXEMBURG','EXPENSE','6683',11904,'Dommages et intérêts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11908,'PCN-LUXEMBURG','EXPENSE','6684',11904,'Malis provenant de clauses d’indexation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11909,'PCN-LUXEMBURG','EXPENSE','6688',11904,'Autres charges exceptionnelles diverses','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11910,'PCN-LUXEMBURG','EXPENSE','669',11883,'Dotations aux provisions exceptionnelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11911,'PCN-LUXEMBURG','EXPENSE','67','','Impôts sur le résultat','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11912,'PCN-LUXEMBURG','EXPENSE','671',11911,'Impôt sur le revenu des collectivités','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11913,'PCN-LUXEMBURG','EXPENSE','6711',11912,'Exercice courant','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11914,'PCN-LUXEMBURG','EXPENSE','6712',11912,'Exercices antérieurs','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11915,'PCN-LUXEMBURG','EXPENSE','672',11911,'Impôt commercial','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11916,'PCN-LUXEMBURG','EXPENSE','6721',11915,'Exercice courant','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11917,'PCN-LUXEMBURG','EXPENSE','6722',11915,'Exercices antérieurs','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11918,'PCN-LUXEMBURG','EXPENSE','673',11911,'Impôts étrangers sur le résultat','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11919,'PCN-LUXEMBURG','EXPENSE','6731',11918,'Retenues d’impôt à la source','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11920,'PCN-LUXEMBURG','EXPENSE','6732',11918,'Impôts supportés par les établissements stables','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11921,'PCN-LUXEMBURG','EXPENSE','67321',11921,'Exercice courant','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11922,'PCN-LUXEMBURG','EXPENSE','67322',11921,'Exercices antérieurs','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11923,'PCN-LUXEMBURG','EXPENSE','6733',11918,'Impôts supportés par les entreprises non résidentes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11924,'PCN-LUXEMBURG','EXPENSE','6738',11918,'Autres impôts étrangers','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11925,'PCN-LUXEMBURG','EXPENSE','679',11911,'Dotations aux provisions pour impôts sur le résultat','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11926,'PCN-LUXEMBURG','EXPENSE','6791',11925,'Dotations aux provisions pour impôts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11927,'PCN-LUXEMBURG','EXPENSE','6792',11925,'Dotations aux provisions pour impôts différés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11928,'PCN-LUXEMBURG','EXPENSE','68','','Autres impôts ne figurant pas sous le poste ci-dessus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11929,'PCN-LUXEMBURG','EXPENSE','681',11928,'Impôt sur la fortune','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11930,'PCN-LUXEMBURG','EXPENSE','6811',11930,'Exercice courant','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11931,'PCN-LUXEMBURG','EXPENSE','6812',11930,'Exercices antérieurs','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11932,'PCN-LUXEMBURG','EXPENSE','682',11928,'Taxe d’abonnement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11933,'PCN-LUXEMBURG','EXPENSE','683',11928,'Impôts étrangers','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11934,'PCN-LUXEMBURG','EXPENSE','688',11928,'Autres impôts et taxes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11935,'PCN-LUXEMBURG','EXPENSE','689',11928,'Dotations aux provisions pour autres impôts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11936,'PCN-LUXEMBURG','INCOME','70','','Montant net du chiffre d’affaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11937,'PCN-LUXEMBURG','INCOME','701',11936,'Ventes sur commandes en cours','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11938,'PCN-LUXEMBURG','INCOME','7011',11937,'Produits','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11939,'PCN-LUXEMBURG','INCOME','7012',11937,'Prestations de services','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11940,'PCN-LUXEMBURG','INCOME','7013',11937,'Immeubles en construction','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11941,'PCN-LUXEMBURG','INCOME','702',11936,'Ventes de produits finis','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11942,'PCN-LUXEMBURG','INCOME','703',11936,'Ventes de produits intermédiaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11943,'PCN-LUXEMBURG','INCOME','704',11936,'Ventes de produits résiduels','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11944,'PCN-LUXEMBURG','INCOME','705',11936,'Ventes d’éléments destinés à la revente','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11945,'PCN-LUXEMBURG','INCOME','7051',11944,'Ventes de marchandises','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11946,'PCN-LUXEMBURG','INCOME','7052',11944,'Ventes de terrains et d’immeubles existants (promotion immobilière)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11947,'PCN-LUXEMBURG','INCOME','7053',11944,'Ventes d’autres éléments destinés à la revente','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11948,'PCN-LUXEMBURG','INCOME','706',11936,'Prestations de services','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11949,'PCN-LUXEMBURG','INCOME','708',11936,'Autres éléments du chiffre d’affaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11950,'PCN-LUXEMBURG','INCOME','7081',11949,'Commissions et courtages','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11951,'PCN-LUXEMBURG','INCOME','7082',11949,'Locations','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11952,'PCN-LUXEMBURG','INCOME','70821',11951,'Loyer immobilier','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11953,'PCN-LUXEMBURG','INCOME','70822',11951,'Loyer mobilier','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11954,'PCN-LUXEMBURG','INCOME','7083',11949,'Ventes d’emballages','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11955,'PCN-LUXEMBURG','INCOME','7088',11949,'Autres éléments divers du chiffre d’affaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11956,'PCN-LUXEMBURG','INCOME','709',11936,'Rabais, remises et ristournes accordés par l’entreprise','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11957,'PCN-LUXEMBURG','INCOME','7091',11956,'Sur ventes sur commandes en cours','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11958,'PCN-LUXEMBURG','INCOME','7092',11956,'Sur ventes de produits finis','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11959,'PCN-LUXEMBURG','INCOME','7093',11956,'Sur ventes de produits intermédiaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11960,'PCN-LUXEMBURG','INCOME','7094',11956,'Sur ventes de produits résiduels','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11961,'PCN-LUXEMBURG','INCOME','7095',11956,'Sur ventes d’éléments destinés à la revente','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11962,'PCN-LUXEMBURG','INCOME','7096',11956,'Sur prestations de services','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11963,'PCN-LUXEMBURG','INCOME','7098',11956,'Sur autres éléments du chiffre d’affaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11964,'PCN-LUXEMBURG','INCOME','71','','Variation des stocks de produits finis, d’en cours de fabrication et des commandes en cours','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11965,'PCN-LUXEMBURG','INCOME','711',11964,'Variation des stocks de produits en cours de fabrication et de commandes en cours','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11966,'PCN-LUXEMBURG','INCOME','7111',11965,'Variation des stocks de produits en cours','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11967,'PCN-LUXEMBURG','INCOME','7112',11965,'Variation des stocks de commandes en cours – produits','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11968,'PCN-LUXEMBURG','INCOME','7113',11965,'Variation des stocks de commandes en cours – prestations de services','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11969,'PCN-LUXEMBURG','INCOME','7114',11965,'Variation des stocks d’immeubles en construction','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11970,'PCN-LUXEMBURG','INCOME','712',11964,'Variation des stocks de produits finis et marchandises','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11971,'PCN-LUXEMBURG','INCOME','7121',11970,'Variation des stocks de produits finis','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11972,'PCN-LUXEMBURG','INCOME','7122',11970,'Variation des stocks de produits intermédiaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11973,'PCN-LUXEMBURG','INCOME','7123',11970,'Variation des stocks de produits résiduels','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11974,'PCN-LUXEMBURG','INCOME','7126',11970,'Variation des stocks de marchandises','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11975,'PCN-LUXEMBURG','INCOME','7127',11970,'Variation des stocks de marchandises en voie d’acheminement, mises en dépôt ou données en consignation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11976,'PCN-LUXEMBURG','INCOME','72','','Production immobilisée','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11977,'PCN-LUXEMBURG','INCOME','721',11976,'Immobilisations incorporelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11978,'PCN-LUXEMBURG','INCOME','7211',11977,'Frais de recherche et développement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11979,'PCN-LUXEMBURG','INCOME','7212',11977,'Concessions, brevets, licences, marques, droits et valeurs similaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11980,'PCN-LUXEMBURG','INCOME','72121',11979,'Concessions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11981,'PCN-LUXEMBURG','INCOME','72122',11979,'Brevets','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11982,'PCN-LUXEMBURG','INCOME','72123',11979,'Licences informatiques','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11983,'PCN-LUXEMBURG','INCOME','72124',11979,'Marques et franchises','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11984,'PCN-LUXEMBURG','INCOME','72125',11983,'Droits et valeurs similaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11985,'PCN-LUXEMBURG','INCOME','721251',11984,'Droits d’auteur et de reproduction','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11986,'PCN-LUXEMBURG','INCOME','721258',11984,'Autres droits et valeurs similaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11987,'PCN-LUXEMBURG','INCOME','722',11976,'Immobilisations corporelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11988,'PCN-LUXEMBURG','INCOME','7221',11987,'Terrains et constructions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11989,'PCN-LUXEMBURG','INCOME','7222',11987,'Installations techniques et machines','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11990,'PCN-LUXEMBURG','INCOME','7223',11987,'Autres installations, outillage, mobilier et matériel roulant','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11991,'PCN-LUXEMBURG','INCOME','73','','Reprises de corrections de valeur des éléments d’actif non financiers','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11992,'PCN-LUXEMBURG','INCOME','732',11991,'Reprises de corrections de valeur sur immobilisations incorporelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11993,'PCN-LUXEMBURG','INCOME','7321',11992,'Frais de recherche et de développement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11994,'PCN-LUXEMBURG','INCOME','7322',11992,'Concessions, brevets, licences, marques ainsi que droits et valeurs similaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11995,'PCN-LUXEMBURG','INCOME','7323',11992,'Fonds de commerce dans la mesure où il a été acquis à titre onéreux','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11996,'PCN-LUXEMBURG','INCOME','7324',11992,'Acomptes versés et immobilisations incorporelles en cours','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11997,'PCN-LUXEMBURG','INCOME','733',11991,'Reprises de corrections de valeur sur immobilisations corporelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11998,'PCN-LUXEMBURG','INCOME','7331',11997,'Terrains et constructions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11999,'PCN-LUXEMBURG','INCOME','73311',11998,'Terrains','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12000,'PCN-LUXEMBURG','INCOME','73312',11998,'Agencements et aménagements de terrains','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12001,'PCN-LUXEMBURG','INCOME','73313',11998,'Constructions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12002,'PCN-LUXEMBURG','INCOME','73314',11998,'Constructions sur sol d’autrui','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12003,'PCN-LUXEMBURG','INCOME','7332',11997,'Installations techniques et machines','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12004,'PCN-LUXEMBURG','INCOME','7333',11997,'Autres installations, outillage, mobilier et matériel roulant','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12005,'PCN-LUXEMBURG','INCOME','7334',11997,'Acomptes versés et immobilisations corporelles en cours','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12006,'PCN-LUXEMBURG','INCOME','734',11991,'Reprises de corrections de valeur sur stocks','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12007,'PCN-LUXEMBURG','INCOME','7341',12006,'Matières premières et consommables','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12008,'PCN-LUXEMBURG','INCOME','7342',12006,'Produits en cours de fabrication et commandes en cours','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12009,'PCN-LUXEMBURG','INCOME','7343',12006,'Produits finis et marchandises','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12010,'PCN-LUXEMBURG','INCOME','7344',12006,'Terrains et immeubles destinés à la revente','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12011,'PCN-LUXEMBURG','INCOME','7345',12006,'Acomptes versés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12012,'PCN-LUXEMBURG','INCOME','735',11991,'Reprises de corrections de valeur sur créances de l’actif circulant','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12013,'PCN-LUXEMBURG','INCOME','7351',12012,'Créances résultant de ventes et prestations de services','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12014,'PCN-LUXEMBURG','INCOME','7352',12012,'Créances sur des entreprises liées et des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12015,'PCN-LUXEMBURG','INCOME','7353',12012,'Autres créances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12016,'PCN-LUXEMBURG','INCOME','74','','Autres produits d’exploitation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12017,'PCN-LUXEMBURG','INCOME','741',12016,'Redevances pour concessions, brevets, licences, marques, droits et valeurs similaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12018,'PCN-LUXEMBURG','INCOME','7411',12017,'Concessions','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12019,'PCN-LUXEMBURG','INCOME','7412',12017,'Brevets','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12020,'PCN-LUXEMBURG','INCOME','7413',12017,'Licences informatiques','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12021,'PCN-LUXEMBURG','INCOME','7414',12017,'Marques et franchises','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12022,'PCN-LUXEMBURG','INCOME','7415',12017,'Droits et valeurs similaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12023,'PCN-LUXEMBURG','INCOME','74151',12022,'Droits d’auteur et de reproduction','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12024,'PCN-LUXEMBURG','INCOME','74158',12022,'Autres droits et valeurs similaires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12025,'PCN-LUXEMBURG','INCOME','742',12016,'Revenus des immeubles non affectés aux activités professionnelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12026,'PCN-LUXEMBURG','INCOME','743',12016,'Jetons de présence, tantièmes et rémunérations assimilées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12027,'PCN-LUXEMBURG','INCOME','744',12016,'Subventions d’exploitation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12028,'PCN-LUXEMBURG','INCOME','7441',12027,'Subventions sur produits','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12029,'PCN-LUXEMBURG','INCOME','7442',12027,'Bonifications d’intérêt','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12030,'PCN-LUXEMBURG','INCOME','7443',12027,'Montants compensatoires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12031,'PCN-LUXEMBURG','INCOME','7444',12027,'Subventions destinées à promouvoir l’emploi','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12032,'PCN-LUXEMBURG','INCOME','74441',12031,'Primes d’apprentissage reçues','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12033,'PCN-LUXEMBURG','INCOME','74442',12031,'Autres subventions destinées à promouvoir l’emploi','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12034,'PCN-LUXEMBURG','INCOME','7448',12027,'Autres subventions d’exploitation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12035,'PCN-LUXEMBURG','INCOME','745',12016,'Ristournes perçues des coopératives (provenant des excédents)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12036,'PCN-LUXEMBURG','INCOME','746',12016,'Indemnités d’assurance touchées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12037,'PCN-LUXEMBURG','INCOME','747',12016,'Reprises de plus-values immunisées et de subventions d’investissement en capital','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12038,'PCN-LUXEMBURG','INCOME','7471',12037,'Plus-values immunisées non réinvesties','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12039,'PCN-LUXEMBURG','INCOME','7472',12037,'Plus-values immunisées réinvesties','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12040,'PCN-LUXEMBURG','INCOME','7473',12037,'Subventions d’investissement en capital','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12041,'PCN-LUXEMBURG','INCOME','748',12016,'Autres produits d’exploitation divers','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12042,'PCN-LUXEMBURG','INCOME','749',12016,'Reprises sur provisions d’exploitation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12043,'PCN-LUXEMBURG','INCOME','75','','Produits financiers','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12044,'PCN-LUXEMBURG','INCOME','751',12043,'Reprises sur corrections de valeur et ajustements pour juste valeur sur immobilisations financières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12045,'PCN-LUXEMBURG','INCOME','7511',12044,'Reprises sur corrections de valeur sur immobilisations financières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12046,'PCN-LUXEMBURG','INCOME','75111',12045,'Parts dans des entreprises liées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12047,'PCN-LUXEMBURG','INCOME','75112',12045,'Créances sur des entreprises liées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12048,'PCN-LUXEMBURG','INCOME','75113',12045,'Parts dans des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12049,'PCN-LUXEMBURG','INCOME','75114',12045,'Créances sur des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12050,'PCN-LUXEMBURG','INCOME','75115',12045,'Titres ayant le caractère d’immobilisations','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12051,'PCN-LUXEMBURG','INCOME','75116',12045,'Prêts et créances immobilisées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12052,'PCN-LUXEMBURG','INCOME','75117',12045,'Actions propres ou parts propres','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12053,'PCN-LUXEMBURG','INCOME','7512',12044,'Ajustements pour juste valeur sur immobilisations financières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12054,'PCN-LUXEMBURG','INCOME','752',12043,'Revenus des immobilisations financières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12055,'PCN-LUXEMBURG','INCOME','7521',12054,'Parts dans des entreprises liées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12056,'PCN-LUXEMBURG','INCOME','7522',12054,'Créances sur des entreprises liées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12057,'PCN-LUXEMBURG','INCOME','7523',12054,'Parts dans des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12058,'PCN-LUXEMBURG','INCOME','7524',12054,'Créances sur des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12059,'PCN-LUXEMBURG','INCOME','7525',12054,'Titres ayant le caractère d’immobilisations','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12060,'PCN-LUXEMBURG','INCOME','7526',12054,'Prêts et créances immobilisées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12061,'PCN-LUXEMBURG','INCOME','7527',12054,'Actions propres ou parts propres','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12062,'PCN-LUXEMBURG','INCOME','753',12043,'Reprises sur corrections de valeur et ajustements pour juste valeur sur éléments financiers de l’actif circulant','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12063,'PCN-LUXEMBURG','INCOME','7531',12062,'Reprises sur corrections de valeur sur créances sur des entreprises liées et des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12064,'PCN-LUXEMBURG','INCOME','7532',12062,'Reprises sur corrections de valeur sur autres créances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12065,'PCN-LUXEMBURG','INCOME','7533',12062,'Reprises sur corrections de valeur sur valeurs mobilières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12066,'PCN-LUXEMBURG','INCOME','75331',12065,'Parts dans les entreprises liées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12067,'PCN-LUXEMBURG','INCOME','75332',12065,'Parts dans des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12068,'PCN-LUXEMBURG','INCOME','75333',12065,'Actions propres ou parts propres','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12069,'PCN-LUXEMBURG','INCOME','75338',12065,'Autres valeurs mobilières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12070,'PCN-LUXEMBURG','INCOME','7534',12062,'Ajustements pour juste valeur sur éléments financiers de l’actif circulant','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12071,'PCN-LUXEMBURG','INCOME','754',12043,'Plus-value de cession et autres produits de valeurs mobilières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12072,'PCN-LUXEMBURG','INCOME','7541',12071,'Plus-value de cession de valeurs mobilière','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12073,'PCN-LUXEMBURG','INCOME','75411',12072,'Parts dans les entreprises liées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12074,'PCN-LUXEMBURG','INCOME','75412',12072,'Parts dans des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12075,'PCN-LUXEMBURG','INCOME','75413',12072,'Actions propres ou parts propres','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12076,'PCN-LUXEMBURG','INCOME','75418',12072,'Autres valeurs mobilières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12077,'PCN-LUXEMBURG','INCOME','7548',12071,'Autres produits de valeurs mobilières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12078,'PCN-LUXEMBURG','INCOME','75481',12077,'Parts dans les entreprises liées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12079,'PCN-LUXEMBURG','INCOME','75482',12077,'Parts dans des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12080,'PCN-LUXEMBURG','INCOME','75483',12077,'Actions propres ou parts propres','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12081,'PCN-LUXEMBURG','INCOME','75488',12077,'Autres valeurs mobilières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12082,'PCN-LUXEMBURG','INCOME','755',12043,'Autres intérêts et escomptes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12083,'PCN-LUXEMBURG','INCOME','7552',12082,'Intérêts bancaires et assimilés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12084,'PCN-LUXEMBURG','INCOME','75521',12083,'Intérêts sur comptes courants','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12085,'PCN-LUXEMBURG','INCOME','75522',12083,'Intérêts sur comptes à terme','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12086,'PCN-LUXEMBURG','INCOME','75523',12083,'Intérêts sur leasings financiers','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12087,'PCN-LUXEMBURG','INCOME','7553',12082,'Intérêts sur créances commerciales','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12088,'PCN-LUXEMBURG','INCOME','7554',12082,'Intérêts sur des entreprises liées et sur des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12089,'PCN-LUXEMBURG','INCOME','7555',12082,'Escomptes d’effets de commerce','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12090,'PCN-LUXEMBURG','INCOME','7556',12082,'Escomptes obtenus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12091,'PCN-LUXEMBURG','INCOME','7558',12082,'Intérêts sur autres créances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12092,'PCN-LUXEMBURG','INCOME','756',12043,'Gains de change','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12093,'PCN-LUXEMBURG','INCOME','757',12043,'Quote-part de bénéfice dans les entreprises collectives (autres que les sociétés de capitaux)','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12094,'PCN-LUXEMBURG','INCOME','758',12043,'Autres produits financiers','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12095,'PCN-LUXEMBURG','INCOME','759',12043,'Reprises sur provisions financières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12096,'PCN-LUXEMBURG','INCOME','76','','Produits exceptionnels','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12097,'PCN-LUXEMBURG','INCOME','761',12096,'Reprises sur corrections de valeur exceptionnelles sur immobilisations incorporelles et corporelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12098,'PCN-LUXEMBURG','INCOME','7611',12097,'Immobilisations incorporelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12099,'PCN-LUXEMBURG','INCOME','7612',12097,'Immobilisations corporelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12100,'PCN-LUXEMBURG','INCOME','762',12096,'Reprises sur corrections de valeur exceptionnelles sur éléments de l’actif circulant','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12101,'PCN-LUXEMBURG','INCOME','7621',12100,'Sur stocks','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12102,'PCN-LUXEMBURG','INCOME','7622',12100,'Sur créances de l’actif circulant','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12103,'PCN-LUXEMBURG','INCOME','763',12096,'Produits de cession d’immobilisations incorporelles et corporelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12104,'PCN-LUXEMBURG','INCOME','7631',12103,'Immobilisations incorporelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12105,'PCN-LUXEMBURG','INCOME','7632',12103,'Immobilisations corporelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12106,'PCN-LUXEMBURG','INCOME','764',12096,'Produits de cession d’immobilisations financières','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12107,'PCN-LUXEMBURG','INCOME','7641',12106,'Parts dans les entreprises liées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12108,'PCN-LUXEMBURG','INCOME','7642',12106,'Créances sur entreprises liées','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12109,'PCN-LUXEMBURG','INCOME','7643',12106,'Parts dans des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12110,'PCN-LUXEMBURG','INCOME','7644',12106,'Créances sur des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12111,'PCN-LUXEMBURG','INCOME','7645',12106,'Titres ayant le caractère d’immobilisations','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12112,'PCN-LUXEMBURG','INCOME','7646',12106,'Prêts et créances immobilisés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12113,'PCN-LUXEMBURG','INCOME','7647',12106,'Actions propres ou parts propres','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12114,'PCN-LUXEMBURG','INCOME','765',12096,'Produits de cession sur créances de l’actif circulant financier','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12115,'PCN-LUXEMBURG','INCOME','7651',12114,'Créances sur des entreprises liées et sur des entreprises avec lesquelles la société a un lien de participation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12116,'PCN-LUXEMBURG','INCOME','7652',12114,'Autres créances','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12117,'PCN-LUXEMBURG','INCOME','768',12096,'Autres produits exceptionnels','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12118,'PCN-LUXEMBURG','INCOME','7681',12117,'Pénalités sur marchés et dédits perçus sur achats et sur ventes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12119,'PCN-LUXEMBURG','INCOME','7682',12117,'Libéralités reçues','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12120,'PCN-LUXEMBURG','INCOME','7683',12117,'Rentrées sur créances amorties','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12121,'PCN-LUXEMBURG','INCOME','7684',12117,'Subventions exceptionnelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12122,'PCN-LUXEMBURG','INCOME','7685',12117,'Bonis provenant de clauses d’indexation','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12123,'PCN-LUXEMBURG','INCOME','7686',12117,'Bonis provenant du rachat par l’entreprise d’actions et d’obligations émises par elle-même','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12124,'PCN-LUXEMBURG','INCOME','7688',12117,'Autres produits exceptionnels divers','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12125,'PCN-LUXEMBURG','INCOME','769',12096,'Reprises sur provisions exceptionnelles','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12126,'PCN-LUXEMBURG','INCOME','77','','Régularisations d’impôts sur le résultat','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12127,'PCN-LUXEMBURG','INCOME','771',12126,'Régularisations d’impôt sur le revenu des collectivités','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12128,'PCN-LUXEMBURG','INCOME','772',12126,'Régularisations d’impôt commercial','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12129,'PCN-LUXEMBURG','INCOME','773',12126,'Régularisations d’impôts étrangers sur le résultat','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12130,'PCN-LUXEMBURG','INCOME','779',12126,'Reprises sur provisions pour impôts sur le résultat','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12131,'PCN-LUXEMBURG','INCOME','7791',12130,'Reprises sur provisions pour impôts','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12132,'PCN-LUXEMBURG','INCOME','7792',12130,'Reprises sur provisions pour impôts différés','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12133,'PCN-LUXEMBURG','INCOME','78','','Régularisations d’autres impôts ne figurant pas sous le poste ci-dessus','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12134,'PCN-LUXEMBURG','INCOME','781',12133,'Régularisations d’impôt sur la fortune','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12135,'PCN-LUXEMBURG','INCOME','782',12133,'Régularisations de taxes d’abonnement','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12136,'PCN-LUXEMBURG','INCOME','783',12133,'Régularisations d’impôts étrangers','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12137,'PCN-LUXEMBURG','INCOME','788',12133,'Régularisations d’autres impôts et taxes','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12138,'PCN-LUXEMBURG','INCOME','789',12133,'Reprises sur provisions pour autres impôts','1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17000, 'PCN2020-LUXEMBURG', 'LIABILIT', '101', 0, 'Capital souscrit', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17001, 'PCN2020-LUXEMBURG', 'LIABILIT', '102', 0, 'Capital souscrit non appelé', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17002, 'PCN2020-LUXEMBURG', 'LIABILIT', '103', 0, 'Capital souscrit appelé et non versé', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17003, 'PCN2020-LUXEMBURG', 'LIABILIT', '104', 0, 'Cap. Entr. Indiv/soc. de pers. et assim.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17004, 'PCN2020-LUXEMBURG', 'LIABILIT', '105', 0, 'Dotation des succursales', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17005, 'PCN2020-LUXEMBURG', 'LIABILIT', '10611', 0, 'Prélèvements en numéraire (train de vie)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17006, 'PCN2020-LUXEMBURG', 'LIABILIT', '10612', 0, 'Prélèvements en nature de marchandises,', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17007, 'PCN2020-LUXEMBURG', 'LIABILIT', '10613', 0, 'Part personnelle des frais de maladie', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17008, 'PCN2020-LUXEMBURG', 'LIABILIT', '106141', 0, 'Vie', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17009, 'PCN2020-LUXEMBURG', 'LIABILIT', '106142', 0, 'Accident', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17010, 'PCN2020-LUXEMBURG', 'LIABILIT', '106143', 0, 'Incendie', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17011, 'PCN2020-LUXEMBURG', 'LIABILIT', '106144', 0, 'Responsabilité civile', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17012, 'PCN2020-LUXEMBURG', 'LIABILIT', '106145', 0, 'Multirisques', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17013, 'PCN2020-LUXEMBURG', 'LIABILIT', '106148', 0, 'Autres primes d’assurances privées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17014, 'PCN2020-LUXEMBURG', 'LIABILIT', '106151', 0, 'Assurances sociales (assurance dépendanc', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17015, 'PCN2020-LUXEMBURG', 'LIABILIT', '106152', 0, 'Allocations familiales', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17016, 'PCN2020-LUXEMBURG', 'LIABILIT', '106153', 0, 'Cotisations pour mutuelles', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17017, 'PCN2020-LUXEMBURG', 'LIABILIT', '106154', 0, 'Caisse de décès, médico-chirurgicale, Pr', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17018, 'PCN2020-LUXEMBURG', 'LIABILIT', '106158', 0, 'Autres cotisations', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17019, 'PCN2020-LUXEMBURG', 'LIABILIT', '106161', 0, 'Salaires', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17020, 'PCN2020-LUXEMBURG', 'LIABILIT', '106162', 0, 'Loyer', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17021, 'PCN2020-LUXEMBURG', 'LIABILIT', '106163', 0, 'Chauffage, gaz, électricité', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17022, 'PCN2020-LUXEMBURG', 'LIABILIT', '106164', 0, 'Eau', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17023, 'PCN2020-LUXEMBURG', 'LIABILIT', '106165', 0, 'Téléphone', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17024, 'PCN2020-LUXEMBURG', 'LIABILIT', '106166', 0, 'Voiture', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17025, 'PCN2020-LUXEMBURG', 'LIABILIT', '106168', 0, 'Autres prélèvements en nature', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17026, 'PCN2020-LUXEMBURG', 'LIABILIT', '106171', 0, 'Mobilier privé', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17027, 'PCN2020-LUXEMBURG', 'LIABILIT', '106172', 0, 'Voiture privée', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17028, 'PCN2020-LUXEMBURG', 'LIABILIT', '106173', 0, 'Titres privés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17029, 'PCN2020-LUXEMBURG', 'LIABILIT', '106174', 0, 'Immeubles privés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17030, 'PCN2020-LUXEMBURG', 'LIABILIT', '106178', 0, 'Autres acquisitions', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17031, 'PCN2020-LUXEMBURG', 'LIABILIT', '106181', 0, 'Impôt sur le revenu payé (IRPP)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17032, 'PCN2020-LUXEMBURG', 'LIABILIT', '106183', 0, 'Impôt commercial communal (ICC) - arriér', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17033, 'PCN2020-LUXEMBURG', 'LIABILIT', '106188', 0, 'Autres impôts', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17034, 'PCN2020-LUXEMBURG', 'LIABILIT', '106191', 0, 'Réparations aux immeubles privés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17035, 'PCN2020-LUXEMBURG', 'LIABILIT', '106192', 0, 'Placements sur comptes financiers privés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17036, 'PCN2020-LUXEMBURG', 'LIABILIT', '106193', 0, 'Remboursements de dettes privées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17037, 'PCN2020-LUXEMBURG', 'LIABILIT', '106194', 0, 'Dons et dotations aux enfants', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17038, 'PCN2020-LUXEMBURG', 'LIABILIT', '106195', 0, 'Droits de succession et droits de mutati', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17039, 'PCN2020-LUXEMBURG', 'LIABILIT', '106198', 0, 'Autres prélèvements privés particuliers', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17040, 'PCN2020-LUXEMBURG', 'LIABILIT', '10621', 0, 'Héritage ou donation', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17041, 'PCN2020-LUXEMBURG', 'LIABILIT', '10622', 0, 'Avoirs privés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17042, 'PCN2020-LUXEMBURG', 'LIABILIT', '10623', 0, 'Emprunts privés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17043, 'PCN2020-LUXEMBURG', 'LIABILIT', '106241', 0, 'Mobilier privé', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17044, 'PCN2020-LUXEMBURG', 'LIABILIT', '106242', 0, 'Voiture privée', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17045, 'PCN2020-LUXEMBURG', 'LIABILIT', '106243', 0, 'Titres privés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17046, 'PCN2020-LUXEMBURG', 'LIABILIT', '106244', 0, 'Immeubles privés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17047, 'PCN2020-LUXEMBURG', 'LIABILIT', '106248', 0, 'Autres cessions', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17048, 'PCN2020-LUXEMBURG', 'LIABILIT', '10625', 0, 'Loyers encaissés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17049, 'PCN2020-LUXEMBURG', 'LIABILIT', '10626', 0, 'Salaires ou rentes touchés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17050, 'PCN2020-LUXEMBURG', 'LIABILIT', '10627', 0, 'Allocations familiales reçues', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17051, 'PCN2020-LUXEMBURG', 'LIABILIT', '106281', 0, 'Impôt sur le revenu (IRPP)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17052, 'PCN2020-LUXEMBURG', 'LIABILIT', '106284', 0, 'Impôt commercial communal (ICC)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17053, 'PCN2020-LUXEMBURG', 'LIABILIT', '106288', 0, 'Autres remboursements d’impôts', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17054, 'PCN2020-LUXEMBURG', 'LIABILIT', '10629', 0, 'Quote-part professionnelle de frais priv', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17055, 'PCN2020-LUXEMBURG', 'LIABILIT', '111', 0, 'Primes d’émission', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17056, 'PCN2020-LUXEMBURG', 'LIABILIT', '112', 0, 'Primes de fusion', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17057, 'PCN2020-LUXEMBURG', 'LIABILIT', '113', 0, 'Primes d’apport', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17058, 'PCN2020-LUXEMBURG', 'LIABILIT', '114', 0, 'Primes de convers. d’obligat. en actions', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17059, 'PCN2020-LUXEMBURG', 'LIABILIT', '115', 0, 'App. en cap. prop. non rému. par titres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17060, 'PCN2020-LUXEMBURG', 'LIABILIT', '122', 0, 'Réserves de mise en équivalence', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17061, 'PCN2020-LUXEMBURG', 'LIABILIT', '123', 0, 'Plus-values sur écarts de conver. immun.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17062, 'PCN2020-LUXEMBURG', 'LIABILIT', '128', 0, 'Autres réserves de réévaluation', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17063, 'PCN2020-LUXEMBURG', 'LIABILIT', '131', 0, 'Réserve légale', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17064, 'PCN2020-LUXEMBURG', 'LIABILIT', '132', 0, 'Rés. pour act. propres ou parts propres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17065, 'PCN2020-LUXEMBURG', 'LIABILIT', '133', 0, 'Réserves statutaires', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17066, 'PCN2020-LUXEMBURG', 'LIABILIT', '1381', 0, 'Autres réserves disponibles', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17067, 'PCN2020-LUXEMBURG', 'LIABILIT', '13821', 0, 'Réserve pour l’impôt sur la fortune (IF)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17068, 'PCN2020-LUXEMBURG', 'LIABILIT', '13822', 0, 'Réserves en application de la juste val.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17069, 'PCN2020-LUXEMBURG', 'LIABILIT', '138231', 0, 'Plus-values immunisées à réinvestir', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17070, 'PCN2020-LUXEMBURG', 'LIABILIT', '138232', 0, 'Plus-values immunisées réinvesties', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17071, 'PCN2020-LUXEMBURG', 'LIABILIT', '13828', 0, 'Réserves non disp. non visées ci-dessus', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17072, 'PCN2020-LUXEMBURG', 'LIABILIT', '1411', 0, 'Résultats reportés en instance d’affect.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17073, 'PCN2020-LUXEMBURG', 'LIABILIT', '1412', 0, 'Résultats reportés (affectés)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17074, 'PCN2020-LUXEMBURG', 'LIABILIT', '142', 0, 'Résultat de l’exercice', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17075, 'PCN2020-LUXEMBURG', 'LIABILIT', '15', 0, 'Acomptes sur dividendes', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17076, 'PCN2020-LUXEMBURG', 'LIABILIT', '1611', 0, 'Frais de développement', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17077, 'PCN2020-LUXEMBURG', 'LIABILIT', '16121', 0, 'acquis à titre onéreux', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17078, 'PCN2020-LUXEMBURG', 'LIABILIT', '16122', 0, 'créés par l’entreprise elle-même', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17079, 'PCN2020-LUXEMBURG', 'LIABILIT', '1613', 0, 'Fonds de comm., acquis à titre onéreux', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17080, 'PCN2020-LUXEMBURG', 'LIABILIT', '1621', 0, 'Subv. sur terrains, aménag. et constr.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17081, 'PCN2020-LUXEMBURG', 'LIABILIT', '1622', 0, 'Subv. sur installations techn. et mach.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17082, 'PCN2020-LUXEMBURG', 'LIABILIT', '1623', 0, 'Subv. autr. instal./outil./mob./m. roul.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17083, 'PCN2020-LUXEMBURG', 'LIABILIT', '168', 0, 'Autres subventions d’invest. en capital', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17084, 'PCN2020-LUXEMBURG', 'LIABILIT', '181', 0, 'Prov. pour pensions et oblig. simil.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17085, 'PCN2020-LUXEMBURG', 'LIABILIT', '182', 0, 'Provisions pour impôts', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17086, 'PCN2020-LUXEMBURG', 'LIABILIT', '183', 0, 'Provisions pour impôts différés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17087, 'PCN2020-LUXEMBURG', 'LIABILIT', '1881', 0, 'Provisions d’exploitation', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17088, 'PCN2020-LUXEMBURG', 'LIABILIT', '1882', 0, 'Provisions financières', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17089, 'PCN2020-LUXEMBURG', 'LIABILIT', '1921', 0, 'dont la durée résiduelle est <1an', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17090, 'PCN2020-LUXEMBURG', 'LIABILIT', '1922', 0, 'dont la durée résiduelle est >1an', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17091, 'PCN2020-LUXEMBURG', 'LIABILIT', '1931', 0, 'dont la durée résiduelle est <1an', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17092, 'PCN2020-LUXEMBURG', 'LIABILIT', '1932', 0, 'dont la durée résiduelle est >1an', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17093, 'PCN2020-LUXEMBURG', 'LIABILIT', '1941', 0, 'dont la durée résiduelle est <1an', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17094, 'PCN2020-LUXEMBURG', 'LIABILIT', '1942', 0, 'dont la durée résiduelle est >1an', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17095, 'PCN2020-LUXEMBURG', 'ASSETS', '201', 0, 'Frais de constit. et de premier établis.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17096, 'PCN2020-LUXEMBURG', 'ASSETS', '203', 0, 'Frais d’aug. cap., d’opé. div. (F, S, T)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17097, 'PCN2020-LUXEMBURG', 'ASSETS', '204', 0, 'Frais d’émission d’emprunts', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17098, 'PCN2020-LUXEMBURG', 'ASSETS', '208', 0, 'Autres frais assimilés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17099, 'PCN2020-LUXEMBURG', 'ASSETS', '211', 0, 'Frais de développement', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17100, 'PCN2020-LUXEMBURG', 'ASSETS', '21211', 0, 'Concessions', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17101, 'PCN2020-LUXEMBURG', 'ASSETS', '21212', 0, 'Brevets', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17102, 'PCN2020-LUXEMBURG', 'ASSETS', '21213', 0, 'Licences informatiques', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17103, 'PCN2020-LUXEMBURG', 'ASSETS', '21214', 0, 'Marques et franchises', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17104, 'PCN2020-LUXEMBURG', 'ASSETS', '212151', 0, 'Droits d’auteur et de reproduction', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17105, 'PCN2020-LUXEMBURG', 'ASSETS', '212152', 0, 'Quotas d’ém. de gaz à effet de serre', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17106, 'PCN2020-LUXEMBURG', 'ASSETS', '212158', 0, 'Aut. drts et val. sim. acq. à tit. onér.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17107, 'PCN2020-LUXEMBURG', 'ASSETS', '21221', 0, 'Concessions', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17108, 'PCN2020-LUXEMBURG', 'ASSETS', '21222', 0, 'Brevets', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17109, 'PCN2020-LUXEMBURG', 'ASSETS', '21223', 0, 'Licences informatiques', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17110, 'PCN2020-LUXEMBURG', 'ASSETS', '21224', 0, 'Marques et franchises', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17111, 'PCN2020-LUXEMBURG', 'ASSETS', '212251', 0, 'Droits d’auteur et de reproduction', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17112, 'PCN2020-LUXEMBURG', 'ASSETS', '212258', 0, 'Aut.drts/val.sim. créés par ent. elle-m.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17113, 'PCN2020-LUXEMBURG', 'ASSETS', '213', 0, 'Fonds de comm. acquis à tit. onéreux', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17114, 'PCN2020-LUXEMBURG', 'ASSETS', '214', 0, 'Acomp. versés et immob. Incorp en cours', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17115, 'PCN2020-LUXEMBURG', 'ASSETS', '221111', 0, 'Terrains bâtis', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17116, 'PCN2020-LUXEMBURG', 'ASSETS', '221112', 0, 'Droits immobiliers et assimilés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17117, 'PCN2020-LUXEMBURG', 'ASSETS', '221118', 0, 'Autres terrains', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17118, 'PCN2020-LUXEMBURG', 'ASSETS', '22112', 0, 'Terrains à l’étranger', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17119, 'PCN2020-LUXEMBURG', 'ASSETS', '22121', 0, 'Agencem. et aménag. de terrains au Lux.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17120, 'PCN2020-LUXEMBURG', 'ASSETS', '22122', 0, 'Agencem. et aménag. de terrains étranger', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17121, 'PCN2020-LUXEMBURG', 'ASSETS', '221311', 0, 'Constructions / Bâtiments résidentiels', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17122, 'PCN2020-LUXEMBURG', 'ASSETS', '221312', 0, 'Constructions / Bâtiments non résiden.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17123, 'PCN2020-LUXEMBURG', 'ASSETS', '221313', 0, 'Constructions / Bâtiments à usage mixte', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17124, 'PCN2020-LUXEMBURG', 'ASSETS', '221318', 0, 'Autres constructions / bâtiments', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17125, 'PCN2020-LUXEMBURG', 'ASSETS', '22132', 0, 'Constructions / Bâtiments à l’étranger', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17126, 'PCN2020-LUXEMBURG', 'ASSETS', '22141', 0, 'Agen. et amén. de constr./bâtim. au Lux.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17127, 'PCN2020-LUXEMBURG', 'ASSETS', '22142', 0, 'Agen. et amén. de constr./bâtim. étrang.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17128, 'PCN2020-LUXEMBURG', 'ASSETS', '22151', 0, 'Immeubles de placement au Luxembourg', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17129, 'PCN2020-LUXEMBURG', 'ASSETS', '22152', 0, 'Immeubles de placement à l’étranger', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17130, 'PCN2020-LUXEMBURG', 'ASSETS', '2221', 0, 'Installations techniques', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17131, 'PCN2020-LUXEMBURG', 'ASSETS', '2222', 0, 'Machines', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17132, 'PCN2020-LUXEMBURG', 'ASSETS', '2231', 0, 'Equip. de transport et de manutention', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17133, 'PCN2020-LUXEMBURG', 'ASSETS', '2232', 0, 'Véhicules de transport', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17134, 'PCN2020-LUXEMBURG', 'ASSETS', '2233', 0, 'Outillage', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17135, 'PCN2020-LUXEMBURG', 'ASSETS', '2234', 0, 'Mobilier', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17136, 'PCN2020-LUXEMBURG', 'ASSETS', '2235', 0, 'Matériel informatique', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17137, 'PCN2020-LUXEMBURG', 'ASSETS', '223501', 0, 'Amortissement sur Matériel roulant', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17138, 'PCN2020-LUXEMBURG', 'ASSETS', '223509', 0, 'Amortissement sur MAC Book Air', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17139, 'PCN2020-LUXEMBURG', 'ASSETS', '2236', 0, 'Cheptel', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17140, 'PCN2020-LUXEMBURG', 'ASSETS', '2237', 0, 'Emballages récupérables', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17141, 'PCN2020-LUXEMBURG', 'ASSETS', '2238', 0, 'Autres installations', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17142, 'PCN2020-LUXEMBURG', 'ASSETS', '22411', 0, 'Terrains, aménag. et constr. au Lux.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17143, 'PCN2020-LUXEMBURG', 'ASSETS', '22412', 0, 'Terrains, aménag. et constr. étranger', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17144, 'PCN2020-LUXEMBURG', 'ASSETS', '2242', 0, 'Installations techniques et machines', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17145, 'PCN2020-LUXEMBURG', 'ASSETS', '2243', 0, 'Aut. install., outil., mob., mat. roul.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17146, 'PCN2020-LUXEMBURG', 'ASSETS', '231', 0, 'Parts dans des entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17147, 'PCN2020-LUXEMBURG', 'ASSETS', '232', 0, 'Créances sur des entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17148, 'PCN2020-LUXEMBURG', 'ASSETS', '233', 0, 'Participations', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17149, 'PCN2020-LUXEMBURG', 'ASSETS', '234', 0, 'Créances sur des entr. lien particip.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17150, 'PCN2020-LUXEMBURG', 'ASSETS', '235111', 0, 'Actions cotées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17151, 'PCN2020-LUXEMBURG', 'ASSETS', '235112', 0, 'Actions non cotées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17152, 'PCN2020-LUXEMBURG', 'ASSETS', '23518', 0, 'Aut. titres immob. (droit de propriété)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17153, 'PCN2020-LUXEMBURG', 'ASSETS', '23521', 0, 'Obligations', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17154, 'PCN2020-LUXEMBURG', 'ASSETS', '23528', 0, 'Autres titres immob. (droit de créance)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17155, 'PCN2020-LUXEMBURG', 'ASSETS', '2353', 0, 'Parts d’OPC', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17156, 'PCN2020-LUXEMBURG', 'ASSETS', '2358', 0, 'Autres titres ayant le caractère d’immo.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17157, 'PCN2020-LUXEMBURG', 'ASSETS', '2361', 0, 'Prêts', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17158, 'PCN2020-LUXEMBURG', 'ASSETS', '2362', 0, 'Dépôts et cautionnements versés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17159, 'PCN2020-LUXEMBURG', 'ASSETS', '2363', 0, 'Créances immobilisées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17160, 'PCN2020-LUXEMBURG', 'ASSETS', '301', 0, 'Stocks de matières premières', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17161, 'PCN2020-LUXEMBURG', 'ASSETS', '303', 0, 'Stocks de matières et fourn. consom.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17162, 'PCN2020-LUXEMBURG', 'ASSETS', '304', 0, 'Stocks d’emballages', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17163, 'PCN2020-LUXEMBURG', 'ASSETS', '311', 0, 'Stocks de produits en cours de fabric.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17164, 'PCN2020-LUXEMBURG', 'ASSETS', '312', 0, 'Commandes en cours - produits', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17165, 'PCN2020-LUXEMBURG', 'ASSETS', '313', 0, 'Commandes en cours - prest. de serv.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17166, 'PCN2020-LUXEMBURG', 'ASSETS', '314', 0, 'Immeubles en construction', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17167, 'PCN2020-LUXEMBURG', 'ASSETS', '315', 0, 'Ac.déd./stks.prod.en co. fabr./com.en c.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17168, 'PCN2020-LUXEMBURG', 'ASSETS', '321', 0, 'Stocks de produits finis', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17169, 'PCN2020-LUXEMBURG', 'ASSETS', '322', 0, 'Stocks de produits intermédiaires', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17170, 'PCN2020-LUXEMBURG', 'ASSETS', '323', 0, 'Stks prod.résid.(déch.,reb.,mat.récup.)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17171, 'PCN2020-LUXEMBURG', 'ASSETS', '361', 0, 'Stocks de marchandises', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17172, 'PCN2020-LUXEMBURG', 'ASSETS', '3621', 0, 'Stocks de terrains au Luxembourg', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17173, 'PCN2020-LUXEMBURG', 'ASSETS', '3622', 0, 'Stocks de terrains à l’étranger', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17174, 'PCN2020-LUXEMBURG', 'ASSETS', '3631', 0, 'Stocks d’immeubles au Luxembourg', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17175, 'PCN2020-LUXEMBURG', 'ASSETS', '3632', 0, 'Stocks d’immeubles à l’étranger', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17176, 'PCN2020-LUXEMBURG', 'ASSETS', '37', 0, 'Acomptes versés sur stocks', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17177, 'PCN2020-LUXEMBURG', 'ASSETS', '4011', 0, 'Clients', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17178, 'PCN2020-LUXEMBURG', 'ASSETS', '4012', 0, 'Clients - Effets à recevoir', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17179, 'PCN2020-LUXEMBURG', 'ASSETS', '4013', 0, 'Clients douteux ou litigieux', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17180, 'PCN2020-LUXEMBURG', 'ASSETS', '4014', 0, 'Clients - Factures à établir', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17181, 'PCN2020-LUXEMBURG', 'ASSETS', '4015', 0, 'Clients créditeurs', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17182, 'PCN2020-LUXEMBURG', 'ASSETS', '4019', 0, 'Corrections de valeur', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17183, 'PCN2020-LUXEMBURG', 'ASSETS', '4021', 0, 'Clients', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17184, 'PCN2020-LUXEMBURG', 'ASSETS', '4025', 0, 'Clients créditeurs', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17185, 'PCN2020-LUXEMBURG', 'ASSETS', '4029', 0, 'Corrections de valeur', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17186, 'PCN2020-LUXEMBURG', 'ASSETS', '41111', 0, 'Ventes et prestations de services', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17187, 'PCN2020-LUXEMBURG', 'ASSETS', '41112', 0, 'Prêts et avances', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17188, 'PCN2020-LUXEMBURG', 'ASSETS', '41118', 0, 'Autres créances', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17189, 'PCN2020-LUXEMBURG', 'ASSETS', '41119', 0, 'Corrections de valeur', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17190, 'PCN2020-LUXEMBURG', 'ASSETS', '41121', 0, 'Ventes et prestations de services', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17191, 'PCN2020-LUXEMBURG', 'ASSETS', '41122', 0, 'Prêts et avances', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17192, 'PCN2020-LUXEMBURG', 'ASSETS', '41128', 0, 'Autres créances', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17193, 'PCN2020-LUXEMBURG', 'ASSETS', '41129', 0, 'Corrections de valeur', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17194, 'PCN2020-LUXEMBURG', 'ASSETS', '41211', 0, 'Ventes et prestations de services', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17195, 'PCN2020-LUXEMBURG', 'ASSETS', '41212', 0, 'Prêts et avances', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17196, 'PCN2020-LUXEMBURG', 'ASSETS', '41218', 0, 'Autres créances', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17197, 'PCN2020-LUXEMBURG', 'ASSETS', '41219', 0, 'Corrections de valeur', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17198, 'PCN2020-LUXEMBURG', 'ASSETS', '41221', 0, 'Ventes et prestations de services', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17199, 'PCN2020-LUXEMBURG', 'ASSETS', '41222', 0, 'Prêts et avances', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17200, 'PCN2020-LUXEMBURG', 'ASSETS', '41228', 0, 'Autres créances', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17201, 'PCN2020-LUXEMBURG', 'ASSETS', '41229', 0, 'Corrections de valeur', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17202, 'PCN2020-LUXEMBURG', 'ASSETS', '42111', 0, 'Avances et acomptes', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17203, 'PCN2020-LUXEMBURG', 'ASSETS', '42119', 0, 'Corrections de valeur', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17204, 'PCN2020-LUXEMBURG', 'ASSETS', '4212', 0, 'Cr./assoc. ou act.(aut. qu'ent. liées)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17205, 'PCN2020-LUXEMBURG', 'ASSETS', '42121', 0, 'De Franco Vincent', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17206, 'PCN2020-LUXEMBURG', 'ASSETS', '42131', 0, 'Subventions d’investissement', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17207, 'PCN2020-LUXEMBURG', 'ASSETS', '42132', 0, 'Subventions d’exploitation', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17208, 'PCN2020-LUXEMBURG', 'ASSETS', '42138', 0, 'Autres subventions', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17209, 'PCN2020-LUXEMBURG', 'ASSETS', '42141', 0, 'Impôt sur le revenu des coll. (IRC)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17210, 'PCN2020-LUXEMBURG', 'ASSETS', '42142', 0, 'Impôt commercial communal (ICC)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17211, 'PCN2020-LUXEMBURG', 'ASSETS', '42143', 0, 'Impôt sur la fortune (IF)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17212, 'PCN2020-LUXEMBURG', 'ASSETS', '42144', 0, 'Retenue d’impôt sur trait. et salaires', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17213, 'PCN2020-LUXEMBURG', 'ASSETS', '42145', 0, 'Retenue d’impôt sur rev. de cap. mobil.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17214, 'PCN2020-LUXEMBURG', 'ASSETS', '42146', 0, 'Retenue d’impôt sur les tantièmes', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17215, 'PCN2020-LUXEMBURG', 'ASSETS', '42148', 0, 'ACD - Autres créances', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17216, 'PCN2020-LUXEMBURG', 'ASSETS', '4215', 0, 'Admin. des Douanes et Accises (ADA)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17217, 'PCN2020-LUXEMBURG', 'ASSETS', '421611', 0, 'TVA en amont', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17218, 'PCN2020-LUXEMBURG', 'ASSETS', '421612', 0, 'TVA à recevoir', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17219, 'PCN2020-LUXEMBURG', 'ASSETS', '421613', 0, 'TVA acomptes versés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17220, 'PCN2020-LUXEMBURG', 'ASSETS', '421618', 0, 'TVA - Autres créances', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17221, 'PCN2020-LUXEMBURG', 'ASSETS', '421621', 0, 'Droits d’enregistrement', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17222, 'PCN2020-LUXEMBURG', 'ASSETS', '421622', 0, 'Taxe d’abonnement', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17223, 'PCN2020-LUXEMBURG', 'ASSETS', '421628', 0, 'Autres impôts indirects', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17224, 'PCN2020-LUXEMBURG', 'ASSETS', '42168', 0, 'AED - Autres créances', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17225, 'PCN2020-LUXEMBURG', 'ASSETS', '42171', 0, 'Centre Commun de Sécurité Sociale (CCSS)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17226, 'PCN2020-LUXEMBURG', 'ASSETS', '42172', 0, 'Remboursement mutualité', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17227, 'PCN2020-LUXEMBURG', 'ASSETS', '42178', 0, 'Autres organismes sociaux', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17228, 'PCN2020-LUXEMBURG', 'ASSETS', '421811', 0, 'TVA étrangères', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17229, 'PCN2020-LUXEMBURG', 'ASSETS', '421818', 0, 'Autres impôts étrangers', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17230, 'PCN2020-LUXEMBURG', 'ASSETS', '42187', 0, 'Instruments financiers dérivés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17231, 'PCN2020-LUXEMBURG', 'ASSETS', '42188', 0, 'Autres créances diverses', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17232, 'PCN2020-LUXEMBURG', 'ASSETS', '42189', 0, 'Corrections de valeur', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17233, 'PCN2020-LUXEMBURG', 'ASSETS', '4221', 0, 'Personnel - Avances et acomptes', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17234, 'PCN2020-LUXEMBURG', 'ASSETS', '4222', 0, 'Cr./assoc. ou act.(aut. qu'ent. liées)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17235, 'PCN2020-LUXEMBURG', 'ASSETS', '42231', 0, 'Subventions d’investissement', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17236, 'PCN2020-LUXEMBURG', 'ASSETS', '42232', 0, 'Subventions d’exploitation', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17237, 'PCN2020-LUXEMBURG', 'ASSETS', '42238', 0, 'Autres subventions', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17238, 'PCN2020-LUXEMBURG', 'ASSETS', '42287', 0, 'Instruments financiers dérivés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17239, 'PCN2020-LUXEMBURG', 'ASSETS', '42288', 0, 'Autres créances diverses', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17240, 'PCN2020-LUXEMBURG', 'ASSETS', '42289', 0, 'Corrections de valeur', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17241, 'PCN2020-LUXEMBURG', 'LIABILIT', '4311', 0, 'Acomptes reçus sur commandes', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17242, 'PCN2020-LUXEMBURG', 'LIABILIT', '4312', 0, 'Stks pr. en c.fab.,com. en c. - ac. reç.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17243, 'PCN2020-LUXEMBURG', 'LIABILIT', '4321', 0, 'Acomptes reçus sur commandes', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17244, 'PCN2020-LUXEMBURG', 'LIABILIT', '4322', 0, 'Stk. pr. en c. fab., com. en c.-ac. reç.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17245, 'PCN2020-LUXEMBURG', 'LIABILIT', '44111', 0, 'Fournisseurs', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17246, 'PCN2020-LUXEMBURG', 'LIABILIT', '44112', 0, 'Fournisseurs - Factures non parvenues', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17247, 'PCN2020-LUXEMBURG', 'LIABILIT', '44113', 0, 'Fournisseurs débiteurs', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17248, 'PCN2020-LUXEMBURG', 'LIABILIT', '44121', 0, 'Fournisseurs', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17249, 'PCN2020-LUXEMBURG', 'LIABILIT', '44123', 0, 'Fournisseurs débiteurs', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17250, 'PCN2020-LUXEMBURG', 'LIABILIT', '4421', 0, 'Effets à payer dont la durée résid. <1an', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17251, 'PCN2020-LUXEMBURG', 'LIABILIT', '4422', 0, 'Effets à payer dont la durée résid. >1an', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17252, 'PCN2020-LUXEMBURG', 'LIABILIT', '45111', 0, 'Achats et prestations de services', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17253, 'PCN2020-LUXEMBURG', 'LIABILIT', '45112', 0, 'Emprunts et avances', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17254, 'PCN2020-LUXEMBURG', 'LIABILIT', '45118', 0, 'Autres dettes', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17255, 'PCN2020-LUXEMBURG', 'LIABILIT', '45121', 0, 'Achats et prestations de services', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17256, 'PCN2020-LUXEMBURG', 'LIABILIT', '45122', 0, 'Emprunts et avances', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17257, 'PCN2020-LUXEMBURG', 'LIABILIT', '45128', 0, 'Autres dettes', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17258, 'PCN2020-LUXEMBURG', 'LIABILIT', '45211', 0, 'Achats et prestations de services', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17259, 'PCN2020-LUXEMBURG', 'LIABILIT', '45212', 0, 'Emprunts et avances', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17260, 'PCN2020-LUXEMBURG', 'LIABILIT', '45218', 0, 'Autres dettes', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17261, 'PCN2020-LUXEMBURG', 'LIABILIT', '45221', 0, 'Achats et prestations de services', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17262, 'PCN2020-LUXEMBURG', 'LIABILIT', '45222', 0, 'Emprunts et avances', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17263, 'PCN2020-LUXEMBURG', 'LIABILIT', '45228', 0, 'Autres dettes', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17264, 'PCN2020-LUXEMBURG', 'LIABILIT', '4611', 0, 'Administrations communales', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17265, 'PCN2020-LUXEMBURG', 'LIABILIT', '461211', 0, 'IRC - charge fiscale estimée', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17266, 'PCN2020-LUXEMBURG', 'LIABILIT', '461212', 0, 'IRC - dette fiscale à payer', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17267, 'PCN2020-LUXEMBURG', 'LIABILIT', '461221', 0, 'ICC - charge fiscale estimée', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17268, 'PCN2020-LUXEMBURG', 'LIABILIT', '461222', 0, 'ICC - dette fiscale à payer', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17269, 'PCN2020-LUXEMBURG', 'LIABILIT', '461231', 0, 'IF - charge fiscale estimée', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17270, 'PCN2020-LUXEMBURG', 'LIABILIT', '461232', 0, 'IF - dette fiscale à payer', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17271, 'PCN2020-LUXEMBURG', 'LIABILIT', '46124', 0, 'Retenue d’impôt sur trait. et sal. (RTS)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17272, 'PCN2020-LUXEMBURG', 'LIABILIT', '46125', 0, 'Retenue d’impôt sur revenus de capitaux', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17273, 'PCN2020-LUXEMBURG', 'LIABILIT', '46126', 0, 'Retenue d’impôt sur les tantièmes', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17274, 'PCN2020-LUXEMBURG', 'LIABILIT', '46128', 0, 'ACD - Autres dettes', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17275, 'PCN2020-LUXEMBURG', 'LIABILIT', '4613', 0, 'Admin. des Douanes et Accises (ADA)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17276, 'PCN2020-LUXEMBURG', 'LIABILIT', '461411', 0, 'TVA en aval', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17277, 'PCN2020-LUXEMBURG', 'LIABILIT', '461412', 0, 'TVA à payer', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17278, 'PCN2020-LUXEMBURG', 'LIABILIT', '461413', 0, 'TVA acomptes reçus', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17279, 'PCN2020-LUXEMBURG', 'LIABILIT', '461418', 0, 'TVA - Autres dettes', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17280, 'PCN2020-LUXEMBURG', 'LIABILIT', '461421', 0, 'Droits d’enregistrement', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17281, 'PCN2020-LUXEMBURG', 'LIABILIT', '461422', 0, 'Taxe d’abonnement', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17282, 'PCN2020-LUXEMBURG', 'LIABILIT', '461428', 0, 'Autres impôts indirects', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17283, 'PCN2020-LUXEMBURG', 'LIABILIT', '46148', 0, 'AED - Autres dettes', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17284, 'PCN2020-LUXEMBURG', 'LIABILIT', '46151', 0, 'TVA étrangères', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17285, 'PCN2020-LUXEMBURG', 'LIABILIT', '46158', 0, 'Autres impôts étrangers', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17286, 'PCN2020-LUXEMBURG', 'LIABILIT', '461611', 0, 'TVA AMONT', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17287, 'PCN2020-LUXEMBURG', 'LIABILIT', '4621', 0, 'Centre Commun de Sécurité Sociale (CCSS)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17288, 'PCN2020-LUXEMBURG', 'LIABILIT', '4622', 0, 'Organismes étrangers de sécurité sociale', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17289, 'PCN2020-LUXEMBURG', 'LIABILIT', '4628', 0, 'Autres organismes sociaux', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17290, 'PCN2020-LUXEMBURG', 'LIABILIT', '4711', 0, 'Dépôts et cautionnements reçus', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17291, 'PCN2020-LUXEMBURG', 'LIABILIT', '4712', 0, 'Dettes/ass. et act. (aut. qu’ent. liées)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17292, 'PCN2020-LUXEMBURG', 'LIABILIT', '4713', 0, 'Dettes / admin., gér., aut. org. assim.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17293, 'PCN2020-LUXEMBURG', 'LIABILIT', '4714', 0, 'De Franco Vincent', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17294, 'PCN2020-LUXEMBURG', 'LIABILIT', '47141', 0, 'Desloges Mickael', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17295, 'PCN2020-LUXEMBURG', 'LIABILIT', '4715', 0, 'Etat-Q.ém.gaz à eff.serre à rest.à l’ac.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17296, 'PCN2020-LUXEMBURG', 'LIABILIT', '47161', 0, 'Autres emprunts', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17297, 'PCN2020-LUXEMBURG', 'LIABILIT', '47162', 0, 'Dettes de leasing', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17298, 'PCN2020-LUXEMBURG', 'LIABILIT', '47163', 0, 'Rentes viagères', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17299, 'PCN2020-LUXEMBURG', 'LIABILIT', '47168', 0, 'Autres dettes assimilées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17300, 'PCN2020-LUXEMBURG', 'LIABILIT', '4717', 0, 'Instruments financiers dérivés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17301, 'PCN2020-LUXEMBURG', 'LIABILIT', '4718', 0, 'Autres dettes diverses', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17302, 'PCN2020-LUXEMBURG', 'LIABILIT', '4721', 0, 'Dépôts et cautionnements reçus', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17303, 'PCN2020-LUXEMBURG', 'LIABILIT', '4722', 0, 'Dettes/ass. et act. (aut. qu’ent. liées)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17304, 'PCN2020-LUXEMBURG', 'LIABILIT', '4723', 0, 'Dettes / admin., gér., aut. org. assim.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17305, 'PCN2020-LUXEMBURG', 'LIABILIT', '4724', 0, 'Dettes envers le personnel', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17306, 'PCN2020-LUXEMBURG', 'LIABILIT', '47261', 0, 'Autres emprunts', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17307, 'PCN2020-LUXEMBURG', 'LIABILIT', '47262', 0, 'Dettes de leasing', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17308, 'PCN2020-LUXEMBURG', 'LIABILIT', '47263', 0, 'Rentes viagères', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17309, 'PCN2020-LUXEMBURG', 'LIABILIT', '47268', 0, 'Autres dettes assimilées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17310, 'PCN2020-LUXEMBURG', 'LIABILIT', '4727', 0, 'Instruments financiers dérivés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17311, 'PCN2020-LUXEMBURG', 'LIABILIT', '4728', 0, 'Autres dettes diverses', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17312, 'PCN2020-LUXEMBURG', 'LIABILIT', '481', 0, 'Charges à report. (sur 1 ou plus. exer.)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17313, 'PCN2020-LUXEMBURG', 'LIABILIT', '482', 0, 'Produits à report.(sur 1 ou plus. exer.)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17314, 'PCN2020-LUXEMBURG', 'LIABILIT', '483', 0, 'Etat-Q.ém.gaz à eff.serre assim. ou all.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17315, 'PCN2020-LUXEMBURG', 'LIABILIT', '484', 0, 'Comptes transit. ou d’attente - Actif', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17316, 'PCN2020-LUXEMBURG', 'LIABILIT', '485', 0, 'Comptes transit. ou d’attente - Passif', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17317, 'PCN2020-LUXEMBURG', 'LIABILIT', '486', 0, 'Comptes de liaison (succursales) - Actif', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17318, 'PCN2020-LUXEMBURG', 'LIABILIT', '487', 0, 'Comptes de liaison (succurs.) - Passif', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17319, 'PCN2020-LUXEMBURG', 'ASSETS', '501', 0, 'Parts dans des entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17320, 'PCN2020-LUXEMBURG', 'ASSETS', '502', 0, 'Actions propres ou parts propres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17321, 'PCN2020-LUXEMBURG', 'ASSETS', '503', 0, 'Parts dans des entrep. lien particip.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17322, 'PCN2020-LUXEMBURG', 'ASSETS', '5081', 0, 'Actions - Titres cotés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17323, 'PCN2020-LUXEMBURG', 'ASSETS', '5082', 0, 'Actions - Titres non cotés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17324, 'PCN2020-LUXEMBURG', 'ASSETS', '5083', 0, 'Obl.,aut.cr.émis.par l’ent.rach.par elle', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17325, 'PCN2020-LUXEMBURG', 'ASSETS', '5084', 0, 'Obligations - Titres cotés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17326, 'PCN2020-LUXEMBURG', 'ASSETS', '5085', 0, 'Obligations - Titres non cotés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17327, 'PCN2020-LUXEMBURG', 'ASSETS', '5088', 0, 'Autres valeurs mobilières diverses', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17328, 'PCN2020-LUXEMBURG', 'ASSETS', '5131', 0, 'Raiffeisen LU83 - 6555', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17329, 'PCN2020-LUXEMBURG', 'ASSETS', '5132', 0, 'Banques et CCP : découverts', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17330, 'PCN2020-LUXEMBURG', 'ASSETS', '516', 0, 'Caisse', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17331, 'PCN2020-LUXEMBURG', 'ASSETS', '5171', 0, 'Virements internes : solde débiteur', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17332, 'PCN2020-LUXEMBURG', 'ASSETS', '5172', 0, 'Virements internes : solde créditeur', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17333, 'PCN2020-LUXEMBURG', 'ASSETS', '518', 0, 'Autres avoirs', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17334, 'PCN2020-LUXEMBURG', 'EXPENSE', '601', 0, 'Achats de matières premières', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17335, 'PCN2020-LUXEMBURG', 'EXPENSE', '60311', 0, 'Combustibles solides', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17336, 'PCN2020-LUXEMBURG', 'EXPENSE', '60312', 0, 'Combustibles liquides', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17337, 'PCN2020-LUXEMBURG', 'EXPENSE', '60313', 0, 'Gaz', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17338, 'PCN2020-LUXEMBURG', 'EXPENSE', '60314', 0, 'Eau et eaux usées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17339, 'PCN2020-LUXEMBURG', 'EXPENSE', '60315', 0, 'Electricité', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17340, 'PCN2020-LUXEMBURG', 'EXPENSE', '6032', 0, 'Produits d’entretien', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17341, 'PCN2020-LUXEMBURG', 'EXPENSE', '6033', 0, 'Fourn., pet.équip.-atelier, usine, maga.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17342, 'PCN2020-LUXEMBURG', 'EXPENSE', '6034', 0, 'Vêtements professionnels', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17343, 'PCN2020-LUXEMBURG', 'EXPENSE', '6035', 0, 'Fournitures administratives et de bureau', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17344, 'PCN2020-LUXEMBURG', 'EXPENSE', '6036', 0, 'Carburants', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17345, 'PCN2020-LUXEMBURG', 'EXPENSE', '6037', 0, 'Lubrifiants', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17346, 'PCN2020-LUXEMBURG', 'EXPENSE', '6038', 0, 'Autres fournitures consommables', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17347, 'PCN2020-LUXEMBURG', 'EXPENSE', '604', 0, 'Achats d’emballages', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17348, 'PCN2020-LUXEMBURG', 'EXPENSE', '6061', 0, 'Achats de marchandises', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17349, 'PCN2020-LUXEMBURG', 'EXPENSE', '6062', 0, 'Achats de terrains destinés à la revente', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17350, 'PCN2020-LUXEMBURG', 'EXPENSE', '6063', 0, 'Achats d’immeubles destinés à la revente', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17351, 'PCN2020-LUXEMBURG', 'EXPENSE', '6071', 0, 'Variation des stocks de matières prem.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17352, 'PCN2020-LUXEMBURG', 'EXPENSE', '6073', 0, 'Variation stks mat. et fournit. consomm.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17353, 'PCN2020-LUXEMBURG', 'EXPENSE', '6074', 0, 'Variation des stocks d’emballages', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17354, 'PCN2020-LUXEMBURG', 'EXPENSE', '60761', 0, 'Marchandises', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17355, 'PCN2020-LUXEMBURG', 'EXPENSE', '60762', 0, 'Terrains destinés à la revente', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17356, 'PCN2020-LUXEMBURG', 'EXPENSE', '60763', 0, 'Immeubles destinés à la revente', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17357, 'PCN2020-LUXEMBURG', 'EXPENSE', '60811', 0, 'Travail à façon', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17358, 'PCN2020-LUXEMBURG', 'EXPENSE', '60812', 0, 'Recherche et développement', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17359, 'PCN2020-LUXEMBURG', 'EXPENSE', '60813', 0, 'Frais d’architectes et d’ingénieurs', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17360, 'PCN2020-LUXEMBURG', 'EXPENSE', '60814', 0, 'Sous-trait. Incorp. aux ouvrag. et prod.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17361, 'PCN2020-LUXEMBURG', 'EXPENSE', '6082', 0, 'Aut. ach. mat. inco. aux ouvr. et prod.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17362, 'PCN2020-LUXEMBURG', 'EXPENSE', '6083', 0, 'Ach. quo. d’ém.gaz eff. serre et assim.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17363, 'PCN2020-LUXEMBURG', 'EXPENSE', '6088', 0, 'Autres achats incorp. aux ouvr. et prod.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17364, 'PCN2020-LUXEMBURG', 'EXPENSE', '6091', 0, 'RRR sur achats de matières premières', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17365, 'PCN2020-LUXEMBURG', 'EXPENSE', '6093', 0, 'RRR sur achats mat. et fourn. consomm.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17366, 'PCN2020-LUXEMBURG', 'EXPENSE', '6094', 0, 'RRR sur achats d’emballages', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17367, 'PCN2020-LUXEMBURG', 'EXPENSE', '6096', 0, 'RRR/ach.march., autr.biens dest. revente', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17368, 'PCN2020-LUXEMBURG', 'EXPENSE', '6098', 0, 'RRR / achats incorp. aux ouvra. et prod.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17369, 'PCN2020-LUXEMBURG', 'EXPENSE', '6099', 0, 'RRR non affectés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17370, 'PCN2020-LUXEMBURG', 'EXPENSE', '61111', 0, 'Terrains', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17371, 'PCN2020-LUXEMBURG', 'EXPENSE', '61112', 0, 'Constructions / Bâtiments', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17372, 'PCN2020-LUXEMBURG', 'EXPENSE', '61123', 0, 'Matériel roulant', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17373, 'PCN2020-LUXEMBURG', 'EXPENSE', '61128', 0, 'Autres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17374, 'PCN2020-LUXEMBURG', 'EXPENSE', '6113', 0, 'Charges locatives et de copropriété', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17375, 'PCN2020-LUXEMBURG', 'EXPENSE', '6114', 0, 'Leasing financier immobilier', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17376, 'PCN2020-LUXEMBURG', 'EXPENSE', '61153', 0, 'Matériel roulant', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17377, 'PCN2020-LUXEMBURG', 'EXPENSE', '61158', 0, 'Autres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17378, 'PCN2020-LUXEMBURG', 'EXPENSE', '6121', 0, 'S.-trait.géné.(non inc. aux ouv.et pro.)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17379, 'PCN2020-LUXEMBURG', 'EXPENSE', '61221', 0, 'Constructions / Bâtiments', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17380, 'PCN2020-LUXEMBURG', 'EXPENSE', '61223', 0, 'Matériel roulant', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17381, 'PCN2020-LUXEMBURG', 'EXPENSE', '61228', 0, 'Autres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17382, 'PCN2020-LUXEMBURG', 'EXPENSE', '6131', 0, 'Commissions et courtages', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17383, 'PCN2020-LUXEMBURG', 'EXPENSE', '61311', 0, 'CCSS Santé', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17384, 'PCN2020-LUXEMBURG', 'EXPENSE', '6132', 0, 'Services informatiques', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17385, 'PCN2020-LUXEMBURG', 'EXPENSE', '61332', 0, 'Frais sur émission d’emprunts', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17386, 'PCN2020-LUXEMBURG', 'EXPENSE', '61333', 0, 'Frais cpts,comm. banc.,drts garde/tit.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17387, 'PCN2020-LUXEMBURG', 'EXPENSE', '61334', 0, 'Frais sur moyens de paiements électro.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17388, 'PCN2020-LUXEMBURG', 'EXPENSE', '61336', 0, 'Rémunérations d’affacturage', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17389, 'PCN2020-LUXEMBURG', 'EXPENSE', '61338', 0, 'Aut.serv.banc.et ass.(<> int.&fr.assim.)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17390, 'PCN2020-LUXEMBURG', 'EXPENSE', '61341', 0, 'Honoraires juridiq.,de conten. et assim.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17391, 'PCN2020-LUXEMBURG', 'EXPENSE', '61342', 0, 'Honoraires compta.,fisc.,audit et assim.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17392, 'PCN2020-LUXEMBURG', 'EXPENSE', '61348', 0, 'Autres honoraires', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17393, 'PCN2020-LUXEMBURG', 'EXPENSE', '6135', 0, 'Frais d’actes notariés et assimilés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17394, 'PCN2020-LUXEMBURG', 'EXPENSE', '6138', 0, 'Aut. rémunérat. d’interméd., honoraires.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17395, 'PCN2020-LUXEMBURG', 'EXPENSE', '61411', 0, 'Constructions / Bâtiments', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17396, 'PCN2020-LUXEMBURG', 'EXPENSE', '61412', 0, 'Matériel roulant', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17397, 'PCN2020-LUXEMBURG', 'EXPENSE', '61418', 0, 'Autres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17398, 'PCN2020-LUXEMBURG', 'EXPENSE', '6142', 0, 'Assurance sur biens pris en location', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17399, 'PCN2020-LUXEMBURG', 'EXPENSE', '6143', 0, 'Assurance-transport', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17400, 'PCN2020-LUXEMBURG', 'EXPENSE', '6144', 0, 'Assurance risque d’exploitation', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17401, 'PCN2020-LUXEMBURG', 'EXPENSE', '6145', 0, 'Assurance insolvabilité clients', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17402, 'PCN2020-LUXEMBURG', 'EXPENSE', '6146', 0, 'Assurance responsabilité civile', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17403, 'PCN2020-LUXEMBURG', 'EXPENSE', '6148', 0, 'Autres assurances', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17404, 'PCN2020-LUXEMBURG', 'EXPENSE', '61511', 0, 'Annonces et insertions', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17405, 'PCN2020-LUXEMBURG', 'EXPENSE', '61512', 0, 'Echantillons', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17406, 'PCN2020-LUXEMBURG', 'EXPENSE', '61513', 0, 'Foires et expositions', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17407, 'PCN2020-LUXEMBURG', 'EXPENSE', '61514', 0, 'Cadeaux à la clientèle', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17408, 'PCN2020-LUXEMBURG', 'EXPENSE', '61515', 0, 'Catalogues et imprimés et publications', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17409, 'PCN2020-LUXEMBURG', 'EXPENSE', '61516', 0, 'Dons courants', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17410, 'PCN2020-LUXEMBURG', 'EXPENSE', '61517', 0, 'Sponsoring', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17411, 'PCN2020-LUXEMBURG', 'EXPENSE', '61518', 0, 'Autres achats de services publicitaires', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17412, 'PCN2020-LUXEMBURG', 'EXPENSE', '615211', 0, 'Direction(le cas éch. exploit.et assoc.)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17413, 'PCN2020-LUXEMBURG', 'EXPENSE', '615212', 0, 'Personnel', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17414, 'PCN2020-LUXEMBURG', 'EXPENSE', '61522', 0, 'Frais de déménagement de l’entreprise', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17415, 'PCN2020-LUXEMBURG', 'EXPENSE', '61523', 0, 'Missions', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17416, 'PCN2020-LUXEMBURG', 'EXPENSE', '61524', 0, 'Réceptions et frais de représentation', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17417, 'PCN2020-LUXEMBURG', 'EXPENSE', '61531', 0, 'Frais postaux', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17418, 'PCN2020-LUXEMBURG', 'EXPENSE', '61532', 0, 'Frais de télécommunication', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17419, 'PCN2020-LUXEMBURG', 'EXPENSE', '6161', 0, 'Transports sur achats', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17420, 'PCN2020-LUXEMBURG', 'EXPENSE', '6162', 0, 'Transports sur ventes', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17421, 'PCN2020-LUXEMBURG', 'EXPENSE', '6165', 0, 'Transports collectifs du personnel', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17422, 'PCN2020-LUXEMBURG', 'EXPENSE', '6168', 0, 'Autres transports', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17423, 'PCN2020-LUXEMBURG', 'EXPENSE', '6171', 0, 'Personnel intérimaire', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17424, 'PCN2020-LUXEMBURG', 'EXPENSE', '6172', 0, 'Personnel prêté à l’entreprise', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17425, 'PCN2020-LUXEMBURG', 'EXPENSE', '6181', 0, 'Documentation', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17426, 'PCN2020-LUXEMBURG', 'EXPENSE', '6182', 0, 'Frais format., colloq., sémin., confér.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17427, 'PCN2020-LUXEMBURG', 'EXPENSE', '6183', 0, 'Elimination déchets indust.& non indust.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17428, 'PCN2020-LUXEMBURG', 'EXPENSE', '61841', 0, 'Combustibles solides', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17429, 'PCN2020-LUXEMBURG', 'EXPENSE', '61842', 0, 'Combustibles liquid.(mazout, carbur,...)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17430, 'PCN2020-LUXEMBURG', 'EXPENSE', '61843', 0, 'Gaz', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17431, 'PCN2020-LUXEMBURG', 'EXPENSE', '61844', 0, 'Eau et eaux usées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17432, 'PCN2020-LUXEMBURG', 'EXPENSE', '61845', 0, 'Electricité', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17433, 'PCN2020-LUXEMBURG', 'EXPENSE', '61851', 0, 'Fournitures administratives et de bureau', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17434, 'PCN2020-LUXEMBURG', 'EXPENSE', '61852', 0, 'Petit équipement', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17435, 'PCN2020-LUXEMBURG', 'EXPENSE', '61853', 0, 'Vêtements professionnels', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17436, 'PCN2020-LUXEMBURG', 'EXPENSE', '61854', 0, 'Produits d’entretien', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17437, 'PCN2020-LUXEMBURG', 'EXPENSE', '61858', 0, 'Autres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17438, 'PCN2020-LUXEMBURG', 'EXPENSE', '6186', 0, 'Frais de surveillance et de gardiennage', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17439, 'PCN2020-LUXEMBURG', 'EXPENSE', '6187', 0, 'Cotisations aux associations profession.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17440, 'PCN2020-LUXEMBURG', 'EXPENSE', '6188', 0, 'Autres charges externes diverses', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17441, 'PCN2020-LUXEMBURG', 'EXPENSE', '619', 0, 'RRR obt.&non direct.déd.des autr.ch.ext.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17442, 'PCN2020-LUXEMBURG', 'EXPENSE', '62111', 0, 'Salaires de base', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17443, 'PCN2020-LUXEMBURG', 'EXPENSE', '621121', 0, 'Dimanche', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17444, 'PCN2020-LUXEMBURG', 'EXPENSE', '621122', 0, 'Jours fériés légaux', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17445, 'PCN2020-LUXEMBURG', 'EXPENSE', '621123', 0, 'Heures supplémentaires', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17446, 'PCN2020-LUXEMBURG', 'EXPENSE', '621128', 0, 'Autres suppléments', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17447, 'PCN2020-LUXEMBURG', 'EXPENSE', '62114', 0, 'Gratifications, primes et commissions', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17448, 'PCN2020-LUXEMBURG', 'EXPENSE', '62115', 0, 'Avantages en nature', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17449, 'PCN2020-LUXEMBURG', 'EXPENSE', '62116', 0, 'Indemnités de licenciement', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17450, 'PCN2020-LUXEMBURG', 'EXPENSE', '62117', 0, 'Trimestre de faveur', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17451, 'PCN2020-LUXEMBURG', 'EXPENSE', '6218', 0, 'Autres avantages', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17452, 'PCN2020-LUXEMBURG', 'EXPENSE', '6219', 0, 'Remboursements sur salaires', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17453, 'PCN2020-LUXEMBURG', 'EXPENSE', '6221', 0, 'Etudiants', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17454, 'PCN2020-LUXEMBURG', 'EXPENSE', '6222', 0, 'Salaires occasionnels', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17455, 'PCN2020-LUXEMBURG', 'EXPENSE', '6228', 0, 'Autres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17456, 'PCN2020-LUXEMBURG', 'EXPENSE', '6231', 0, 'Charges sociales couvrant les pensions', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17457, 'PCN2020-LUXEMBURG', 'EXPENSE', '62311', 0, 'CCSS', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17458, 'PCN2020-LUXEMBURG', 'EXPENSE', '62312', 0, 'Caisse nationale de pension', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17459, 'PCN2020-LUXEMBURG', 'EXPENSE', '6232', 0, 'Autr.ch.soc.(inclus maladie, accid.,...)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17460, 'PCN2020-LUXEMBURG', 'EXPENSE', '62411', 0, 'Primes à des fonds de pensions extérieur', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17461, 'PCN2020-LUXEMBURG', 'EXPENSE', '62412', 0, 'Variations / prov. pour pensions compl.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17462, 'PCN2020-LUXEMBURG', 'EXPENSE', '62413', 0, 'Retenue d’impôt sur pension complément.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17463, 'PCN2020-LUXEMBURG', 'EXPENSE', '62414', 0, 'Prime d’assurance insolvabilité', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17464, 'PCN2020-LUXEMBURG', 'EXPENSE', '62415', 0, 'Pensions complém.versées par l’employeur', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17465, 'PCN2020-LUXEMBURG', 'EXPENSE', '6248', 0, 'Autr. frais de perso.non visés ci-dessus', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17466, 'PCN2020-LUXEMBURG', 'EXPENSE', '6311', 0, 'DCV sur frais de constit. & 1er établis.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17467, 'PCN2020-LUXEMBURG', 'EXPENSE', '6313', 0, 'DCV frais augm.capit.&d’opér.div.(F,S,T)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17468, 'PCN2020-LUXEMBURG', 'EXPENSE', '6314', 0, 'DCV sur frais d’émission d’emprunts', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17469, 'PCN2020-LUXEMBURG', 'EXPENSE', '6318', 0, 'DCV sur autres frais assimilés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17470, 'PCN2020-LUXEMBURG', 'EXPENSE', '6321', 0, 'DCV sur frais de développement', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17471, 'PCN2020-LUXEMBURG', 'EXPENSE', '6322', 0, 'DCV/conc.,brev.,lic.,marq.,drt&vals sim.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17472, 'PCN2020-LUXEMBURG', 'EXPENSE', '6323', 0, 'DCV/fonds de comm. si acq. à titre onér.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17473, 'PCN2020-LUXEMBURG', 'EXPENSE', '6324', 0, 'DCV/acomp. versés&immo, incorp. en cours', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17474, 'PCN2020-LUXEMBURG', 'EXPENSE', '63311', 0, 'DCV sur terrains', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17475, 'PCN2020-LUXEMBURG', 'EXPENSE', '63312', 0, 'DCV/agencements et aménag. de terrains', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17476, 'PCN2020-LUXEMBURG', 'EXPENSE', '63313', 0, 'DCV sur constructions / bâtiments', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17477, 'PCN2020-LUXEMBURG', 'EXPENSE', '63314', 0, 'DCV sur agencem.&aménag. constr./bâtim.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17478, 'PCN2020-LUXEMBURG', 'EXPENSE', '63315', 0, 'AJV sur immeubles de placement', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17479, 'PCN2020-LUXEMBURG', 'EXPENSE', '6332', 0, 'DCV sur install. techniques et machines', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17480, 'PCN2020-LUXEMBURG', 'EXPENSE', '6333', 0, 'DCV/aut. Install.,outill.,mob.,mat.roul.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17481, 'PCN2020-LUXEMBURG', 'EXPENSE', '6334', 0, 'DCV/acom. versés et immo. copr. en cours', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17482, 'PCN2020-LUXEMBURG', 'EXPENSE', '6341', 0, 'DCV sur stocks de mat. prem. et consomm.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17483, 'PCN2020-LUXEMBURG', 'EXPENSE', '6342', 0, 'DCV/stks prod. en c. fab. et comm. en c.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17484, 'PCN2020-LUXEMBURG', 'EXPENSE', '6343', 0, 'DCV sur stocks de produits', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17485, 'PCN2020-LUXEMBURG', 'EXPENSE', '6344', 0, 'DCV/stks de march.&aut.biens dest. vente', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17486, 'PCN2020-LUXEMBURG', 'EXPENSE', '6345', 0, 'DCV sur acomptes versés sur stocks', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17487, 'PCN2020-LUXEMBURG', 'EXPENSE', '6351', 0, 'DCV/créan. résult. de ventes&prest serv.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17488, 'PCN2020-LUXEMBURG', 'EXPENSE', '6352', 0, 'DCV/créan./entrep. liées&liens de part.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17489, 'PCN2020-LUXEMBURG', 'EXPENSE', '6353', 0, 'DCV sur autres créances', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17490, 'PCN2020-LUXEMBURG', 'EXPENSE', '6354', 0, 'AJV sur créances de l’actif circulant', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17491, 'PCN2020-LUXEMBURG', 'EXPENSE', '6411', 0, 'Concessions', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17492, 'PCN2020-LUXEMBURG', 'EXPENSE', '6412', 0, 'Brevets', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17493, 'PCN2020-LUXEMBURG', 'EXPENSE', '6413', 0, 'Licences informatiques', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17494, 'PCN2020-LUXEMBURG', 'EXPENSE', '6414', 0, 'Marques et franchises', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17495, 'PCN2020-LUXEMBURG', 'EXPENSE', '64151', 0, 'Droits d’auteur et de reproduction', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17496, 'PCN2020-LUXEMBURG', 'EXPENSE', '64158', 0, 'Autres droits et valeurs similaires', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17497, 'PCN2020-LUXEMBURG', 'EXPENSE', '642', 0, 'Indemnités, dommages et intérêts', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17498, 'PCN2020-LUXEMBURG', 'EXPENSE', '6431', 0, 'Jetons de présence', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17499, 'PCN2020-LUXEMBURG', 'EXPENSE', '6432', 0, 'Tantièmes', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17500, 'PCN2020-LUXEMBURG', 'EXPENSE', '6438', 0, 'Autres rémunérations assimilées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17501, 'PCN2020-LUXEMBURG', 'EXPENSE', '64411', 0, 'Valeur comptable d’immo. incorp. cédées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17502, 'PCN2020-LUXEMBURG', 'EXPENSE', '64412', 0, 'Produits de cession d’immo. incorp.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17503, 'PCN2020-LUXEMBURG', 'EXPENSE', '64421', 0, 'Valeur comptable d’immo. corp. cédées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17504, 'PCN2020-LUXEMBURG', 'EXPENSE', '64422', 0, 'Produits de cession d’immo. corp.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17505, 'PCN2020-LUXEMBURG', 'EXPENSE', '6451', 0, 'Créan. résult. de ventes et prest. serv.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17506, 'PCN2020-LUXEMBURG', 'EXPENSE', '6452', 0, 'Créances sur des entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17507, 'PCN2020-LUXEMBURG', 'EXPENSE', '6453', 0, 'Créances sur des entrep. lien part.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17508, 'PCN2020-LUXEMBURG', 'EXPENSE', '6454', 0, 'Autres créances', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17509, 'PCN2020-LUXEMBURG', 'EXPENSE', '6461', 0, 'Impôt foncier', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17510, 'PCN2020-LUXEMBURG', 'EXPENSE', '6462', 0, 'TVA non récupérable', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17511, 'PCN2020-LUXEMBURG', 'EXPENSE', '6463', 0, 'Drts / les march. en prov. de l’étranger', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17512, 'PCN2020-LUXEMBURG', 'EXPENSE', '6464', 0, 'Drts accises à la prod. & taxe de conso.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17513, 'PCN2020-LUXEMBURG', 'EXPENSE', '64651', 0, 'Droits d’enregistrement', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17514, 'PCN2020-LUXEMBURG', 'EXPENSE', '64658', 0, 'Autr.Drts d’enreg.&timbre,drts d’hypoth.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17515, 'PCN2020-LUXEMBURG', 'EXPENSE', '6466', 0, 'Taxes sur les véhicules', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17516, 'PCN2020-LUXEMBURG', 'EXPENSE', '6467', 0, 'Taxe de cabaretage', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17517, 'PCN2020-LUXEMBURG', 'EXPENSE', '6468', 0, 'Autres droits et taxes', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17518, 'PCN2020-LUXEMBURG', 'EXPENSE', '647', 0, 'Dotations aux plus-values immunisées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17519, 'PCN2020-LUXEMBURG', 'EXPENSE', '6481', 0, 'Amendes, sanctions et pénalités', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17520, 'PCN2020-LUXEMBURG', 'EXPENSE', '6488', 0, 'Charges d’exploitation diverses', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17521, 'PCN2020-LUXEMBURG', 'EXPENSE', '6491', 0, 'Dotations aux provisions pour impôts', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17522, 'PCN2020-LUXEMBURG', 'EXPENSE', '6492', 0, 'Dotations aux provisions d’exploitation', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17523, 'PCN2020-LUXEMBURG', 'EXPENSE', '65111', 0, 'DCV sur parts dans des entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17524, 'PCN2020-LUXEMBURG', 'EXPENSE', '65112', 0, 'DCV sur créan. sur des entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17525, 'PCN2020-LUXEMBURG', 'EXPENSE', '65113', 0, 'DCV sur participations', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17526, 'PCN2020-LUXEMBURG', 'EXPENSE', '65114', 0, 'DCV / créan. / des entr. lien particip.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17527, 'PCN2020-LUXEMBURG', 'EXPENSE', '65115', 0, 'DCV sur titres ayant le caract. d’immo.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17528, 'PCN2020-LUXEMBURG', 'EXPENSE', '65116', 0, 'DCV sur prêts, dépôts et créances immob.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17529, 'PCN2020-LUXEMBURG', 'EXPENSE', '6512', 0, 'AJV sur immobilisations financières', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17530, 'PCN2020-LUXEMBURG', 'EXPENSE', '65211', 0, 'Parts dans des entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17531, 'PCN2020-LUXEMBURG', 'EXPENSE', '65212', 0, 'Créances sur des entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17532, 'PCN2020-LUXEMBURG', 'EXPENSE', '65213', 0, 'Participations', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17533, 'PCN2020-LUXEMBURG', 'EXPENSE', '65214', 0, 'Créances sur des entrep. lien part.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17534, 'PCN2020-LUXEMBURG', 'EXPENSE', '65215', 0, 'Titres ayant le caractère d’immob.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17535, 'PCN2020-LUXEMBURG', 'EXPENSE', '65216', 0, 'Prêts, dépôts et créances immobilisés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17536, 'PCN2020-LUXEMBURG', 'EXPENSE', '652211', 0, 'Val. compt. parts cédées dans entr.liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17537, 'PCN2020-LUXEMBURG', 'EXPENSE', '652212', 0, 'Produits cession parts dans entr. liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17538, 'PCN2020-LUXEMBURG', 'EXPENSE', '652221', 0, 'Val. compt. créances cédées/entr. liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17539, 'PCN2020-LUXEMBURG', 'EXPENSE', '652222', 0, 'Prod. de cession de créan./entrep. liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17540, 'PCN2020-LUXEMBURG', 'EXPENSE', '652231', 0, 'Valeur comptable de participation cédée', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17541, 'PCN2020-LUXEMBURG', 'EXPENSE', '652232', 0, 'Produits de cession de participations', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17542, 'PCN2020-LUXEMBURG', 'EXPENSE', '652241', 0, 'Val.compt. créan. cédées/entr.lien part.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17543, 'PCN2020-LUXEMBURG', 'EXPENSE', '652242', 0, 'Prod. cess. créan. / entr. lien. part.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17544, 'PCN2020-LUXEMBURG', 'EXPENSE', '652251', 0, 'Val.compt. titr. cédés ayant carac.immo.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17545, 'PCN2020-LUXEMBURG', 'EXPENSE', '652252', 0, 'Prod. de cess. titr. ayant carac. immo.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17546, 'PCN2020-LUXEMBURG', 'EXPENSE', '652261', 0, 'Val.compt. prêts,dép.,créan. immo. cédés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17547, 'PCN2020-LUXEMBURG', 'EXPENSE', '652262', 0, 'Prod. de cess. prêts,dép.,créan. immob.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17548, 'PCN2020-LUXEMBURG', 'EXPENSE', '65311', 0, 'DCV sur parts dans des entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17549, 'PCN2020-LUXEMBURG', 'EXPENSE', '65312', 0, 'DCV sur actions propres ou parts propres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17550, 'PCN2020-LUXEMBURG', 'EXPENSE', '65313', 0, 'DCV sur parts dans des entr. lien part.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17551, 'PCN2020-LUXEMBURG', 'EXPENSE', '65318', 0, 'DCV sur autres valeurs mobilières', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17552, 'PCN2020-LUXEMBURG', 'EXPENSE', '6532', 0, 'AJV sur valeurs mobilières', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17553, 'PCN2020-LUXEMBURG', 'EXPENSE', '65411', 0, 'sur des entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17554, 'PCN2020-LUXEMBURG', 'EXPENSE', '65412', 0, 'sur des entrepr. lien participation', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17555, 'PCN2020-LUXEMBURG', 'EXPENSE', '65413', 0, 'sur autres créances de l’actif circulant', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17556, 'PCN2020-LUXEMBURG', 'EXPENSE', '65421', 0, 'Parts dans des entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17557, 'PCN2020-LUXEMBURG', 'EXPENSE', '65422', 0, 'Actions propres ou parts propres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17558, 'PCN2020-LUXEMBURG', 'EXPENSE', '65423', 0, 'Parts dans des entrepr. lien particip.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17559, 'PCN2020-LUXEMBURG', 'EXPENSE', '65428', 0, 'Autres valeurs mobilières', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17560, 'PCN2020-LUXEMBURG', 'EXPENSE', '65511', 0, 'Int. sur emprunts obligat. - entr. liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17561, 'PCN2020-LUXEMBURG', 'EXPENSE', '65512', 0, 'Intérêts sur emprunts obligat. - autres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17562, 'PCN2020-LUXEMBURG', 'EXPENSE', '65521', 0, 'Intérêts sur comptes bancaires', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17563, 'PCN2020-LUXEMBURG', 'EXPENSE', '65522', 0, 'Intérêts bancaires sur opérat. de finan.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17564, 'PCN2020-LUXEMBURG', 'EXPENSE', '655231', 0, 'Int. sur leasings finan. - entrep. liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17565, 'PCN2020-LUXEMBURG', 'EXPENSE', '655232', 0, 'Intérêts sur leasing financier - autres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17566, 'PCN2020-LUXEMBURG', 'EXPENSE', '6553', 0, 'Intérêts sur dettes commerciales', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17567, 'PCN2020-LUXEMBURG', 'EXPENSE', '65541', 0, 'Intérêts sur des entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17568, 'PCN2020-LUXEMBURG', 'EXPENSE', '65542', 0, 'Intérêts sur des entrepr. lien particip.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17569, 'PCN2020-LUXEMBURG', 'EXPENSE', '65551', 0, 'Escomp. et fr./eff. de comm.-entr. liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17570, 'PCN2020-LUXEMBURG', 'EXPENSE', '65552', 0, 'Escomp. et fr./effets de comm. - autres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17571, 'PCN2020-LUXEMBURG', 'EXPENSE', '65561', 0, 'Escomptes accordés - entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17572, 'PCN2020-LUXEMBURG', 'EXPENSE', '65562', 0, 'Escomptes accordés - autres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17573, 'PCN2020-LUXEMBURG', 'EXPENSE', '65581', 0, 'Int./autres emprunts&dettes-entr. liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17574, 'PCN2020-LUXEMBURG', 'EXPENSE', '65582', 0, 'Int./autres emprunts&dettes - autres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17575, 'PCN2020-LUXEMBURG', 'EXPENSE', '6561', 0, 'Pertes de change - entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17576, 'PCN2020-LUXEMBURG', 'EXPENSE', '6562', 0, 'Pertes de change - autres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17577, 'PCN2020-LUXEMBURG', 'EXPENSE', '657', 0, 'Quote-p. dans perte entr. mises équival.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17578, 'PCN2020-LUXEMBURG', 'EXPENSE', '6581', 0, 'Aut. charges financières - entrep. liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17579, 'PCN2020-LUXEMBURG', 'EXPENSE', '6582', 0, 'Autres charges financières - autres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17580, 'PCN2020-LUXEMBURG', 'EXPENSE', '6591', 0, 'Dot. aux provisions fin. - entr. liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17581, 'PCN2020-LUXEMBURG', 'EXPENSE', '6592', 0, 'Dot. aux provisions fin. - autres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17582, 'PCN2020-LUXEMBURG', 'EXPENSE', '6711', 0, 'IRC - exercice courant', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17583, 'PCN2020-LUXEMBURG', 'EXPENSE', '6712', 0, 'IRC - exercices antérieurs', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17584, 'PCN2020-LUXEMBURG', 'EXPENSE', '6721', 0, 'ICC - exercice courant', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17585, 'PCN2020-LUXEMBURG', 'EXPENSE', '6722', 0, 'ICC - exercices antérieurs', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17586, 'PCN2020-LUXEMBURG', 'EXPENSE', '6731', 0, 'Retenues d’impôt à la source', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17587, 'PCN2020-LUXEMBURG', 'EXPENSE', '67321', 0, 'Exercice courant', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17588, 'PCN2020-LUXEMBURG', 'EXPENSE', '67322', 0, 'Exercices antérieurs', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17589, 'PCN2020-LUXEMBURG', 'EXPENSE', '6733', 0, 'Impôts supportés par entrep. non résid.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17590, 'PCN2020-LUXEMBURG', 'EXPENSE', '6738', 0, 'Autres impôts étrangers sur le résultat', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17591, 'PCN2020-LUXEMBURG', 'EXPENSE', '679', 0, 'Dot. aux provisions pour impôts différés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17592, 'PCN2020-LUXEMBURG', 'EXPENSE', '6811', 0, 'IF - exercice courant', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17593, 'PCN2020-LUXEMBURG', 'EXPENSE', '6812', 0, 'IF - exercices antérieurs', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17594, 'PCN2020-LUXEMBURG', 'EXPENSE', '682', 0, 'Taxe d’abonnement', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17595, 'PCN2020-LUXEMBURG', 'EXPENSE', '683', 0, 'Impôts étrangers', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17596, 'PCN2020-LUXEMBURG', 'EXPENSE', '688', 0, 'Autres impôts', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17597, 'PCN2020-LUXEMBURG', 'INCOME', '7021', 0, 'Ventes de produits finis', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17598, 'PCN2020-LUXEMBURG', 'INCOME', '7022', 0, 'Ventes de produits intermédiaires', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17599, 'PCN2020-LUXEMBURG', 'INCOME', '7023', 0, 'Ventes de produits résiduels', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17600, 'PCN2020-LUXEMBURG', 'INCOME', '7029', 0, 'Ventes de produits en cours de fabric.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17601, 'PCN2020-LUXEMBURG', 'INCOME', '70311', 0, 'Concessions', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17602, 'PCN2020-LUXEMBURG', 'INCOME', '70312', 0, 'Brevets', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17603, 'PCN2020-LUXEMBURG', 'INCOME', '70313', 0, 'Licences informatiques', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17604, 'PCN2020-LUXEMBURG', 'INCOME', '70314', 0, 'Marques et franchises', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17605, 'PCN2020-LUXEMBURG', 'INCOME', '703151', 0, 'Droits d’auteur et de reproduction', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17606, 'PCN2020-LUXEMBURG', 'INCOME', '703158', 0, 'Autres droits et valeurs similaires', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17607, 'PCN2020-LUXEMBURG', 'INCOME', '70321', 0, 'Revenus de location immobilière', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17608, 'PCN2020-LUXEMBURG', 'INCOME', '70322', 0, 'Revenus de location mobilière', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17609, 'PCN2020-LUXEMBURG', 'INCOME', '7033', 0, 'Prest. de serv. non visées ci-dessus', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17610, 'PCN2020-LUXEMBURG', 'INCOME', '7039', 0, 'Prestations de serv. en cours de réalis.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17611, 'PCN2020-LUXEMBURG', 'INCOME', '704', 0, 'Ventes d’emballages', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17612, 'PCN2020-LUXEMBURG', 'INCOME', '705', 0, 'Commissions et courtages obtenus', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17613, 'PCN2020-LUXEMBURG', 'INCOME', '7061', 0, 'Ventes de marchandises', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17614, 'PCN2020-LUXEMBURG', 'INCOME', '7062', 0, 'Ventes de terrains destinés à la revente', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17615, 'PCN2020-LUXEMBURG', 'INCOME', '7063', 0, 'Ventes d’immeubles destinés à la revente', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17616, 'PCN2020-LUXEMBURG', 'INCOME', '708', 0, 'Autres éléments du chiffre d’affaires', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17617, 'PCN2020-LUXEMBURG', 'INCOME', '7092', 0, 'RRR sur ventes de produits', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17618, 'PCN2020-LUXEMBURG', 'INCOME', '7093', 0, 'RRR sur prestations de services', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17619, 'PCN2020-LUXEMBURG', 'INCOME', '7094', 0, 'RRR sur ventes d’emballages', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17620, 'PCN2020-LUXEMBURG', 'INCOME', '7095', 0, 'RRR sur commissions et courtages', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17621, 'PCN2020-LUXEMBURG', 'INCOME', '7096', 0, 'RRR sur vent.march.&aut.biens dest. rev.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17622, 'PCN2020-LUXEMBURG', 'INCOME', '7098', 0, 'RRR sur autres éléments du ch. d’affaire', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17623, 'PCN2020-LUXEMBURG', 'INCOME', '7099', 0, 'RRR non affectés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17624, 'PCN2020-LUXEMBURG', 'INCOME', '7111', 0, 'Var. stks prod. en cours de fabric.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17625, 'PCN2020-LUXEMBURG', 'INCOME', '7112', 0, 'Var. stks : comm. en cours - produits', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17626, 'PCN2020-LUXEMBURG', 'INCOME', '7113', 0, 'Var. stks : comm. en cours - pres. serv.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17627, 'PCN2020-LUXEMBURG', 'INCOME', '7114', 0, 'Variation des stks : immeub. en constru.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17628, 'PCN2020-LUXEMBURG', 'INCOME', '7121', 0, 'Variation des stocks de produits finis', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17629, 'PCN2020-LUXEMBURG', 'INCOME', '7122', 0, 'Variation des stks prod. intermédiaires', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17630, 'PCN2020-LUXEMBURG', 'INCOME', '7123', 0, 'Variation des stocks de produits résidu.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17631, 'PCN2020-LUXEMBURG', 'INCOME', '7211', 0, 'Frais de développement', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17632, 'PCN2020-LUXEMBURG', 'INCOME', '72121', 0, 'Concessions', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17633, 'PCN2020-LUXEMBURG', 'INCOME', '72122', 0, 'Brevets', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17634, 'PCN2020-LUXEMBURG', 'INCOME', '72123', 0, 'Licences informatiques', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17635, 'PCN2020-LUXEMBURG', 'INCOME', '72124', 0, 'Marques et franchises', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17636, 'PCN2020-LUXEMBURG', 'INCOME', '721251', 0, 'Droits d’auteur et de reproduction', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17637, 'PCN2020-LUXEMBURG', 'INCOME', '721258', 0, 'Autres droits et valeurs similaires', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17638, 'PCN2020-LUXEMBURG', 'INCOME', '7221', 0, 'Terrains, aménagements et constructions', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17639, 'PCN2020-LUXEMBURG', 'INCOME', '7222', 0, 'Installations techniques et machines', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17640, 'PCN2020-LUXEMBURG', 'INCOME', '7223', 0, 'Aut. install., outill., mob, mat. roul.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17641, 'PCN2020-LUXEMBURG', 'INCOME', '7321', 0, 'RCV sur frais de développement', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17642, 'PCN2020-LUXEMBURG', 'INCOME', '7322', 0, 'RV/conc.,brev.,licen.,marq.,drt&val.sim.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17643, 'PCN2020-LUXEMBURG', 'INCOME', '7324', 0, 'RV/acomp. versés&immob. incorp. en cours', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17644, 'PCN2020-LUXEMBURG', 'INCOME', '73311', 0, 'RV sur terrains', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17645, 'PCN2020-LUXEMBURG', 'INCOME', '73312', 0, 'RV sur agencements, aménag. de terrains', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17646, 'PCN2020-LUXEMBURG', 'INCOME', '73313', 0, 'RCV sur constructions / bâtiments', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17647, 'PCN2020-LUXEMBURG', 'INCOME', '73314', 0, 'RV sur agenc., aménag de constr., bâtim.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17648, 'PCN2020-LUXEMBURG', 'INCOME', '73315', 0, 'AJV sur immeubles de placement', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17649, 'PCN2020-LUXEMBURG', 'INCOME', '7332', 0, 'RV sur installations techni. et machin.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17650, 'PCN2020-LUXEMBURG', 'INCOME', '7333', 0, 'RV/aut. instal.,outill.,mobil.,mat.roul.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17651, 'PCN2020-LUXEMBURG', 'INCOME', '7334', 0, 'RV/acompt. versés et immo.copr. en cours', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17652, 'PCN2020-LUXEMBURG', 'INCOME', '7341', 0, 'RV sur stocks de mat. prem. et consomm.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17653, 'PCN2020-LUXEMBURG', 'INCOME', '7342', 0, 'RV/stks prod.en cours fab.&comm.en cours', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17654, 'PCN2020-LUXEMBURG', 'INCOME', '7343', 0, 'RCV sur stocks de produits', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17655, 'PCN2020-LUXEMBURG', 'INCOME', '7344', 0, 'RV/stks march.&aut. biens dest.à revente', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17656, 'PCN2020-LUXEMBURG', 'INCOME', '7345', 0, 'RCV sur acomptes versés sur stocks', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17657, 'PCN2020-LUXEMBURG', 'INCOME', '7351', 0, 'RV/créan. résult. de ventes&prest. serv.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17658, 'PCN2020-LUXEMBURG', 'INCOME', '7352', 0, 'RV/créan./entr. liées & entr. lien part.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17659, 'PCN2020-LUXEMBURG', 'INCOME', '7353', 0, 'RCV sur autres créances', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17660, 'PCN2020-LUXEMBURG', 'INCOME', '7354', 0, 'AV sur créances de l’actif circulant', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17661, 'PCN2020-LUXEMBURG', 'INCOME', '7411', 0, 'Concessions', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17662, 'PCN2020-LUXEMBURG', 'INCOME', '7412', 0, 'Brevets', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17663, 'PCN2020-LUXEMBURG', 'INCOME', '7413', 0, 'Licences informatiques', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17664, 'PCN2020-LUXEMBURG', 'INCOME', '7414', 0, 'Marques et franchises', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17665, 'PCN2020-LUXEMBURG', 'INCOME', '74151', 0, 'Droits d’auteur et de reproduction', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17666, 'PCN2020-LUXEMBURG', 'INCOME', '74158', 0, 'Autres droits et valeurs similaires', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17667, 'PCN2020-LUXEMBURG', 'INCOME', '7421', 0, 'Revenus de location immobilière', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17668, 'PCN2020-LUXEMBURG', 'INCOME', '7422', 0, 'Revenus de location mobilière', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17669, 'PCN2020-LUXEMBURG', 'INCOME', '743', 0, 'Jetons de prés., tantièm., rémun. assim.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17670, 'PCN2020-LUXEMBURG', 'INCOME', '74411', 0, 'Valeur comptable d’immo. incorp. cédées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17671, 'PCN2020-LUXEMBURG', 'INCOME', '74412', 0, 'Produits de cession d’immo. incopr.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17672, 'PCN2020-LUXEMBURG', 'INCOME', '74421', 0, 'Valeur comptable d’immo. corp. cédées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17673, 'PCN2020-LUXEMBURG', 'INCOME', '74422', 0, 'Produits de cession d’immo. corp.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17674, 'PCN2020-LUXEMBURG', 'INCOME', '7451', 0, 'Subventions sur produits', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17675, 'PCN2020-LUXEMBURG', 'INCOME', '7452', 0, 'Bonifications d’intérêt', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17676, 'PCN2020-LUXEMBURG', 'INCOME', '7453', 0, 'Indemnités compensatoires', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17677, 'PCN2020-LUXEMBURG', 'INCOME', '7454', 0, 'Subventions destinées à promouv. emploi', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17678, 'PCN2020-LUXEMBURG', 'INCOME', '7458', 0, 'Autres subventions d’exploitation', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17679, 'PCN2020-LUXEMBURG', 'INCOME', '746', 0, 'Avantages en nature', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17680, 'PCN2020-LUXEMBURG', 'INCOME', '7471', 0, 'Plus-values immunisées non réinvesties', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17681, 'PCN2020-LUXEMBURG', 'INCOME', '7472', 0, 'Plus-values immunisées réinvesties', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17682, 'PCN2020-LUXEMBURG', 'INCOME', '7473', 0, 'Subventions d’investissement en capital', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17683, 'PCN2020-LUXEMBURG', 'INCOME', '7481', 0, 'Indemnités d’assurance', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17684, 'PCN2020-LUXEMBURG', 'INCOME', '7488', 0, 'Produits d’exploitation divers', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17685, 'PCN2020-LUXEMBURG', 'INCOME', '748801', 0, 'Remboursement mutualité', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17686, 'PCN2020-LUXEMBURG', 'INCOME', '7491', 0, 'Reprises de provisions pour impôts', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17687, 'PCN2020-LUXEMBURG', 'INCOME', '7492', 0, 'Reprises de provisions d’exploitation', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17688, 'PCN2020-LUXEMBURG', 'INCOME', '75111', 0, 'RV sur parts dans des entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17689, 'PCN2020-LUXEMBURG', 'INCOME', '75112', 0, 'RV sur créances / des entreprises liés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17690, 'PCN2020-LUXEMBURG', 'INCOME', '75113', 0, 'RV sur participations', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17691, 'PCN2020-LUXEMBURG', 'INCOME', '75114', 0, 'RV sur créances sur entr. lien part.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17692, 'PCN2020-LUXEMBURG', 'INCOME', '75115', 0, 'RV sur titres ayant le caractère d’immo.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17693, 'PCN2020-LUXEMBURG', 'INCOME', '75116', 0, 'RV sur prêts, dépôts et créances immob.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17694, 'PCN2020-LUXEMBURG', 'INCOME', '7512', 0, 'AJV sur immobilisations financières', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17695, 'PCN2020-LUXEMBURG', 'INCOME', '75211', 0, 'Parts dans des entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17696, 'PCN2020-LUXEMBURG', 'INCOME', '75212', 0, 'Créances sur des entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17697, 'PCN2020-LUXEMBURG', 'INCOME', '75213', 0, 'Participations', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17698, 'PCN2020-LUXEMBURG', 'INCOME', '75214', 0, 'Créances sur des entrep. lien part.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17699, 'PCN2020-LUXEMBURG', 'INCOME', '75215', 0, 'Titres ayant le caractère d’immob.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17700, 'PCN2020-LUXEMBURG', 'INCOME', '75216', 0, 'Prêts, dépôts et créances immobilisés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17701, 'PCN2020-LUXEMBURG', 'INCOME', '752211', 0, 'Val. compt. parts cédées dans entr.liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17702, 'PCN2020-LUXEMBURG', 'INCOME', '752212', 0, 'Prod. de cession parts dans entr. liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17703, 'PCN2020-LUXEMBURG', 'INCOME', '752221', 0, 'Val. compt. de créan. cédées/entr. liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17704, 'PCN2020-LUXEMBURG', 'INCOME', '752222', 0, 'Prod. de cession créan./des entr. liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17705, 'PCN2020-LUXEMBURG', 'INCOME', '752231', 0, 'Valeur comptable de participation cédée', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17706, 'PCN2020-LUXEMBURG', 'INCOME', '752232', 0, 'Produits de cession de participations', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17707, 'PCN2020-LUXEMBURG', 'INCOME', '752241', 0, 'Val.compt. créan. cédées/entr.lien part.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17708, 'PCN2020-LUXEMBURG', 'INCOME', '752242', 0, 'Produits cess. de créan./entr.lien part.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17709, 'PCN2020-LUXEMBURG', 'INCOME', '752251', 0, 'Val.compt.titre cédé ayant caract.immo.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17710, 'PCN2020-LUXEMBURG', 'INCOME', '752252', 0, 'Prod. cess. titres ayant caract. d’immo.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17711, 'PCN2020-LUXEMBURG', 'INCOME', '752261', 0, 'Val.comp. prêts,dépôt,créan.immo. cédés', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17712, 'PCN2020-LUXEMBURG', 'INCOME', '752262', 0, 'Prod. cess. prêts, dépôts, créan. immob.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17713, 'PCN2020-LUXEMBURG', 'INCOME', '75311', 0, 'RV sur parts dans des entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17714, 'PCN2020-LUXEMBURG', 'INCOME', '75312', 0, 'RV sur actions propres ou parts propres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17715, 'PCN2020-LUXEMBURG', 'INCOME', '75313', 0, 'RV sur parts dans des entr. lien part.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17716, 'PCN2020-LUXEMBURG', 'INCOME', '75318', 0, 'RV sur autres valeurs mobilières', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17717, 'PCN2020-LUXEMBURG', 'INCOME', '7532', 0, 'AJV sur valeurs mobilières', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17718, 'PCN2020-LUXEMBURG', 'INCOME', '75411', 0, 'sur des entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17719, 'PCN2020-LUXEMBURG', 'INCOME', '75412', 0, 'sur des entreprises lien participation', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17720, 'PCN2020-LUXEMBURG', 'INCOME', '75413', 0, 'sur autres créances de l’actif circulant', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17721, 'PCN2020-LUXEMBURG', 'INCOME', '75421', 0, 'Parts dans des entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17722, 'PCN2020-LUXEMBURG', 'INCOME', '75422', 0, 'Actions propres ou parts propres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17723, 'PCN2020-LUXEMBURG', 'INCOME', '75423', 0, 'Parts dans des entreprises lien part.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17724, 'PCN2020-LUXEMBURG', 'INCOME', '75428', 0, 'Autres valeurs mobilières', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17725, 'PCN2020-LUXEMBURG', 'INCOME', '75481', 0, 'Parts dans des entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17726, 'PCN2020-LUXEMBURG', 'INCOME', '75482', 0, 'Actions propres ou parts propres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17727, 'PCN2020-LUXEMBURG', 'INCOME', '75483', 0, 'Parts dans des entreprises lien part.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17728, 'PCN2020-LUXEMBURG', 'INCOME', '75488', 0, 'Autres valeurs mobilières', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17729, 'PCN2020-LUXEMBURG', 'INCOME', '75521', 0, 'Intérêts sur comptes bancaires', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17730, 'PCN2020-LUXEMBURG', 'INCOME', '755231', 0, 'Intérêts / leasings fin. - entrep. liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17731, 'PCN2020-LUXEMBURG', 'INCOME', '755232', 0, 'Intérêts sur leasings financiers - autre', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17732, 'PCN2020-LUXEMBURG', 'INCOME', '7553', 0, 'Intérêts sur créances commerciales', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17733, 'PCN2020-LUXEMBURG', 'INCOME', '75541', 0, 'Intérêts sur des entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17734, 'PCN2020-LUXEMBURG', 'INCOME', '75542', 0, 'Intérêts sur des entrep. lien part.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17735, 'PCN2020-LUXEMBURG', 'INCOME', '75551', 0, 'Escomptes d’effets de comm.-entrep.liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17736, 'PCN2020-LUXEMBURG', 'INCOME', '75552', 0, 'Escomptes d’effets de commerce - autres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17737, 'PCN2020-LUXEMBURG', 'INCOME', '75561', 0, 'Escomptes obtenus - entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17738, 'PCN2020-LUXEMBURG', 'INCOME', '75562', 0, 'Escomptes obtenus - autres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17739, 'PCN2020-LUXEMBURG', 'INCOME', '75581', 0, 'Intérêts sur aut. créances-entrep. liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17740, 'PCN2020-LUXEMBURG', 'INCOME', '75582', 0, 'Intérêts sur autres créances - autres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17741, 'PCN2020-LUXEMBURG', 'INCOME', '7561', 0, 'Gains de change - entreprises liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17742, 'PCN2020-LUXEMBURG', 'INCOME', '7562', 0, 'Gains de change - autres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17743, 'PCN2020-LUXEMBURG', 'INCOME', '757', 0, 'Quote-p. bénéf. dans entr.mise en equiv.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17744, 'PCN2020-LUXEMBURG', 'INCOME', '7581', 0, 'Autres produits financiers-entrep. liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17745, 'PCN2020-LUXEMBURG', 'INCOME', '7582', 0, 'Autres produits financiers - autres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17746, 'PCN2020-LUXEMBURG', 'INCOME', '7591', 0, 'Reprises de prov. finan. - entrep. liées', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17747, 'PCN2020-LUXEMBURG', 'INCOME', '7592', 0, 'Reprises de provisions finan. - autres', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17748, 'PCN2020-LUXEMBURG', 'INCOME', '771', 0, 'Régularisations d’impôt IRC', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17749, 'PCN2020-LUXEMBURG', 'INCOME', '772', 0, 'Régularisations d’impôt ICC', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17750, 'PCN2020-LUXEMBURG', 'INCOME', '773', 0, 'Régul. d’impôts étrangers / le résultat', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17751, 'PCN2020-LUXEMBURG', 'INCOME', '779', 0, 'Reprises de provisions pour impôts diff.', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17752, 'PCN2020-LUXEMBURG', 'INCOME', '781', 0, 'Régularisations d’impôt IF', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17753, 'PCN2020-LUXEMBURG', 'INCOME', '782', 0, 'Régularisations de taxe d’abonnement', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17754, 'PCN2020-LUXEMBURG', 'INCOME', '783', 0, 'Régularisations d’impôts étrangers', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17755, 'PCN2020-LUXEMBURG', 'INCOME', '788', 0, 'Régularisations d’autres impôts', '1'); + + + diff --git a/htdocs/install/mysql/tables/llx_asset_type_extrafields-asset.sql b/htdocs/install/mysql/data/llx_c_asset_disposal_type.sql similarity index 54% rename from htdocs/install/mysql/tables/llx_asset_type_extrafields-asset.sql rename to htdocs/install/mysql/data/llx_c_asset_disposal_type.sql index 7ff09176216..4951b9df198 100644 --- a/htdocs/install/mysql/tables/llx_asset_type_extrafields-asset.sql +++ b/htdocs/install/mysql/data/llx_c_asset_disposal_type.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2018 Alexandre Spangaro +-- Copyright (C) 2022 OpenDSI -- -- 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 @@ -12,12 +12,13 @@ -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . +-- +-- -create table llx_asset_type_extrafields -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - fk_object integer NOT NULL, - import_key varchar(14) -- import key -) ENGINE=innodb; +-- +-- Do not include comments at end of line, this file is parsed during install and string '--' are removed. +-- +INSERT INTO llx_c_asset_disposal_type (rowid, entity, code, label, active) VALUES (1, 1, 'C', 'Sale', 1); +INSERT INTO llx_c_asset_disposal_type (rowid, entity, code, label, active) VALUES (2, 1, 'HS', 'Putting out of service', 1); +INSERT INTO llx_c_asset_disposal_type (rowid, entity, code, label, active) VALUES (3, 1, 'D', 'Destruction', 1); diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql index 06d957310bb..d35797c3750 100644 --- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql +++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql @@ -51,7 +51,8 @@ -- VPGSQL8.2 ALTER TABLE llx_c_payment_term ALTER COLUMN rowid SET DEFAULT nextval('llx_c_payment_term_rowid_seq'); -- VPGSQL8.2 SELECT setval('llx_c_payment_term_rowid_seq', MAX(rowid)) FROM llx_c_payment_term; - +ALTER TABLE llx_entrepot ADD COLUMN barcode varchar(180) DEFAULT NULL; +ALTER TABLE llx_entrepot ADD COLUMN fk_barcode_type integer DEFAULT NULL; ALTER TABLE llx_c_transport_mode ADD UNIQUE INDEX uk_c_transport_mode (code, entity); @@ -136,6 +137,9 @@ ALTER TABLE llx_bank ADD COLUMN amount_main_currency double(24,8) NULL; -- v16 +ALTER TABLE llx_projet_task_time ADD COLUMN intervention_id integer DEFAULT NULL; +ALTER TABLE llx_projet_task_time ADD COLUMN intervention_line_id integer DEFAULT NULL; + ALTER TABLE llx_c_stcomm MODIFY COLUMN code VARCHAR(24) NOT NULL; ALTER TABLE llx_societe_account DROP FOREIGN KEY llx_societe_account_fk_website; @@ -178,48 +182,48 @@ ALTER TABLE llx_stock_mouvement_extrafields ADD INDEX idx_stock_mouvement_extraf CREATE TABLE llx_facture_fourn_rec ( rowid integer AUTO_INCREMENT PRIMARY KEY, - titre varchar(200) NOT NULL, - ref_supplier varchar(180) NOT NULL, - entity integer DEFAULT 1 NOT NULL, - fk_soc integer NOT NULL, + titre varchar(200) NOT NULL, + ref_supplier varchar(180) NOT NULL, + entity integer DEFAULT 1 NOT NULL, + fk_soc integer NOT NULL, datec datetime, - tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - suspended integer DEFAULT 0, - libelle varchar(255), - amount double(24, 8) DEFAULT 0 NOT NULL, - remise real DEFAULT 0, - vat_src_code varchar(10) DEFAULT '', - localtax1 double(24,8) DEFAULT 0, - localtax2 double(24,8) DEFAULT 0, - total_ht double(24,8) DEFAULT 0, - total_tva double(24,8) DEFAULT 0, - total_ttc double(24,8) DEFAULT 0, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + suspended integer DEFAULT 0, + libelle varchar(255), + amount double(24,8) DEFAULT 0 NOT NULL, + remise real DEFAULT 0, + vat_src_code varchar(10) DEFAULT '', + localtax1 double(24,8) DEFAULT 0, + localtax2 double(24,8) DEFAULT 0, + total_ht double(24,8) DEFAULT 0, + total_tva double(24,8) DEFAULT 0, + total_ttc double(24,8) DEFAULT 0, fk_user_author integer, fk_user_modif integer, fk_projet integer, fk_account integer, - fk_cond_reglement integer, - fk_mode_reglement integer, + fk_cond_reglement integer, + fk_mode_reglement integer, date_lim_reglement date, note_private text, note_public text, modelpdf varchar(255), fk_multicurrency integer, multicurrency_code varchar(3), - multicurrency_tx double(24,8) DEFAULT 1, - multicurrency_total_ht double(24,8) DEFAULT 0, - multicurrency_total_tva double(24,8) DEFAULT 0, - multicurrency_total_ttc double(24,8) DEFAULT 0, - usenewprice integer DEFAULT 0, + multicurrency_tx double(24,8) DEFAULT 1, + multicurrency_total_ht double(24,8) DEFAULT 0, + multicurrency_total_tva double(24,8) DEFAULT 0, + multicurrency_total_ttc double(24,8) DEFAULT 0, + usenewprice integer DEFAULT 0, frequency integer, - unit_frequency varchar(2) DEFAULT 'm', - date_when datetime DEFAULT NULL, - date_last_gen datetime DEFAULT NULL, - nb_gen_done integer DEFAULT NULL, - nb_gen_max integer DEFAULT NULL, - auto_validate integer DEFAULT 0, - generate_pdf integer DEFAULT 1 -)ENGINE=innodb; + unit_frequency varchar(2) DEFAULT 'm', + date_when datetime DEFAULT NULL, + date_last_gen datetime DEFAULT NULL, + nb_gen_done integer DEFAULT NULL, + nb_gen_max integer DEFAULT NULL, + auto_validate integer DEFAULT 0, + generate_pdf integer DEFAULT 1 +) ENGINE=innodb; ALTER TABLE llx_facture_fourn_rec ADD UNIQUE INDEX uk_facture_fourn_rec_ref (titre, entity); ALTER TABLE llx_facture_fourn_rec ADD UNIQUE INDEX uk_facture_fourn_rec_ref_supplier (ref_supplier, fk_soc, entity); @@ -248,23 +252,23 @@ CREATE TABLE llx_facture_fourn_det_rec fk_parent_line integer NULL, fk_product integer NULL, ref varchar(50), - label varchar(255) DEFAULT NULL, + label varchar(255) DEFAULT NULL, description text, pu_ht double(24,8), pu_ttc double(24,8), qty real, - remise_percent real DEFAULT 0, - fk_remise_except integer NULL, - vat_src_code varchar(10) DEFAULT '', + remise_percent real DEFAULT 0, + fk_remise_except integer NULL, + vat_src_code varchar(10) DEFAULT '', tva_tx double(7,4), - localtax1_tx double(7,4) DEFAULT 0, - localtax1_type varchar(10) NULL, - localtax2_tx double(7,4) DEFAULT 0, - localtax2_type varchar(10) NULL, + localtax1_tx double(7,4) DEFAULT 0, + localtax1_type varchar(10) NULL, + localtax2_tx double(7,4) DEFAULT 0, + localtax2_type varchar(10) NULL, total_ht double(24,8), total_tva double(24,8), - total_localtax1 double(24,8) DEFAULT 0, - total_localtax2 double(24,8) DEFAULT 0, + total_localtax1 double(24,8) DEFAULT 0, + total_localtax2 double(24,8) DEFAULT 0, total_ttc double(24,8), product_type integer DEFAULT 0, date_start integer DEFAULT NULL, @@ -282,17 +286,20 @@ CREATE TABLE llx_facture_fourn_det_rec multicurrency_total_ht double(24,8) DEFAULT 0, multicurrency_total_tva double(24,8) DEFAULT 0, multicurrency_total_ttc double(24,8) DEFAULT 0 -)ENGINE=innodb; +) ENGINE=innodb; + ALTER TABLE llx_facture_fourn_det_rec ADD CONSTRAINT fk_facture_fourn_det_rec_fk_unit FOREIGN KEY (fk_unit) REFERENCES llx_c_units (rowid); + CREATE TABLE llx_facture_fourn_det_rec_extrafields ( rowid integer AUTO_INCREMENT PRIMARY KEY, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, fk_object integer NOT NULL, -- object id - import_key varchar(14) -- import key -)ENGINE=innodb; + import_key varchar(14) -- import key +) ENGINE=innodb; + ALTER TABLE llx_facture_fourn_det_rec_extrafields ADD INDEX idx_facture_fourn_det_rec_extrafields (fk_object); @@ -311,7 +318,8 @@ ALTER TABLE llx_emailcollector_emailcollector ADD COLUMN position INTEGER NOT NU ALTER TABLE llx_advtargetemailing RENAME TO llx_mailing_advtarget; -ALTER TABLE llx_mailing ADD UNIQUE INDEX uk_mailing(titre, entity); +ALTER TABLE llx_mailing ADD UNIQUE INDEX uk_mailing (titre, entity); + create table llx_inventory_extrafields ( @@ -321,6 +329,7 @@ create table llx_inventory_extrafields import_key varchar(14) -- import key ) ENGINE=innodb; + ALTER TABLE llx_inventory_extrafields ADD INDEX idx_inventory_extrafields (fk_object); ALTER TABLE llx_reception MODIFY COLUMN ref_supplier varchar(128); @@ -330,6 +339,234 @@ ALTER TABLE llx_bank_account ADD COLUMN pti_in_ctti smallint DEFAULT 0 AFTER dom -- Set default ticket type to OTHER if no default exists UPDATE llx_c_ticket_type SET use_default=1 WHERE code='OTHER' AND NOT EXISTS(SELECT * FROM (SELECT * FROM llx_c_ticket_type) AS t WHERE use_default=1); +-- Assets - New module +ALTER TABLE llx_asset DROP FOREIGN KEY fk_asset_asset_type; +ALTER TABLE llx_asset DROP INDEX idx_asset_fk_asset_type; + +ALTER TABLE llx_asset CHANGE COLUMN amount_ht acquisition_value_ht double(24,8) NOT NULL; +ALTER TABLE llx_asset CHANGE COLUMN amount_vat recovered_vat double(24,8); + +DELETE FROM llx_asset WHERE fk_asset_type IS NOT NULL; + +ALTER TABLE llx_asset DROP COLUMN fk_asset_type; +ALTER TABLE llx_asset DROP COLUMN description; + +ALTER TABLE llx_asset ADD COLUMN fk_asset_model integer AFTER label; +ALTER TABLE llx_asset ADD COLUMN reversal_amount_ht double(24,8) AFTER fk_asset_model; +ALTER TABLE llx_asset ADD COLUMN reversal_date date AFTER recovered_vat; +ALTER TABLE llx_asset ADD COLUMN date_acquisition date NOT NULL AFTER reversal_date; +ALTER TABLE llx_asset ADD COLUMN date_start date NOT NULL AFTER date_acquisition; +ALTER TABLE llx_asset ADD COLUMN qty real DEFAULT 1 NOT NULL AFTER date_start; +ALTER TABLE llx_asset ADD COLUMN acquisition_type smallint DEFAULT 0 NOT NULL AFTER qty; +ALTER TABLE llx_asset ADD COLUMN asset_type smallint DEFAULT 0 NOT NULL AFTER acquisition_type; +ALTER TABLE llx_asset ADD COLUMN not_depreciated integer DEFAULT 0 AFTER asset_type; +ALTER TABLE llx_asset ADD COLUMN disposal_date date AFTER not_depreciated; +ALTER TABLE llx_asset ADD COLUMN disposal_amount_ht double(24,8) AFTER disposal_date; +ALTER TABLE llx_asset ADD COLUMN fk_disposal_type integer AFTER disposal_amount_ht; +ALTER TABLE llx_asset ADD COLUMN disposal_depreciated integer DEFAULT 0 AFTER fk_disposal_type; +ALTER TABLE llx_asset ADD COLUMN disposal_subject_to_vat integer DEFAULT 0 AFTER disposal_depreciated; +ALTER TABLE llx_asset ADD COLUMN last_main_doc varchar(255) AFTER fk_user_modif; +ALTER TABLE llx_asset ADD COLUMN model_pdf varchar(255) AFTER import_key; + +DROP TABLE llx_asset_type; + + +CREATE TABLE llx_c_asset_disposal_type +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer NOT NULL DEFAULT 1, + code varchar(16) NOT NULL, + label varchar(50) NOT NULL, + active integer NOT NULL DEFAULT 1 +) ENGINE=innodb; + + +CREATE TABLE llx_asset_accountancy_codes_economic +( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + fk_asset integer, + fk_asset_model integer, + + asset varchar(32), + depreciation_asset varchar(32), + depreciation_expense varchar(32), + value_asset_sold varchar(32), + receivable_on_assignment varchar(32), + proceeds_from_sales varchar(32), + vat_collected varchar(32), + vat_deductible varchar(32), + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_modif integer +) ENGINE=innodb; + + +CREATE TABLE llx_asset_accountancy_codes_fiscal +( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + fk_asset integer, + fk_asset_model integer, + + accelerated_depreciation varchar(32), + endowment_accelerated_depreciation varchar(32), + provision_accelerated_depreciation varchar(32), + + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_modif integer +) ENGINE=innodb; + + +CREATE TABLE llx_asset_depreciation_options_economic +( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + fk_asset integer, + fk_asset_model integer, + + depreciation_type smallint DEFAULT 0 NOT NULL, -- 0:linear, 1:degressive, 2:exceptional + accelerated_depreciation_option integer, -- activate accelerated depreciation mode (fiscal) + + degressive_coefficient double(24,8), + duration smallint NOT NULL, + duration_type smallint DEFAULT 0 NOT NULL, -- 0:annual, 1:monthly, 2:daily + + amount_base_depreciation_ht double(24,8), + amount_base_deductible_ht double(24,8), + total_amount_last_depreciation_ht double(24,8), + + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_modif integer +) ENGINE=innodb; + + +CREATE TABLE llx_asset_depreciation_options_fiscal +( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + fk_asset integer, + fk_asset_model integer, + + depreciation_type smallint DEFAULT 0 NOT NULL, -- 0:linear, 1:degressive, 2:exceptional + + degressive_coefficient double(24,8), + duration smallint NOT NULL, + duration_type smallint DEFAULT 0 NOT NULL, -- 0:annual, 1:monthly, 2:daily + + amount_base_depreciation_ht double(24,8), + amount_base_deductible_ht double(24,8), + total_amount_last_depreciation_ht double(24,8), + + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_modif integer +) ENGINE=innodb; + + +CREATE TABLE llx_asset_depreciation +( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + + fk_asset integer NOT NULL, + depreciation_mode varchar(255) NOT NULL, -- (economic, fiscal or other) + + ref varchar(255) NOT NULL, + depreciation_date datetime NOT NULL, + depreciation_ht double(24,8) NOT NULL, + cumulative_depreciation_ht double(24,8) NOT NULL, + + accountancy_code_debit varchar(32), + accountancy_code_credit varchar(32), + + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_modif integer +) ENGINE=innodb; + + +CREATE TABLE llx_asset_model( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + entity integer DEFAULT 1 NOT NULL, -- multi company id + ref varchar(128) NOT NULL, + label varchar(255) NOT NULL, + + asset_type smallint NOT NULL, + fk_pays integer DEFAULT 0, + + note_public text, + note_private text, + date_creation datetime NOT NULL, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + import_key varchar(14), + status smallint NOT NULL +) ENGINE=innodb; + +CREATE TABLE llx_asset_model_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_object integer NOT NULL, + import_key varchar(14) -- import key +) ENGINE=innodb; + + +ALTER TABLE llx_c_asset_disposal_type ADD UNIQUE INDEX uk_c_asset_disposal_type(code, entity); + +ALTER TABLE llx_asset ADD INDEX idx_asset_fk_asset_model (fk_asset_model); +ALTER TABLE llx_asset ADD INDEX idx_asset_fk_disposal_type (fk_disposal_type); + +ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid); +ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_disposal_type FOREIGN KEY (fk_disposal_type) REFERENCES llx_c_asset_disposal_type (rowid); +ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user (rowid); +ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid); + +ALTER TABLE llx_asset_accountancy_codes_economic ADD INDEX idx_asset_ace_rowid (rowid); +ALTER TABLE llx_asset_accountancy_codes_economic ADD UNIQUE uk_asset_ace_fk_asset (fk_asset); +ALTER TABLE llx_asset_accountancy_codes_economic ADD UNIQUE uk_asset_ace_fk_asset_model (fk_asset_model); + +ALTER TABLE llx_asset_accountancy_codes_economic ADD CONSTRAINT fk_asset_ace_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid); +ALTER TABLE llx_asset_accountancy_codes_economic ADD CONSTRAINT fk_asset_ace_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid); +ALTER TABLE llx_asset_accountancy_codes_economic ADD CONSTRAINT fk_asset_ace_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid); + +ALTER TABLE llx_asset_accountancy_codes_fiscal ADD INDEX idx_asset_acf_rowid (rowid); +ALTER TABLE llx_asset_accountancy_codes_fiscal ADD UNIQUE uk_asset_acf_fk_asset (fk_asset); +ALTER TABLE llx_asset_accountancy_codes_fiscal ADD UNIQUE uk_asset_acf_fk_asset_model (fk_asset_model); + +ALTER TABLE llx_asset_accountancy_codes_fiscal ADD CONSTRAINT fk_asset_acf_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid); +ALTER TABLE llx_asset_accountancy_codes_fiscal ADD CONSTRAINT fk_asset_acf_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid); +ALTER TABLE llx_asset_accountancy_codes_fiscal ADD CONSTRAINT fk_asset_acf_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid); + +ALTER TABLE llx_asset_depreciation_options_economic ADD INDEX idx_asset_doe_rowid (rowid); +ALTER TABLE llx_asset_depreciation_options_economic ADD UNIQUE uk_asset_doe_fk_asset (fk_asset); +ALTER TABLE llx_asset_depreciation_options_economic ADD UNIQUE uk_asset_doe_fk_asset_model (fk_asset_model); + +ALTER TABLE llx_asset_depreciation_options_economic ADD CONSTRAINT fk_asset_doe_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid); +ALTER TABLE llx_asset_depreciation_options_economic ADD CONSTRAINT fk_asset_doe_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid); +ALTER TABLE llx_asset_depreciation_options_economic ADD CONSTRAINT fk_asset_doe_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid); + +ALTER TABLE llx_asset_depreciation_options_fiscal ADD INDEX idx_asset_dof_rowid (rowid); +ALTER TABLE llx_asset_depreciation_options_fiscal ADD UNIQUE uk_asset_dof_fk_asset (fk_asset); +ALTER TABLE llx_asset_depreciation_options_fiscal ADD UNIQUE uk_asset_dof_fk_asset_model (fk_asset_model); + +ALTER TABLE llx_asset_depreciation_options_fiscal ADD CONSTRAINT fk_asset_dof_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid); +ALTER TABLE llx_asset_depreciation_options_fiscal ADD CONSTRAINT fk_asset_dof_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid); +ALTER TABLE llx_asset_depreciation_options_fiscal ADD CONSTRAINT fk_asset_dof_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid); + +ALTER TABLE llx_asset_depreciation ADD INDEX idx_asset_depreciation_rowid (rowid); +ALTER TABLE llx_asset_depreciation ADD INDEX idx_asset_depreciation_fk_asset (fk_asset); +ALTER TABLE llx_asset_depreciation ADD INDEX idx_asset_depreciation_depreciation_mode (depreciation_mode); +ALTER TABLE llx_asset_depreciation ADD INDEX idx_asset_depreciation_ref (ref); +ALTER TABLE llx_asset_depreciation ADD UNIQUE uk_asset_depreciation_fk_asset (fk_asset, depreciation_mode, ref); + +ALTER TABLE llx_asset_depreciation ADD CONSTRAINT fk_asset_depreciation_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid); +ALTER TABLE llx_asset_depreciation ADD CONSTRAINT fk_asset_depreciation_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid); + +ALTER TABLE llx_asset_model ADD INDEX idx_asset_model_rowid (rowid); +ALTER TABLE llx_asset_model ADD INDEX idx_asset_model_ref (ref); +ALTER TABLE llx_asset_model ADD INDEX idx_asset_model_pays (fk_pays); +ALTER TABLE llx_asset_model ADD INDEX idx_asset_model_entity (entity); +ALTER TABLE llx_asset_model ADD UNIQUE INDEX uk_asset_model (entity, ref); + +ALTER TABLE llx_asset_model ADD CONSTRAINT fk_asset_model_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user (rowid); +ALTER TABLE llx_asset_model ADD CONSTRAINT fk_asset_model_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid); + +ALTER TABLE llx_asset_model_extrafields ADD INDEX idx_asset_model_extrafields (fk_object); ALTER TABLE llx_user DROP COLUMN webcal_login; ALTER TABLE llx_user DROP COLUMN module_comm; @@ -363,10 +600,11 @@ UPDATE llx_c_availability SET type_duration = 'w', qty = 4 WHERE code = 'AV_4W'; -- Deposit generation helper with specific payment terms -ALTER TABLE llx_c_payment_term ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER decalage; -ALTER TABLE llx_societe ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER cond_reglement; -ALTER TABLE llx_propal ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER fk_cond_reglement; -ALTER TABLE llx_commande ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER fk_cond_reglement; +ALTER TABLE llx_c_payment_term ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER decalage; +ALTER TABLE llx_societe ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER cond_reglement; +ALTER TABLE llx_propal ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER fk_cond_reglement; +ALTER TABLE llx_commande ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER fk_cond_reglement; + INSERT INTO llx_c_payment_term(code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour, deposit_percent) values ('DEP30PCTDEL', 13, 0, '__DEPOSIT_PERCENT__% deposit', '__DEPOSIT_PERCENT__% deposit, remainder on delivery', 0, 1, '30'); @@ -381,13 +619,13 @@ DELETE FROM llx_boxes_def WHERE file IN ('box_bom.php@bom', 'box_bom.php', 'box_ ALTER TABLE llx_takepos_floor_tables ADD UNIQUE(entity,label); -ALTER TABLE llx_partnership ADD COLUMN url_to_check varchar(255); -ALTER TABLE llx_c_partnership_type ADD COLUMN keyword varchar(128); +ALTER TABLE llx_partnership ADD COLUMN url_to_check varchar(255); +ALTER TABLE llx_c_partnership_type ADD COLUMN keyword varchar(128); -ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN firstname varchar(100); -ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN lastname varchar(100); -ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN email_company varchar(128) after email; +ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN firstname varchar(100); +ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN lastname varchar(100); +ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN email_company varchar(128) after email; ALTER TABLE llx_c_email_template ADD COLUMN email_from varchar(255); @@ -406,4 +644,18 @@ ALTER TABLE llx_extrafields ADD COLUMN cssview varchar(128); ALTER TABLE llx_extrafields ADD COLUMN csslist varchar(128); ALTER TABLE llx_cronjob ADD COLUMN email_alert varchar(128); - \ No newline at end of file + +ALTER TABLE llx_paiement MODIFY COLUMN ext_payment_id varchar(255); +ALTER TABLE llx_payment_donation MODIFY COLUMN ext_payment_id varchar(255); +ALTER TABLE llx_prelevement_facture_demande MODIFY COLUMN ext_payment_id varchar(255); + +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (140, 'PCN2020-LUXEMBURG', 'Plan comptable normalisé 2020 Luxembourgeois', 1); + +ALTER TABLE llx_cronjob MODIFY COLUMN label varchar(255) NOT NULL; + +-- We need to keep only the PurgeDeleteTemporaryFilesShort with params = 'tempfilsold+logfiles' +DELETE FROM llx_cronjob WHERE label = 'PurgeDeleteTemporaryFilesShort' AND params = 'tempfilesold'; + +ALTER TABLE llx_cronjob DROP INDEX uk_cronjob; +ALTER TABLE llx_cronjob ADD UNIQUE INDEX uk_cronjob (label, entity); + diff --git a/htdocs/install/mysql/tables/llx_adherent_type.sql b/htdocs/install/mysql/tables/llx_adherent_type.sql index 243372c0452..4144d9b32b7 100644 --- a/htdocs/install/mysql/tables/llx_adherent_type.sql +++ b/htdocs/install/mysql/tables/llx_adherent_type.sql @@ -18,22 +18,23 @@ -- -- =================================================================== -- --- statut --- 0 : actif --- 1 : inactif +-- state / statut +-- 0 : active / actif +-- 1 : inactive / inactif +-- create table llx_adherent_type ( rowid integer AUTO_INCREMENT PRIMARY KEY, - entity integer DEFAULT 1 NOT NULL, + entity integer DEFAULT 1 NOT NULL, -- multi company id tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - statut smallint NOT NULL DEFAULT 0, - libelle varchar(50) NOT NULL, - morphy varchar(3) NOT NULL, - duration varchar(6) DEFAULT NULL, - subscription varchar(3) NOT NULL DEFAULT '1', - amount double(24,8) DEFAULT NULL, - vote varchar(3) NOT NULL DEFAULT '1', - note text, - mail_valid text + statut smallint NOT NULL DEFAULT 0, -- state 0 = active , 1 = inactive + libelle varchar(50) NOT NULL, -- label + morphy varchar(3) NOT NULL, -- moral and/or physical entity + duration varchar(6) DEFAULT NULL, -- (minimal) duration of membership + subscription varchar(3) NOT NULL DEFAULT '1', -- subscription with costs / fee or without / for free + amount double(24,8) DEFAULT NULL, -- membership fee + vote varchar(3) NOT NULL DEFAULT '1', -- entitled to vote + note text, -- description / comment + mail_valid text -- text for welcome email )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_asset-asset.key.sql b/htdocs/install/mysql/tables/llx_asset-asset.key.sql index a82f29ee58b..6175ed8a2b7 100644 --- a/htdocs/install/mysql/tables/llx_asset-asset.key.sql +++ b/htdocs/install/mysql/tables/llx_asset-asset.key.sql @@ -1,4 +1,5 @@ --- Copyright (C) 2018 Alexandre Spangaro +-- ======================================================================== +-- Copyright (C) 2018-2022 OpenDSI -- -- 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 @@ -12,12 +13,12 @@ -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see https://www.gnu.org/licenses/. +-- ======================================================================== +ALTER TABLE llx_asset ADD INDEX idx_asset_fk_asset_model (fk_asset_model); +ALTER TABLE llx_asset ADD INDEX idx_asset_fk_disposal_type (fk_disposal_type); -ALTER TABLE llx_asset ADD INDEX idx_asset_rowid (rowid); -ALTER TABLE llx_asset ADD INDEX idx_asset_ref (ref); -ALTER TABLE llx_asset ADD INDEX idx_asset_entity (entity); - -ALTER TABLE llx_asset ADD INDEX idx_asset_fk_asset_type (fk_asset_type); -ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_asset_type FOREIGN KEY (fk_asset_type) REFERENCES llx_asset_type (rowid); - +ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid); +ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_disposal_type FOREIGN KEY (fk_disposal_type) REFERENCES llx_c_asset_disposal_type (rowid); +ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user (rowid); +ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid); diff --git a/htdocs/install/mysql/tables/llx_asset-asset.sql b/htdocs/install/mysql/tables/llx_asset-asset.sql index 52eeda3ba58..2eed188bc14 100644 --- a/htdocs/install/mysql/tables/llx_asset-asset.sql +++ b/htdocs/install/mysql/tables/llx_asset-asset.sql @@ -1,4 +1,5 @@ --- Copyright (C) 2018 Alexandre Spangaro +-- ======================================================================== +-- Copyright (C) 2018-2022 OpenDSI -- -- 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 @@ -12,23 +13,53 @@ -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see https://www.gnu.org/licenses/. - +-- ======================================================================== +-- +-- Table for fixed asset +-- +-- Data example: +-- INSERT INTO llx_asset (ref, entity, label, fk_asset_model, reversal_amount_ht, acquisition_value_ht, recovered_vat, reversal_date, date_acquisition, date_start, qty, acquisition_type, asset_type, not_depreciated, disposal_date, disposal_amount_ht, fk_disposal_type, disposal_depreciated, disposal_subject_to_vat, note_public, note_private, date_creation, tms, fk_user_creat, fk_user_modif, last_main_doc, import_key, model_pdf, status) VALUES +-- ('LAPTOP', 1, 'LAPTOP xxx for accountancy department', 1, NULL, 1000.00000000, NULL, NULL, '2022-01-18', '2022-01-20', 0, 0, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2022-01-18 14:31:21', '2022-03-09 14:09:46', 1, 1, NULL, NULL, NULL, 0); CREATE TABLE llx_asset( - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - ref varchar(128) NOT NULL, - entity integer DEFAULT 1 NOT NULL, - label varchar(255), - amount_ht double(24,8) DEFAULT NULL, - amount_vat double(24,8) DEFAULT NULL, - fk_asset_type integer NOT NULL, - description text, - note_public text, - note_private text, - date_creation datetime NOT NULL, - tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - fk_user_creat integer NOT NULL, - fk_user_modif integer, - import_key varchar(14), - status integer NOT NULL + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + ref varchar(128) NOT NULL, + entity integer DEFAULT 1 NOT NULL, + label varchar(255), + + fk_asset_model integer, + + reversal_amount_ht double(24,8), + acquisition_value_ht double(24,8) DEFAULT NULL, + recovered_vat double(24,8), + + reversal_date date, + + date_acquisition date NOT NULL, + date_start date NOT NULL, + + qty real DEFAULT 1 NOT NULL, + + acquisition_type smallint DEFAULT 0 NOT NULL, + asset_type smallint DEFAULT 0 NOT NULL, + + not_depreciated integer DEFAULT 0, + + disposal_date date, + disposal_amount_ht double(24,8), + fk_disposal_type integer, + disposal_depreciated integer DEFAULT 0, + disposal_subject_to_vat integer DEFAULT 0, + + note_public text, + note_private text, + + date_creation datetime NOT NULL, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + last_main_doc varchar(255), + import_key varchar(14), + model_pdf varchar(255), + status integer NOT NULL ) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_asset_accountancy_codes_economic-asset.key.sql b/htdocs/install/mysql/tables/llx_asset_accountancy_codes_economic-asset.key.sql new file mode 100644 index 00000000000..69bc6754f65 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_asset_accountancy_codes_economic-asset.key.sql @@ -0,0 +1,24 @@ +-- ======================================================================== +-- Copyright (C) 2022 OpenDSI +-- +-- 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 +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see https://www.gnu.org/licenses/. +-- ======================================================================== + +ALTER TABLE llx_asset_accountancy_codes_economic ADD INDEX idx_asset_ace_rowid (rowid); +ALTER TABLE llx_asset_accountancy_codes_economic ADD UNIQUE uk_asset_ace_fk_asset (fk_asset); +ALTER TABLE llx_asset_accountancy_codes_economic ADD UNIQUE uk_asset_ace_fk_asset_model (fk_asset_model); + +ALTER TABLE llx_asset_accountancy_codes_economic ADD CONSTRAINT fk_asset_ace_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid); +ALTER TABLE llx_asset_accountancy_codes_economic ADD CONSTRAINT fk_asset_ace_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid); +ALTER TABLE llx_asset_accountancy_codes_economic ADD CONSTRAINT fk_asset_ace_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid); diff --git a/htdocs/install/mysql/tables/llx_asset_accountancy_codes_economic-asset.sql b/htdocs/install/mysql/tables/llx_asset_accountancy_codes_economic-asset.sql new file mode 100644 index 00000000000..30969e59916 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_asset_accountancy_codes_economic-asset.sql @@ -0,0 +1,40 @@ +-- ======================================================================== +-- Copyright (C) 2022 OpenDSI +-- +-- 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 +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see https://www.gnu.org/licenses/. +-- ======================================================================== +-- +-- Table to store the configuration of the accounting accounts of a fixed asset for economic status (fk_asset will be filled and fk_asset_model will be null) +-- or to store the configuration of the accounting accounts for templates of asset (fk_asset_model will be filled and fk_asset will be null) +-- +-- Data example: +-- INSERT INTO llx_asset_accountancy_codes_economic (fk_asset, fk_asset_model, asset, depreciation_asset, depreciation_expense, value_asset_sold, receivable_on_assignment, proceeds_from_sales, vat_collected, vat_deductible, tms, fk_user_modif) VALUES +-- (1, NULL, '2183', '2818', '68112', '675', '465', '775', '44571', '44562', '2022-01-18 14:20:20', 1); + +CREATE TABLE llx_asset_accountancy_codes_economic( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + fk_asset integer, + fk_asset_model integer, + + asset varchar(32), + depreciation_asset varchar(32), + depreciation_expense varchar(32), + value_asset_sold varchar(32), + receivable_on_assignment varchar(32), + proceeds_from_sales varchar(32), + vat_collected varchar(32), + vat_deductible varchar(32), + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_modif integer +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_asset_accountancy_codes_fiscal-asset.key.sql b/htdocs/install/mysql/tables/llx_asset_accountancy_codes_fiscal-asset.key.sql new file mode 100644 index 00000000000..f7a4109b9fa --- /dev/null +++ b/htdocs/install/mysql/tables/llx_asset_accountancy_codes_fiscal-asset.key.sql @@ -0,0 +1,24 @@ +-- ======================================================================== +-- Copyright (C) 2022 OpenDSI +-- +-- 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 +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see https://www.gnu.org/licenses/. +-- ======================================================================== + +ALTER TABLE llx_asset_accountancy_codes_fiscal ADD INDEX idx_asset_acf_rowid (rowid); +ALTER TABLE llx_asset_accountancy_codes_fiscal ADD UNIQUE uk_asset_acf_fk_asset (fk_asset); +ALTER TABLE llx_asset_accountancy_codes_fiscal ADD UNIQUE uk_asset_acf_fk_asset_model (fk_asset_model); + +ALTER TABLE llx_asset_accountancy_codes_fiscal ADD CONSTRAINT fk_asset_acf_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid); +ALTER TABLE llx_asset_accountancy_codes_fiscal ADD CONSTRAINT fk_asset_acf_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid); +ALTER TABLE llx_asset_accountancy_codes_fiscal ADD CONSTRAINT fk_asset_acf_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid); diff --git a/htdocs/install/mysql/tables/llx_asset_accountancy_codes_fiscal-asset.sql b/htdocs/install/mysql/tables/llx_asset_accountancy_codes_fiscal-asset.sql new file mode 100644 index 00000000000..9c005727f81 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_asset_accountancy_codes_fiscal-asset.sql @@ -0,0 +1,35 @@ +-- ======================================================================== +-- Copyright (C) 2022 OpenDSI +-- +-- 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 +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see https://www.gnu.org/licenses/. +-- ======================================================================== +-- +-- Table to store the configuration of the accounting accounts of a fixed asset for fiscal status +-- +-- Data example: +-- INSERT INTO llx_asset_accountancy_codes_fiscal (fk_asset, fk_asset_model, accelerated_depreciation, endowment_accelerated_depreciation, provision_accelerated_depreciation, tms, fk_user_modif) VALUES +-- (1, NULL, NULL, NULL, NULL, '2022-01-18 14:20:20', 1); + +CREATE TABLE llx_asset_accountancy_codes_fiscal( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + fk_asset integer, + fk_asset_model integer, + + accelerated_depreciation varchar(32), + endowment_accelerated_depreciation varchar(32), + provision_accelerated_depreciation varchar(32), + + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_modif integer +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_asset_depreciation-asset.key.sql b/htdocs/install/mysql/tables/llx_asset_depreciation-asset.key.sql new file mode 100644 index 00000000000..531f88d72ba --- /dev/null +++ b/htdocs/install/mysql/tables/llx_asset_depreciation-asset.key.sql @@ -0,0 +1,25 @@ +-- ======================================================================== +-- Copyright (C) 2022 OpenDSI +-- +-- 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 +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see https://www.gnu.org/licenses/. +-- ======================================================================== + +ALTER TABLE llx_asset_depreciation ADD INDEX idx_asset_depreciation_rowid (rowid); +ALTER TABLE llx_asset_depreciation ADD INDEX idx_asset_depreciation_fk_asset (fk_asset); +ALTER TABLE llx_asset_depreciation ADD INDEX idx_asset_depreciation_depreciation_mode (depreciation_mode); +ALTER TABLE llx_asset_depreciation ADD INDEX idx_asset_depreciation_ref (ref); +ALTER TABLE llx_asset_depreciation ADD UNIQUE uk_asset_depreciation_fk_asset (fk_asset, depreciation_mode, ref); + +ALTER TABLE llx_asset_depreciation ADD CONSTRAINT fk_asset_depreciation_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid); +ALTER TABLE llx_asset_depreciation ADD CONSTRAINT fk_asset_depreciation_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid); diff --git a/htdocs/install/mysql/tables/llx_asset_depreciation-asset.sql b/htdocs/install/mysql/tables/llx_asset_depreciation-asset.sql new file mode 100644 index 00000000000..0347e8d112d --- /dev/null +++ b/htdocs/install/mysql/tables/llx_asset_depreciation-asset.sql @@ -0,0 +1,100 @@ +-- ======================================================================== +-- Copyright (C) 2022 OpenDSI +-- +-- 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 +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see https://www.gnu.org/licenses/. +-- ========================================================================. +-- +-- Table to store depreciation of a fixed asset +-- +-- Data example: +-- INSERT INTO llx_asset_depreciation (rowid, fk_asset, depreciation_mode, ref, depreciation_date, depreciation_ht, cumulative_depreciation_ht, accountancy_code_debit, accountancy_code_credit, tms, fk_user_modif) VALUES +-- (194, 1, 'economic', '2022-01', '2022-01-31 23:59:59', 2.00000000, 2.00000000, '2818', '68112', '2022-03-09 14:10:29', NULL), +-- (195, 1, 'economic', '2022-02', '2022-02-28 23:59:59', 5.00000000, 7.00000000, '2818', '68112', '2022-03-09 14:10:29', NULL), +-- (314, 1, 'economic', '2022-03', '2022-03-31 23:59:59', 8.33000000, 15.33000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (315, 1, 'economic', '2022-04', '2022-04-30 23:59:59', 8.33000000, 23.66000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (316, 1, 'economic', '2022-05', '2022-05-31 23:59:59', 8.33000000, 31.99000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (317, 1, 'economic', '2022-06', '2022-06-30 23:59:59', 8.33000000, 40.32000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (318, 1, 'economic', '2022-07', '2022-07-31 23:59:59', 8.33000000, 48.65000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (319, 1, 'economic', '2022-08', '2022-08-31 23:59:59', 8.33000000, 56.98000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (320, 1, 'economic', '2022-09', '2022-09-30 23:59:59', 8.33000000, 65.31000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (321, 1, 'economic', '2022-10', '2022-10-31 23:59:59', 8.33000000, 73.64000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (322, 1, 'economic', '2022-11', '2022-11-30 23:59:59', 8.33000000, 81.97000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (323, 1, 'economic', '2022-12', '2022-12-31 23:59:59', 8.33000000, 90.30000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (324, 1, 'economic', '2023-01', '2023-01-31 23:59:59', 8.33000000, 98.63000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (325, 1, 'economic', '2023-02', '2023-02-28 23:59:59', 8.33000000, 106.96000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (326, 1, 'economic', '2023-03', '2023-03-31 23:59:59', 8.33000000, 115.29000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (327, 1, 'economic', '2023-04', '2023-04-30 23:59:59', 8.33000000, 123.62000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (328, 1, 'economic', '2023-05', '2023-05-31 23:59:59', 8.33000000, 131.95000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (329, 1, 'economic', '2023-06', '2023-06-30 23:59:59', 8.33000000, 140.28000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (330, 1, 'economic', '2023-07', '2023-07-31 23:59:59', 8.33000000, 148.61000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (331, 1, 'economic', '2023-08', '2023-08-31 23:59:59', 8.33000000, 156.94000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (332, 1, 'economic', '2023-09', '2023-09-30 23:59:59', 8.33000000, 165.27000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (333, 1, 'economic', '2023-10', '2023-10-31 23:59:59', 8.33000000, 173.60000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (334, 1, 'economic', '2023-11', '2023-11-30 23:59:59', 8.33000000, 181.93000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (335, 1, 'economic', '2023-12', '2023-12-31 23:59:59', 8.33000000, 190.26000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (336, 1, 'economic', '2024-01', '2024-01-31 23:59:59', 8.33000000, 198.59000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (337, 1, 'economic', '2024-02', '2024-02-29 23:59:59', 8.33000000, 206.92000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (338, 1, 'economic', '2024-03', '2024-03-31 23:59:59', 8.33000000, 215.25000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (339, 1, 'economic', '2024-04', '2024-04-30 23:59:59', 8.33000000, 223.58000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (340, 1, 'economic', '2024-05', '2024-05-31 23:59:59', 8.33000000, 231.91000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (341, 1, 'economic', '2024-06', '2024-06-30 23:59:59', 8.33000000, 240.24000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (342, 1, 'economic', '2024-07', '2024-07-31 23:59:59', 8.33000000, 248.57000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (343, 1, 'economic', '2024-08', '2024-08-31 23:59:59', 8.33000000, 256.90000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (344, 1, 'economic', '2024-09', '2024-09-30 23:59:59', 8.33000000, 265.23000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (345, 1, 'economic', '2024-10', '2024-10-31 23:59:59', 8.33000000, 273.56000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (346, 1, 'economic', '2024-11', '2024-11-30 23:59:59', 8.33000000, 281.89000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (347, 1, 'economic', '2024-12', '2024-12-31 23:59:59', 8.33000000, 290.22000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (348, 1, 'economic', '2025-01', '2025-01-31 23:59:59', 8.33000000, 298.55000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (349, 1, 'economic', '2025-02', '2025-02-28 23:59:59', 8.33000000, 306.88000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (350, 1, 'economic', '2025-03', '2025-03-31 23:59:59', 8.33000000, 315.21000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (351, 1, 'economic', '2025-04', '2025-04-30 23:59:59', 8.33000000, 323.54000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (352, 1, 'economic', '2025-05', '2025-05-31 23:59:59', 8.33000000, 331.87000000, '2818', '68112', '2022-03-09 14:15:48', NULL), +-- (353, 1, 'economic', '2025-06', '2025-06-30 23:59:59', 8.33000000, 340.20000000, '2818', '68112', '2022-03-09 14:15:49', NULL), +-- (354, 1, 'economic', '2025-07', '2025-07-31 23:59:59', 8.33000000, 348.53000000, '2818', '68112', '2022-03-09 14:15:49', NULL), +-- (355, 1, 'economic', '2025-08', '2025-08-31 23:59:59', 8.33000000, 356.86000000, '2818', '68112', '2022-03-09 14:15:49', NULL), +-- (356, 1, 'economic', '2025-09', '2025-09-30 23:59:59', 8.33000000, 365.19000000, '2818', '68112', '2022-03-09 14:15:49', NULL), +-- (357, 1, 'economic', '2025-10', '2025-10-31 23:59:59', 8.33000000, 373.52000000, '2818', '68112', '2022-03-09 14:15:49', NULL), +-- (358, 1, 'economic', '2025-11', '2025-11-30 23:59:59', 8.33000000, 381.85000000, '2818', '68112', '2022-03-09 14:15:49', NULL), +-- (359, 1, 'economic', '2025-12', '2025-12-31 23:59:59', 8.33000000, 390.18000000, '2818', '68112', '2022-03-09 14:15:49', NULL), +-- (360, 1, 'economic', '2026-01', '2026-01-31 23:59:59', 8.33000000, 398.51000000, '2818', '68112', '2022-03-09 14:15:49', NULL), +-- (361, 1, 'economic', '2026-02', '2026-02-28 23:59:59', 8.33000000, 406.84000000, '2818', '68112', '2022-03-09 14:15:49', NULL), +-- (362, 1, 'economic', '2026-03', '2026-03-31 23:59:59', 8.33000000, 415.17000000, '2818', '68112', '2022-03-09 14:15:49', NULL), +-- (363, 1, 'economic', '2026-04', '2026-04-30 23:59:59', 8.33000000, 423.50000000, '2818', '68112', '2022-03-09 14:15:49', NULL), +-- (364, 1, 'economic', '2026-05', '2026-05-31 23:59:59', 8.33000000, 431.83000000, '2818', '68112', '2022-03-09 14:15:49', NULL), +-- (365, 1, 'economic', '2026-06', '2026-06-30 23:59:59', 8.33000000, 440.16000000, '2818', '68112', '2022-03-09 14:15:49', NULL), +-- (366, 1, 'economic', '2026-07', '2026-07-31 23:59:59', 8.33000000, 448.49000000, '2818', '68112', '2022-03-09 14:15:49', NULL), +-- (367, 1, 'economic', '2026-08', '2026-08-31 23:59:59', 8.33000000, 456.82000000, '2818', '68112', '2022-03-09 14:15:49', NULL), +-- (368, 1, 'economic', '2026-09', '2026-09-30 23:59:59', 8.33000000, 465.15000000, '2818', '68112', '2022-03-09 14:15:49', NULL), +-- (369, 1, 'economic', '2026-10', '2026-10-31 23:59:59', 8.33000000, 473.48000000, '2818', '68112', '2022-03-09 14:15:49', NULL), +-- (370, 1, 'economic', '2026-11', '2026-11-30 23:59:59', 8.33000000, 481.81000000, '2818', '68112', '2022-03-09 14:15:49', NULL), +-- (371, 1, 'economic', '2026-12', '2026-12-31 23:59:59', 8.33000000, 490.14000000, '2818', '68112', '2022-03-09 14:15:49', NULL), +-- (372, 1, 'economic', '2027-01', '2027-01-31 23:59:59', 9.86000000, 500.00000000, '2818', '68112', '2022-03-09 14:15:49', NULL); + +CREATE TABLE llx_asset_depreciation( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + + fk_asset integer NOT NULL, + depreciation_mode varchar(255) NOT NULL, -- (economic, fiscal or other) + + ref varchar(255) NOT NULL, + depreciation_date datetime NOT NULL, + depreciation_ht double(24,8) NOT NULL, + cumulative_depreciation_ht double(24,8) NOT NULL, + + accountancy_code_debit varchar(32), + accountancy_code_credit varchar(32), + + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_modif integer +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_asset_depreciation_options_economic-asset.key.sql b/htdocs/install/mysql/tables/llx_asset_depreciation_options_economic-asset.key.sql new file mode 100644 index 00000000000..569e4f286a2 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_asset_depreciation_options_economic-asset.key.sql @@ -0,0 +1,24 @@ +-- ======================================================================== +-- Copyright (C) 2022 OpenDSI +-- +-- 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 +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see https://www.gnu.org/licenses/. +-- ======================================================================== + +ALTER TABLE llx_asset_depreciation_options_economic ADD INDEX idx_asset_doe_rowid (rowid); +ALTER TABLE llx_asset_depreciation_options_economic ADD UNIQUE uk_asset_doe_fk_asset (fk_asset); +ALTER TABLE llx_asset_depreciation_options_economic ADD UNIQUE uk_asset_doe_fk_asset_model (fk_asset_model); + +ALTER TABLE llx_asset_depreciation_options_economic ADD CONSTRAINT fk_asset_doe_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid); +ALTER TABLE llx_asset_depreciation_options_economic ADD CONSTRAINT fk_asset_doe_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid); +ALTER TABLE llx_asset_depreciation_options_economic ADD CONSTRAINT fk_asset_doe_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid); diff --git a/htdocs/install/mysql/tables/llx_asset_depreciation_options_economic-asset.sql b/htdocs/install/mysql/tables/llx_asset_depreciation_options_economic-asset.sql new file mode 100644 index 00000000000..e23a2ed1414 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_asset_depreciation_options_economic-asset.sql @@ -0,0 +1,41 @@ +-- ======================================================================== +-- Copyright (C) 2022 OpenDSI +-- +-- 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 +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see https://www.gnu.org/licenses/. +-- ======================================================================== +-- +-- Table to store economical depreciation of a fixed asset +-- +-- Data example: +-- INSERT INTO llx_asset_depreciation_options_economic (fk_asset, fk_asset_model, depreciation_type, accelerated_depreciation_option, degressive_coefficient, duration, duration_type, amount_base_depreciation_ht, amount_base_deductible_ht, total_amount_last_depreciation_ht, tms, fk_user_modif) VALUES +-- (1, NULL, 1, NULL, 1.75000000, 60, 1, 500.00000000, 0.00000000, 7.00000000, '2022-03-09 14:15:48', 1); + +CREATE TABLE llx_asset_depreciation_options_economic( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + fk_asset integer, + fk_asset_model integer, + + depreciation_type smallint DEFAULT 0 NOT NULL, -- 0:linear, 1:degressive, 2:exceptional + accelerated_depreciation_option integer, -- activate accelerated depreciation mode (fiscal) + degressive_coefficient double(24,8), + duration smallint NOT NULL, + duration_type smallint DEFAULT 0 NOT NULL, -- 0:annual, 1:monthly, 2:daily + + amount_base_depreciation_ht double(24,8), + amount_base_deductible_ht double(24,8), + total_amount_last_depreciation_ht double(24,8), + + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_modif integer +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_asset_depreciation_options_fiscal-asset.key.sql b/htdocs/install/mysql/tables/llx_asset_depreciation_options_fiscal-asset.key.sql new file mode 100644 index 00000000000..1fb678696d1 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_asset_depreciation_options_fiscal-asset.key.sql @@ -0,0 +1,24 @@ +-- ======================================================================== +-- Copyright (C) 2022 OpenDSI +-- +-- 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 +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see https://www.gnu.org/licenses/. +-- ======================================================================== + +ALTER TABLE llx_asset_depreciation_options_fiscal ADD INDEX idx_asset_dof_rowid (rowid); +ALTER TABLE llx_asset_depreciation_options_fiscal ADD UNIQUE uk_asset_dof_fk_asset (fk_asset); +ALTER TABLE llx_asset_depreciation_options_fiscal ADD UNIQUE uk_asset_dof_fk_asset_model (fk_asset_model); + +ALTER TABLE llx_asset_depreciation_options_fiscal ADD CONSTRAINT fk_asset_dof_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid); +ALTER TABLE llx_asset_depreciation_options_fiscal ADD CONSTRAINT fk_asset_dof_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid); +ALTER TABLE llx_asset_depreciation_options_fiscal ADD CONSTRAINT fk_asset_dof_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid); diff --git a/htdocs/install/mysql/tables/llx_asset_depreciation_options_fiscal-asset.sql b/htdocs/install/mysql/tables/llx_asset_depreciation_options_fiscal-asset.sql new file mode 100644 index 00000000000..3d9d5e9d091 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_asset_depreciation_options_fiscal-asset.sql @@ -0,0 +1,40 @@ +-- ======================================================================== +-- Copyright (C) 2022 OpenDSI +-- +-- 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 +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see https://www.gnu.org/licenses/. +-- ======================================================================== +-- +-- Table to store fiscal depreciation of a fixed asset +-- +-- Data example: +-- INSERT INTO llx_asset_depreciation_options_fiscal (fk_asset, fk_asset_model, depreciation_type, accelerated_depreciation_option, degressive_coefficient, duration, duration_type, amount_base_depreciation_ht, amount_base_deductible_ht, total_amount_last_depreciation_ht, tms, fk_user_modif) VALUES +-- (1, NULL, 1, NULL, 1.75000000, 60, 1, 500.00000000, 0.00000000, 7.00000000, '2022-03-09 14:15:48', 1); + +CREATE TABLE llx_asset_depreciation_options_fiscal( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + fk_asset integer, + fk_asset_model integer, + + depreciation_type smallint DEFAULT 0 NOT NULL, -- 0:linear, 1:degressive, 2:exceptional + degressive_coefficient double(24,8), + duration smallint NOT NULL, + duration_type smallint DEFAULT 0 NOT NULL, -- 0:annual, 1:monthly, 2:daily + + amount_base_depreciation_ht double(24,8), + amount_base_deductible_ht double(24,8), + total_amount_last_depreciation_ht double(24,8), + + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_modif integer +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_asset_extrafields-asset.key.sql b/htdocs/install/mysql/tables/llx_asset_extrafields-asset.key.sql index fe6bb053ed6..5671e2a5b9f 100644 --- a/htdocs/install/mysql/tables/llx_asset_extrafields-asset.key.sql +++ b/htdocs/install/mysql/tables/llx_asset_extrafields-asset.key.sql @@ -16,5 +16,4 @@ -- -- =================================================================== - ALTER TABLE llx_asset_extrafields ADD INDEX idx_asset_extrafields (fk_object); diff --git a/htdocs/install/mysql/tables/llx_asset_extrafields-asset.sql b/htdocs/install/mysql/tables/llx_asset_extrafields-asset.sql index c93fac7b20a..95cae4315da 100644 --- a/htdocs/install/mysql/tables/llx_asset_extrafields-asset.sql +++ b/htdocs/install/mysql/tables/llx_asset_extrafields-asset.sql @@ -1,3 +1,4 @@ +-- =================================================================== -- Copyright (C) 2018 Alexandre Spangaro -- -- This program is free software; you can redistribute it and/or modify @@ -12,12 +13,15 @@ -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see https://www.gnu.org/licenses/. +-- =================================================================== +-- +-- Table for extrafields of fixed asset +-- create table llx_asset_extrafields ( - rowid integer AUTO_INCREMENT PRIMARY KEY, - tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - fk_object integer NOT NULL, - import_key varchar(14) -- import key + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_object integer NOT NULL, + import_key varchar(14) -- import key ) ENGINE=innodb; - diff --git a/htdocs/install/mysql/tables/llx_asset_model-asset.key.sql b/htdocs/install/mysql/tables/llx_asset_model-asset.key.sql new file mode 100644 index 00000000000..5c301e5c147 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_asset_model-asset.key.sql @@ -0,0 +1,25 @@ +-- ======================================================================== +-- Copyright (C) 2022 OpenDSI +-- +-- 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 +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- ======================================================================== + +ALTER TABLE llx_asset_model ADD INDEX idx_asset_model_rowid (rowid); +ALTER TABLE llx_asset_model ADD INDEX idx_asset_model_entity (entity); +ALTER TABLE llx_asset_model ADD INDEX idx_asset_model_ref (ref); +ALTER TABLE llx_asset_model ADD INDEX idx_asset_model_pays (fk_pays); +ALTER TABLE llx_asset_model ADD UNIQUE INDEX uk_asset_model (entity, ref); + +ALTER TABLE llx_asset_model ADD CONSTRAINT fk_asset_model_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user (rowid); +ALTER TABLE llx_asset_model ADD CONSTRAINT fk_asset_model_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid); diff --git a/htdocs/install/mysql/tables/llx_asset_model-asset.sql b/htdocs/install/mysql/tables/llx_asset_model-asset.sql new file mode 100644 index 00000000000..8c285515986 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_asset_model-asset.sql @@ -0,0 +1,39 @@ +-- ======================================================================== +-- Copyright (C) 2022 OpenDSI +-- +-- 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 +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- ======================================================================== +-- +-- Table for fixed asset model +-- +-- Data example: +-- INSERT INTO llx_asset_model (entity, ref, label, asset_type, note_public, note_private, date_creation, tms, fk_user_creat, fk_user_modif, import_key, status) VALUES +-- (1, 'LAPTOP', 'Laptop', 1, NULL, NULL, '2022-01-18 14:27:09', '2022-01-24 09:31:49', 1, 1, NULL, 1); + +CREATE TABLE llx_asset_model( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + entity integer DEFAULT 1 NOT NULL, -- multi company id + ref varchar(128) NOT NULL, + label varchar(255) NOT NULL, + asset_type smallint NOT NULL, + fk_pays integer DEFAULT 0, + note_public text, + note_private text, + date_creation datetime NOT NULL, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + import_key varchar(14), + status smallint NOT NULL +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_asset_type-asset.key.sql b/htdocs/install/mysql/tables/llx_asset_model_extrafield-asset.key.sql similarity index 67% rename from htdocs/install/mysql/tables/llx_asset_type-asset.key.sql rename to htdocs/install/mysql/tables/llx_asset_model_extrafield-asset.key.sql index 4a7c4cb1145..22a6ee89196 100644 --- a/htdocs/install/mysql/tables/llx_asset_type-asset.key.sql +++ b/htdocs/install/mysql/tables/llx_asset_model_extrafield-asset.key.sql @@ -1,4 +1,5 @@ --- Copyright (C) 2018 Alexandre Spangaro +-- ======================================================================== +-- Copyright (C) 2022 OpenDSI -- -- 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 @@ -12,5 +13,6 @@ -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . +-- ======================================================================== -ALTER TABLE llx_asset_type ADD UNIQUE INDEX uk_asset_type_label (label, entity); +ALTER TABLE llx_asset_model_extrafields ADD INDEX idx_asset_model_extrafields (fk_object); diff --git a/htdocs/install/mysql/tables/llx_asset_type_extrafields-asset.key.sql b/htdocs/install/mysql/tables/llx_asset_model_extrafield-asset.sql similarity index 52% rename from htdocs/install/mysql/tables/llx_asset_type_extrafields-asset.key.sql rename to htdocs/install/mysql/tables/llx_asset_model_extrafield-asset.sql index ec0b4b28619..1f42d83fc57 100644 --- a/htdocs/install/mysql/tables/llx_asset_type_extrafields-asset.key.sql +++ b/htdocs/install/mysql/tables/llx_asset_model_extrafield-asset.sql @@ -1,4 +1,5 @@ --- Copyright (C) 2018 Alexandre Spangaro +-- ======================================================================== +-- Copyright (C) 2022 OpenDSI -- -- 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 @@ -12,6 +13,15 @@ -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . +-- ======================================================================== +-- +-- Table for extrafields of fixed asset model +-- - -ALTER TABLE llx_asset_type_extrafields ADD INDEX idx_asset_type_extrafields (fk_object); +CREATE TABLE llx_asset_model_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_object integer NOT NULL, + import_key varchar(14) -- import key +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_asset_type-asset.sql b/htdocs/install/mysql/tables/llx_asset_type-asset.sql deleted file mode 100644 index 1205acb959b..00000000000 --- a/htdocs/install/mysql/tables/llx_asset_type-asset.sql +++ /dev/null @@ -1,26 +0,0 @@ --- Copyright (C) 2018 Alexandre Spangaro --- --- 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 --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program. If not, see . - -create table llx_asset_type -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - entity integer DEFAULT 1 NOT NULL, -- multi company id - tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - label varchar(50) NOT NULL, - accountancy_code_asset varchar(32), - accountancy_code_depreciation_asset varchar(32), - accountancy_code_depreciation_expense varchar(32), - note text -)ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_asset_disposal_type-asset.key.sql b/htdocs/install/mysql/tables/llx_c_asset_disposal_type-asset.key.sql new file mode 100644 index 00000000000..3f588dc506d --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_asset_disposal_type-asset.key.sql @@ -0,0 +1,18 @@ +-- ======================================================================== +-- Copyright (C) 2022 OpenDSI +-- +-- 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 +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see https://www.gnu.org/licenses/. +-- ======================================================================== + +ALTER TABLE llx_c_asset_disposal_type ADD UNIQUE INDEX uk_c_asset_disposal_type(code, entity); diff --git a/htdocs/install/mysql/tables/llx_c_asset_disposal_type-asset.sql b/htdocs/install/mysql/tables/llx_c_asset_disposal_type-asset.sql new file mode 100644 index 00000000000..6eba1e75f14 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_asset_disposal_type-asset.sql @@ -0,0 +1,27 @@ +-- ======================================================================== +-- Copyright (C) 2022 OpenDSI +-- +-- 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 +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see https://www.gnu.org/licenses/. +-- ======================================================================== +-- +-- Table to store disposal type for a fixed asset + +CREATE TABLE llx_c_asset_disposal_type +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer NOT NULL DEFAULT 1, + code varchar(16) NOT NULL, + label varchar(50) NOT NULL, + active integer DEFAULT 1 NOT NULL +)ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_cronjob.key.sql b/htdocs/install/mysql/tables/llx_cronjob.key.sql index d0fac214ba0..a1d7587e217 100644 --- a/htdocs/install/mysql/tables/llx_cronjob.key.sql +++ b/htdocs/install/mysql/tables/llx_cronjob.key.sql @@ -21,3 +21,5 @@ ALTER TABLE llx_cronjob ADD INDEX idx_cronjob_datelastrun (datelastrun); ALTER TABLE llx_cronjob ADD INDEX idx_cronjob_datenextrun (datenextrun); ALTER TABLE llx_cronjob ADD INDEX idx_cronjob_datestart (datestart); ALTER TABLE llx_cronjob ADD INDEX idx_cronjob_dateend (dateend); + +ALTER TABLE llx_cronjob ADD UNIQUE INDEX uk_cronjob (label, entity); diff --git a/htdocs/install/mysql/tables/llx_cronjob.sql b/htdocs/install/mysql/tables/llx_cronjob.sql index 69d30d924e8..27e8a31cc9a 100644 --- a/htdocs/install/mysql/tables/llx_cronjob.sql +++ b/htdocs/install/mysql/tables/llx_cronjob.sql @@ -24,7 +24,7 @@ CREATE TABLE llx_cronjob tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, datec datetime, jobtype varchar(10) NOT NULL, -- 'method', 'function' or 'command' - label text NOT NULL, + label varchar(255) NOT NULL, command varchar(255), classesname varchar(255), -- when jobtype is 'method', name of the class file containing the method. objectname varchar(255), diff --git a/htdocs/install/mysql/tables/llx_entrepot.sql b/htdocs/install/mysql/tables/llx_entrepot.sql index b2e814c15c6..4b93106e0d4 100644 --- a/htdocs/install/mysql/tables/llx_entrepot.sql +++ b/htdocs/install/mysql/tables/llx_entrepot.sql @@ -35,6 +35,8 @@ create table llx_entrepot fk_pays integer DEFAULT 0, phone varchar(20), -- phone number fax varchar(20), -- fax number + barcode varchar(180) DEFAULT NULL, -- barcode + fk_barcode_type integer DEFAULT NULL, -- barcode type warehouse_usage integer DEFAULT 1, -- 1=internal, 2=external (virtual warehouse or stock out of company) statut tinyint DEFAULT 1, -- 1 open, 0 close fk_user_author integer, diff --git a/htdocs/install/mysql/tables/llx_paiement.sql b/htdocs/install/mysql/tables/llx_paiement.sql index bbf7d52e6c7..84cdc86b29a 100644 --- a/htdocs/install/mysql/tables/llx_paiement.sql +++ b/htdocs/install/mysql/tables/llx_paiement.sql @@ -32,7 +32,7 @@ create table llx_paiement fk_paiement integer NOT NULL, -- type of payment in llx_c_paiement num_paiement varchar(50), note text, - ext_payment_id varchar(128), -- external id of payment (for example Stripe charge id) + ext_payment_id varchar(255), -- external id of payment (for example Stripe charge id) ext_payment_site varchar(128), -- name of external paymentmode (for example 'stripe') fk_bank integer NOT NULL DEFAULT 0, fk_user_creat integer, -- utilisateur qui a cree l'info diff --git a/htdocs/install/mysql/tables/llx_payment_donation.sql b/htdocs/install/mysql/tables/llx_payment_donation.sql index a93a6c1a0e9..c14ec9b00de 100644 --- a/htdocs/install/mysql/tables/llx_payment_donation.sql +++ b/htdocs/install/mysql/tables/llx_payment_donation.sql @@ -27,7 +27,7 @@ create table llx_payment_donation fk_typepayment integer NOT NULL, num_payment varchar(50), note text, - ext_payment_id varchar(128), -- external id of payment (for example Stripe charge id) + ext_payment_id varchar(255), -- external id of payment (for example Stripe charge id) ext_payment_site varchar(128), -- name of external paymentmode (for example 'stripe') fk_bank integer NOT NULL, fk_user_creat integer, -- creation user diff --git a/htdocs/install/mysql/tables/llx_prelevement_facture_demande.sql b/htdocs/install/mysql/tables/llx_prelevement_facture_demande.sql index 4e1f37c6d3f..9837f709777 100644 --- a/htdocs/install/mysql/tables/llx_prelevement_facture_demande.sql +++ b/htdocs/install/mysql/tables/llx_prelevement_facture_demande.sql @@ -35,6 +35,6 @@ create table llx_prelevement_facture_demande code_guichet varchar(6), number varchar(255), cle_rib varchar(5), - ext_payment_id varchar(128), + ext_payment_id varchar(255), ext_payment_site varchar(128) )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_projet_task_time.sql b/htdocs/install/mysql/tables/llx_projet_task_time.sql index 63eadb1177f..e91e50b5721 100644 --- a/htdocs/install/mysql/tables/llx_projet_task_time.sql +++ b/htdocs/install/mysql/tables/llx_projet_task_time.sql @@ -29,6 +29,8 @@ create table llx_projet_task_time thm double(24,8), invoice_id integer DEFAULT NULL, -- If we need to invoice each line of timespent, we can save invoice id here invoice_line_id integer DEFAULT NULL, -- If we need to invoice each line of timespent, we can save invoice line id here + intervention_id integer DEFAULT NULL, -- If we need to have an intervention line for each line of timespent, we can save intervention id here + intervention_line_id integer DEFAULT NULL, -- If we need to have an intervention line of timespent line, we can save intervention line id here import_key varchar(14), -- Import key datec datetime, -- date creation time tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 4a9705c8ae7..30e7b45d198 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -2011,7 +2011,7 @@ function migrate_modeles($db, $langs, $conf) dolibarr_install_syslog("upgrade2::migrate_modeles"); - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { include_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; $modellist = ModelePDFFactures::liste_modeles($db); if (count($modellist) == 0) { diff --git a/htdocs/intracommreport/admin/intracommreport.php b/htdocs/intracommreport/admin/intracommreport.php index 13231c43af2..3185e8a030e 100644 --- a/htdocs/intracommreport/admin/intracommreport.php +++ b/htdocs/intracommreport/admin/intracommreport.php @@ -117,7 +117,7 @@ foreach ($list_DEB as $key) { print ''.$label.''; // Value print ''; - print ''; + print ''; print ''; print ''; @@ -181,7 +181,7 @@ foreach ($list_DES as $key) { print ''.$label.''; // Value print ''; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/intracommreport/card.php b/htdocs/intracommreport/card.php index e801416d63d..681320e0d75 100644 --- a/htdocs/intracommreport/card.php +++ b/htdocs/intracommreport/card.php @@ -68,6 +68,19 @@ $hookmanager->initHooks(array('intracommcard', 'globalcard')); $error = 0; +$permissiontoread = $user->rights->intracommreport->read; +$permissiontoadd = $user->rights->intracommreport->write; +$permissiontodelete = $user->rights->intracommreport->delete; + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (isset($object->status) && ($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +if (empty($conf->intracommreport->enabled)) accessforbidden(); +if (!$permissiontoread) accessforbidden(); + + /* * Actions @@ -80,7 +93,7 @@ if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } -if ($user->rights->intracommreport->delete && $action == 'confirm_delete' && $confirm == 'yes') { +if ($permissiontodelete && $action == 'confirm_delete' && $confirm == 'yes') { $result = $object->delete($id, $user); if ($result > 0) { if (!empty($backtopage)) { @@ -95,7 +108,7 @@ if ($user->rights->intracommreport->delete && $action == 'confirm_delete' && $co } } -if ($action == 'add' && $user->rights->intracommreport->write) { +if ($action == 'add' && $permissiontoadd) { $object->label = trim($label); $object->type = trim($exporttype); $object->type_declaration = $type_declaration; diff --git a/htdocs/intracommreport/class/intracommreport.class.php b/htdocs/intracommreport/class/intracommreport.class.php index ef13649f8c8..5411e6b7aaa 100644 --- a/htdocs/intracommreport/class/intracommreport.class.php +++ b/htdocs/intracommreport/class/intracommreport.class.php @@ -24,6 +24,7 @@ */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; + /** * Class to manage intracomm report */ @@ -124,7 +125,6 @@ class IntracommReport extends CommonObject */ public function getXML($mode = 'O', $type = 'introduction', $period_reference = '') { - global $conf, $mysoc; /**************Construction de quelques variables********************/ @@ -286,34 +286,34 @@ class IntracommReport extends CommonObject global $mysoc, $conf; if ($type == 'expedition' || $exporttype == 'des') { - $sql = 'SELECT f.ref as refinvoice, f.total_ht'; + $sql = "SELECT f.ref as refinvoice, f.total_ht"; $table = 'facture'; $table_extraf = 'facture_extrafields'; $tabledet = 'facturedet'; $field_link = 'fk_facture'; } else { // Introduction - $sql = 'SELECT f.ref_supplier as refinvoice, f.total_ht'; + $sql = "SELECT f.ref_supplier as refinvoice, f.total_ht"; $table = 'facture_fourn'; $table_extraf = 'facture_fourn_extrafields'; $tabledet = 'facture_fourn_det'; $field_link = 'fk_facture_fourn'; } - $sql .= ', l.fk_product, l.qty + $sql .= ", l.fk_product, l.qty , p.weight, p.rowid as id_prod, p.customcode , s.rowid as id_client, s.nom, s.zip, s.fk_pays, s.tva_intra , c.code , ext.mode_transport - FROM '.MAIN_DB_PREFIX.$tabledet.' l - INNER JOIN '.MAIN_DB_PREFIX.$table.' f ON (f.rowid = l.'.$field_link.') - LEFT JOIN '.MAIN_DB_PREFIX.$table_extraf.' ext ON (ext.fk_object = f.rowid) - INNER JOIN '.MAIN_DB_PREFIX.'product p ON (p.rowid = l.fk_product) - INNER JOIN '.MAIN_DB_PREFIX.'societe s ON (s.rowid = f.fk_soc) - LEFT JOIN '.MAIN_DB_PREFIX.'c_country c ON (c.rowid = s.fk_pays) + FROM ".MAIN_DB_PREFIX.$tabledet." l + INNER JOIN ".MAIN_DB_PREFIX.$table." f ON (f.rowid = l.".$this->db->escape($field_link).") + LEFT JOIN ".MAIN_DB_PREFIX.$table_extraf." ext ON (ext.fk_object = f.rowid) + INNER JOIN ".MAIN_DB_PREFIX."product p ON (p.rowid = l.fk_product) + INNER JOIN ".MAIN_DB_PREFIX."societe s ON (s.rowid = f.fk_soc) + LEFT JOIN ".MAIN_DB_PREFIX."c_country c ON (c.rowid = s.fk_pays) WHERE f.fk_statut > 0 - AND l.product_type = '.($exporttype == 'des' ? 1 : 0).' - AND f.entity = '.$conf->entity.' - AND (s.fk_pays <> '.$mysoc->country_id.' OR s.fk_pays IS NULL) - AND f.datef BETWEEN "'.$period_reference.'-01" AND "'.$period_reference.'-'.date('t').'"'; + AND l.product_type = ".($exporttype == "des" ? 1 : 0)." + AND f.entity = ".((int) $conf->entity)." + AND (s.fk_pays <> ".((int) $mysoc->country_id)." OR s.fk_pays IS NULL) + AND f.datef BETWEEN '".$this->db->escape($period_reference)."-01' AND '".$this->db->escape($period_reference)."-".date('t')."'"; return $sql; } @@ -399,27 +399,27 @@ class IntracommReport extends CommonObject } foreach ($TLinesFraisDePort as $res) { - $sql = 'SELECT p.customcode - FROM '.MAIN_DB_PREFIX.$tabledet.' d - INNER JOIN '.MAIN_DB_PREFIX.$table.' f ON (f.rowid = d.'.$field_link.') - INNER JOIN '.MAIN_DB_PREFIX.'product p ON (p.rowid = d.fk_product) + $sql = "SELECT p.customcode + FROM ".MAIN_DB_PREFIX.$tabledet." d + INNER JOIN ".MAIN_DB_PREFIX.$table." f ON (f.rowid = d.".$this->db->escape($field_link).") + INNER JOIN ".MAIN_DB_PREFIX."product p ON (p.rowid = d.fk_product) WHERE d.fk_product IS NOT NULL - AND f.entity = '.$conf->entity.' - AND '.$more_sql.' = "'.$res->refinvoice.'" + AND f.entity = ".((int) $conf->entity)." + AND ".$more_sql." = '".$this->db->escape($res->refinvoice)."' AND d.total_ht = ( SELECT MAX(d.total_ht) - FROM '.MAIN_DB_PREFIX.$tabledet.' d - INNER JOIN '.MAIN_DB_PREFIX.$table.' f ON (f.rowid = d.'.$field_link.') + FROM ".MAIN_DB_PREFIX.$tabledet." d + INNER JOIN ".MAIN_DB_PREFIX.$table." f ON (f.rowid = d.".$this->db->escape($field_link).") WHERE d.fk_product IS NOT NULL - AND '.$more_sql.' = "'.$res->refinvoice.'" + AND ".$more_sql." = '".$this->db->escape($res->refinvoice)."' AND d.fk_product NOT IN ( SELECT fk_product - FROM '.MAIN_DB_PREFIX.'categorie_product - WHERE fk_categorie = '.((int) $categ_fraisdeport->id).' + FROM ".MAIN_DB_PREFIX."categorie_product + WHERE fk_categorie = ".((int) $categ_fraisdeport->id)." ) - )'; + )"; $resql = $this->db->query($sql); $ress = $this->db->fetch_object($resql); @@ -437,7 +437,9 @@ class IntracommReport extends CommonObject */ public function getNextDeclarationNumber() { - $resql = $this->db->query('SELECT MAX(numero_declaration) as max_declaration_number FROM '.MAIN_DB_PREFIX.$this->table_element." WHERE exporttype='".$this->db->escape($this->exporttype)."'"); + $sql = "SELECT MAX(numero_declaration) as max_declaration_number FROM ".MAIN_DB_PREFIX.$this->table_element; + $sql .= " WHERE exporttype = '".$this->db->escape($this->exporttype)."'"; + $resql = $this->db->query($sql); if ($resql) { $res = $this->db->fetch_object($resql); } @@ -463,7 +465,6 @@ class IntracommReport extends CommonObject */ public function generateXMLFile() { - $name = $this->periode.'.xml'; $fname = sys_get_temp_dir().'/'.$name; $f = fopen($fname, 'w+'); diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 3f0142915a0..88ef801625e 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -862,27 +862,11 @@ class KnowledgeRecord extends CommonObject if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - - if ($obj->fk_user_valid) { - $vuser = new User($this->db); - $vuser->fetch($obj->fk_user_valid); - $this->user_validation = $vuser; - } - - if ($obj->fk_user_cloture) { - $cluser = new User($this->db); - $cluser->fetch($obj->fk_user_cloture); - $this->user_cloture = $cluser; - } + $this->user_creation_id = $obj->fk_user_creat; + $this->user_modification_id = $obj->fk_user_modif; $this->date_creation = $this->db->jdate($obj->datec); - $this->date_modification = $this->db->jdate($obj->datem); - $this->date_validation = $this->db->jdate($obj->datev); + $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem); } $this->db->free($result); diff --git a/htdocs/knowledgemanagement/knowledgerecord_agenda.php b/htdocs/knowledgemanagement/knowledgerecord_agenda.php index 81750e720c7..37c6b9a6e3c 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_agenda.php +++ b/htdocs/knowledgemanagement/knowledgerecord_agenda.php @@ -149,7 +149,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) { + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; if ($permissiontoadd) { @@ -218,7 +218,7 @@ if ($object->id > 0) { print '
    '; - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { print ''.$langs->trans("AddAction").''; } else { @@ -228,7 +228,7 @@ if ($object->id > 0) { print '
    '; - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { $param = '&id='.$object->id.'&socid='.$socid; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index 0c7ed519042..baddd9e29a5 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -366,7 +366,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) { + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project') . ' '; if ($permissiontoadd) { @@ -411,7 +411,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print ''.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_KNOWLEDGEMANAGEMENT, 1); print ""; diff --git a/htdocs/knowledgemanagement/knowledgerecord_contact.php b/htdocs/knowledgemanagement/knowledgerecord_contact.php index c338653b840..2b2facafc18 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_contact.php +++ b/htdocs/knowledgemanagement/knowledgerecord_contact.php @@ -132,7 +132,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/knowledgemanagement/knowledgerecord_document.php b/htdocs/knowledgemanagement/knowledgerecord_document.php index dbffe6aa3da..ec88c33d882 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_document.php +++ b/htdocs/knowledgemanagement/knowledgerecord_document.php @@ -130,7 +130,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/knowledgemanagement/knowledgerecord_note.php b/htdocs/knowledgemanagement/knowledgerecord_note.php index 2e58480adec..0f56a6115a3 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_note.php +++ b/htdocs/knowledgemanagement/knowledgerecord_note.php @@ -104,7 +104,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 0f85c4b1c33..b059cc9952a 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -161,7 +161,7 @@ BANK_DISABLE_DIRECT_INPUT=Disable direct recording of transaction in bank accoun ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL=Enable draft export on journal ACCOUNTANCY_COMBO_FOR_AUX=Enable combo list for subsidiary account (may be slow if you have a lot of third parties, break ability to search on a part of value) ACCOUNTING_DATE_START_BINDING=Define a date to start binding & transfer in accountancy. Below this date, the transactions will not be transferred to accounting. -ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER=On accountancy transfer, select period show by default +ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER=On accountancy transfer, what is the period selected by default ACCOUNTING_SELL_JOURNAL=Sell journal ACCOUNTING_PURCHASE_JOURNAL=Purchase journal @@ -182,7 +182,7 @@ DONATION_ACCOUNTINGACCOUNT=Accounting account to register donations ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT=Accounting account to register subscriptions ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT=Accounting account by default to register customer deposit -UseAuxiliaryAccountOnCustomerDeposit=Use sub-accounts on customer deposit lines +UseAuxiliaryAccountOnCustomerDeposit=Store customer account as individual account in subsidiary ledger for lines of down payments (if disabled, individual account for down payment lines will remain empty) ACCOUNTING_PRODUCT_BUY_ACCOUNT=Accounting account by default for the bought products (used if not defined in the product sheet) ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT=Accounting account by default for the bought products in EEC (used if not defined in the product sheet) @@ -427,6 +427,7 @@ SorryThisModuleIsNotCompatibleWithTheExperimentalFeatureOfSituationInvoices=Sorr AccountancyErrorMismatchLetterCode=Mismatch in reconcile code AccountancyErrorMismatchBalanceAmount=The balance (%s) is not equal to 0 AccountancyErrorLetteringBookkeeping=Errors have occurred concerning the transactions: %s +ErrorAccountNumberAlreadyExists=The accounting number %s already exists ## Import ImportAccountingEntries=Accounting entries diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index e4725704dd5..698ade8b8d1 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2252,13 +2252,21 @@ TemplateforBusinessCards=Template for a business card in different size InventorySetup= Inventory Setup ExportUseLowMemoryMode=Use a low memory mode ExportUseLowMemoryModeHelp=Use the low memory mode to execute the exec of the dump (compression is done through a pipe instead of into the PHP memory). This method does not allow to check that file is completed and error message can't be reported if it fails. -ShowQuickAddLink=Show a button to quickly add an object, in top right menu + +ModuleWebhookName = Webhook +ModuleWebhookDesc = Interface to catch dolibarr triggers and send it to an URL +WebhookSetup = Webhook setup +Settings = Settings +WebhookSetupPage = Webhook setup page +ShowQuickAddLink=Show a button to quickly add an element in top right menu + HashForPing=Hash used for ping ReadOnlyMode=Is instance in "Read Only" mode DEBUGBAR_USE_LOG_FILE=Use the dolibarr.log file to trap Logs UsingLogFileShowAllRecordOfSubrequestButIsSlower=Use the dolibarr.log file to trap Logs instead of live memory catching. It allows to catch all logs instead of only log of current process (so including the one of ajax subrequests pages) but will make your instance very very slow. Not recommended. FixedOrPercent=Fixed (use keyword 'fixed') or percent (use keyword 'percent') DefaultOpportunityStatus=Default opportunity status (first status when lead is created) + IconAndText=Icon and text TextOnly=Text only IconOnlyAllTextsOnHover=Icon only - All texts appears under icon on mouse hover menu bar @@ -2266,4 +2274,7 @@ IconOnlyTextOnHover=Icon only - Text of icon appears under icon on mouse hover t IconOnly=Icon only - Text on tooltip only INVOICE_ADD_ZATCA_QR_CODE=Show the ZATCA QR code on invoices INVOICE_ADD_ZATCA_QR_CODEMore=Some Arabic countries need this QR Code on their invoices -UrlSocialNetworksDesc=Url link of social network. Use {socialid} for the variable part that contains the social network ID. \ No newline at end of file +INVOICE_ADD_SWISS_QR_CODE=Show the swiss QR-Bill code on invoices +UrlSocialNetworksDesc=Url link of social network. Use {socialid} for the variable part that contains the social network ID. +IfThisCategoryIsChildOfAnother=If this category is a child of another one +NoName=No name diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang index a2d05767cae..62c2752ff9f 100644 --- a/htdocs/langs/en_US/categories.lang +++ b/htdocs/langs/en_US/categories.lang @@ -95,6 +95,7 @@ ShowCategory=Show tag/category ByDefaultInList=By default in list ChooseCategory=Choose category StocksCategoriesArea=Warehouse Categories +TicketsCategoriesArea=Tickets Categories ActionCommCategoriesArea=Event Categories WebsitePagesCategoriesArea=Page-Container Categories KnowledgemanagementsCategoriesArea=KM article Categories diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index c4a964b6b62..71b16f24506 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -60,13 +60,14 @@ NatureOfThirdParty=Nature of Third party NatureOfContact=Nature of Contact Address=Address State=State/Province +StateId=State ID StateCode=State/Province code StateShort=State Region=Region Region-State=Region - State Country=Country CountryCode=Country code -CountryId=Country id +CountryId=Country ID Phone=Phone PhoneShort=Phone Skype=Skype diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 0e61076345b..82ef7f0be9a 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -300,3 +300,4 @@ InvoiceToPay15Days=To pay (15 to 30 days) InvoiceToPay30Days=To pay (> 30 days) ConfirmPreselectAccount=Preselect accountancy code ConfirmPreselectAccountQuestion=Are you sure you want to preselect the %s selected lines with this accountancy code ? +AmountPaidMustMatchAmountOfDownPayment=Amount paid must match amount of down payment \ No newline at end of file diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 3955f0f9bb3..c50ccc810cf 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -92,6 +92,7 @@ ErrorModuleRequireJavascript=Javascript must not be disabled to have this featur ErrorPasswordsMustMatch=Both typed passwords must match each other ErrorContactEMail=A technical error occured. Please, contact administrator to following email %s and provide the error code %s in your message, or add a screen copy of this page. ErrorWrongValueForField=Field %s: '%s' does not match regex rule %s +ErrorHtmlInjectionForField=Field %s: The value '%s' contains a malicious data not allowed ErrorFieldValueNotIn=Field %s: '%s' is not a value found in field %s of %s ErrorFieldRefNotIn=Field %s: '%s' is not a %s existing ref ErrorsOnXLines=%s errors found @@ -287,6 +288,7 @@ ErrorInvoiceLoadThirdParty=Can't load third-party object for invoice "%s" ErrorInvoiceLoadThirdPartyKey=Third-party key "%s" no set for invoice "%s" ErrorDeleteLineNotAllowedByObjectStatus=Delete line is not allowed by current object status ErrorAjaxRequestFailed=Request failed +ErrorThirpdartyOrMemberidIsMandatory=Third party or Member of partnership is mandatory # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. @@ -321,7 +323,8 @@ WarningCreateSubAccounts=Warning, you can't create directly a sub account, you m WarningAvailableOnlyForHTTPSServers=Available only if using HTTPS secured connection. WarningModuleXDisabledSoYouMayMissEventHere=Module %s has not been enabled. So you may miss a lot of event here. WarningPaypalPaymentNotCompatibleWithStrict=The value 'Strict' makes the online payment features not working correctly. Use 'Lax' instead. - +WarningThemeForcedTo=Warning, theme has been forced to %s by hidden constant MAIN_FORCETHEME + # Validate RequireValidValue = Value not valid RequireAtLeastXString = Requires at least %s character(s) diff --git a/htdocs/langs/en_US/exports.lang b/htdocs/langs/en_US/exports.lang index c6dd04fd488..c4c629c9a87 100644 --- a/htdocs/langs/en_US/exports.lang +++ b/htdocs/langs/en_US/exports.lang @@ -18,6 +18,7 @@ ExportableFields=Exportable fields ExportedFields=Exported fields ImportModelName=Import profile name ImportModelSaved=Import profile saved as %s. +ImportProfile=Import profile DatasetToExport=Dataset to export DatasetToImport=Import file into dataset ChooseFieldsOrdersAndTitle=Choose fields order... @@ -53,6 +54,7 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats +DownloadEmptyExampleShort=Download a sample file DownloadEmptyExample=Download a template file with examples and information on fields you can import StarAreMandatory=Into the template file, all fields with a * are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... @@ -138,3 +140,6 @@ StocksWithBatch=Stocks and location (warehouse) of products with batch/serial nu WarningFirstImportedLine=The first line(s) will not be imported with the current selection NotUsedFields=Fields of database not used SelectImportFieldsSource = Choose the source file fields you want to import and their target field in database by choosing the fields in each select boxes, or select a predefined import profile: +MandatoryTargetFieldsNotMapped=Some mandatory target fields are not mapped +AllTargetMandatoryFieldsAreMapped=All target fields that need a mandatory value are mapped +ResultOfSimulationNoError=Result of simulation: No error \ No newline at end of file diff --git a/htdocs/langs/en_US/hrm.lang b/htdocs/langs/en_US/hrm.lang index ff917913eee..a45028aba60 100644 --- a/htdocs/langs/en_US/hrm.lang +++ b/htdocs/langs/en_US/hrm.lang @@ -70,9 +70,9 @@ RequiredSkills=Required skills for this job UserRank=User Rank SkillList=Skill list SaveRank=Save rank -knowHow=Know how -HowToBe=How to be -knowledge=Knowledge +TypeKnowHow=Know how +TypeHowToBe=How to be +TypeKnowledge=Knowledge AbandonmentComment=Abandonment comment DateLastEval=Date last evaluation NoEval=No evaluation done for this employee @@ -88,3 +88,4 @@ DeleteSkill = Skill removed SkillsExtraFields=Attributs supplémentaires (Compétences) JobsExtraFields=Attributs supplémentaires (Emplois) EvaluationsExtraFields=Attributs supplémentaires (Evaluations) +NeedBusinessTravels=Need business travels \ No newline at end of file diff --git a/htdocs/langs/en_US/languages.lang b/htdocs/langs/en_US/languages.lang index 820339e6875..6de4824ecea 100644 --- a/htdocs/langs/en_US/languages.lang +++ b/htdocs/langs/en_US/languages.lang @@ -13,6 +13,7 @@ Language_az_AZ=Azerbaijani Language_bn_BD=Bengali Language_bn_IN=Bengali (India) Language_bg_BG=Bulgarian +Language_bo_CN=Tibetan Language_bs_BA=Bosnian Language_ca_ES=Catalan Language_cs_CZ=Czech @@ -93,6 +94,7 @@ Language_nl_BE=Dutch (Belgium) Language_nl_NL=Dutch Language_pl_PL=Polish Language_pt_AO=Portuguese (Angola) +Language_pt_MZ=Portuguese (Mozambique) Language_pt_BR=Portuguese (Brazil) Language_pt_PT=Portuguese Language_ro_MD=Romanian (Moldavia) diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 22060706a36..1c205f48f46 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -35,7 +35,8 @@ DateEndSubscription=End date of membership EndSubscription=End of membership SubscriptionId=Contribution ID WithoutSubscription=Without contribution -MemberId=Member id +MemberId=Member Id +MemberRef=Member Ref NewMember=New member MemberType=Member type MemberTypeId=Member type id diff --git a/htdocs/langs/en_US/oauth.lang b/htdocs/langs/en_US/oauth.lang index dda6f1bdf73..08f7956f455 100644 --- a/htdocs/langs/en_US/oauth.lang +++ b/htdocs/langs/en_US/oauth.lang @@ -9,12 +9,13 @@ HasAccessToken=A token was generated and saved into local database NewTokenStored=Token received and saved ToCheckDeleteTokenOnProvider=Click here to check/delete authorization saved by %s OAuth provider TokenDeleted=Token deleted -RequestAccess=Click here to request/renew access and receive a new token to save +RequestAccess=Click here to request/renew access and receive a new token DeleteAccess=Click here to delete token UseTheFollowingUrlAsRedirectURI=Use the following URL as the Redirect URI when creating your credentials with your OAuth provider: -ListOfSupportedOauthProviders=Enter the credentials provided by your OAuth2 provider. Only supported OAuth2 providers are listedd here. These services may be used by other modules that need OAuth2 authentication. -OAuthSetupForLogin=Page to generate an OAuth token +ListOfSupportedOauthProviders=Add your OAuth2 token providers. Then, go on your OAuth provider admin page to create/get an OAuth ID and Secret and save them here. Once done, switch on the other tab to generate your token. +OAuthSetupForLogin=Page to manage (generate/delete) OAuth tokens SeePreviousTab=See previous tab +OAuthProvider=OAuth provider OAuthIDSecret=OAuth ID and Secret TOKEN_REFRESH=Token Refresh Present TOKEN_EXPIRED=Token expired @@ -23,10 +24,13 @@ TOKEN_DELETE=Delete saved token OAUTH_GOOGLE_NAME=OAuth Google service OAUTH_GOOGLE_ID=OAuth Google Id OAUTH_GOOGLE_SECRET=OAuth Google Secret -OAUTH_GOOGLE_DESC=Go to this page then "Credentials" to create OAuth credentials OAUTH_GITHUB_NAME=OAuth GitHub service OAUTH_GITHUB_ID=OAuth GitHub Id OAUTH_GITHUB_SECRET=OAuth GitHub Secret -OAUTH_GITHUB_DESC=Go to this page then "Register a new application" to create OAuth credentials +OAUTH_URL_FOR_CREDENTIAL=Go to this page to create or get your OAuth ID and Secret OAUTH_STRIPE_TEST_NAME=OAuth Stripe Test -OAUTH_STRIPE_LIVE_NAME=OAuth Stripe Live \ No newline at end of file +OAUTH_STRIPE_LIVE_NAME=OAuth Stripe Live +OAUTH_ID=OAuth ID +OAUTH_SECRET=OAuth secret +OAuthProviderAdded=OAuth provider added +AOAuthEntryForThisProviderAndLabelAlreadyHasAKey=An OAuth entry for this provider and label already exists \ No newline at end of file diff --git a/htdocs/langs/fr_FR/hrm.lang b/htdocs/langs/fr_FR/hrm.lang index 4a640a2e639..c812afa1fc9 100644 --- a/htdocs/langs/fr_FR/hrm.lang +++ b/htdocs/langs/fr_FR/hrm.lang @@ -70,9 +70,9 @@ RequiredSkills=Compétences requises pour cet emploi UserRank=Niveau employé SkillList=Liste compétence SaveRank=Sauvegarder niveau -knowHow=Savoir comment -HowToBe=Comment être -knowledge=Connaissances +TypeKnowHow=Savoir comment +TypeHowToBe=Comment être +TypeKnowledge=Connaissances AbandonmentComment=Commentaire sur l'abandon DateLastEval=Date dernière évaluation NoEval=Aucune évaluation effectuée pour cet employé diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 4bc539c1ff0..3ad898cda98 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -309,7 +309,7 @@ if ($action == 'create') { print ''.$langs->trans("Insurance").''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); // Projet associe @@ -424,7 +424,7 @@ if ($id > 0) { $morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, $user->rights->loan->write, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, $user->rights->loan->write, 'string', '', null, null, '', 1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->loadLangs(array("projects")); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->loan->write) { diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 37ab6194da5..147f07b7e1b 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -224,15 +224,15 @@ class Loan extends CommonObject $this->error = "ErrorBadParameter"; return -2; } - if (($conf->accounting->enabled) && empty($this->account_capital)) { + if (isModEnabled('accounting') && empty($this->account_capital)) { $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("LoanAccountancyCapitalCode")); return -2; } - if (($conf->accounting->enabled) && empty($this->account_insurance)) { + if (isModEnabled('accounting') && empty($this->account_insurance)) { $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("LoanAccountancyInsuranceCode")); return -2; } - if (($conf->accounting->enabled) && empty($this->account_interest)) { + if (isModEnabled('accounting') && empty($this->account_interest)) { $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("LoanAccountancyInterestCode")); return -2; } @@ -690,7 +690,7 @@ class Loan extends CommonObject public function info($id) { $sql = 'SELECT l.rowid, l.datec, l.fk_user_author, l.fk_user_modif,'; - $sql .= ' l.tms'; + $sql .= ' l.tms as datem'; $sql .= ' WHERE l.rowid = '.((int) $id); dol_syslog(get_class($this).'::info', LOG_DEBUG); @@ -700,21 +700,11 @@ class Loan extends CommonObject if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - if ($obj->fk_user_modif) { - $muser = new User($this->db); - $muser->fetch($obj->fk_user_modif); - $this->user_modification = $muser; - } - $this->date_creation = $this->db->jdate($obj->datec); - if (empty($obj->fk_user_modif)) { - $obj->tms = ""; - } - $this->date_modification = $this->db->jdate($obj->tms); + + $this->user_creation_id = $obj->fk_user_author; + $this->user_modification_id = $obj->fk_user_modif; + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem); $this->db->free($result); return 1; diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php index 1ed3e644b7f..3bc60980245 100644 --- a/htdocs/loan/document.php +++ b/htdocs/loan/document.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -103,7 +103,7 @@ if ($object->id) { $morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, 0, 'string', '', null, null, '', 1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' : '; if ($user->rights->loan->write) { diff --git a/htdocs/loan/info.php b/htdocs/loan/info.php index 3a5e95c7823..a0db5ca35a7 100644 --- a/htdocs/loan/info.php +++ b/htdocs/loan/info.php @@ -26,7 +26,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -67,7 +67,7 @@ $morehtmlref = '
    '; $morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, 0, 'string', '', null, null, '', 1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' : '; if ($user->rights->loan->write) { diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php index 0b982728b9e..c9b6ef0e679 100644 --- a/htdocs/loan/note.php +++ b/htdocs/loan/note.php @@ -30,7 +30,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -92,7 +92,7 @@ if ($id > 0) { $morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, 0, 'string', '', null, null, '', 1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->loadLangs(array("projects")); $morehtmlref .= '
    '.$langs->trans('Project').' : '; if ($user->rights->loan->write) { diff --git a/htdocs/loan/schedule.php b/htdocs/loan/schedule.php index 62ad7519ac9..0944142bc1c 100644 --- a/htdocs/loan/schedule.php +++ b/htdocs/loan/schedule.php @@ -149,7 +149,7 @@ $morehtmlref = '
    '; $morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, 0, 'string', '', null, null, '', 1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->loadLangs(array("projects")); $morehtmlref .= '
    '.$langs->trans('Project').' : '; if ($user->rights->loan->write) { diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index d035661ba62..5697e93407d 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -131,7 +131,7 @@ function testSqlAndScriptInject($val, $type) $inj += preg_match('/user\s*\(/i', $val); // avoid to use function user() or mysql_user() that return current database login $inj += preg_match('/information_schema/i', $val); // avoid to use request that read information_schema database $inj += preg_match('/global->MAIN_ONLY_LOGIN_ALLOWED)) { register_shutdown_function('dol_shutdown'); // Load debugbar -if (!empty($conf->debugbar->enabled) && !GETPOST('dol_use_jmobile') && empty($_SESSION['dol_use_jmobile'])) { +if (isModEnabled('debugbar') && !GETPOST('dol_use_jmobile') && empty($_SESSION['dol_use_jmobile'])) { global $debugbar; include_once DOL_DOCUMENT_ROOT.'/debugbar/class/DebugBar.php'; $debugbar = new DolibarrDebugBar(); @@ -480,10 +480,13 @@ if ((!empty($conf->global->MAIN_VERSION_LAST_UPGRADE) && ($conf->global->MAIN_VE $dolibarrversionlastupgrade = preg_split('/[.-]/', $versiontocompare); $dolibarrversionprogram = preg_split('/[.-]/', DOL_VERSION); $rescomp = versioncompare($dolibarrversionprogram, $dolibarrversionlastupgrade); - if ($rescomp > 0) { // Programs have a version higher than database. We did not add "&& $rescomp < 3" because we want upgrade process for build upgrades - dol_syslog("main.inc: database version ".$versiontocompare." is lower than programs version ".DOL_VERSION.". Redirect to install page.", LOG_WARNING); - header("Location: ".DOL_URL_ROOT."/install/index.php"); - exit; + if ($rescomp > 0) { // Programs have a version higher than database. + if (empty($conf->global->MAIN_NO_UPGRADE_REDIRECT_ON_LEVEL_3_CHANGE) || $rescomp < 3) { + // We did not add "&& $rescomp < 3" because we want upgrade process for build upgrades + dol_syslog("main.inc: database version ".$versiontocompare." is lower than programs version ".DOL_VERSION.". Redirect to install/upgrade page.", LOG_WARNING); + header("Location: ".DOL_URL_ROOT."/install/index.php"); + exit; + } } } @@ -1752,7 +1755,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr if (!$disablejs && !empty($conf->use_javascript_ajax)) { // CKEditor - if (empty($disableforlogin) && (!empty($conf->fckeditor->enabled) && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor') && !defined('DISABLE_CKEDITOR')) || defined('FORCE_CKEDITOR')) { + if (empty($disableforlogin) && (isModEnabled('fckeditor') && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor') && !defined('DISABLE_CKEDITOR')) || defined('FORCE_CKEDITOR')) { print ''."\n"; $pathckeditor = DOL_URL_ROOT.'/includes/ckeditor/ckeditor/'; $jsckeditor = 'ckeditor.js'; @@ -1780,7 +1783,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr // Browser notifications (if NOREQUIREMENU is on, it is mostly a page for popup, so we do not enable notif too. We hide also for public pages). if (!defined('NOBROWSERNOTIF') && !defined('NOREQUIREMENU') && !defined('NOLOGIN')) { $enablebrowsernotif = false; - if (!empty($conf->agenda->enabled) && !empty($conf->global->AGENDA_REMINDER_BROWSER)) { + if (isModEnabled('agenda') && !empty($conf->global->AGENDA_REMINDER_BROWSER)) { $enablebrowsernotif = true; } if ($conf->browser->layout == 'phone') { @@ -1959,7 +1962,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead } // Link to module builder - if (!empty($conf->modulebuilder->enabled)) { + if (isModEnabled('modulebuilder')) { $text = ''; //$text.= img_picto(":".$langs->trans("ModuleBuilder"), 'printer_top.png', 'class="printer"'); $text .= ''; @@ -2247,7 +2250,7 @@ function top_menu_user($hideloginname = 0, $urllogout = '') $btnUser = '