diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index f35dc90f0b8..f532dbd9e3b 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -18,7 +18,7 @@ jobs: fetch-depth: 1 #php-version: '7.1' - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2022.3.4 + uses: JetBrains/qodana-action@v2023.1.0 #with: # php-version: '7.1' env: diff --git a/ChangeLog b/ChangeLog index 62ccda4bbb8..eddc57edd08 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,7 +5,185 @@ English Dolibarr ChangeLog ***** ChangeLog for 18.0.0 compared to 17.0.0 ***** -NEW: PHP 8.2 compatibility. +For uses: +--------- + +NEW: PHP 8.2 compatibility (test not yet completed). +NEW: #22740 Add OpenID Connect impl +NEW: #23436 Group social networks fields +NEW: Accountancy - Add specific page to export accounting data rather than the journals page +NEW: Accountancy - Add sub-account balance FPC22 +NEW: Accountancy - Manage customer retained warranty FPC21+ +NEW: Accountancy - Manage intra-community VAT on supplier invoices - FPC22 +NEW: adapt category and product pictures sizes on takepos +NEW: Add ability of ODT support to supplier invoices +NEW: Add a public virtual card page for each user +NEW: Add a status on supplier price ref (WIP to close a supplier ref) +NEW: Add a trigger when create a shipping line batch and fix propagate missing errors +NEW: add bookmarks in selectable landing pages for users +NEW: Add column ext_payment_site for societe_rib +NEW: add convertion of images to webp for a single image +NEW: Add CRC for currency symbol before amount +NEW: add css editor to admin ihm +NEW: add customer code to invoices listing +NEW: Add Customer Order delivered (ORDER_NEW) in module Notification +NEW: add customize CSS in admin/ihm settings +NEW: Add date due and labels into customer comm card +NEW: Add dropdown button actions (example on Create button on project) +NEW: added an option to display the progress of tickets on the public interface +NEW: Add field reply-to in email collector as possible filter +NEW: Add filter on nb of generation done in list of recurring invoices +NEW: Add filters and sort on product unit column +NEW: adding button Send Email on the salary file +NEW: Add link to edit VAT list from error message of missing VAT +NEW: add link to thirdparty tickets history +NEW: add margin in paiement/card.php +NEW: Add mass action delete on VAT +NEW: Add more zip, town, country for owner of a bank account +NEW: add numbering modules for members +NEW: add option keepspace into dol_string_nospecialchar() +NEW: Add origin info when create a product batch when created from a movement stock +NEW: Add possibility to choose format #21426 +NEW: Add SQL contraint on product_stock table to allow only exsting product and warehouse#23543 +NEW: Add statistics by amount on statistics of products. +NEW: Add STRIPE_DEBUG, a way to log Stripe IPN +NEW: Add sub total in order list det +NEW: Add warehouse create and modify triggers. +NEW: Add widget box_members_by_tags.php +NEW: An external module can modify the quick search fields +NEW: Auto activate some modules on install (export/import/wysiwyg editor) +NEW: Autofill email form with the email template with status "Default" on +NEW: Bank name no more mandatory on creation. Can be generated if empty. +NEW: batch referential objets +NEW: Better responsive for mass actions +NEW: Can add any contact on events if global MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT is set at 1 +NEW: Can add the add now link on date into addfieldvalue() +NEW: Can bin accounting line for a given month +NEW: Can edit account on miscellaneous payment (if not transfered) +NEW: Can edit inline the vat number from supplier tab +NEW: Can fill date of salary payment with date of start of salary +NEW: Can filter on a custom group of accounts. Perf or ledger list. +NEW: Can go back to draft on shipment when stock change not on validate +NEW: Can modify bank account of sepa payment (if file not sent yet) +NEW: Can modify margin rates in offers like VAT rates. +NEW: Can modify the date of payment of a salary (if not reconciled) +NEW: Can now edit service name for oauth token +NEW: Can receive more than qty ordered on reception +NEW: Can select several warehouses into the view stock at date in past +NEW: Can select the export format during export of journals +NEW: Can set a checkbox in formconfirm by clicking on the label +NEW: Can set background style with MAIN_LOGIN_BACKGROUND_STYLE +NEW: Can set flag default value on email templates +NEW: Can set the page "List of opportunities" as landing page +NEW: Can show the sql request used on emailing selection +NEW: can stay on edit field when errors occurs +NEW: Can test a geoip conversion from the geoip setup page +NEW: Captcha for public member's subscription form +NEW: category of operation for crabe PDF model +NEW: color for start date and owner +NEW: comment in api_mymodule for seperate methods +NEW: constant PROPALE_ADDON_NOTE_PUBLIC_DEFAULT +NEW: create email substitution variable for intervention signature URL +NEW: Date for salary payment includes the hour/min +NEW: Debug the custom CSS feature to avoid a directory search/scan at +NEW: dev name +NEW: Disable bad reputation product price +NEW: dolExplodeIntoArray can accept regex +NEW: dol_sort_array can sort on alphabetical order even if val is num +NEW: don't have closed contact proposed as receiver for the mails +NEW: Dynamic choice of warehouse and batch in MO production. +NEW: element time integration code + sql +NEW: events list with color +NEW: expend/collapse list of social networks +NEW: filter for Signed+Billed in proposals +NEW: Filter on amount and qty on list of service's contracts +NEW: filter on entity in import +NEW: formconfirm can support field with format datetime +NEW: getCommonSubstitutionArray to have more substitute keys +NEW: helper functions for dates + small demo case +NEW: hook printFieldListFrom in contact list +NEW: inc.php: handle parameters from argv +NEW: Increment website counter on each page access in website module +NEW: Invalidate all sessions of a user when password is modified. +NEW: Invoice - Show Category of operations +NEW: iSuiteExpert export model +NEW: Keep a link between user created from recruitment and application +NEW: limit load products in takepos +NEW: List product in orders +NEW: Make it possible to select hours and minutes in form_confirm +NEW: map table to element for get entity in import +NEW: migration script + delete old table + rename fields and indexes +NEW: Multicurrency REST API to create, update, delete, update rate... +NEW: Multiselect for filter on prospection status +NEW: Name and date to print on PDF Sign +NEW: [Bulk delete Project tasks] +NEW: No overwrite of optionals during put() contact +NEW: Notification for Sign or Refused Propal from Online Page +NEW: notify also the contributor affected to a ticket if a new message public is post (add global TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ALSO_CONTRIBUTOR) +NEW: Now we can edit amount on vat and salaries clone action +NEW: only get openned contact from liste_contact function, to not have acces to closed contact as mail receiver +NEW: operation type in email collector to load or create contact +NEW: option filter for NoSalesRepresentativeAffected in proposals list +NEW: Option to manage deposit slips for more payment modes (not only +NEW: Option to show column for field and line selection on the left +NEW: Order export : allow to export field 'shipment method'. +NEW: payment default values when supplier order created from reception +NEW: Payment : manage contracts +NEW: Possibility to link to German pages in help +NEW: presend mass action in contact list +NEW: product images on popup are cached +NEW: Provide the oldcopy value when calling setValueFrom() function with a trigger key +NEW: Quadratus export with attachments in accountancy export +NEW: referential objects of batch +NEW: remove default percentage for event creation url +NEW: remove keys whose table element is the same as element in map list +NEW: repair script skip views +NEW: Save date to invalidate other session into user table +NEW: search on time spent duration range +NEW: Send an email when ticket assigned +NEW: Send a notification email when ticket assigned +NEW: sepaStripe now creates the payment mode with type pm_ using new API +NEW: set payment default values when supplier order created from reception +NEW: set ticket status to answered if the client has answered from the public interface +NEW: set today start time at begining +NEW: Setup emailcollector easier. Can also use ! for negative search. +NEW: Show counter of access of website in website list +NEW: Show main currency in company info user tooltip +NEW: Show module into list of emails templates +NEW: Show picto into the combobox of widgets +NEW: Show supplier invoice ref of direct debit transfer tab invoices +NEW: show supplier name in getNomUrl of supplier order +NEW: sort of column of custom group of account +NEW: Stock limit for alert and desired optimal stock by product and warehouse import +NEW: substitute date now in email collector +NEW: Support different bank account for several direct debit payments +NEW: Support multiselect in the warehouse selection combo box +NEW: Support option MAIN_SECURITY_MAXFILESIZE_DOWNLOADED #yogosha10660 +NEW: table llx_element_time to store time spent on several elements (mo, ticket...) +NEW: The batch for remind on due date can be setup for using validation date +NEW: The refresh link for imap collector is always visible +NEW: The upgrade process can be done by creating a file upgrade.unlock +NEW: Tooltip to explain how to add a photo on a product +NEW: Use a cache file for external RSS in calendar +NEW: Use by default the domain $dolibarr_main_url_root for SMTP HELO +NEW: use more recent model by default +NEW: VAT can be modified during add of line +NEW: write all fields and their properties in asciidoc format + +For developers or integrators: +------------------------------ + +NEW: triggers on mailing +NEW: add function for listiong objects from directory +NEW: Add helplist property to describe fields of obects +NEW: Add hook in loadLotStock() in html.formproduct.class.php file, add hook 'llxFooter', Add hook online sign +NEW: Update lib parsedownto 1.7.4, phpspreadsheet lib to v1.12 +NEW: Support contact in post() document API +NEW: updating in modulbuilder on tab Menu when adding object +NEW: Add/Edit permissions in ModuleBuilder +NEW: Better generated documentation for modulebuilder +NEW: Add sent info in the parameters provided to the hook sendMailAfter +NEW: add setAsSelectUser into factory for generic setup page WARNING: @@ -269,18 +447,20 @@ WARNING: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: * Minimal PHP version is now PHP 7.0 instead of PHP 5.6 +* Core has introduced a Universal Filter Syntax for seach criteria. Example: ((((field1:=:value1) OR (field2:in:1,2,3)) AND ...). In rare case, some filters + could be provided by URL parameters. For such cases (societe/ajax/company.php), use of Universal Filter Syntax become mandatory. * The signature of method getNomUrl() of class ProductFournisseur has been modified to match the signature of method Product->getNomUrl() * Trigger ORDER_SUPPLIER_DISPATCH is removed, use ORDER_SUPPLIER_RECEIVE and/or LINEORDER_SUPPLIER_DISPATCH instead. * All functions fetch_all() have been set to deprecated for naming consitency, use fetchAll() instead. * Code standardization: '$user->rights->propale' is now '$user->rights->propal' everywhere. * Deprecated method set_billed() on shipment and reception class has been removed. Use setBilled() instead. * Tables llx_prelevement_facture and llx_prelevement_facture_demande have been renamed into llx_prelevement and llx_prelevement_demande. -* Rename MAIN_LIST_ALLOW_NOTES into MAIN_LIST_HIDE_NOTES and rename MAIN_LIST_ALLOW_PRIVATE_NOTES into MAIN_LIST_HIDE_PRIVATE_NOTES -* Rename the substitution for "project label" instead of "project title" in substitution variables -* You must use "$objectoffield" to manipulate the current object inside the formulare of computed custom extrafields instead of $obj/$object. +* Renamed MAIN_LIST_ALLOW_NOTES into MAIN_LIST_HIDE_NOTES and renamed MAIN_LIST_ALLOW_PRIVATE_NOTES into MAIN_LIST_HIDE_PRIVATE_NOTES +* Renamed the substitution for "project label" instead of "project title" in substitution variables +* You must use "$objectoffield" to manipulate the current object inside the form of computed custom extrafields instead of $obj/$object. * Making a global search is sending the parameter using always the name search_all (instead of sometimes sall and search_all) * The property $url_last_version must be public if defined into module descriptor files; -* Filters in class field definitions must be a Dolibarr filter syntax string. + ***** ChangeLog for 16.0.5 compared to 16.0.4 ***** diff --git a/SECURITY.md b/SECURITY.md index 3c89a2f38e1..1c281099885 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -6,8 +6,8 @@ This file contains some policies about the security reports on Dolibarr ERP CRM | Version | Supported | | ---------- | ---------------------- | -| <= 16.0.2 | :x: | -| >= 16.0.3 | :white_check_mark: | +| <= 17.0.0 | :x: | +| >= 17.0.1 | :white_check_mark: | | >= develop | :white_check_mark: | ## Reporting a Vulnerability diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 324f5d8d447..34766f92778 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -95,7 +95,7 @@ $arrayfields = array( 'aa.import_key'=>array('label'=>"ImportId", 'checked'=>-1) ); -if ($conf->global->MAIN_FEATURES_LEVEL < 2) { +if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { unset($arrayfields['categories']); unset($arrayfields['aa.reconcilable']); } @@ -146,7 +146,7 @@ if (empty($reshook)) { $search_array_options = array(); } if ((GETPOST('valid_change_chart', 'alpha') && GETPOST('chartofaccounts', 'int') > 0) // explicit click on button 'Change and load' with js on - || (GETPOST('chartofaccounts', 'int') > 0 && GETPOST('chartofaccounts', 'int') != $conf->global->CHARTOFACCOUNTS)) { // a submit of form is done and chartofaccounts combo has been modified + || (GETPOST('chartofaccounts', 'int') > 0 && GETPOST('chartofaccounts', 'int') != getDolGlobalInt('CHARTOFACCOUNTS'))) { // a submit of form is done and chartofaccounts combo has been modified if ($chartofaccounts > 0 && $permissiontoadd) { // Get language code for this $chartofaccounts $sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'c_country as c, '.MAIN_DB_PREFIX.'accounting_system as a'; @@ -228,7 +228,7 @@ if ($action == 'delete') { print $formconfirm; } -$pcgver = $conf->global->CHARTOFACCOUNTS; +$pcgver = getDolGlobalInt('CHARTOFACCOUNTS'); $sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.account_number, aa.account_parent, aa.label, aa.labelshort, aa.fk_accounting_category,"; $sql .= " aa.reconcilable, aa.active, aa.import_key,"; @@ -240,8 +240,8 @@ $sql .= " WHERE asy.rowid = ".((int) $pcgver); //print $sql; if (strlen(trim($search_account))) { $lengthpaddingaccount = 0; - if ($conf->global->ACCOUNTING_LENGTH_GACCOUNT || $conf->global->ACCOUNTING_LENGTH_AACCOUNT) { - $lengthpaddingaccount = max($conf->global->ACCOUNTING_LENGTH_GACCOUNT, $conf->global->ACCOUNTING_LENGTH_AACCOUNT); + if (getDolGlobalInt('ACCOUNTING_LENGTH_GACCOUNT') || getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT')) { + $lengthpaddingaccount = max(getDolGlobalInt('ACCOUNTING_LENGTH_GACCOUNT'), getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT')); } $search_account_tmp = $search_account; $weremovedsomezero = 0; @@ -289,7 +289,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 126b7ac9c07..26287a5bbb8 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -76,7 +76,7 @@ if ($action == 'add' && $user->hasRight('accounting', 'chartofaccount')) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); $action = 'create'; } else { - $sql = "SELECT pcg_version FROM " . MAIN_DB_PREFIX . "accounting_system WHERE rowid = ".((int) $conf->global->CHARTOFACCOUNTS); + $sql = "SELECT pcg_version FROM " . MAIN_DB_PREFIX . "accounting_system WHERE rowid = ".((int) getDolGlobalInt('CHARTOFACCOUNTS')); dol_syslog('accountancy/admin/card.php:: $sql=' . $sql); $result = $db->query($sql); @@ -139,7 +139,7 @@ if ($action == 'add' && $user->hasRight('accounting', 'chartofaccount')) { } else { $result = $object->fetch($id); - $sql = "SELECT pcg_version FROM ".MAIN_DB_PREFIX."accounting_system WHERE rowid=".((int) $conf->global->CHARTOFACCOUNTS); + $sql = "SELECT pcg_version FROM ".MAIN_DB_PREFIX."accounting_system WHERE rowid=".((int) getDolGlobalInt('CHARTOFACCOUNTS')); dol_syslog('accountancy/admin/card.php:: $sql=' . $sql); $result2 = $db->query($sql); @@ -211,7 +211,7 @@ $form = new Form($db); $formaccounting = new FormAccounting($db); $accountsystem = new AccountancySystem($db); -$accountsystem->fetch($conf->global->CHARTOFACCOUNTS); +$accountsystem->fetch(getDolGlobalInt('CHARTOFACCOUNTS')); $title = $langs->trans('AccountAccounting')." - ".$langs->trans('Card'); diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 82cf7d282f1..d0be20bb918 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -104,7 +104,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('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 diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 174d8fdf13e..fe83a04afd0 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -361,7 +361,7 @@ print ''; foreach ($list as $key) { print ''; - if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO) && ($key == 'ACCOUNTING_LENGTH_GACCOUNT' || $key == 'ACCOUNTING_LENGTH_AACCOUNT')) { + if (getDolGlobalInt('ACCOUNTING_MANAGE_ZERO') && ($key == 'ACCOUNTING_LENGTH_GACCOUNT' || $key == 'ACCOUNTING_LENGTH_AACCOUNT')) { continue; } diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 01bfa1da942..45ce2c7c763 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -394,7 +394,7 @@ if (empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { $sql .= $db->order($sortfield, $sortorder); $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/accountancy/admin/subaccount.php b/htdocs/accountancy/admin/subaccount.php index 31b99be39a3..86df8d69416 100644 --- a/htdocs/accountancy/admin/subaccount.php +++ b/htdocs/accountancy/admin/subaccount.php @@ -78,7 +78,7 @@ $arrayfields = array( 'reconcilable'=>array('label'=>$langs->trans("Reconcilable"), 'checked'=>1) ); -if ($conf->global->MAIN_FEATURES_LEVEL < 2) { +if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { unset($arrayfields['reconcilable']); } @@ -137,8 +137,8 @@ $sql .= " AND sa.code_compta <> ''"; //print $sql; if (strlen(trim($search_subaccount))) { $lengthpaddingaccount = 0; - if ($conf->global->ACCOUNTING_LENGTH_AACCOUNT) { - $lengthpaddingaccount = max($conf->global->ACCOUNTING_LENGTH_AACCOUNT); + if (getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT')) { + $lengthpaddingaccount = getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT'); } $search_subaccount_tmp = $search_subaccount; $weremovedsomezero = 0; @@ -184,8 +184,8 @@ $sql .= " AND sa.code_compta_fournisseur <> ''"; //print $sql; if (strlen(trim($search_subaccount))) { $lengthpaddingaccount = 0; - if ($conf->global->ACCOUNTING_LENGTH_AACCOUNT) { - $lengthpaddingaccount = max($conf->global->ACCOUNTING_LENGTH_AACCOUNT); + if (getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT')) { + $lengthpaddingaccount = getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT'); } $search_subaccount_tmp = $search_subaccount; $weremovedsomezero = 0; @@ -231,8 +231,8 @@ $sql .= " AND u.accountancy_code <> ''"; //print $sql; if (strlen(trim($search_subaccount))) { $lengthpaddingaccount = 0; - if ($conf->global->ACCOUNTING_LENGTH_AACCOUNT) { - $lengthpaddingaccount = max($conf->global->ACCOUNTING_LENGTH_AACCOUNT); + if (getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT')) { + $lengthpaddingaccount = getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT'); } $search_subaccount_tmp = $search_subaccount; $weremovedsomezero = 0; @@ -274,7 +274,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index c45a1202419..976c2f33cc6 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -254,7 +254,7 @@ llxHeader('', $title_page); if ($action != 'export_csv') { // List $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { if ($type == 'sub') { $nbtotalofrecords = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter, 'AND', 1); } else { diff --git a/htdocs/accountancy/bookkeeping/export.php b/htdocs/accountancy/bookkeeping/export.php new file mode 100644 index 00000000000..bc99974ccd8 --- /dev/null +++ b/htdocs/accountancy/bookkeeping/export.php @@ -0,0 +1,1404 @@ + + * Copyright (C) 2013-2016 Florian Henry + * Copyright (C) 2013-2023 Alexandre Spangaro + * Copyright (C) 2022 Lionel Vessiller + * Copyright (C) 2016-2017 Laurent Destailleur + * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2022 Progiseize + * + * 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 htdocs/accountancy/bookkeeping/export.php + * \ingroup Accountancy (Double entries) + * \brief Export operation of book keeping + */ + +// Load Dolibarr environment +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/lettering.class.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; + +// Load translation files required by the page +$langs->loadLangs(array("accountancy", "compta")); + +$socid = GETPOST('socid', 'int'); + +$action = GETPOST('action', 'aZ09'); +$massaction = GETPOST('massaction', 'alpha'); +$confirm = GETPOST('confirm', 'alpha'); +$toselect = GETPOST('toselect', 'array'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'bookkeepinglist'; +$search_mvt_num = GETPOST('search_mvt_num', 'int'); +$search_doc_type = GETPOST("search_doc_type", 'alpha'); +$search_doc_ref = GETPOST("search_doc_ref", 'alpha'); +$search_date_startyear = GETPOST('search_date_startyear', 'int'); +$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); +$search_date_startday = GETPOST('search_date_startday', 'int'); +$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); +$search_date_endday = GETPOST('search_date_endday', 'int'); +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); +$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); +$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int')); +$search_date_creation_startyear = GETPOST('search_date_creation_startyear', 'int'); +$search_date_creation_startmonth = GETPOST('search_date_creation_startmonth', 'int'); +$search_date_creation_startday = GETPOST('search_date_creation_startday', 'int'); +$search_date_creation_endyear = GETPOST('search_date_creation_endyear', 'int'); +$search_date_creation_endmonth = GETPOST('search_date_creation_endmonth', 'int'); +$search_date_creation_endday = GETPOST('search_date_creation_endday', 'int'); +$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); +$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); +$search_date_modification_startyear = GETPOST('search_date_modification_startyear', 'int'); +$search_date_modification_startmonth = GETPOST('search_date_modification_startmonth', 'int'); +$search_date_modification_startday = GETPOST('search_date_modification_startday', 'int'); +$search_date_modification_endyear = GETPOST('search_date_modification_endyear', 'int'); +$search_date_modification_endmonth = GETPOST('search_date_modification_endmonth', 'int'); +$search_date_modification_endday = GETPOST('search_date_modification_endday', 'int'); +$search_date_modification_start = dol_mktime(0, 0, 0, $search_date_modification_startmonth, $search_date_modification_startday, $search_date_modification_startyear); +$search_date_modification_end = dol_mktime(23, 59, 59, $search_date_modification_endmonth, $search_date_modification_endday, $search_date_modification_endyear); +$search_date_export_startyear = GETPOST('search_date_export_startyear', 'int'); +$search_date_export_startmonth = GETPOST('search_date_export_startmonth', 'int'); +$search_date_export_startday = GETPOST('search_date_export_startday', 'int'); +$search_date_export_endyear = GETPOST('search_date_export_endyear', 'int'); +$search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int'); +$search_date_export_endday = GETPOST('search_date_export_endday', 'int'); +$search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear); +$search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); +$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int'); +$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int'); +$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int'); +$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int'); +$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int'); +$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int'); +$search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear); +$search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); +$search_import_key = GETPOST("search_import_key", 'alpha'); + +//var_dump($search_date_start);exit; +if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) { + $action = 'delbookkeepingyear'; +} +if (GETPOST("button_export_file_x") || GETPOST("button_export_file.x") || GETPOST("button_export_file")) { + $action = 'export_file'; +} + +$search_account_category = GETPOST('search_account_category', 'int'); + +$search_accountancy_code = GETPOST("search_accountancy_code", 'alpha'); +$search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha'); +if ($search_accountancy_code_start == - 1) { + $search_accountancy_code_start = ''; +} +$search_accountancy_code_end = GETPOST('search_accountancy_code_end', 'alpha'); +if ($search_accountancy_code_end == - 1) { + $search_accountancy_code_end = ''; +} + +$search_accountancy_aux_code = GETPOST("search_accountancy_aux_code", 'alpha'); +$search_accountancy_aux_code_start = GETPOST('search_accountancy_aux_code_start', 'alpha'); +if ($search_accountancy_aux_code_start == - 1) { + $search_accountancy_aux_code_start = ''; +} +$search_accountancy_aux_code_end = GETPOST('search_accountancy_aux_code_end', 'alpha'); +if ($search_accountancy_aux_code_end == - 1) { + $search_accountancy_aux_code_end = ''; +} +$search_mvt_label = GETPOST('search_mvt_label', 'alpha'); +$search_direction = GETPOST('search_direction', 'alpha'); +$search_debit = GETPOST('search_debit', 'alpha'); +$search_credit = GETPOST('search_credit', 'alpha'); +$search_ledger_code = GETPOST('search_ledger_code', 'array'); +$search_lettering_code = GETPOST('search_lettering_code', 'alpha'); +$search_not_reconciled = GETPOST('search_not_reconciled', 'alpha'); + +// Load variable for pagination +$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; +} +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if ($sortorder == "") { + $sortorder = "ASC"; +} +if ($sortfield == "") { + $sortfield = "t.piece_num,t.rowid"; +} + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$object = new BookKeeping($db); +$hookmanager->initHooks(array('bookkeepingexport')); + +$formaccounting = new FormAccounting($db); +$form = new Form($db); + +if (!in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOST('page', 'int') == '' && !GETPOST('noreset', 'int') && $user->hasRight('accounting', 'mouvements', 'export')) { + if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('restore_lastsearch_values') && !GETPOST('search_accountancy_code_start')) { + $query = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear "; + $query .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."' limit 1"; + $res = $db->query($query); + + if ($res->num_rows > 0) { + $fiscalYear = $db->fetch_object($res); + $search_date_start = strtotime($fiscalYear->date_start); + $search_date_end = strtotime($fiscalYear->date_end); + } else { + $month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1); + $year_start = dol_print_date(dol_now(), '%Y'); + if (dol_print_date(dol_now(), '%m') < $month_start) { + $year_start--; // If current month is lower that starting fiscal month, we start last year + } + $year_end = $year_start + 1; + $month_end = $month_start - 1; + if ($month_end < 1) { + $month_end = 12; + $year_end--; + } + $search_date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start); + $search_date_end = dol_get_last_day($year_end, $month_end); + } + } +} + + +$arrayfields = array( + 't.piece_num'=>array('label'=>$langs->trans("TransactionNumShort"), 'checked'=>1), + 't.code_journal'=>array('label'=>$langs->trans("Codejournal"), 'checked'=>1), + 't.doc_date'=>array('label'=>$langs->trans("Docdate"), 'checked'=>1), + 't.doc_ref'=>array('label'=>$langs->trans("Piece"), 'checked'=>1), + 't.numero_compte'=>array('label'=>$langs->trans("AccountAccountingShort"), 'checked'=>1), + 't.subledger_account'=>array('label'=>$langs->trans("SubledgerAccount"), 'checked'=>1), + 't.label_operation'=>array('label'=>$langs->trans("Label"), 'checked'=>1), + 't.debit'=>array('label'=>$langs->trans("AccountingDebit"), 'checked'=>1), + 't.credit'=>array('label'=>$langs->trans("AccountingCredit"), 'checked'=>1), + 't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1), + 't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0), + 't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0), + 't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1), + 't.date_validated'=>array('label'=>$langs->trans("DateValidationAndLock"), 'checked'=>1, 'enabled'=>!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")), + 't.import_key'=>array('label'=>$langs->trans("ImportId"), 'checked'=>0, 'position'=>1100), +); + +if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) { + unset($arrayfields['t.lettering_code']); +} + +$accountancyexport = new AccountancyExport($db); +$listofformat = $accountancyexport->getType(); +$formatexportset = getDolGlobalString('ACCOUNTING_EXPORT_MODELCSV'); +if (empty($listofformat[$formatexportset])) { + $formatexportset = 1; +} + +$error = 0; + +if (!isModEnabled('accounting')) { + accessforbidden(); +} +if ($user->socid > 0) { + accessforbidden(); +} +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { + accessforbidden(); +} + + +/* + * Actions + */ + +$param = ''; + +if (GETPOST('cancel', 'alpha')) { + $action = 'list'; $massaction = ''; +} +if (!GETPOST('confirmmassaction', 'alpha')) { + $massaction = ''; +} + +$parameters = array('socid'=>$socid); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers + $search_mvt_num = ''; + $search_doc_type = ''; + $search_doc_ref = ''; + $search_doc_date = ''; + $search_account_category = ''; + $search_accountancy_code = ''; + $search_accountancy_code_start = ''; + $search_accountancy_code_end = ''; + $search_accountancy_aux_code = ''; + $search_accountancy_aux_code_start = ''; + $search_accountancy_aux_code_end = ''; + $search_mvt_label = ''; + $search_direction = ''; + $search_ledger_code = array(); + $search_date_startyear = ''; + $search_date_startmonth = ''; + $search_date_startday = ''; + $search_date_endyear = ''; + $search_date_endmonth = ''; + $search_date_endday = ''; + $search_date_start = ''; + $search_date_end = ''; + $search_date_creation_startyear = ''; + $search_date_creation_startmonth = ''; + $search_date_creation_startday = ''; + $search_date_creation_endyear = ''; + $search_date_creation_endmonth = ''; + $search_date_creation_endday = ''; + $search_date_creation_start = ''; + $search_date_creation_end = ''; + $search_date_modification_startyear = ''; + $search_date_modification_startmonth = ''; + $search_date_modification_startday = ''; + $search_date_modification_endyear = ''; + $search_date_modification_endmonth = ''; + $search_date_modification_endday = ''; + $search_date_modification_start = ''; + $search_date_modification_end = ''; + $search_date_export_startyear = ''; + $search_date_export_startmonth = ''; + $search_date_export_startday = ''; + $search_date_export_endyear = ''; + $search_date_export_endmonth = ''; + $search_date_export_endday = ''; + $search_date_export_start = ''; + $search_date_export_end = ''; + $search_date_validation_startyear = ''; + $search_date_validation_startmonth = ''; + $search_date_validation_startday = ''; + $search_date_validation_endyear = ''; + $search_date_validation_endmonth = ''; + $search_date_validation_endday = ''; + $search_date_validation_start = ''; + $search_date_validation_end = ''; + $search_debit = ''; + $search_credit = ''; + $search_lettering_code = ''; + $search_not_reconciled = ''; + $search_import_key = ''; + $toselect = array(); + } + + // Must be after the remove filter action, before the export. + $filter = array(); + if (!empty($search_date_start)) { + $filter['t.doc_date>='] = $search_date_start; + $tmp = dol_getdate($search_date_start); + $param .= '&search_date_startmonth='.urlencode($tmp['mon']).'&search_date_startday='.urlencode($tmp['mday']).'&search_date_startyear='.urlencode($tmp['year']); + } + if (!empty($search_date_end)) { + $filter['t.doc_date<='] = $search_date_end; + $tmp = dol_getdate($search_date_end); + $param .= '&search_date_endmonth='.urlencode($tmp['mon']).'&search_date_endday='.urlencode($tmp['mday']).'&search_date_endyear='.urlencode($tmp['year']); + } + if (!empty($search_doc_date)) { + $filter['t.doc_date'] = $search_doc_date; + $tmp = dol_getdate($search_doc_date); + $param .= '&doc_datemonth='.urlencode($tmp['mon']).'&doc_dateday='.urlencode($tmp['mday']).'&doc_dateyear='.urlencode($tmp['year']); + } + if (!empty($search_doc_type)) { + $filter['t.doc_type'] = $search_doc_type; + $param .= '&search_doc_type='.urlencode($search_doc_type); + } + if (!empty($search_doc_ref)) { + $filter['t.doc_ref'] = $search_doc_ref; + $param .= '&search_doc_ref='.urlencode($search_doc_ref); + } + if ($search_account_category != '-1' && !empty($search_account_category)) { + require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php'; + $accountingcategory = new AccountancyCategory($db); + + $listofaccountsforgroup = $accountingcategory->getCptsCat(0, 'fk_accounting_category = '.((int) $search_account_category)); + $listofaccountsforgroup2 = array(); + if (is_array($listofaccountsforgroup)) { + foreach ($listofaccountsforgroup as $tmpval) { + $listofaccountsforgroup2[] = "'".$db->escape($tmpval['id'])."'"; + } + } + $filter['t.search_accounting_code_in'] = join(',', $listofaccountsforgroup2); + $param .= '&search_account_category='.urlencode($search_account_category); + } + if (!empty($search_accountancy_code)) { + $filter['t.numero_compte'] = $search_accountancy_code; + $param .= '&search_accountancy_code='.urlencode($search_accountancy_code); + } + if (!empty($search_accountancy_code_start)) { + $filter['t.numero_compte>='] = $search_accountancy_code_start; + $param .= '&search_accountancy_code_start='.urlencode($search_accountancy_code_start); + } + if (!empty($search_accountancy_code_end)) { + $filter['t.numero_compte<='] = $search_accountancy_code_end; + $param .= '&search_accountancy_code_end='.urlencode($search_accountancy_code_end); + } + if (!empty($search_accountancy_aux_code)) { + $filter['t.subledger_account'] = $search_accountancy_aux_code; + $param .= '&search_accountancy_aux_code='.urlencode($search_accountancy_aux_code); + } + if (!empty($search_accountancy_aux_code_start)) { + $filter['t.subledger_account>='] = $search_accountancy_aux_code_start; + $param .= '&search_accountancy_aux_code_start='.urlencode($search_accountancy_aux_code_start); + } + if (!empty($search_accountancy_aux_code_end)) { + $filter['t.subledger_account<='] = $search_accountancy_aux_code_end; + $param .= '&search_accountancy_aux_code_end='.urlencode($search_accountancy_aux_code_end); + } + if (!empty($search_mvt_label)) { + $filter['t.label_operation'] = $search_mvt_label; + $param .= '&search_mvt_label='.urlencode($search_mvt_label); + } + if (!empty($search_direction)) { + $filter['t.sens'] = $search_direction; + $param .= '&search_direction='.urlencode($search_direction); + } + if (!empty($search_ledger_code)) { + $filter['t.code_journal'] = $search_ledger_code; + foreach ($search_ledger_code as $code) { + $param .= '&search_ledger_code[]='.urlencode($code); + } + } + if (!empty($search_mvt_num)) { + $filter['t.piece_num'] = $search_mvt_num; + $param .= '&search_mvt_num='.urlencode($search_mvt_num); + } + if (!empty($search_date_creation_start)) { + $filter['t.date_creation>='] = $search_date_creation_start; + $tmp = dol_getdate($search_date_creation_start); + $param .= '&search_date_creation_startmonth='.urlencode($tmp['mon']).'&search_date_creation_startday='.urlencode($tmp['mday']).'&search_date_creation_startyear='.urlencode($tmp['year']); + } + if (!empty($search_date_creation_end)) { + $filter['t.date_creation<='] = $search_date_creation_end; + $tmp = dol_getdate($search_date_creation_end); + $param .= '&search_date_creation_endmonth='.urlencode($tmp['mon']).'&search_date_creation_endday='.urlencode($tmp['mday']).'&search_date_creation_endyear='.urlencode($tmp['year']); + } + if (!empty($search_date_modification_start)) { + $filter['t.tms>='] = $search_date_modification_start; + $tmp = dol_getdate($search_date_modification_start); + $param .= '&search_date_modification_startmonth='.urlencode($tmp['mon']).'&search_date_modification_startday='.urlencode($tmp['mday']).'&search_date_modification_startyear='.urlencode($tmp['year']); + } + if (!empty($search_date_modification_end)) { + $filter['t.tms<='] = $search_date_modification_end; + $tmp = dol_getdate($search_date_modification_end); + $param .= '&search_date_modification_endmonth='.urlencode($tmp['mon']).'&search_date_modification_endday='.urlencode($tmp['mday']).'&search_date_modification_endyear='.urlencode($tmp['year']); + } + if (!empty($search_date_export_start)) { + $filter['t.date_export>='] = $search_date_export_start; + $tmp = dol_getdate($search_date_export_start); + $param .= '&search_date_export_startmonth='.urlencode($tmp['mon']).'&search_date_export_startday='.urlencode($tmp['mday']).'&search_date_export_startyear='.urlencode($tmp['year']); + } + if (!empty($search_date_export_end)) { + $filter['t.date_export<='] = $search_date_export_end; + $tmp = dol_getdate($search_date_export_end); + $param .= '&search_date_export_endmonth='.urlencode($tmp['mon']).'&search_date_export_endday='.urlencode($tmp['mday']).'&search_date_export_endyear='.urlencode($tmp['year']); + } + if (!empty($search_date_validation_start)) { + $filter['t.date_validated>='] = $search_date_validation_start; + $tmp = dol_getdate($search_date_validation_start); + $param .= '&search_date_validation_startmonth='.urlencode($tmp['mon']).'&search_date_validation_startday='.urlencode($tmp['mday']).'&search_date_validation_startyear='.urlencode($tmp['year']); + } + if (!empty($search_date_validation_end)) { + $filter['t.date_validated<='] = $search_date_validation_end; + $tmp = dol_getdate($search_date_validation_end); + $param .= '&search_date_validation_endmonth='.urlencode($tmp['mon']).'&search_date_validation_endday='.urlencode($tmp['mday']).'&search_date_validation_endyear='.urlencode($tmp['year']); + } + if (!empty($search_debit)) { + $filter['t.debit'] = $search_debit; + $param .= '&search_debit='.urlencode($search_debit); + } + if (!empty($search_credit)) { + $filter['t.credit'] = $search_credit; + $param .= '&search_credit='.urlencode($search_credit); + } + if (!empty($search_lettering_code)) { + $filter['t.lettering_code'] = $search_lettering_code; + $param .= '&search_lettering_code='.urlencode($search_lettering_code); + } + if (!empty($search_not_reconciled)) { + $filter['t.reconciled_option'] = $search_not_reconciled; + $param .= '&search_not_reconciled='.urlencode($search_not_reconciled); + } + if (!empty($search_import_key)) { + $filter['t.import_key'] = $search_import_key; + $param .= '&search_import_key='.urlencode($search_import_key); + } + + if ($action == 'setreexport') { + $setreexport = GETPOST('value', 'int'); + if (!dolibarr_set_const($db, "ACCOUNTING_REEXPORT", $setreexport, 'yesno', 0, '', $conf->entity)) { + $error++; + } + + if (!$error) { + if (empty($conf->global->ACCOUNTING_REEXPORT)) { + setEventMessages($langs->trans("ExportOfPiecesAlreadyExportedIsDisable"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("ExportOfPiecesAlreadyExportedIsEnable"), null, 'warnings'); + } + } else { + setEventMessages($langs->trans("Error"), null, 'errors'); + } + } + + // Mass actions + $objectclass = 'Bookkeeping'; + $objectlabel = 'Bookkeeping'; + $permissiontoread = $user->hasRight('societe', 'lire'); + $permissiontodelete = $user->hasRight('societe', 'supprimer'); + $permissiontoadd = $user->hasRight('societe', 'creer'); + $uploaddir = $conf->societe->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; +} + +// Build and execute select (used by page and export action) +// must de set after the action that set $filter +// -------------------------------------------------------------------- + +$sql = 'SELECT'; +$sql .= ' t.rowid,'; +$sql .= " t.doc_date,"; +$sql .= " t.doc_type,"; +$sql .= " t.doc_ref,"; +$sql .= " t.fk_doc,"; +$sql .= " t.fk_docdet,"; +$sql .= " t.thirdparty_code,"; +$sql .= " t.subledger_account,"; +$sql .= " t.subledger_label,"; +$sql .= " t.numero_compte,"; +$sql .= " t.label_compte,"; +$sql .= " t.label_operation,"; +$sql .= " t.debit,"; +$sql .= " t.credit,"; +$sql .= " t.lettering_code,"; +$sql .= " t.montant as amount,"; +$sql .= " t.sens,"; +$sql .= " t.fk_user_author,"; +$sql .= " t.import_key,"; +$sql .= " t.code_journal,"; +$sql .= " t.journal_label,"; +$sql .= " t.piece_num,"; +$sql .= " t.date_creation,"; +$sql .= " t.tms as date_modification,"; +$sql .= " t.date_export,"; +$sql .= " t.date_validated as date_validation,"; +$sql .= " t.import_key"; + +$sqlfields = $sql; // $sql fields to remove for count total + +$sql .= ' FROM '.MAIN_DB_PREFIX.$object->table_element.' as t'; +// Manage filter +$sqlwhere = array(); +if (count($filter) > 0) { + foreach ($filter as $key => $value) { + if ($key == 't.doc_date') { + $sqlwhere[] = $key."='".$db->idate($value)."'"; + } elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=') { + $sqlwhere[] = $key."'".$db->idate($value)."'"; + } elseif ($key == 't.numero_compte>=' || $key == 't.numero_compte<=' || $key == 't.subledger_account>=' || $key == 't.subledger_account<=') { + $sqlwhere[] = $key."'".$db->escape($value)."'"; + } elseif ($key == 't.fk_doc' || $key == 't.fk_docdet' || $key == 't.piece_num') { + $sqlwhere[] = $key.'='.((int) $value); + } elseif ($key == 't.subledger_account' || $key == 't.numero_compte') { + $sqlwhere[] = $key." LIKE '".$db->escape($value)."%'"; + } elseif ($key == 't.subledger_account') { + $sqlwhere[] = natural_search($key, $value, 0, 1); + } elseif ($key == 't.date_creation>=' || $key == 't.date_creation<=') { + $sqlwhere[] = $key."'".$db->idate($value)."'"; + } elseif ($key == 't.tms>=' || $key == 't.tms<=') { + $sqlwhere[] = $key."'".$db->idate($value)."'"; + } elseif ($key == 't.date_export>=' || $key == 't.date_export<=') { + $sqlwhere[] = $key."'".$db->idate($value)."'"; + } elseif ($key == 't.date_validated>=' || $key == 't.date_validated<=') { + $sqlwhere[] = $key."'".$db->idate($value)."'"; + } elseif ($key == 't.credit' || $key == 't.debit') { + $sqlwhere[] = natural_search($key, $value, 1, 1); + } elseif ($key == 't.reconciled_option') { + $sqlwhere[] = 't.lettering_code IS NULL'; + } elseif ($key == 't.code_journal' && !empty($value)) { + if (is_array($value)) { + $sqlwhere[] = natural_search("t.code_journal", join(',', $value), 3, 1); + } else { + $sqlwhere[] = natural_search("t.code_journal", $value, 3, 1); + } + } elseif ($key == 't.search_accounting_code_in' && !empty($value)) { + $sqlwhere[] = 't.numero_compte IN ('.$db->sanitize($value, 1).')'; + } else { + $sqlwhere[] = natural_search($key, $value, 0, 1); + } + } +} +$sql .= ' WHERE t.entity IN ('.getEntity('accountancy').')'; +if (empty($conf->global->ACCOUNTING_REEXPORT)) { // Reexport not enabled (default mode) + $sql .= " AND t.date_export IS NULL"; +} +if (count($sqlwhere) > 0) { + $sql .= ' AND '.implode(' AND ', $sqlwhere); +} +//print $sql; + + +// Export into a file with format defined into setup (FEC, CSV, ...) +// Must be after definition of $sql +if ($action == 'export_fileconfirm' && $user->hasRight('accounting', 'mouvements', 'export')) { + // TODO Replace the fetchAll to get all ->line followed by call to ->export(). fetchAll() currently consumes too much memory on large export. + // Replace this with the query($sql) and loop on each line to export them. + $result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', (empty($conf->global->ACCOUNTING_REEXPORT) ? 0 : 1)); + + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } else { + // Export files then exit + $accountancyexport = new AccountancyExport($db); + + $formatexport = GETPOST('formatexport', 'int'); + $notexportlettering = GETPOST('notexportlettering', 'alpha'); + + if (!empty($notexportlettering)) { + if (is_array($object->lines)) { + foreach ($object->lines as $k => $movement) { + unset($object->lines[$k]->lettering_code); + unset($object->lines[$k]->date_lettering); + } + } + } + + $notifiedexportdate = GETPOST('notifiedexportdate', 'alpha'); + $notifiedvalidationdate = GETPOST('notifiedvalidationdate', 'alpha'); + $withAttachment = !empty(trim(GETPOST('notifiedexportfull', 'alphanohtml'))) ? 1 : 0; + + // Output data on screen or download + $result = $accountancyexport->export($object->lines, $formatexport, $withAttachment); + + $error = 0; + if ($result < 0) { + $error++; + } else { + if (!empty($notifiedexportdate) || !empty($notifiedvalidationdate)) { + if (is_array($object->lines)) { + dol_syslog("/accountancy/bookkeeping/list.php Function export_file Specify movements as exported", LOG_DEBUG); + + // Specify as export : update field date_export or date_validated + $db->begin(); + + // TODO Merge update for each line into one global using rowid IN (list of movement ids) + foreach ($object->lines as $movement) { + $now = dol_now(); + + $setfields = ''; + if (!empty($notifiedexportdate) && empty($movement->date_export)) { + $setfields .= ($setfields ? "," : "")." date_export = '".$db->idate($now)."'"; + } + if (!empty($notifiedvalidationdate) && empty($movement->date_validation)) { + $setfields .= ($setfields ? "," : "")." date_validated = '".$db->idate($now)."'"; + } + + if ($setfields) { + $sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping"; + $sql .= " SET ".$setfields; + $sql .= " WHERE rowid = ".((int) $movement->id); + + $result = $db->query($sql); + if (!$result) { + $error++; + break; + } + } + } + + if (!$error) { + $db->commit(); + } else { + $error++; + $accountancyexport->errors[] = $langs->trans('NotAllExportedMovementsCouldBeRecordedAsExportedOrValidated'); + $db->rollback(); + } + } + } + } + + if ($error) { + setEventMessages('', $accountancyexport->errors, 'errors'); + header('Location: '.$_SERVER['PHP_SELF']); + } + exit(); // download or show errors + } +} + + +/* + * View + */ + +$formother = new FormOther($db); +$formfile = new FormFile($db); + +$title_page = $langs->trans("Operations").' - '.$langs->trans("ExportAccountancy"); + +// Count total nb of records +$nbtotalofrecords = ''; +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { + /* The fast and low memory method to get and count full list converts the sql into a sql count */ + $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); + $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); + $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 resultset is smaller then paging size (filtering), goto and load page 0 + $page = 0; + $offset = 0; + } + $db->free($resql); +} + +// 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) { + dol_print_error($db); + exit; +} + +$num = $db->num_rows($resql); + +$arrayofselected = is_array($toselect) ? $toselect : array(); + +// Output page +// -------------------------------------------------------------------- + +llxHeader('', $title_page); + +$formconfirm = ''; + +if ($action == 'export_file') { + $form_question = array(); + + $form_question['formatexport'] = array( + 'name' => 'formatexport', + 'type' => 'select', + 'label' => $langs->trans('Modelcsv'), // TODO Use Selectmodelcsv and show a select combo + 'values' => $listofformat, + 'default' => $formatexportset, + 'morecss' => 'minwidth200 maxwidth200' + ); + + $form_question['separator0'] = array('name'=>'separator0', 'type'=>'separator'); + + if (getDolGlobalInt("ACCOUNTING_ENABLE_LETTERING")) { + // If 1, we check by default. + $checked = !empty($conf->global->ACCOUNTING_DEFAULT_NOT_EXPORT_LETTERING) ? 'true' : 'false'; + $form_question['notexportlettering'] = array( + 'name' => 'notexportlettering', + 'type' => 'checkbox', + 'label' => $langs->trans('NotExportLettering'), + 'value' => $checked, + ); + + $form_question['separator1'] = array('name'=>'separator1', 'type'=>'separator'); + } + + // If 1 or not set, we check by default. + $checked = (!isset($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE) || !empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE)); + $form_question['notifiedexportdate'] = array( + 'name' => 'notifiedexportdate', + 'type' => 'checkbox', + 'label' => $langs->trans('NotifiedExportDate'), + 'value' => (!empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE) ? 'false' : 'true'), + ); + + $form_question['separator2'] = array('name'=>'separator2', 'type'=>'separator'); + + if (!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")) { + // If 0 or not set, we NOT check by default. + $checked = (isset($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) || !empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE)); + $form_question['notifiedvalidationdate'] = array( + 'name' => 'notifiedvalidationdate', + 'type' => 'checkbox', + 'label' => $langs->trans('NotifiedValidationDate', $langs->transnoentitiesnoconv("MenuAccountancyClosure")), + 'value' => $checked, + ); + + $form_question['separator3'] = array('name'=>'separator3', 'type'=>'separator'); + } + + // add documents in an archive for accountancy export (Quadratus) + if (getDolGlobalString('ACCOUNTING_EXPORT_MODELCSV') == AccountancyExport::$EXPORT_TYPE_QUADRATUS) { + $form_question['notifiedexportfull'] = array( + 'name' => 'notifiedexportfull', + 'type' => 'checkbox', + 'label' => $langs->trans('NotifiedExportFull'), + 'value' => 'false', + ); + } + + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").'...', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 420, 600); +} + +// Print form confirm +print $formconfirm; + +//$param=''; param started before +if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + $param .= '&contextpage='.urlencode($contextpage); +} +if ($limit > 0 && $limit != $conf->liste_limit) { + $param .= '&limit='.urlencode($limit); +} + +// List of mass actions available +$arrayofmassactions = array(); +$massactionbutton = $form->selectMassAction($massaction, $arrayofmassactions); + +print '
'; +print ''; +print ''; +if ($optioncss != '') { + print ''; +} +print ''; +print ''; +print ''; +print ''; + +if (count($filter)) { + $buttonLabel = $langs->trans("ExportFilteredList"); +} else { + $buttonLabel = $langs->trans("ExportList"); +} + +$parameters = array('param' => $param); +$reshook = $hookmanager->executeHooks('addMoreActionsButtonsList', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +$newcardbutton = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint; +if (empty($reshook)) { + // Button re-export + if (empty($conf->global->ACCOUNTING_REEXPORT)) { + $newcardbutton .= ''.img_picto($langs->trans("ClickToShowAlreadyExportedLines"), 'switch_off', 'class="small size15x valignmiddle"'); + $newcardbutton .= ''.$langs->trans("ClickToShowAlreadyExportedLines").''; + $newcardbutton .= ''; + } else { + $newcardbutton .= ''.img_picto($langs->trans("DocsAlreadyExportedAreIncluded"), 'switch_on', 'class="warning size15x valignmiddle"'); + $newcardbutton .= ''.$langs->trans("DocsAlreadyExportedAreIncluded").''; + $newcardbutton .= ''; + } + + if ($user->hasRight('accounting', 'mouvements', 'export')) { + $newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file&token='.newToken().($param ? '&'.$param : '').'&sortfield='.urlencode($sortfield).'&sortorder='.urlencode($sortorder), $user->hasRight('accounting', 'mouvements', 'export')); + } +} + +print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1); + +// Not display message when all the list of docs are included +if (empty($conf->global->ACCOUNTING_REEXPORT)) { + print info_admin($langs->trans("WarningDataDisappearsWhenDataIsExported"), 0, 0, 0, 'hideonsmartphone info'); +} + +//$topicmail = "Information"; +//$modelmail = "accountingbookkeeping"; +//$objecttmp = new BookKeeping($db); +//$trackid = 'bk'.$object->id; +include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; + +$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +if ($massactionbutton && $contextpage != 'poslist') { + $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); +} + +$moreforfilter = ''; +$moreforfilter .= '
'; +$moreforfilter .= $langs->trans('AccountingCategory').': '; +$moreforfilter .= '
'; +$moreforfilter .= $formaccounting->select_accounting_category($search_account_category, 'search_account_category', 1, 0, 0, 0); +$moreforfilter .= '
'; +$moreforfilter .= '
'; + +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +if (empty($reshook)) { + $moreforfilter .= $hookmanager->resPrint; +} else { + $moreforfilter = $hookmanager->resPrint; +} + +print '
'; +print $moreforfilter; +print '
'; + +print '
'; +print ''; + +// Filters lines +print ''; +// Action column +if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; +} +// Movement number +if (!empty($arrayfields['t.piece_num']['checked'])) { + print ''; +} +// Code journal +if (!empty($arrayfields['t.code_journal']['checked'])) { + print ''; +} +// Date document +if (!empty($arrayfields['t.doc_date']['checked'])) { + print ''; +} +// Ref document +if (!empty($arrayfields['t.doc_ref']['checked'])) { + print ''; +} +// Accountancy account +if (!empty($arrayfields['t.numero_compte']['checked'])) { + print ''; +} +// Subledger account +if (!empty($arrayfields['t.subledger_account']['checked'])) { + print ''; +} +// Label operation +if (!empty($arrayfields['t.label_operation']['checked'])) { + print ''; +} +// Debit +if (!empty($arrayfields['t.debit']['checked'])) { + print ''; +} +// Credit +if (!empty($arrayfields['t.credit']['checked'])) { + print ''; +} +// Lettering code +if (!empty($arrayfields['t.lettering_code']['checked'])) { + print ''; +} + +// Fields from hook +$parameters = array('arrayfields'=>$arrayfields); +$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + +// Date creation +if (!empty($arrayfields['t.date_creation']['checked'])) { + print ''; +} +// Date modification +if (!empty($arrayfields['t.tms']['checked'])) { + print ''; +} +// Date export +if (!empty($arrayfields['t.date_export']['checked'])) { + print ''; +} +// Date validation +if (!empty($arrayfields['t.date_validated']['checked'])) { + print ''; +} +if (!empty($arrayfields['t.import_key']['checked'])) { + print ''; +} +// Action column +if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; +} +print "\n"; + +print ''; +if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch actioncolumn ');} +if (!empty($arrayfields['t.piece_num']['checked'])) { + print_liste_field_titre($arrayfields['t.piece_num']['label'], $_SERVER['PHP_SELF'], "t.piece_num", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['t.code_journal']['checked'])) { + print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center '); +} +if (!empty($arrayfields['t.doc_date']['checked'])) { + print_liste_field_titre($arrayfields['t.doc_date']['label'], $_SERVER['PHP_SELF'], "t.doc_date", "", $param, '', $sortfield, $sortorder, 'center '); +} +if (!empty($arrayfields['t.doc_ref']['checked'])) { + print_liste_field_titre($arrayfields['t.doc_ref']['label'], $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['t.numero_compte']['checked'])) { + print_liste_field_titre($arrayfields['t.numero_compte']['label'], $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['t.subledger_account']['checked'])) { + print_liste_field_titre($arrayfields['t.subledger_account']['label'], $_SERVER['PHP_SELF'], "t.subledger_account", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['t.label_operation']['checked'])) { + print_liste_field_titre($arrayfields['t.label_operation']['label'], $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['t.debit']['checked'])) { + print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['t.credit']['checked'])) { + print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['t.lettering_code']['checked'])) { + print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, '', $sortfield, $sortorder, 'center '); +} +// Hook fields +$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +if (!empty($arrayfields['t.date_creation']['checked'])) { + print_liste_field_titre($arrayfields['t.date_creation']['label'], $_SERVER['PHP_SELF'], "t.date_creation", "", $param, '', $sortfield, $sortorder, 'center '); +} +if (!empty($arrayfields['t.tms']['checked'])) { + print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, '', $sortfield, $sortorder, 'center '); +} +if (!empty($arrayfields['t.date_export']['checked'])) { + print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export,t.doc_date", "", $param, '', $sortfield, $sortorder, 'center '); +} +if (!empty($arrayfields['t.date_validated']['checked'])) { + print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated,t.doc_date", "", $param, '', $sortfield, $sortorder, 'center '); +} +if (!empty($arrayfields['t.import_key']['checked'])) { + print_liste_field_titre($arrayfields['t.import_key']['label'], $_SERVER["PHP_SELF"], "t.import_key", "", $param, '', $sortfield, $sortorder, 'center '); +} +if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); +} +print "\n"; + + +$line = new BookKeepingLine(); + +// Loop on record +// -------------------------------------------------------------------- +$i = 0; +$totalarray = array(); +$totalarray['nbfield'] = 0; +$total_debit = 0; +$total_credit = 0; +$totalarray['val'] = array (); +$totalarray['val']['totaldebit'] = 0; +$totalarray['val']['totalcredit'] = 0; + +while ($i < min($num, $limit)) { + $obj = $db->fetch_object($resql); + if (empty($obj)) { + break; // Should not happen + } + + $line->id = $obj->rowid; + $line->doc_date = $db->jdate($obj->doc_date); + $line->doc_type = $obj->doc_type; + $line->doc_ref = $obj->doc_ref; + $line->fk_doc = $obj->fk_doc; + $line->fk_docdet = $obj->fk_docdet; + $line->thirdparty_code = $obj->thirdparty_code; + $line->subledger_account = $obj->subledger_account; + $line->subledger_label = $obj->subledger_label; + $line->numero_compte = $obj->numero_compte; + $line->label_compte = $obj->label_compte; + $line->label_operation = $obj->label_operation; + $line->debit = $obj->debit; + $line->credit = $obj->credit; + $line->montant = $obj->amount; // deprecated + $line->amount = $obj->amount; + $line->sens = $obj->sens; + $line->lettering_code = $obj->lettering_code; + $line->fk_user_author = $obj->fk_user_author; + $line->import_key = $obj->import_key; + $line->code_journal = $obj->code_journal; + $line->journal_label = $obj->journal_label; + $line->piece_num = $obj->piece_num; + $line->date_creation = $db->jdate($obj->date_creation); + $line->date_modification = $db->jdate($obj->date_modification); + $line->date_export = $db->jdate($obj->date_export); + $line->date_validation = $db->jdate($obj->date_validation); + + $total_debit += $line->debit; + $total_credit += $line->credit; + + print ''; + // Action column + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Piece number + if (!empty($arrayfields['t.piece_num']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Journal code + if (!empty($arrayfields['t.code_journal']['checked'])) { + $accountingjournal = new AccountingJournal($db); + $result = $accountingjournal->fetch('', $line->code_journal); + $journaltoshow = (($result > 0) ? $accountingjournal->getNomUrl(0, 0, 0, '', 0) : $line->code_journal); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Document date + if (!empty($arrayfields['t.doc_date']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Document ref + if (!empty($arrayfields['t.doc_ref']['checked'])) { + if ($line->doc_type == 'customer_invoice') { + $langs->loadLangs(array('bills')); + + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + $objectstatic = new Facture($db); + $objectstatic->fetch($line->fk_doc); + //$modulepart = 'facture'; + + $filename = dol_sanitizeFileName($line->doc_ref); + $filedir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($line->doc_ref); + $urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id; + $documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); + } elseif ($line->doc_type == 'supplier_invoice') { + $langs->loadLangs(array('bills')); + + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; + $objectstatic = new FactureFournisseur($db); + $objectstatic->fetch($line->fk_doc); + //$modulepart = 'invoice_supplier'; + + $filename = dol_sanitizeFileName($line->doc_ref); + $filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($line->fk_doc, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref); + $subdir = get_exdir($objectstatic->id, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref); + $documentlink = $formfile->getDocumentsLink($objectstatic->element, $subdir, $filedir); + } elseif ($line->doc_type == 'expense_report') { + $langs->loadLangs(array('trips')); + + require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; + $objectstatic = new ExpenseReport($db); + $objectstatic->fetch($line->fk_doc); + //$modulepart = 'expensereport'; + + $filename = dol_sanitizeFileName($line->doc_ref); + $filedir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($line->doc_ref); + $urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id; + $documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); + } elseif ($line->doc_type == 'bank') { + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + $objectstatic = new AccountLine($db); + $objectstatic->fetch($line->fk_doc); + } else { + // Other type + } + + $labeltoshow = ''; + $labeltoshowalt = ''; + if ($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice' || $line->doc_type == 'expense_report') { + $labeltoshow .= $objectstatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1); + $labeltoshow .= $documentlink; + $labeltoshowalt .= $objectstatic->ref; + } elseif ($line->doc_type == 'bank') { + $labeltoshow .= $objectstatic->getNomUrl(1); + $labeltoshowalt .= $objectstatic->ref; + $bank_ref = strstr($line->doc_ref, '-'); + $labeltoshow .= " " . $bank_ref; + $labeltoshowalt .= " " . $bank_ref; + } else { + $labeltoshow .= $line->doc_ref; + $labeltoshowalt .= $line->doc_ref; + } + + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Account number + if (!empty($arrayfields['t.numero_compte']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Subledger account + if (!empty($arrayfields['t.subledger_account']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Label operation + if (!empty($arrayfields['t.label_operation']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Amount debit + if (!empty($arrayfields['t.debit']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'totaldebit'; + } + $totalarray['val']['totaldebit'] += $line->debit; + } + + // Amount credit + if (!empty($arrayfields['t.credit']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'totalcredit'; + } + $totalarray['val']['totalcredit'] += $line->credit; + } + + // Lettering code + if (!empty($arrayfields['t.lettering_code']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // 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; + + // Creation operation date + if (!empty($arrayfields['t.date_creation']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Modification operation date + if (!empty($arrayfields['t.tms']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Exported operation date + if (!empty($arrayfields['t.date_export']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Validated operation date + if (!empty($arrayfields['t.date_validated']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + if (!empty($arrayfields['t.import_key']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Action column + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + + print "\n"; + + $i++; +} + +// 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 ''; +} + +$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 "
'; + $searchpicto = $form->showFilterButtons('left'); + print $searchpicto; + print ''; + print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1, 'small maxwidth75'); + print ''; + print '
'; + print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print '
'; + print '
'; + print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); + print '
'; + print '
'; + print '
'; + print $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', $langs->trans('From'), array(), 1, 1, 'maxwidth150', 'account'); + print '
'; + print '
'; + print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), array(), 1, 1, 'maxwidth150', 'account'); + print '
'; + print '
'; + // TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because it does not + // use setup of keypress to select thirdparty and this hang browser on large database. + if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { + print '
'; + //print $langs->trans('From').' '; + print $formaccounting->select_auxaccount($search_accountancy_aux_code_start, 'search_accountancy_aux_code_start', $langs->trans('From'), 'maxwidth250', 'subledgeraccount'); + print '
'; + print '
'; + print $formaccounting->select_auxaccount($search_accountancy_aux_code_end, 'search_accountancy_aux_code_end', $langs->trans('to'), 'maxwidth250', 'subledgeraccount'); + print '
'; + } else { + print ''; + } + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'; + print '
'; + print '
'; + print $form->selectDate($search_date_creation_start, 'search_date_creation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print '
'; + print '
'; + print $form->selectDate($search_date_creation_end, 'search_date_creation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); + print '
'; + print '
'; + print '
'; + print $form->selectDate($search_date_modification_start, 'search_date_modification_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print '
'; + print '
'; + print $form->selectDate($search_date_modification_end, 'search_date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print '
'; + print '
'; + print '
'; + print $form->selectDate($search_date_export_start, 'search_date_export_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print '
'; + print '
'; + print $form->selectDate($search_date_export_end, 'search_date_export_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); + print '
'; + print '
'; + print '
'; + print $form->selectDate($search_date_validation_start, 'search_date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print '
'; + print '
'; + print $form->selectDate($search_date_validation_end, 'search_date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); + print '
'; + print '
'; + print ''; + print ''; + $searchpicto = $form->showFilterButtons(); + print $searchpicto; + print '
'; + if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($line->id, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print ''; + $object->id = $line->id; + $object->piece_num = $line->piece_num; + print $object->getNomUrl(1, '', 0, '', 1); + print ''.$journaltoshow.''.dol_print_date($line->doc_date, 'day').''; + print $labeltoshow; + print "'.length_accountg($line->numero_compte).''.length_accounta($line->subledger_account).''.dol_escape_htmltag($line->label_operation).''.($line->debit != 0 ? price($line->debit) : '').''.($line->credit != 0 ? price($line->credit) : '').''.$line->lettering_code.''.dol_print_date($line->date_creation, 'dayhour', 'tzuserrel').''.dol_print_date($line->date_modification, 'dayhour', 'tzuserrel').''.dol_print_date($line->date_export, 'dayhour', 'tzuserrel').''.dol_print_date($line->date_validation, 'dayhour', 'tzuserrel').''.$obj->import_key."'; + if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($line->id, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print '
'.$langs->trans("NoRecordFound").'
"; +print '
'; + +print '
'; + +// End of page +llxFooter(); + +$db->close(); diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 78106b1026e..585d5b664cb 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2016 Florian Henry - * Copyright (C) 2013-2022 Alexandre Spangaro + * Copyright (C) 2013-2023 Alexandre Spangaro * Copyright (C) 2022 Lionel Vessiller * Copyright (C) 2016-2017 Laurent Destailleur * Copyright (C) 2018-2021 Frédéric France @@ -29,7 +29,6 @@ // Load Dolibarr environment require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/lettering.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; @@ -96,14 +95,6 @@ $search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_star $search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); $search_import_key = GETPOST("search_import_key", 'alpha'); -//var_dump($search_date_start);exit; -if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) { - $action = 'delbookkeepingyear'; -} -if (GETPOST("button_export_file_x") || GETPOST("button_export_file.x") || GETPOST("button_export_file")) { - $action = 'export_file'; -} - $search_account_category = GETPOST('search_account_category', 'int'); $search_accountancy_code = GETPOST("search_accountancy_code", 'alpha'); @@ -159,7 +150,7 @@ $hookmanager->initHooks(array('bookkeepinglist')); $formaccounting = new FormAccounting($db); $form = new Form($db); -if (!in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOST('page', 'int') == '' && !GETPOST('noreset', 'int') && $user->hasRight('accounting', 'mouvements', 'export')) { +if (!in_array($action, array('delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOST('page', 'int') == '' && !GETPOST('noreset', 'int') && $user->hasRight('accounting', 'mouvements', 'export')) { if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('restore_lastsearch_values') && !GETPOST('search_accountancy_code_start')) { $query = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear "; $query .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."' limit 1"; @@ -201,8 +192,8 @@ $arrayfields = array( 't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1), 't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0), 't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0), - 't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1), - 't.date_validated'=>array('label'=>$langs->trans("DateValidationAndLock"), 'checked'=>1, 'enabled'=>!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")), + 't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>0), + 't.date_validated'=>array('label'=>$langs->trans("DateValidationAndLock"), 'checked'=>0, 'enabled'=>!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")), 't.import_key'=>array('label'=>$langs->trans("ImportId"), 'checked'=>0, 'position'=>1100), ); @@ -210,13 +201,6 @@ if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) { unset($arrayfields['t.lettering_code']); } -$accountancyexport = new AccountancyExport($db); -$listofformat = $accountancyexport->getType(); -$formatexportset = getDolGlobalString('ACCOUNTING_EXPORT_MODELCSV'); -if (empty($listofformat[$formatexportset])) { - $formatexportset = 1; -} - $error = 0; if (!isModEnabled('accounting')) { @@ -457,49 +441,6 @@ if (empty($reshook)) { $param .= '&search_import_key='.urlencode($search_import_key); } - //if ($action == 'delbookkeepingyearconfirm' && !$user->hasRight('accounting', 'mouvements', 'supprimer_tous')) { - // $delmonth = GETPOST('delmonth', 'int'); - // $delyear = GETPOST('delyear', 'int'); - // if ($delyear == -1) { - // $delyear = 0; - // } - // $deljournal = GETPOST('deljournal', 'alpha'); - // if ($deljournal == -1) { - // $deljournal = 0; - // } - // - // if (!empty($delmonth) || !empty($delyear) || !empty($deljournal)) { - // $result = $object->deleteByYearAndJournal($delyear, $deljournal, '', ($delmonth > 0 ? $delmonth : 0)); - // if ($result < 0) { - // setEventMessages($object->error, $object->errors, 'errors'); - // } else { - // setEventMessages("RecordDeleted", null, 'mesgs'); - // } - // - // // Make a redirect to avoid to launch the delete later after a back button - // header("Location: list.php".($param ? '?'.$param : '')); - // exit; - // } else { - // setEventMessages("NoRecordDeleted", null, 'warnings'); - // } - //} - if ($action == 'setreexport') { - $setreexport = GETPOST('value', 'int'); - if (!dolibarr_set_const($db, "ACCOUNTING_REEXPORT", $setreexport, 'yesno', 0, '', $conf->entity)) { - $error++; - } - - if (!$error) { - if ($conf->global->ACCOUNTING_REEXPORT == 1) { - setEventMessages($langs->trans("ExportOfPiecesAlreadyExportedIsEnable"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("ExportOfPiecesAlreadyExportedIsDisable"), null, 'warnings'); - } - } else { - setEventMessages($langs->trans("Error"), null, 'errors'); - } - } - // Mass actions $objectclass = 'Bookkeeping'; $objectlabel = 'Bookkeeping'; @@ -707,103 +648,12 @@ if (count($filter) > 0) { } } $sql .= ' WHERE t.entity IN ('.getEntity('accountancy').')'; -if (empty($conf->global->ACCOUNTING_REEXPORT)) { - $sql .= " AND t.date_export IS NULL"; -} + if (count($sqlwhere) > 0) { $sql .= ' AND '.implode(' AND ', $sqlwhere); } //print $sql; - -// Export into a file with format defined into setup (FEC, CSV, ...) -// Must be after definition of $sql -if ($action == 'export_fileconfirm' && $user->hasRight('accounting', 'mouvements', 'export')) { - // TODO Replace the fetchAll to get all ->line followed by call to ->export(). It currently consumes too much memory on large export. - // Replace this with the query($sql) and loop on each line to export them. - $result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', (empty($conf->global->ACCOUNTING_REEXPORT) ? 0 : 1)); - - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } else { - // Export files then exit - $accountancyexport = new AccountancyExport($db); - - $formatexport = GETPOST('formatexport', 'int'); - $notexportlettering = GETPOST('notexportlettering', 'alpha'); - - if (!empty($notexportlettering)) { - if (is_array($object->lines)) { - foreach ($object->lines as $k => $movement) { - unset($object->lines[$k]->lettering_code); - unset($object->lines[$k]->date_lettering); - } - } - } - - $notifiedexportdate = GETPOST('notifiedexportdate', 'alpha'); - $notifiedvalidationdate = GETPOST('notifiedvalidationdate', 'alpha'); - $withAttachment = !empty(trim(GETPOST('notifiedexportfull', 'alphanohtml'))) ? 1 : 0; - - // Output data on screen or download - $result = $accountancyexport->export($object->lines, $formatexport, $withAttachment); - - $error = 0; - if ($result < 0) { - $error++; - } else { - if (!empty($notifiedexportdate) || !empty($notifiedvalidationdate)) { - if (is_array($object->lines)) { - dol_syslog("/accountancy/bookkeeping/list.php Function export_file Specify movements as exported", LOG_DEBUG); - - // Specify as export : update field date_export or date_validated - $db->begin(); - - // TODO Merge update for each line into one gloacl using rowid IN (list of movement ids) - foreach ($object->lines as $movement) { - $now = dol_now(); - - $setfields = ''; - if (!empty($notifiedexportdate) && empty($movement->date_export)) { - $setfields .= ($setfields ? "," : "")." date_export = '".$db->idate($now)."'"; - } - if (!empty($notifiedvalidationdate) && empty($movement->date_validation)) { - $setfields .= ($setfields ? "," : "")." date_validated = '".$db->idate($now)."'"; - } - - if ($setfields) { - $sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping"; - $sql .= " SET ".$setfields; - $sql .= " WHERE rowid = ".((int) $movement->id); - - $result = $db->query($sql); - if (!$result) { - $error++; - break; - } - } - } - - if (!$error) { - $db->commit(); - } else { - $error++; - $accountancyexport->errors[] = $langs->trans('NotAllExportedMovementsCouldBeRecordedAsExportedOrValidated'); - $db->rollback(); - } - } - } - } - - if ($error) { - setEventMessages('', $accountancyexport->errors, 'errors'); - header('Location: '.$_SERVER['PHP_SELF']); - } - exit(); // download or show errors - } -} - - /* * View */ @@ -815,7 +665,7 @@ $title_page = $langs->trans("Operations").' - '.$langs->trans("Journals"); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); @@ -857,111 +707,6 @@ llxHeader('', $title_page); $formconfirm = ''; -if ($action == 'export_file') { - $form_question = array(); - - $form_question['formatexport'] = array( - 'name' => 'formatexport', - 'type' => 'select', - 'label' => $langs->trans('Modelcsv'), // TODO Use Selectmodelcsv and show a select combo - 'values' => $listofformat, - 'default' => $formatexportset, - 'morecss' => 'minwidth200 maxwidth200' - ); - - $form_question['separator0'] = array('name'=>'separator0', 'type'=>'separator'); - - if (getDolGlobalInt("ACCOUNTING_ENABLE_LETTERING")) { - // If 1, we check by default. - $checked = !empty($conf->global->ACCOUNTING_DEFAULT_NOT_EXPORT_LETTERING) ? 'true' : 'false'; - $form_question['notexportlettering'] = array( - 'name' => 'notexportlettering', - 'type' => 'checkbox', - 'label' => $langs->trans('NotExportLettering'), - 'value' => $checked, - ); - - $form_question['separator1'] = array('name'=>'separator1', 'type'=>'separator'); - } - - // If 1 or not set, we check by default. - $checked = (!isset($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE) || !empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE)); - $form_question['notifiedexportdate'] = array( - 'name' => 'notifiedexportdate', - 'type' => 'checkbox', - 'label' => $langs->trans('NotifiedExportDate'), - 'value' => (!empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE) ? 'false' : 'true'), - ); - - $form_question['separator2'] = array('name'=>'separator2', 'type'=>'separator'); - - if (!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")) { - // If 0 or not set, we NOT check by default. - $checked = (isset($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) || !empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE)); - $form_question['notifiedvalidationdate'] = array( - 'name' => 'notifiedvalidationdate', - 'type' => 'checkbox', - 'label' => $langs->trans('NotifiedValidationDate', $langs->transnoentitiesnoconv("MenuAccountancyClosure")), - 'value' => $checked, - ); - - $form_question['separator3'] = array('name'=>'separator3', 'type'=>'separator'); - } - - // add documents in an archive for accountancy export (Quadratus) - if (getDolGlobalString('ACCOUNTING_EXPORT_MODELCSV') == AccountancyExport::$EXPORT_TYPE_QUADRATUS) { - $form_question['notifiedexportfull'] = array( - 'name' => 'notifiedexportfull', - 'type' => 'checkbox', - 'label' => $langs->trans('NotifiedExportFull'), - 'value' => 'false', - ); - } - - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").'...', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 420, 600); -} - -//if ($action == 'delbookkeepingyear') { -// $form_question = array(); -// $delyear = GETPOST('delyear', 'int'); -// $deljournal = GETPOST('deljournal', 'alpha'); -// -// if (empty($delyear)) { -// $delyear = dol_print_date(dol_now(), '%Y'); -// } -// $month_array = array(); -// for ($i = 1; $i <= 12; $i++) { -// $month_array[$i] = $langs->trans("Month".sprintf("%02d", $i)); -// } -// $year_array = $formaccounting->selectyear_accountancy_bookkepping($delyear, 'delyear', 0, 'array'); -// $journal_array = $formaccounting->select_journal($deljournal, 'deljournal', '', 1, 1, 1, '', 0, 1); -// -// $form_question['delmonth'] = array( -// 'name' => 'delmonth', -// 'type' => 'select', -// 'label' => $langs->trans('DelMonth'), -// 'values' => $month_array, -// 'morecss' => 'minwidth150', -// 'default' => '' -// ); -// $form_question['delyear'] = array( -// 'name' => 'delyear', -// 'type' => 'select', -// 'label' => $langs->trans('DelYear'), -// 'values' => $year_array, -// 'default' => $delyear -// ); -// $form_question['deljournal'] = array( -// 'name' => 'deljournal', -// 'type' => 'other', // We don't use select here, the journal_array is already a select html component -// 'label' => $langs->trans('DelJournal'), -// 'value' => $journal_array, -// 'default' => $deljournal -// ); -// -// $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt', $langs->transnoentitiesnoconv("RegistrationInAccounting")), 'delbookkeepingyearconfirm', $form_question, '', 1, 320); -//} - // Print form confirm print $formconfirm; @@ -1015,21 +760,6 @@ if ($reshook < 0) { $newcardbutton = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint; if (empty($reshook)) { - // Button re-export - if (!empty($conf->global->ACCOUNTING_REEXPORT)) { - $newcardbutton .= ''.img_picto($langs->trans("ClickToHideAlreadyExportedLines"), 'switch_off', 'class="small size15x valignmiddle"'); - $newcardbutton .= ''.$langs->trans("ClickToHideAlreadyExportedLines").''; - $newcardbutton .= ''; - } else { - $newcardbutton .= ''.img_picto($langs->trans("DocsAlreadyExportedAreExcluded"), 'switch_on', 'class="warning size15x valignmiddle"'); - $newcardbutton .= ''.$langs->trans("DocsAlreadyExportedAreExcluded").''; - $newcardbutton .= ''; - } - - if ($user->hasRight('accounting', 'mouvements', 'export')) { - $newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file&token='.newToken().($param ? '&'.$param : '').'&sortfield='.urlencode($sortfield).'&sortorder='.urlencode($sortorder), $user->hasRight('accounting', 'mouvements', 'export')); - } - $newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly')); $newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?type=sub'.$param, '', 1, array('morecss' => 'marginleftonly')); @@ -1608,13 +1338,6 @@ print $hookmanager->resPrint; print ""; print ''; -// TODO Replace this with mass delete action -//if ($user->rights->accounting->mouvements->supprimer_tous) { -// print '
'."\n"; -// print ''.$langs->trans("DeleteMvt").''; -// print '
'; -//} - print ''; // End of page diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 599e2360147..9031c73624b 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -559,7 +559,7 @@ llxHeader('', $title_page); // List $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { // TODO Perf Replace this by a count if ($type == 'sub') { $nbtotalofrecords = $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter, 'AND', 1, 1); diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 5c13c2efba8..80b74c41fdf 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -466,7 +466,7 @@ class AccountancyCategory // extends CommonObject $sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as aa"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; $sql .= " WHERE (aa.fk_accounting_category <> ".((int) $id)." OR aa.fk_accounting_category IS NULL)"; - $sql .= " AND asy.rowid = ".((int) $conf->global->CHARTOFACCOUNTS); + $sql .= " AND asy.rowid = ".((int) getDolGlobalInt('CHARTOFACCOUNTS')); $sql .= " AND aa.active = 1"; $sql .= " AND aa.entity = ".$conf->entity; $sql .= " GROUP BY aa.account_number, aa.label"; @@ -512,7 +512,7 @@ class AccountancyCategory // extends CommonObject $sql = "SELECT aa.rowid, aa.account_number"; $sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as aa"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; - $sql .= " AND asy.rowid = ".((int) $conf->global->CHARTOFACCOUNTS); + $sql .= " AND asy.rowid = ".((int) getDolGlobalInt('CHARTOFACCOUNTS')); $sql .= " AND aa.active = 1"; $sql .= " AND aa.entity = ".$conf->entity; $sql .= " ORDER BY LENGTH(aa.account_number) DESC;"; // LENGTH is ok with mysql and postgresql @@ -839,7 +839,7 @@ class AccountancyCategory // extends CommonObject exit(); } - $pcgverid = $conf->global->CHARTOFACCOUNTS; + $pcgverid = getDolGlobalInt('CHARTOFACCOUNTS'); $pcgvercode = dol_getIdFromCode($this->db, $pcgverid, 'accounting_system', 'rowid', 'pcg_version'); if (empty($pcgvercode)) { $pcgvercode = $pcgverid; diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index a3c39cb06ee..82fda954c32 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -37,8 +37,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - +require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; /** * Manage the different format accountancy export @@ -313,12 +315,19 @@ class AccountancyExport /** * Function who chose which export to use with the default config, and make the export into a file * - * @param array $TData Array with data - * @param int $formatexportset Id of export format - * @param int $withAttachment [=0] Not add files or 1 to have attached in an archive (ex : Quadratus) + * @param array $TData Array with data + * @param int $formatexportset Id of export format + * @param int $withAttachment [=0] Not add files + * or 1 to have attached in an archive (ex : Quadratus) - Force output mode to write in a file (output mode = 1) + * @param int $downloadMode [=0] Direct download + * or 1 to download after writing files - Forced by default when use withAttachment = 1 + * or -1 not to download files + * @param int $outputMode [=0] Print on screen + * or 1 to write in file and uses a temp directory - Forced by default when use withAttachment = 1 + * or 2 to write in file a default export directory (accounting/export/) * @return int <0 if KO, >0 OK */ - public function export(&$TData, $formatexportset, $withAttachment = 0) + public function export(&$TData, $formatexportset, $withAttachment = 0, $downloadMode = 0, $outputMode = 0) { global $conf, $langs; global $search_date_end; // Used into /accountancy/tpl/export_journal.tpl.php @@ -332,101 +341,152 @@ class AccountancyExport $exportFile = null; $exportFileName = ''; $exportFilePath = ''; + $archiveFullName = ''; + $archivePath = ''; $archiveFileList = array(); if ($withAttachment == 1) { + if ($downloadMode == 0) { + $downloadMode = 1; // force to download after writing all files (can't use direct download) + } + if ($outputMode == 0) { + $outputMode = 1; // force to put files in a temp directory (can't use print on screen) + } + // PHP ZIP extension must be enabled if (!extension_loaded('zip')) { $langs->load('install'); $this->errors[] = $langs->trans('ErrorPHPDoesNotSupport', 'ZIP'); return -1; } - } else { - $mimetype = $this->getMimeType($formatexportset); + } + + $mimetype = $this->getMimeType($formatexportset); + if ($downloadMode == 0) { + // begin to print header for direct download top_httphead($mimetype, 1); } include DOL_DOCUMENT_ROOT.'/accountancy/tpl/export_journal.tpl.php'; - if ($withAttachment == 1 && !empty($completefilename)) { - // create export file - $tmpDir = !empty($conf->accounting->multidir_temp[$conf->entity]) ? $conf->accounting->multidir_temp[$conf->entity] : $conf->accounting->dir_temp; - $exportFileFullName = $completefilename; - $exportFileBaseName = basename($exportFileFullName); - $exportFileName = pathinfo($exportFileBaseName, PATHINFO_FILENAME); - $exportFilePath = $tmpDir.'/'.$exportFileFullName; - $exportFile = fopen($exportFilePath, 'w'); - if (!$exportFile) { - $this->errors[] = $langs->trans('ErrorFileNotFound', $exportFilePath); - return -1; - } - $archiveFileList[0] = array( - 'path' => $exportFilePath, - 'name' => $exportFileFullName, - ); + if ($outputMode == 1 || $outputMode == 2) { + if ($outputMode == 1) { + // uses temp directory by default to write files + if (!empty($conf->accounting->multidir_temp[$conf->entity])) { + $outputDir = $conf->accounting->multidir_temp[$conf->entity]; + } else { + $outputDir = $conf->accounting->dir_temp; + } + } else { + // uses default export directory "accounting/export" + if (!empty($conf->accounting->multidir_output[$conf->entity])) { + $outputDir = $conf->accounting->multidir_output[$conf->entity]; + } else { + $outputDir = $conf->accounting->dir_output; + } - // archive name and path - $archiveFullName = $exportFileName.'.zip'; - $archivePath = $tmpDir.'/'.$archiveFullName; + // directory already created when module is enabled + $outputDir .= '/export'; + $outputDir .= '/'.dol_sanitizePathName($formatexportset); + if (!dol_is_dir($outputDir)) { + if (dol_mkdir($outputDir) < 0) { + $this->errors[] = $langs->trans('ErrorCanNotCreateDir', $outputDir);; + return -1; + } + } + } + + if ($outputDir != '') { + if (!dol_is_dir($outputDir)) { + $langs->load('errors'); + $this->errors[] = $langs->trans('ErrorDirNotFound', $outputDir);; + return -1; + } + + if (!empty($completefilename)) { + // create export file + $exportFileFullName = $completefilename; + $exportFileBaseName = basename($exportFileFullName); + $exportFileName = pathinfo($exportFileBaseName, PATHINFO_FILENAME); + $exportFilePath = $outputDir . '/' . $exportFileFullName; + $exportFile = fopen($exportFilePath, 'w'); + if (!$exportFile) { + $this->errors[] = $langs->trans('ErrorFileNotFound', $exportFilePath); + return -1; + } + + if ($withAttachment == 1) { + $archiveFileList[0] = array( + 'path' => $exportFilePath, + 'name' => $exportFileFullName, + ); + + // archive name and path + $archiveFullName = $exportFileName . '.zip'; + $archivePath = $outputDir . '/' . $archiveFullName; + } + } + } } + // export file (print on screen or write in a file) and prepare archive list if with attachment is set to 1 switch ($formatexportset) { case self::$EXPORT_TYPE_CONFIGURABLE: - $this->exportConfigurable($TData); + $this->exportConfigurable($TData, $exportFile); break; case self::$EXPORT_TYPE_CEGID: - $this->exportCegid($TData); + $this->exportCegid($TData, $exportFile); break; case self::$EXPORT_TYPE_COALA: - $this->exportCoala($TData); + $this->exportCoala($TData, $exportFile); break; case self::$EXPORT_TYPE_BOB50: - $this->exportBob50($TData); + $this->exportBob50($TData, $exportFile); break; case self::$EXPORT_TYPE_CIEL: - $this->exportCiel($TData); + $this->exportCiel($TData, $exportFile); break; case self::$EXPORT_TYPE_QUADRATUS: $archiveFileList = $this->exportQuadratus($TData, $exportFile, $archiveFileList, $withAttachment); break; case self::$EXPORT_TYPE_WINFIC: - $this->exportWinfic($TData); + $this->exportWinfic($TData, $exportFile); break; case self::$EXPORT_TYPE_EBP: - $this->exportEbp($TData); + $this->exportEbp($TData, $exportFile); break; case self::$EXPORT_TYPE_COGILOG: - $this->exportCogilog($TData); + $this->exportCogilog($TData, $exportFile); break; case self::$EXPORT_TYPE_AGIRIS: - $this->exportAgiris($TData); + $this->exportAgiris($TData, $exportFile); break; case self::$EXPORT_TYPE_OPENCONCERTO: - $this->exportOpenConcerto($TData); + $this->exportOpenConcerto($TData, $exportFile); break; case self::$EXPORT_TYPE_SAGE50_SWISS: - $this->exportSAGE50SWISS($TData); + $this->exportSAGE50SWISS($TData, $exportFile); break; case self::$EXPORT_TYPE_CHARLEMAGNE: - $this->exportCharlemagne($TData); + $this->exportCharlemagne($TData, $exportFile); break; case self::$EXPORT_TYPE_LDCOMPTA: - $this->exportLDCompta($TData); + $this->exportLDCompta($TData, $exportFile); break; case self::$EXPORT_TYPE_LDCOMPTA10: - $this->exportLDCompta10($TData); + $this->exportLDCompta10($TData, $exportFile); break; case self::$EXPORT_TYPE_GESTIMUMV3: - $this->exportGestimumV3($TData); + $this->exportGestimumV3($TData, $exportFile); break; case self::$EXPORT_TYPE_GESTIMUMV5: - $this->exportGestimumV5($TData); + $this->exportGestimumV5($TData, $exportFile); break; case self::$EXPORT_TYPE_FEC: - $this->exportFEC($TData); + $this->exportFEC($TData, $exportFile); break; case self::$EXPORT_TYPE_FEC2: - $this->exportFEC2($TData); + $this->exportFEC2($TData, $exportFile); break; case self::$EXPORT_TYPE_ISUITEEXPERT : - $this->exportiSuiteExpert($TData); + $this->exportiSuiteExpert($TData, $exportFile); break; default: global $hookmanager; @@ -440,7 +500,7 @@ class AccountancyExport } // create and download export file or archive - if ($withAttachment == 1) { + if ($outputMode == 1 || $outputMode == 2) { $error = 0; // close export file @@ -448,50 +508,60 @@ class AccountancyExport fclose($exportFile); } - if (!empty($archiveFullName) && !empty($archivePath) && !empty($archiveFileList)) { - // archive files - $downloadFileMimeType = 'application/zip'; - $downloadFileFullName = $archiveFullName; - $downloadFilePath = $archivePath; + if ($withAttachment == 1) { + // create archive file + if (!empty($archiveFullName) && !empty($archivePath) && !empty($archiveFileList)) { + // archive files + $downloadFileMimeType = 'application/zip'; + $downloadFileFullName = $archiveFullName; + $downloadFilePath = $archivePath; - // create archive - $archive = new ZipArchive(); - $res = $archive->open($archivePath, ZipArchive::OVERWRITE | ZipArchive::CREATE); - if ($res !== true) { - $error++; - $this->errors[] = $langs->trans('ErrorFileNotFound', $archivePath); - } - if (!$error) { - // add files - foreach ($archiveFileList as $archiveFileArr) { - $res = $archive->addFile($archiveFileArr['path'], $archiveFileArr['name']); - if (!$res) { - $error++; - $this->errors[] = $langs->trans('ErrorArchiveAddFile', $archiveFileArr['name']); - break; + // create archive + $archive = new ZipArchive(); + $res = $archive->open($archivePath, ZipArchive::OVERWRITE | ZipArchive::CREATE); + if ($res !== true) { + $error++; + $this->errors[] = $langs->trans('ErrorFileNotFound', $archivePath); + } + if (!$error) { + // add files + foreach ($archiveFileList as $archiveFileArr) { + $res = $archive->addFile($archiveFileArr['path'], $archiveFileArr['name']); + if (!$res) { + $error++; + $this->errors[] = $langs->trans('ErrorArchiveAddFile', $archiveFileArr['name']); + break; + } } } + if (!$error) { + // close archive + $archive->close(); + } } - if (!$error) { - // close archive - $archive->close(); - } - } elseif (!empty($exportFileFullName) && !empty($exportFilePath)) { - // only one file to download - $downloadFileMimeType = 'text/csv'; - $downloadFileFullName = $exportFileFullName; - $downloadFilePath = $exportFilePath; } if (!$error) { - // download export file - if (!empty($downloadFileMimeType) && !empty($downloadFileFullName) && !empty($downloadFilePath)) { - header('Content-Type: '.$downloadFileMimeType); - header('Content-Disposition: attachment; filename='.$downloadFileFullName); - header('Cache-Control: Public, must-revalidate'); - header('Pragma: public'); - header('Content-Length: '.dol_filesize($downloadFilePath)); - readfileLowMemory($downloadFilePath); + // download after writing files + if ($downloadMode == 1) { + if ($withAttachment == 0) { + // only download exported file + if (!empty($exportFileFullName) && !empty($exportFilePath)) { + $downloadFileMimeType = $mimetype; + $downloadFileFullName = $exportFileFullName; + $downloadFilePath = $exportFilePath; + } + } + + // download export file or archive + if (!empty($downloadFileMimeType) && !empty($downloadFileFullName) && !empty($downloadFilePath)) { + header('Content-Type: ' . $downloadFileMimeType); + header('Content-Disposition: attachment; filename=' . $downloadFileFullName); + header('Cache-Control: Public, must-revalidate'); + header('Pragma: public'); + header('Content-Length: ' . dol_filesize($downloadFilePath)); + readfileLowMemory($downloadFilePath); + } } } @@ -507,124 +577,162 @@ class AccountancyExport /** * Export format : CEGID * - * @param array $objectLines data - * @return void + * @param array $objectLines data + * @param resource $exportFile [=null] File resource to export or print if null + * @return void */ - public function exportCegid($objectLines) + public function exportCegid($objectLines, $exportFile = null) { - foreach ($objectLines as $line) { - $date = dol_print_date($line->doc_date, '%d%m%Y'); - $separator = ";"; - $end_line = "\n"; + $separator = ";"; + $end_line = "\n"; - print $date.$separator; - print $line->code_journal.$separator; - print length_accountg($line->numero_compte).$separator; - print length_accounta($line->subledger_account).$separator; - print $line->sens.$separator; - print price2fec(abs($line->debit - $line->credit)).$separator; - print dol_string_unaccent($line->label_operation).$separator; - print dol_string_unaccent($line->doc_ref); - print $end_line; + foreach ($objectLines as $line) { + $date_document = dol_print_date($line->doc_date, '%d%m%Y'); + + $tab = array(); + + $tab[] = $date_document; + $tab[] = $line->code_journal; + $tab[] = length_accountg($line->numero_compte); + $tab[] = length_accounta($line->subledger_account); + $tab[] = $line->sens; + $tab[] = price2fec(abs($line->debit - $line->credit)); + $tab[] = dol_string_unaccent($line->label_operation); + $tab[] = dol_string_unaccent($line->doc_ref); + + $output = implode($separator, $tab).$end_line; + if ($exportFile) { + fwrite($exportFile, $output); + } else { + print $output; + } } } /** * Export format : COGILOG * - * @param array $objectLines data - * @return void + * @param array $objectLines data + * @param resource $exportFile [=null] File resource to export or print if null + * @return void */ - public function exportCogilog($objectLines) + public function exportCogilog($objectLines, $exportFile = null) { - foreach ($objectLines as $line) { - $date = dol_print_date($line->doc_date, '%d%m%Y'); - $separator = ";"; - $end_line = "\n"; + $separator = ";"; + $end_line = "\n"; - print $line->code_journal.$separator; - print $date.$separator; - print $line->piece_num.$separator; - print length_accountg($line->numero_compte).$separator; - print $separator; - print $line->label_operation.$separator; - print $date.$separator; + foreach ($objectLines as $line) { + $date_document = dol_print_date($line->doc_date, '%d%m%Y'); + + $tab = array(); + + $tab[] = $line->code_journal; + $tab[] = $date_document; + $tab[] = $line->piece_num; + $tab[] = length_accountg($line->numero_compte); + $tab[] = ""; + $tab[] = $line->label_operation; + $tab[] = $date_document; if ($line->sens == 'D') { - print price($line->debit).$separator; - print $separator; + $tab[] = price($line->debit); + $tab[] = ""; } elseif ($line->sens == 'C') { - print $separator; - print price($line->credit).$separator; + $tab[] = ""; + $tab[] = price($line->credit); + } + $tab[] = $line->doc_ref; + $tab[] = $line->label_operation; + + $output = implode($separator, $tab).$end_line; + if ($exportFile) { + fwrite($exportFile, $output); + } else { + print $output; } - print $line->doc_ref.$separator; - print $line->label_operation.$separator; - print $end_line; } } /** * Export format : COALA * - * @param array $objectLines data - * @return void + * @param array $objectLines data + * @param resource $exportFile [=null] File resource to export or print if null + * @return void */ - public function exportCoala($objectLines) + public function exportCoala($objectLines, $exportFile = null) { // Coala export $separator = ";"; $end_line = "\n"; foreach ($objectLines as $line) { - $date = dol_print_date($line->doc_date, '%d/%m/%Y'); + $date_document = dol_print_date($line->doc_date, '%d/%m/%Y'); - print $date.$separator; - print $line->code_journal.$separator; - print length_accountg($line->numero_compte).$separator; - print $line->piece_num.$separator; - print $line->doc_ref.$separator; - print price($line->debit).$separator; - print price($line->credit).$separator; - print 'E'.$separator; - print length_accounta($line->subledger_account).$separator; - print $end_line; + $tab = array(); + + $tab[] = $date_document; + $tab[] = $line->code_journal; + $tab[] = length_accountg($line->numero_compte); + $tab[] = $line->piece_num; + $tab[] = $line->doc_ref; + $tab[] = price($line->debit); + $tab[] = price($line->credit); + $tab[] = 'E'; + $tab[] = length_accounta($line->subledger_account); + + $output = implode($separator, $tab).$end_line; + if ($exportFile) { + fwrite($exportFile, $output); + } else { + print $output; + } } } /** * Export format : BOB50 * - * @param array $objectLines data - * @return void + * @param array $objectLines data + * @param resource $exportFile [=null] File resource to export or print if null + * @return void */ - public function exportBob50($objectLines) + public function exportBob50($objectLines, $exportFile = null) { - // Bob50 $separator = ";"; $end_line = "\n"; foreach ($objectLines as $line) { - print $line->piece_num.$separator; - $date = dol_print_date($line->doc_date, '%d/%m/%Y'); - print $date.$separator; + $date_document = dol_print_date($line->doc_date, '%d/%m/%Y'); + + $tab = array(); + + $tab[] = $line->piece_num; + $tab[] = $date_document; if (empty($line->subledger_account)) { - print 'G'.$separator; - print length_accounta($line->numero_compte).$separator; + $tab[] = 'G'; + $tab[] = length_accountg($line->numero_compte); } else { if (substr($line->numero_compte, 0, 3) == '411') { - print 'C'.$separator; + $tab[] = 'C'; } if (substr($line->numero_compte, 0, 3) == '401') { - print 'F'.$separator; + $tab[] = 'F'; } - print length_accountg($line->subledger_account).$separator; + $tab[] = length_accounta($line->subledger_account); } - print price($line->debit).$separator; - print price($line->credit).$separator; - print dol_trunc($line->label_operation, 32).$separator; - print $end_line; + $tab[] = price($line->debit); + $tab[] = price($line->credit); + $tab[] = dol_trunc($line->label_operation, 32); + + $output = implode($separator, $tab).$end_line; + if ($exportFile) { + fwrite($exportFile, $output); + } else { + print $output; + } } } @@ -639,41 +747,46 @@ class AccountancyExport * If you want to force filename to "XIMPORT.TXT" for automatically import file present in a directory : * use constant ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME * - * @param array $TData data - * @return void + * @param array $objectLines data + * @param resource $exportFile [=null] File resource to export or print if null + * @return void */ - public function exportCiel(&$TData) + public function exportCiel($objectLines, $exportFile = null) { $end_line = "\r\n"; $i = 1; - foreach ($TData as $data) { - $code_compta = length_accountg($data->numero_compte); - if (!empty($data->subledger_account)) { - $code_compta = length_accounta($data->subledger_account); + foreach ($objectLines as $line) { + $code_compta = length_accountg($line->numero_compte); + if (!empty($line->subledger_account)) { + $code_compta = length_accounta($line->subledger_account); } - $date_document = dol_print_date($data->doc_date, '%Y%m%d'); - $date_echeance = dol_print_date($data->date_lim_reglement, '%Y%m%d'); + $date_document = dol_print_date($line->doc_date, '%Y%m%d'); + $date_echeance = dol_print_date($line->date_lim_reglement, '%Y%m%d'); - $Tab = array(); - $Tab['num_ecriture'] = str_pad($data->piece_num, 5); - $Tab['code_journal'] = str_pad(self::trunc($data->code_journal, 2), 2); - $Tab['date_ecriture'] = str_pad($date_document, 8, ' ', STR_PAD_LEFT); - $Tab['date_echeance'] = str_pad($date_echeance, 8, ' ', STR_PAD_LEFT); - $Tab['num_piece'] = str_pad(self::trunc($data->doc_ref, 12), 12); - $Tab['num_compte'] = str_pad(self::trunc($code_compta, 11), 11); - $Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).dol_string_unaccent($data->label_operation), 25), 25); - $Tab['montant'] = str_pad(price2fec(abs($data->debit - $data->credit)), 13, ' ', STR_PAD_LEFT); - $Tab['type_montant'] = str_pad($data->sens, 1); - $Tab['vide'] = str_repeat(' ', 18); // Analytical accounting - Not managed in Dolibarr - $Tab['intitule_compte'] = str_pad(self::trunc(dol_string_unaccent($data->label_operation), 34), 34); - $Tab['end'] = 'O2003'; // 0 = EUR | 2003 = Format Ciel + $tab = array(); - $Tab['end_line'] = $end_line; + $tab[] = str_pad($line->piece_num, 5); + $tab[] = str_pad(self::trunc($line->code_journal, 2), 2); + $tab[] = str_pad($date_document, 8, ' ', STR_PAD_LEFT); + $tab[] = str_pad($date_echeance, 8, ' ', STR_PAD_LEFT); + $tab[] = str_pad(self::trunc($line->doc_ref, 12), 12); + $tab[] = str_pad(self::trunc($code_compta, 11), 11); + $tab[] = str_pad(self::trunc(dol_string_unaccent($line->doc_ref).dol_string_unaccent($line->label_operation), 25), 25); + $tab[] = str_pad(price2fec(abs($line->debit - $line->credit)), 13, ' ', STR_PAD_LEFT); + $tab[] = str_pad($line->sens, 1); + $tab[] = str_repeat(' ', 18); // Analytical accounting - Not managed in Dolibarr + $tab[] = str_pad(self::trunc(dol_string_unaccent($line->label_operation), 34), 34); + $tab[] = 'O2003'; // 0 = EUR | 2003 = Format Ciel - print implode($Tab); + $output = implode($tab).$end_line; + if ($exportFile) { + fwrite($exportFile, $output); + } else { + print $output; + } $i++; } } @@ -686,13 +799,13 @@ class AccountancyExport * Help : https://docplayer.fr/20769649-Fichier-d-entree-ascii-dans-quadracompta.html * In QuadraCompta | Use menu : "Outils" > "Suivi des dossiers" > "Import ASCII(Compta)" * - * @param array $TData Data + * @param array $objectLines data * @param resource $exportFile [=null] File resource to export or print if null * @param array $archiveFileList [=array()] Archive file list : array of ['path', 'name'] * @param bool $withAttachment [=0] Not add files or 1 to have attached in an archive * @return array Archive file list : array of ['path', 'name'] */ - public function exportQuadratus(&$TData, $exportFile = null, $archiveFileList = array(), $withAttachment = 0) + public function exportQuadratus($objectLines, $exportFile = null, $archiveFileList = array(), $withAttachment = 0) { global $conf, $db; @@ -701,152 +814,152 @@ class AccountancyExport // We should use dol_now function not time however this is wrong date to transfert in accounting // $date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy // $date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy - foreach ($TData as $data) { + foreach ($objectLines as $line) { // Clean some data - $data->doc_ref = dol_string_unaccent($data->doc_ref); - $data->label_operation = dol_string_unaccent($data->label_operation); - $data->numero_compte = dol_string_unaccent($data->numero_compte); - $data->label_compte = dol_string_unaccent($data->label_compte); - $data->subledger_account = dol_string_unaccent($data->subledger_account); - $data->subledger_label = dol_string_unaccent($data->subledger_label); + $line->doc_ref = dol_string_unaccent($line->doc_ref); + $line->label_operation = dol_string_unaccent($line->label_operation); + $line->numero_compte = dol_string_unaccent($line->numero_compte); + $line->label_compte = dol_string_unaccent($line->label_compte); + $line->subledger_account = dol_string_unaccent($line->subledger_account); + $line->subledger_label = dol_string_unaccent($line->subledger_label); - $code_compta = $data->numero_compte; - if (!empty($data->subledger_account)) { - $code_compta = $data->subledger_account; + $code_compta = $line->numero_compte; + if (!empty($line->subledger_account)) { + $code_compta = $line->subledger_account; } - $Tab = array(); + $tab = array(); - if (!empty($data->subledger_account)) { - $Tab['type_ligne'] = 'C'; - $Tab['num_compte'] = str_pad(self::trunc($data->subledger_account, 8), 8); - $Tab['lib_compte'] = str_pad(self::trunc($data->subledger_label, 30), 30); + if (!empty($line->subledger_account)) { + $tab['type_ligne'] = 'C'; + $tab['num_compte'] = str_pad(self::trunc($line->subledger_account, 8), 8); + $tab['lib_compte'] = str_pad(self::trunc($line->subledger_label, 30), 30); - if ($data->doc_type == 'customer_invoice') { - $Tab['lib_alpha'] = strtoupper(str_pad('C'.self::trunc($data->subledger_label, 6), 6)); - $Tab['filler'] = str_repeat(' ', 52); - $Tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, 8), 8); - } elseif ($data->doc_type == 'supplier_invoice') { - $Tab['lib_alpha'] = strtoupper(str_pad('F'.self::trunc($data->subledger_label, 6), 6)); - $Tab['filler'] = str_repeat(' ', 52); - $Tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, 8), 8); + if ($line->doc_type == 'customer_invoice') { + $tab['lib_alpha'] = strtoupper(str_pad('C'.self::trunc(dol_string_unaccent($line->subledger_label), 6), 6)); + $tab['filler'] = str_repeat(' ', 52); + $tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, 8), 8); + } elseif ($line->doc_type == 'supplier_invoice') { + $tab['lib_alpha'] = strtoupper(str_pad('F'.self::trunc(dol_string_unaccent($line->subledger_label), 6), 6)); + $tab['filler'] = str_repeat(' ', 52); + $tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, 8), 8); } else { - $Tab['filler'] = str_repeat(' ', 59); - $Tab['coll_compte'] = str_pad(' ', 8); + $tab['filler'] = str_repeat(' ', 59); + $tab['coll_compte'] = str_pad(' ', 8); } - $Tab['filler2'] = str_repeat(' ', 110); - $Tab['Maj'] = 2; // Partial update (alpha key, label, address, collectif, RIB) + $tab['filler2'] = str_repeat(' ', 110); + $tab['Maj'] = 2; // Partial update (alpha key, label, address, collectif, RIB) - if ($data->doc_type == 'customer_invoice') { - $Tab['type_compte'] = 'C'; - } elseif ($data->doc_type == 'supplier_invoice') { - $Tab['type_compte'] = 'F'; + if ($line->doc_type == 'customer_invoice') { + $tab['type_compte'] = 'C'; + } elseif ($line->doc_type == 'supplier_invoice') { + $tab['type_compte'] = 'F'; } else { - $Tab['type_compte'] = 'G'; + $tab['type_compte'] = 'G'; } - $Tab['filler3'] = str_repeat(' ', 235); + $tab['filler3'] = str_repeat(' ', 235); - $Tab['end_line'] = $end_line; + $tab['end_line'] = $end_line; if ($exportFile) { - fwrite($exportFile, implode($Tab)); + fwrite($exportFile, implode($tab)); } else { - print implode($Tab); + print implode($tab); } } - $Tab = array(); - $Tab['type_ligne'] = 'M'; - $Tab['num_compte'] = str_pad(self::trunc($code_compta, 8), 8); - $Tab['code_journal'] = str_pad(self::trunc($data->code_journal, 2), 2); - $Tab['folio'] = '000'; + $tab = array(); + $tab['type_ligne'] = 'M'; + $tab['num_compte'] = str_pad(self::trunc($code_compta, 8), 8); + $tab['code_journal'] = str_pad(self::trunc($line->code_journal, 2), 2); + $tab['folio'] = '000'; - // We use invoice date $data->doc_date not $date_ecriture which is the transfert date + // We use invoice date $line->doc_date not $date_ecriture which is the transfert date // maybe we should set an option for customer who prefer to keep in accounting software the tranfert date instead of invoice date ? - //$Tab['date_ecriture'] = $date_ecriture; - $Tab['date_ecriture'] = dol_print_date($data->doc_date, '%d%m%y'); - $Tab['filler'] = ' '; - $Tab['libelle_ecriture'] = str_pad(self::trunc($data->doc_ref.' '.$data->label_operation, 20), 20); + //$tab['date_ecriture'] = $date_ecriture; + $tab['date_ecriture'] = dol_print_date($line->doc_date, '%d%m%y'); + $tab['filler'] = ' '; + $tab['libelle_ecriture'] = str_pad(self::trunc($line->doc_ref.' '.$line->label_operation, 20), 20); // Credit invoice - invert sens /* - if ($data->montant < 0) { - if ($data->sens == 'C') { - $Tab['sens'] = 'D'; + if ($line->montant < 0) { + if ($line->sens == 'C') { + $tab['sens'] = 'D'; } else { - $Tab['sens'] = 'C'; + $tab['sens'] = 'C'; } - $Tab['signe_montant'] = '-'; + $tab['signe_montant'] = '-'; } else { - $Tab['sens'] = $data->sens; // C or D - $Tab['signe_montant'] = '+'; + $tab['sens'] = $line->sens; // C or D + $tab['signe_montant'] = '+'; }*/ - $Tab['sens'] = $data->sens; // C or D - $Tab['signe_montant'] = '+'; + $tab['sens'] = $line->sens; // C or D + $tab['signe_montant'] = '+'; // The amount must be in centimes without decimal points. - $Tab['montant'] = str_pad(abs(($data->debit - $data->credit) * 100), 12, '0', STR_PAD_LEFT); - $Tab['contrepartie'] = str_repeat(' ', 8); + $tab['montant'] = str_pad(abs(($line->debit - $line->credit) * 100), 12, '0', STR_PAD_LEFT); + $tab['contrepartie'] = str_repeat(' ', 8); // Force date format : %d%m%y - if (!empty($data->date_lim_reglement)) { - //$Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, $conf->global->ACCOUNTING_EXPORT_DATE); - $Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, '%d%m%y'); // Format must be ddmmyy + if (!empty($line->date_lim_reglement)) { + //$tab['date_echeance'] = dol_print_date($line->date_lim_reglement, $conf->global->ACCOUNTING_EXPORT_DATE); + $tab['date_echeance'] = dol_print_date($line->date_lim_reglement, '%d%m%y'); // Format must be ddmmyy } else { - $Tab['date_echeance'] = '000000'; + $tab['date_echeance'] = '000000'; } // Please keep quadra named field lettrage(2) + codestat(3) instead of fake lettrage(5) - // $Tab['lettrage'] = str_repeat(' ', 5); - $Tab['lettrage'] = str_repeat(' ', 2); - $Tab['codestat'] = str_repeat(' ', 3); - $Tab['num_piece'] = str_pad(self::trunc($data->piece_num, 5), 5); + // $tab['lettrage'] = str_repeat(' ', 5); + $tab['lettrage'] = str_repeat(' ', 2); + $tab['codestat'] = str_repeat(' ', 3); + $tab['num_piece'] = str_pad(self::trunc($line->piece_num, 5), 5); // Keep correct quadra named field instead of anon filler - // $Tab['filler2'] = str_repeat(' ', 20); - $Tab['affaire'] = str_repeat(' ', 10); - $Tab['quantity1'] = str_repeat(' ', 10); - $Tab['num_piece2'] = str_pad(self::trunc($data->piece_num, 8), 8); - $Tab['devis'] = str_pad($conf->currency, 3); - $Tab['code_journal2'] = str_pad(self::trunc($data->code_journal, 3), 3); - $Tab['filler3'] = str_repeat(' ', 3); + // $tab['filler2'] = str_repeat(' ', 20); + $tab['affaire'] = str_repeat(' ', 10); + $tab['quantity1'] = str_repeat(' ', 10); + $tab['num_piece2'] = str_pad(self::trunc($line->piece_num, 8), 8); + $tab['devis'] = str_pad($conf->currency, 3); + $tab['code_journal2'] = str_pad(self::trunc($line->code_journal, 3), 3); + $tab['filler3'] = str_repeat(' ', 3); // Keep correct quadra named field instead of anon filler libelle_ecriture2 is 30 char not 32 !!!! // as we use utf8, we must remove accent to have only one ascii char instead of utf8 2 chars for specials that report wrong line size that will exceed import format spec // TODO: we should filter more than only accent to avoid wrong line size // TODO: remove invoice number doc_ref in label, // TODO: we should offer an option for customer to build the label using invoice number / name / date in accounting software - //$Tab['libelle_ecriture2'] = str_pad(self::trunc($data->doc_ref . ' ' . $data->label_operation, 30), 30); - $Tab['libelle_ecriture2'] = str_pad(self::trunc($data->label_operation, 30), 30); - $Tab['codetva'] = str_repeat(' ', 2); + //$tab['libelle_ecriture2'] = str_pad(self::trunc($line->doc_ref . ' ' . $line->label_operation, 30), 30); + $tab['libelle_ecriture2'] = str_pad(self::trunc($line->label_operation, 30), 30); + $tab['codetva'] = str_repeat(' ', 2); // We need to keep the 10 lastest number of invoice doc_ref not the beginning part that is the unusefull almost same part - // $Tab['num_piece3'] = str_pad(self::trunc($data->piece_num, 10), 10); - $Tab['num_piece3'] = substr(self::trunc($data->doc_ref, 20), -10); - $Tab['reserved'] = str_repeat(' ', 10); // position 159 - $Tab['currency_amount'] = str_repeat(' ', 13); // position 169 + // $tab['num_piece3'] = str_pad(self::trunc($line->piece_num, 10), 10); + $tab['num_piece3'] = substr(self::trunc($line->doc_ref, 20), -10); + $tab['reserved'] = str_repeat(' ', 10); // position 159 + $tab['currency_amount'] = str_repeat(' ', 13); // position 169 // get document file $attachmentFileName = ''; if ($withAttachment == 1) { - $attachmentFileKey = trim($data->piece_num); + $attachmentFileKey = trim($line->piece_num); if (!isset($archiveFileList[$attachmentFileKey])) { $objectDirPath = ''; - $objectFileName = dol_sanitizeFileName($data->doc_ref); - if ($data->doc_type == 'customer_invoice') { + $objectFileName = dol_sanitizeFileName($line->doc_ref); + if ($line->doc_type == 'customer_invoice') { $objectDirPath = !empty($conf->facture->multidir_output[$conf->entity]) ? $conf->facture->multidir_output[$conf->entity] : $conf->facture->dir_output; - } elseif ($data->doc_type == 'expense_report') { + } elseif ($line->doc_type == 'expense_report') { $objectDirPath = !empty($conf->expensereport->multidir_output[$conf->entity]) ? $conf->expensereport->multidir_output[$conf->entity] : $conf->factureexpensereport->dir_output; - } elseif ($data->doc_type == 'supplier_invoice') { + } elseif ($line->doc_type == 'supplier_invoice') { $objectDirPath = !empty($conf->fournisseur->facture->multidir_output[$conf->entity]) ? $conf->fournisseur->facture->multidir_output[$conf->entity] : $conf->fournisseur->facture->dir_output; } $arrayofinclusion = array(); $arrayofinclusion[] = '^'.preg_quote($objectFileName, '/').'\.pdf$'; $fileFoundList = dol_dir_list($objectDirPath.'/'.$objectFileName, 'files', 0, implode('|', $arrayofinclusion), '(\.meta|_preview.*\.png)$', 'date', SORT_DESC, 0, true); if (!empty($fileFoundList)) { - $attachmentFileNameTrunc = str_pad(self::trunc($data->piece_num, 8), 8, '0', STR_PAD_LEFT); + $attachmentFileNameTrunc = str_pad(self::trunc($line->piece_num, 8), 8, '0', STR_PAD_LEFT); foreach ($fileFoundList as $fileFound) { if (strstr($fileFound['name'], $objectFileName)) { $fileFoundPath = $objectDirPath.'/'.$objectFileName.'/'.$fileFound['name']; @@ -867,17 +980,17 @@ class AccountancyExport } } if (dol_strlen($attachmentFileName) == 12) { - $Tab['attachment'] = $attachmentFileName; // position 182 + $tab['attachment'] = $attachmentFileName; // position 182 } else { - $Tab['attachment'] = str_repeat(' ', 12); // position 182 + $tab['attachment'] = str_repeat(' ', 12); // position 182 } - $Tab['filler4'] = str_repeat(' ', 38); - $Tab['end_line'] = $end_line; + $tab['filler4'] = str_repeat(' ', 38); + $tab['end_line'] = $end_line; if ($exportFile) { - fwrite($exportFile, implode($Tab)); + fwrite($exportFile, implode($tab)); } else { - print implode($Tab); + print implode($tab); } } @@ -890,11 +1003,11 @@ class AccountancyExport * * Help : https://wiki.gestan.fr/lib/exe/fetch.php?media=wiki:v15:compta:accountancy-format_winfic-ewinfic-winsiscompta.pdf * - * @param array $TData data - * - * @return void + * @param array $objectLines data + * @param resource $exportFile [=null] File resource to export or print if null + * @return void */ - public function exportWinfic(&$TData) + public function exportWinfic($objectLines, $exportFile = null) { global $conf; @@ -907,67 +1020,67 @@ class AccountancyExport // Warning ! When truncation is necessary, no dot because 3 dots = three characters. The columns are shifted - foreach ($TData as $data) { - $code_compta = $data->numero_compte; - if (!empty($data->subledger_account)) { - $code_compta = $data->subledger_account; + foreach ($objectLines as $line) { + $code_compta = $line->numero_compte; + if (!empty($line->subledger_account)) { + $code_compta = $line->subledger_account; } - $Tab = array(); - //$Tab['type_ligne'] = 'M'; - $Tab['code_journal'] = str_pad(dol_trunc($data->code_journal, 2, 'right', 'UTF-8', 1), 2); + $tab = array(); + //$tab['type_ligne'] = 'M'; + $tab['code_journal'] = str_pad(dol_trunc($line->code_journal, 2, 'right', 'UTF-8', 1), 2); - //We use invoice date $data->doc_date not $date_ecriture which is the transfert date + //We use invoice date $line->doc_date not $date_ecriture which is the transfert date //maybe we should set an option for customer who prefer to keep in accounting software the tranfert date instead of invoice date ? - //$Tab['date_ecriture'] = $date_ecriture; - $Tab['date_operation'] = dol_print_date($data->doc_date, '%d%m%Y'); + //$tab['date_ecriture'] = $date_ecriture; + $tab['date_operation'] = dol_print_date($line->doc_date, '%d%m%Y'); - $Tab['folio'] = ' 1'; + $tab['folio'] = ' 1'; - $Tab['num_ecriture'] = str_pad(dol_trunc($index, 6, 'right', 'UTF-8', 1), 6, ' ', STR_PAD_LEFT); + $tab['num_ecriture'] = str_pad(dol_trunc($index, 6, 'right', 'UTF-8', 1), 6, ' ', STR_PAD_LEFT); - $Tab['jour_ecriture'] = dol_print_date($data->doc_date, '%d%m%y'); + $tab['jour_ecriture'] = dol_print_date($line->doc_date, '%d%m%y'); - $Tab['num_compte'] = str_pad(dol_trunc($code_compta, 6, 'right', 'UTF-8', 1), 6, '0'); + $tab['num_compte'] = str_pad(dol_trunc($code_compta, 6, 'right', 'UTF-8', 1), 6, '0'); - if ($data->sens == 'D') { - $Tab['montant_debit'] = str_pad(number_format($data->debit, 2, ',', ''), 13, ' ', STR_PAD_LEFT); + if ($line->sens == 'D') { + $tab['montant_debit'] = str_pad(number_format($line->debit, 2, ',', ''), 13, ' ', STR_PAD_LEFT); - $Tab['montant_crebit'] = str_pad(number_format(0, 2, ',', ''), 13, ' ', STR_PAD_LEFT); + $tab['montant_crebit'] = str_pad(number_format(0, 2, ',', ''), 13, ' ', STR_PAD_LEFT); } else { - $Tab['montant_debit'] = str_pad(number_format(0, 2, ',', ''), 13, ' ', STR_PAD_LEFT); + $tab['montant_debit'] = str_pad(number_format(0, 2, ',', ''), 13, ' ', STR_PAD_LEFT); - $Tab['montant_crebit'] = str_pad(number_format($data->credit, 2, ',', ''), 13, ' ', STR_PAD_LEFT); + $tab['montant_crebit'] = str_pad(number_format($line->credit, 2, ',', ''), 13, ' ', STR_PAD_LEFT); } - $Tab['libelle_ecriture'] = str_pad(dol_trunc(dol_string_unaccent($data->doc_ref).' '.dol_string_unaccent($data->label_operation), 30, 'right', 'UTF-8', 1), 30); + $tab['libelle_ecriture'] = str_pad(dol_trunc(dol_string_unaccent($line->doc_ref).' '.dol_string_unaccent($line->label_operation), 30, 'right', 'UTF-8', 1), 30); - $Tab['lettrage'] = str_repeat(dol_trunc($data->lettering_code, 2, 'left', 'UTF-8', 1), 2); + $tab['lettrage'] = str_repeat(dol_trunc($line->lettering_code, 2, 'left', 'UTF-8', 1), 2); - $Tab['code_piece'] = str_pad(dol_trunc($data->piece_num, 5, 'left', 'UTF-8', 1), 5, ' ', STR_PAD_LEFT); + $tab['code_piece'] = str_pad(dol_trunc($line->piece_num, 5, 'left', 'UTF-8', 1), 5, ' ', STR_PAD_LEFT); - $Tab['code_stat'] = str_repeat(' ', 4); + $tab['code_stat'] = str_repeat(' ', 4); - if (!empty($data->date_lim_reglement)) { - //$Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, $conf->global->ACCOUNTING_EXPORT_DATE); - $Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, '%d%m%Y'); + if (!empty($line->date_lim_reglement)) { + //$tab['date_echeance'] = dol_print_date($line->date_lim_reglement, $conf->global->ACCOUNTING_EXPORT_DATE); + $tab['date_echeance'] = dol_print_date($line->date_lim_reglement, '%d%m%Y'); } else { - $Tab['date_echeance'] = dol_print_date($data->doc_date, '%d%m%Y'); + $tab['date_echeance'] = dol_print_date($line->doc_date, '%d%m%Y'); } - $Tab['monnaie'] = '1'; + $tab['monnaie'] = '1'; - $Tab['filler'] = ' '; + $tab['filler'] = ' '; - $Tab['ind_compteur'] = ' '; + $tab['ind_compteur'] = ' '; - $Tab['quantite'] = '0,000000000'; + $tab['quantite'] = '0,000000000'; - $Tab['code_pointage'] = str_repeat(' ', 2); + $tab['code_pointage'] = str_repeat(' ', 2); - $Tab['end_line'] = $end_line; + $tab['end_line'] = $end_line; - print implode('|', $Tab); + print implode('|', $tab); $index++; } @@ -977,34 +1090,43 @@ class AccountancyExport /** * Export format : EBP * - * @param array $objectLines data - * @return void + * @param array $objectLines data + * @param resource $exportFile [=null] File resource to export or print if null + * @return void */ - public function exportEbp($objectLines) + public function exportEbp($objectLines, $exportFile = null) { $separator = ','; $end_line = "\n"; foreach ($objectLines as $line) { - $date = dol_print_date($line->doc_date, '%d%m%Y'); + $date_document = dol_print_date($line->doc_date, '%d%m%Y'); - print $line->id.$separator; - print $date.$separator; - print $line->code_journal.$separator; + $tab = array(); + + $tab[] = $line->id; + $tab[] = $date_document; + $tab[] = $line->code_journal; if (empty($line->subledger_account)) { - print $line->numero_compte.$separator; + $tab[] = $line->numero_compte; } else { - print $line->subledger_account.$separator; + $tab[] = $line->subledger_account; } - //print substr(length_accountg($line->numero_compte), 0, 2) . $separator; - print '"'.dol_trunc($line->label_operation, 40, 'right', 'UTF-8', 1).'"'.$separator; - print '"'.dol_trunc($line->piece_num, 15, 'right', 'UTF-8', 1).'"'.$separator; - print price2num(abs($line->debit - $line->credit)).$separator; - print $line->sens.$separator; - print $date.$separator; + //$tab[] = substr(length_accountg($line->numero_compte), 0, 2) . $separator; + $tab[] = '"'.dol_trunc($line->label_operation, 40, 'right', 'UTF-8', 1).'"'; + $tab[] = '"'.dol_trunc($line->piece_num, 15, 'right', 'UTF-8', 1).'"'; + $tab[] = price2num(abs($line->debit - $line->credit)); + $tab[] = $line->sens; + $tab[] = $date_document; //print 'EUR'; - print $end_line; + + $output = implode($separator, $tab).$end_line; + if ($exportFile) { + fwrite($exportFile, $output); + } else { + print $output; + } } } @@ -1012,91 +1134,108 @@ class AccountancyExport /** * Export format : Agiris Isacompta * - * @param array $objectLines data - * @return void + * @param array $objectLines data + * @param resource $exportFile [=null] File resource to export or print if null + * @return void */ - public function exportAgiris($objectLines) + public function exportAgiris($objectLines, $exportFile = null) { - $separator = ';'; $end_line = "\n"; foreach ($objectLines as $line) { - $date = dol_print_date($line->doc_date, '%d%m%Y'); + $date_document = dol_print_date($line->doc_date, '%d%m%Y'); - print $line->piece_num.$separator; - print self::toAnsi($line->label_operation).$separator; - print $date.$separator; - print self::toAnsi($line->label_operation).$separator; + $tab = array(); + + $tab[] = $line->piece_num; + $tab[] = self::toAnsi($line->label_operation); + $tab[] = $date_document; + $tab[] = self::toAnsi($line->label_operation); if (empty($line->subledger_account)) { - print length_accountg($line->numero_compte).$separator; - print self::toAnsi($line->label_compte).$separator; + $tab[] = length_accountg($line->numero_compte); + $tab[] = self::toAnsi($line->label_compte); } else { - print length_accounta($line->subledger_account).$separator; - print self::toAnsi($line->subledger_label).$separator; + $tab[] = length_accounta($line->subledger_account); + $tab[] = self::toAnsi($line->subledger_label); } - print self::toAnsi($line->doc_ref).$separator; - print price($line->debit).$separator; - print price($line->credit).$separator; - print price(abs($line->debit - $line->credit)).$separator; - print $line->sens.$separator; - print $line->lettering_code.$separator; - print $line->code_journal; - print $end_line; + $tab[] = self::toAnsi($line->doc_ref); + $tab[] = price($line->debit); + $tab[] = price($line->credit); + $tab[] = price(abs($line->debit - $line->credit)); + $tab[] = $line->sens; + $tab[] = $line->lettering_code; + $tab[] = $line->code_journal; + + $output = implode($separator, $tab).$end_line; + if ($exportFile) { + fwrite($exportFile, $output); + } else { + print $output; + } } } /** * Export format : OpenConcerto * - * @param array $objectLines data - * @return void + * @param array $objectLines data + * @param resource $exportFile [=null] File resource to export or print if null + * @return void */ - public function exportOpenConcerto($objectLines) + public function exportOpenConcerto($objectLines, $exportFile = null) { - $separator = ';'; $end_line = "\n"; foreach ($objectLines as $line) { - $date = dol_print_date($line->doc_date, '%d/%m/%Y'); + $date_document = dol_print_date($line->doc_date, '%d/%m/%Y'); - print $date.$separator; - print $line->code_journal.$separator; + $tab = array(); + + $tab[] = $date_document; + $tab[] = $line->code_journal; if (empty($line->subledger_account)) { - print length_accountg($line->numero_compte).$separator; + $tab[] = length_accountg($line->numero_compte); } else { - print length_accounta($line->subledger_account).$separator; + $tab[] = length_accounta($line->subledger_account); } - print $line->doc_ref.$separator; - print $line->label_operation.$separator; - print price($line->debit).$separator; - print price($line->credit).$separator; + $tab[] = $line->doc_ref; + $tab[] = $line->label_operation; + $tab[] = price($line->debit); + $tab[] = price($line->credit); - print $end_line; + $output = implode($separator, $tab).$end_line; + if ($exportFile) { + fwrite($exportFile, $output); + } else { + print $output; + } } } /** * Export format : Configurable CSV * - * @param array $objectLines data - * @return void + * @param array $objectLines data + * @param resource $exportFile [=null] File resource to export or print if null + * @return void */ - public function exportConfigurable($objectLines) + public function exportConfigurable($objectLines, $exportFile = null) { global $conf; $separator = $this->separator; foreach ($objectLines as $line) { + $date_document = dol_print_date($line->doc_date, $conf->global->ACCOUNTING_EXPORT_DATE); + $tab = array(); // export configurable - $date = dol_print_date($line->doc_date, $conf->global->ACCOUNTING_EXPORT_DATE); $tab[] = $line->piece_num; - $tab[] = $date; + $tab[] = $date_document; $tab[] = $line->doc_ref; $tab[] = preg_match('/'.$separator.'/', $line->label_operation) ? "'".$line->label_operation."'" : $line->label_operation; $tab[] = length_accountg($line->numero_compte); @@ -1106,44 +1245,57 @@ class AccountancyExport $tab[] = price2num($line->debit - $line->credit); $tab[] = $line->code_journal; - print implode($separator, $tab).$this->end_line; + $output = implode($separator, $tab).$this->end_line; + if ($exportFile) { + fwrite($exportFile, $output); + } else { + print $output; + } } } /** * Export format : FEC * - * @param array $objectLines data - * @return void + * @param array $objectLines data + * @param resource $exportFile [=null] File resource to export or print if null + * @return void */ - public function exportFEC($objectLines) + public function exportFEC($objectLines, $exportFile = null) { global $langs; $separator = "\t"; $end_line = "\r\n"; - print "JournalCode".$separator; - print "JournalLib".$separator; - print "EcritureNum".$separator; - print "EcritureDate".$separator; - print "CompteNum".$separator; - print "CompteLib".$separator; - print "CompAuxNum".$separator; - print "CompAuxLib".$separator; - print "PieceRef".$separator; - print "PieceDate".$separator; - print "EcritureLib".$separator; - print "Debit".$separator; - print "Credit".$separator; - print "EcritureLet".$separator; - print "DateLet".$separator; - print "ValidDate".$separator; - print "Montantdevise".$separator; - print "Idevise".$separator; - print "DateLimitReglmt".$separator; - print "NumFacture"; - print $end_line; + $tab = array(); + $tab[] = "JournalCode"; + $tab[] = "JournalLib"; + $tab[] = "EcritureNum"; + $tab[] = "EcritureDate"; + $tab[] = "CompteNum"; + $tab[] = "CompteLib"; + $tab[] = "CompAuxNum"; + $tab[] = "CompAuxLib"; + $tab[] = "PieceRef"; + $tab[] = "PieceDate"; + $tab[] = "EcritureLib"; + $tab[] = "Debit"; + $tab[] = "Credit"; + $tab[] = "EcritureLet"; + $tab[] = "DateLet"; + $tab[] = "ValidDate"; + $tab[] = "Montantdevise"; + $tab[] = "Idevise"; + $tab[] = "DateLimitReglmt"; + $tab[] = "NumFacture"; + + $output = implode($separator, $tab).$end_line; + if ($exportFile) { + fwrite($exportFile, $output); + } else { + print $output; + } foreach ($objectLines as $line) { if ($line->debit == 0 && $line->credit == 0) { @@ -1172,73 +1324,80 @@ class AccountancyExport $refInvoice = $invoice->ref_supplier; } + $tab = array(); + // FEC:JournalCode - print $line->code_journal . $separator; + $tab[] = $line->code_journal; // FEC:JournalLib $labeljournal = dol_string_unaccent($langs->transnoentities($line->journal_label)); $labeljournal = dol_string_nospecial($labeljournal, ' '); - print $labeljournal . $separator; + $tab[] = $labeljournal; // FEC:EcritureNum - print $line->piece_num . $separator; + $tab[] = $line->piece_num; // FEC:EcritureDate - print $date_document . $separator; + $tab[] = $date_document; // FEC:CompteNum - print $line->numero_compte . $separator; + $tab[] = length_accountg($line->numero_compte); // FEC:CompteLib - print dol_string_unaccent($line->label_compte) . $separator; + $tab[] = dol_string_unaccent($line->label_compte); // FEC:CompAuxNum - print $line->subledger_account . $separator; + $tab[] = length_accounta($line->subledger_account); // FEC:CompAuxLib - print dol_string_unaccent($line->subledger_label) . $separator; + $tab[] = dol_string_unaccent($line->subledger_label); // FEC:PieceRef - print $line->doc_ref . $separator; + $tab[] = $line->doc_ref; // FEC:PieceDate - print dol_string_unaccent($date_creation) . $separator; + $tab[] = dol_string_unaccent($date_creation); // FEC:EcritureLib // Clean label operation to prevent problem on export with tab separator & other character $line->label_operation = str_replace(array("\t", "\n", "\r"), " ", $line->label_operation); - print dol_string_unaccent($line->label_operation) . $separator; + $tab[] = dol_string_unaccent($line->label_operation); // FEC:Debit - print price2fec($line->debit) . $separator; + $tab[] = price2fec($line->debit); // FEC:Credit - print price2fec($line->credit) . $separator; + $tab[] = price2fec($line->credit); // FEC:EcritureLet - print $line->lettering_code . $separator; + $tab[] = $line->lettering_code; // FEC:DateLet - print $date_lettering . $separator; + $tab[] = $date_lettering; // FEC:ValidDate - print $date_validation . $separator; + $tab[] = $date_validation; // FEC:Montantdevise - print $line->multicurrency_amount . $separator; + $tab[] = $line->multicurrency_amount; // FEC:Idevise - print $line->multicurrency_code . $separator; + $tab[] = $line->multicurrency_code; // FEC_suppl:DateLimitReglmt - print $date_limit_payment . $separator; + $tab[] = $date_limit_payment; // FEC_suppl:NumFacture // Clean ref invoice to prevent problem on export with tab separator & other character $refInvoice = str_replace(array("\t", "\n", "\r"), " ", $refInvoice); - print dol_trunc(self::toAnsi($refInvoice), 17, 'right', 'UTF-8', 1); + $tab[] = dol_trunc(self::toAnsi($refInvoice), 17, 'right', 'UTF-8', 1); - print $end_line; + $output = implode($separator, $tab).$end_line; + if ($exportFile) { + fwrite($exportFile, $output); + } else { + print $output; + } } } } @@ -1246,37 +1405,45 @@ class AccountancyExport /** * Export format : FEC2 * - * @param array $objectLines data - * @return void + * @param array $objectLines data + * @param resource $exportFile [=null] File resource to export or print if null + * @return void */ - public function exportFEC2($objectLines) + public function exportFEC2($objectLines, $exportFile = null) { global $langs; $separator = "\t"; $end_line = "\r\n"; - print "JournalCode".$separator; - print "JournalLib".$separator; - print "EcritureNum".$separator; - print "EcritureDate".$separator; - print "CompteNum".$separator; - print "CompteLib".$separator; - print "CompAuxNum".$separator; - print "CompAuxLib".$separator; - print "PieceRef".$separator; - print "PieceDate".$separator; - print "EcritureLib".$separator; - print "Debit".$separator; - print "Credit".$separator; - print "EcritureLet".$separator; - print "DateLet".$separator; - print "ValidDate".$separator; - print "Montantdevise".$separator; - print "Idevise".$separator; - print "DateLimitReglmt".$separator; - print "NumFacture"; - print $end_line; + $tab = array(); + $tab[] = "JournalCode"; + $tab[] = "JournalLib"; + $tab[] = "EcritureNum"; + $tab[] = "EcritureDate"; + $tab[] = "CompteNum"; + $tab[] = "CompteLib"; + $tab[] = "CompAuxNum"; + $tab[] = "CompAuxLib"; + $tab[] = "PieceRef"; + $tab[] = "PieceDate"; + $tab[] = "EcritureLib"; + $tab[] = "Debit"; + $tab[] = "Credit"; + $tab[] = "EcritureLet"; + $tab[] = "DateLet"; + $tab[] = "ValidDate"; + $tab[] = "Montantdevise"; + $tab[] = "Idevise"; + $tab[] = "DateLimitReglmt"; + $tab[] = "NumFacture"; + + $output = implode($separator, $tab).$end_line; + if ($exportFile) { + fwrite($exportFile, $output); + } else { + print $output; + } foreach ($objectLines as $line) { if ($line->debit == 0 && $line->credit == 0) { @@ -1305,74 +1472,80 @@ class AccountancyExport $refInvoice = $invoice->ref_supplier; } + $tab = array(); + // FEC:JournalCode - print $line->code_journal . $separator; + $tab[] = $line->code_journal; // FEC:JournalLib $labeljournal = dol_string_unaccent($langs->transnoentities($line->journal_label)); $labeljournal = dol_string_nospecial($labeljournal, ' '); - print $labeljournal . $separator; + $tab[] = $labeljournal; // FEC:EcritureNum - print $line->piece_num . $separator; + $tab[] = $line->piece_num; // FEC:EcritureDate - print $date_creation . $separator; + $tab[] = $date_creation; // FEC:CompteNum - print length_accountg($line->numero_compte) . $separator; + $tab[] = length_accountg($line->numero_compte); // FEC:CompteLib - print dol_string_unaccent($line->label_compte) . $separator; + $tab[] = dol_string_unaccent($line->label_compte); // FEC:CompAuxNum - print length_accounta($line->subledger_account) . $separator; + $tab[] = length_accounta($line->subledger_account); // FEC:CompAuxLib - print dol_string_unaccent($line->subledger_label) . $separator; + $tab[] = dol_string_unaccent($line->subledger_label); // FEC:PieceRef - print $line->doc_ref . $separator; + $tab[] = $line->doc_ref; // FEC:PieceDate - print $date_document . $separator; + $tab[] = $date_document; // FEC:EcritureLib // Clean label operation to prevent problem on export with tab separator & other character $line->label_operation = str_replace(array("\t", "\n", "\r"), " ", $line->label_operation); - print dol_string_unaccent($line->label_operation) . $separator; + $tab[] = dol_string_unaccent($line->label_operation); // FEC:Debit - print price2fec($line->debit) . $separator; + $tab[] = price2fec($line->debit); // FEC:Credit - print price2fec($line->credit) . $separator; + $tab[] = price2fec($line->credit); // FEC:EcritureLet - print $line->lettering_code . $separator; + $tab[] = $line->lettering_code; // FEC:DateLet - print $date_lettering . $separator; + $tab[] = $date_lettering; // FEC:ValidDate - print $date_validation . $separator; + $tab[] = $date_validation; // FEC:Montantdevise - print $line->multicurrency_amount . $separator; + $tab[] = $line->multicurrency_amount; // FEC:Idevise - print $line->multicurrency_code . $separator; + $tab[] = $line->multicurrency_code; // FEC_suppl:DateLimitReglmt - print $date_limit_payment . $separator; + $tab[] = $date_limit_payment; // FEC_suppl:NumFacture // Clean ref invoice to prevent problem on export with tab separator & other character $refInvoice = str_replace(array("\t", "\n", "\r"), " ", $refInvoice); - print dol_trunc(self::toAnsi($refInvoice), 17, 'right', 'UTF-8', 1); + $tab[] = dol_trunc(self::toAnsi($refInvoice), 17, 'right', 'UTF-8', 1); - - print $end_line; + $output = implode($separator, $tab).$end_line; + if ($exportFile) { + fwrite($exportFile, $output); + } else { + print $output; + } } } } @@ -1383,19 +1556,47 @@ class AccountancyExport * https://onlinehelp.sageschweiz.ch/default.aspx?tabid=19984 * http://media.topal.ch/Public/Schnittstellen/TAF/Specification/Sage50-TAF-format.pdf * - * @param array $objectLines data - * - * @return void + * @param array $objectLines data + * @param resource $exportFile [=null] File resource to export or print if null + * @return void */ - public function exportSAGE50SWISS($objectLines) + public function exportSAGE50SWISS($objectLines, $exportFile = null) { // SAGE50SWISS - $this->separator = ','; - $this->end_line = "\r\n"; + $separator = ','; + $end_line = "\r\n"; // Print header line - print "Blg,Datum,Kto,S/H,Grp,GKto,SId,SIdx,KIdx,BTyp,MTyp,Code,Netto,Steuer,FW-Betrag,Tx1,Tx2,PkKey,OpId,Flag"; - print $this->end_line; + $tab = array(); + + $tab[] = "Blg"; + $tab[] = "Datum"; + $tab[] = "Kto"; + $tab[] = "S/H"; + $tab[] = "Grp"; + $tab[] = "GKto"; + $tab[] = "SId"; + $tab[] = "SIdx"; + $tab[] = "KIdx"; + $tab[] = "BTyp"; + $tab[] = "MTyp"; + $tab[] = "Code"; + $tab[] = "Netto"; + $tab[] = "Steuer"; + $tab[] = "FW-Betrag"; + $tab[] = "Tx1"; + $tab[] = "Tx2"; + $tab[] = "PkKey"; + $tab[] = "OpId"; + $tab[] = "Flag"; + + $output = implode($separator, $tab).$end_line; + if ($exportFile) { + fwrite($exportFile, $output); + } else { + print $output; + } + $thisPieceNum = ""; $thisPieceAccountNr = ""; $aSize = count($objectLines); @@ -1413,56 +1614,58 @@ class AccountancyExport $sammelBuchung = true; } + $tab = array(); + //Blg - print $line->piece_num.$this->separator; + $tab[] = $line->piece_num; // Datum - $date = dol_print_date($line->doc_date, '%d.%m.%Y'); - print $date.$this->separator; + $date_document = dol_print_date($line->doc_date, '%d.%m.%Y'); + $tab[] = $date_document; // Kto - print length_accountg($line->numero_compte).$this->separator; + $tab[] = length_accountg($line->numero_compte); // S/H if ($line->sens == 'D') { - print 'S'.$this->separator; + $tab[] = 'S'; } else { - print 'H'.$this->separator; + $tab[] = 'H'; } - //Grp - print self::trunc($line->code_journal, 1).$this->separator; + // Grp + $tab[] = self::trunc($line->code_journal, 1); // GKto if (empty($line->code_tiers)) { if ($line->piece_num == $thisPieceNum) { - print length_accounta($thisPieceAccountNr).$this->separator; + $tab[] = length_accounta($thisPieceAccountNr); } else { - print "div".$this->separator; + $tab[] = "div"; } } else { - print length_accounta($line->code_tiers).$this->separator; + $tab[] = length_accounta($line->code_tiers); } - //SId - print $this->separator; - //SIdx - print "0".$this->separator; - //KIdx - print "0".$this->separator; - //BTyp - print "0".$this->separator; + // SId + $tab[] = $this->separator; + // SIdx + $tab[] = "0"; + // KIdx + $tab[] = "0"; + // BTyp + $tab[] = "0"; - //MTyp 1=Fibu Einzelbuchung 2=Sammebuchung + // MTyp 1=Fibu Einzelbuchung 2=Sammebuchung if ($sammelBuchung) { - print "2".$this->separator; + $tab[] = "2"; } else { - print "1".$this->separator; + $tab[] = "1"; } // Code - print '""'.$this->separator; + $tab[] = '""'; // Netto - print abs($line->debit - $line->credit).$this->separator; + $tab[] = abs($line->debit - $line->credit); // Steuer - print "0.00".$this->separator; + $tab[] = "0.00"; // FW-Betrag - print "0.00".$this->separator; + $tab[] = "0.00"; // Tx1 $line1 = self::toAnsi($line->label_compte, 29); if ($line1 == "LIQ" || $line1 == "LIQ Beleg ok" || strlen($line1) <= 3) { @@ -1478,18 +1681,23 @@ class AccountancyExport $line2 = ""; } - print '"'.self::toAnsi($line1).'"'.$this->separator; + $tab[] = '"'.self::toAnsi($line1).'"'; // Tx2 - print '"'.self::toAnsi($line2).'"'.$this->separator; + $tab[] = '"'.self::toAnsi($line2).'"'; //PkKey - print "0".$this->separator; + $tab[] = "0"; //OpId - print $this->separator; + $tab[] = $this->separator; // Flag - print "0"; + $tab[] = "0"; - print $this->end_line; + $output = implode($separator, $tab).$end_line; + if ($exportFile) { + fwrite($exportFile, $output); + } else { + print $output; + } if ($line->piece_num !== $thisPieceNum) { $thisPieceNum = $line->piece_num; @@ -1502,11 +1710,11 @@ class AccountancyExport * Export format : LD Compta version 9 * http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Documentation/IntCptW9.pdf * - * @param array $objectLines data - * - * @return void + * @param array $objectLines data + * @param resource $exportFile [=null] File resource to export or print if null + * @return void */ - public function exportLDCompta($objectLines) + public function exportLDCompta($objectLines, $exportFile = null) { $separator = ';'; @@ -1517,21 +1725,23 @@ class AccountancyExport $date_creation = dol_print_date($line->date_creation, '%Y%m%d'); $date_lim_reglement = dol_print_date($line->date_lim_reglement, '%Y%m%d'); + $tab = array(); + // TYPE $type_enregistrement = 'E'; // For write movement - print $type_enregistrement.$separator; + $tab[] = $type_enregistrement; // JNAL - print substr($line->code_journal, 0, 2).$separator; + $tab[] = substr($line->code_journal, 0, 2); // NECR - print $line->id.$separator; + $tab[] = $line->id; // NPIE - print $line->piece_num.$separator; + $tab[] = $line->piece_num; // DATP - print $date_document.$separator; + $tab[] = $date_document; // LIBE - print $line->label_operation.$separator; + $tab[] = $line->label_operation; // DATH - print $date_lim_reglement.$separator; + $tab[] = $date_lim_reglement; // CNPI if ($line->doc_type == 'supplier_invoice') { if (($line->debit - $line->credit) > 0) { @@ -1548,7 +1758,7 @@ class AccountancyExport } else { $nature_piece = ''; } - print $nature_piece.$separator; + $tab[] = $nature_piece; // RACI // if (!empty($line->subledger_account)) { // if ($line->doc_type == 'supplier_invoice') { @@ -1562,71 +1772,76 @@ class AccountancyExport $racine_subledger_account = ''; // for records of type E leave this field blank // } - print $racine_subledger_account.$separator; // deprecated CPTG & CPTA use instead + $tab[] = $racine_subledger_account; // deprecated CPTG & CPTA use instead // MONT - print price(abs($line->debit - $line->credit), 0, '', 1, 2, 2).$separator; + $tab[] = price(abs($line->debit - $line->credit), 0, '', 1, 2, 2); // CODC - print $line->sens.$separator; + $tab[] = $line->sens; // CPTG - print length_accountg($line->numero_compte).$separator; + $tab[] = length_accountg($line->numero_compte); // DATE - print $date_creation.$separator; + $tab[] = $date_creation; // CLET - print $line->lettering_code.$separator; + $tab[] = $line->lettering_code; // DATL - print $line->date_lettering.$separator; + $tab[] = $line->date_lettering; // CPTA if (!empty($line->subledger_account)) { - print length_accounta($line->subledger_account).$separator; + $tab[] = length_accounta($line->subledger_account); } else { - print $separator; + $tab[] = ""; } // CNAT if ($line->doc_type == 'supplier_invoice' && !empty($line->subledger_account)) { - print 'F'.$separator; + $tab[] = 'F'; } elseif ($line->doc_type == 'customer_invoice' && !empty($line->subledger_account)) { - print 'C'.$separator; + $tab[] = 'C'; } else { - print $separator; + $tab[] = ""; } // SECT - print $separator; + $tab[] = ""; // CTRE - print $separator; + $tab[] = ""; // NORL - print $separator; + $tab[] = ""; // DATV - print $separator; + $tab[] = ""; // REFD - print $line->doc_ref.$separator; + $tab[] = $line->doc_ref; // CODH - print $separator; + $tab[] = ""; // NSEQ - print $separator; + $tab[] = ""; // MTDV - print '0'.$separator; + $tab[] = '0'; // CODV - print $separator; + $tab[] = ""; // TXDV - print '0'.$separator; + $tab[] = '0'; // MOPM - print $separator; + $tab[] = ""; // BONP - print $separator; + $tab[] = ""; // BQAF - print $separator; + $tab[] = ""; // ECES - print $separator; + $tab[] = ""; // TXTL - print $separator; + $tab[] = ""; // ECRM - print $separator; + $tab[] = ""; // DATK - print $separator; + $tab[] = ""; // HEUK - print $separator; + $tab[] = ""; - print $end_line; + $output = implode($separator, $tab).$end_line; + if ($exportFile) { + fwrite($exportFile, $output); + } else { + print $output; + } } } @@ -1636,11 +1851,11 @@ class AccountancyExport * * Help : http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Documentation/IntCptW10.pdf * - * @param array $objectLines data - * - * @return void + * @param array $objectLines data + * @param resource $exportFile [=null] File resource to export or print if null + * @return void */ - public function exportLDCompta10($objectLines) + public function exportLDCompta10($objectLines, $exportFile = null) { require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -1674,127 +1889,136 @@ class AccountancyExport $address[2] = substr(str_replace(array("\t", "\r"), " ", $soc->address), 82, 40); } + $tab = array(); + $type_enregistrement = 'C'; //TYPE - print $type_enregistrement.$separator; + $tab[] = $type_enregistrement; //NOCL - print $soc->code_client.$separator; + $tab[] = $soc->code_client; //NMCM - print $separator; + $tab[] = ""; //LIBI - print $separator; + $tab[] = ""; //TITR - print $separator; + $tab[] = ""; //RSSO - print $soc->nom.$separator; + $tab[] = $soc->nom; //CAD1 - print $address[0].$separator; + $tab[] = $address[0]; //CAD2 - print $address[1].$separator; + $tab[] = $address[1]; //CAD3 - print $address[2].$separator; + $tab[] = $address[2]; //COPO - print $soc->zip.$separator; + $tab[] = $soc->zip; //BUDI - print substr($soc->town, 0, 40).$separator; + $tab[] = substr($soc->town, 0, 40); //CPAY - print $separator; + $tab[] = ""; //PAYS - print substr(getCountry($soc->fk_pays), 0, 40).$separator; + $tab[] = substr(getCountry($soc->fk_pays), 0, 40); //NTEL - print $soc->phone.$separator; + $tab[] = $soc->phone; //TLEX - print $separator; + $tab[] = ""; //TLPO - print $separator; + $tab[] = ""; //TLCY - print $separator; + $tab[] = ""; //NINT - print $separator; + $tab[] = ""; //COMM - print $separator; + $tab[] = ""; //SIRE - print str_replace(" ", "", $soc->siret).$separator; + $tab[] = str_replace(" ", "", $soc->siret); //RIBP - print $separator; + $tab[] = ""; //DOBQ - print $separator; + $tab[] = ""; //IBBQ - print $separator; + $tab[] = ""; //COBQ - print $separator; + $tab[] = ""; //GUBQ - print $separator; + $tab[] = ""; //CPBQ - print $separator; + $tab[] = ""; //CLBQ - print $separator; + $tab[] = ""; //BIBQ - print $separator; + $tab[] = ""; //MOPM - print $separator; + $tab[] = ""; //DJPM - print $separator; + $tab[] = ""; //DMPM - print $separator; + $tab[] = ""; //REFM - print $separator; + $tab[] = ""; //SLVA - print $separator; + $tab[] = ""; //PLCR - print $separator; + $tab[] = ""; //ECFI - print $separator; + $tab[] = ""; //CREP - print $separator; + $tab[] = ""; //NREP - print $separator; + $tab[] = ""; //TREP - print $separator; + $tab[] = ""; //MREP - print $separator; + $tab[] = ""; //GRRE - print $separator; + $tab[] = ""; //LTTA - print $separator; + $tab[] = ""; //CACT - print $separator; + $tab[] = ""; //CODV - print $separator; + $tab[] = ""; //GRTR - print $separator; + $tab[] = ""; //NOFP - print $separator; + $tab[] = ""; //BQAF - print $separator; + $tab[] = ""; //BONP - print $separator; + $tab[] = ""; //CESC - print $separator; + $tab[] = ""; - print $end_line; + $output = implode($separator, $tab).$end_line; + if ($exportFile) { + fwrite($exportFile, $output); + } else { + print $output; + } } } + $tab = array(); + $date_document = dol_print_date($line->doc_date, '%Y%m%d'); $date_creation = dol_print_date($line->date_creation, '%Y%m%d'); $date_lim_reglement = dol_print_date($line->date_lim_reglement, '%Y%m%d'); // TYPE E $type_enregistrement = 'E'; // For write movement - print $type_enregistrement.$separator; + $tab[] = $type_enregistrement; // JNAL - print substr($line->code_journal, 0, 2).$separator; + $tab[] = substr($line->code_journal, 0, 2); // NECR - print $line->id.$separator; + $tab[] = $line->id; // NPIE - print $line->piece_num.$separator; + $tab[] = $line->piece_num; // DATP - print $date_document.$separator; + $tab[] = $date_document; // LIBE - print dol_trunc($line->label_operation, 25, 'right', 'UTF-8', 1).$separator; + $tab[] = dol_trunc($line->label_operation, 25, 'right', 'UTF-8', 1); // DATH - print $date_lim_reglement.$separator; + $tab[] = $date_lim_reglement; // CNPI if ($line->doc_type == 'supplier_invoice') { if (($line->amount) < 0) { // Currently, only the sign of amount allows to know the type of invoice (standard or credit note). Other solution is to analyse debit/credit/role of account. TODO Add column doc_type_long or make amount mandatory with rule on sign. @@ -1811,7 +2035,7 @@ class AccountancyExport } else { $nature_piece = ''; } - print $nature_piece.$separator; + $tab[] = $nature_piece; // RACI // if (!empty($line->subledger_account)) { // if ($line->doc_type == 'supplier_invoice') { @@ -1825,75 +2049,80 @@ class AccountancyExport $racine_subledger_account = ''; // for records of type E leave this field blank // } - print $racine_subledger_account.$separator; // deprecated CPTG & CPTA use instead + $tab[] = $racine_subledger_account; // deprecated CPTG & CPTA use instead // MONT - print price(abs($line->debit - $line->credit), 0, '', 1, 2).$separator; + $tab[] = price(abs($line->debit - $line->credit), 0, '', 1, 2); // CODC - print $line->sens.$separator; + $tab[] = $line->sens; // CPTG - print length_accountg($line->numero_compte).$separator; + $tab[] = length_accountg($line->numero_compte); // DATE - print $date_document.$separator; + $tab[] = $date_document; // CLET - print $line->lettering_code.$separator; + $tab[] = $line->lettering_code; // DATL - print $line->date_lettering.$separator; + $tab[] = $line->date_lettering; // CPTA if (!empty($line->subledger_account)) { - print length_accounta($line->subledger_account).$separator; + $tab[] = length_accounta($line->subledger_account); } else { - print $separator; + $tab[] = ""; } // CNAT if ($line->doc_type == 'supplier_invoice' && !empty($line->subledger_account)) { - print 'F'.$separator; + $tab[] = 'F'; } elseif ($line->doc_type == 'customer_invoice' && !empty($line->subledger_account)) { - print 'C'.$separator; + $tab[] = 'C'; } else { - print $separator; + $tab[] = ""; } // CTRE - print $separator; + $tab[] = ""; // NORL - print $separator; + $tab[] = ""; // DATV - print $separator; + $tab[] = ""; // REFD - print $line->doc_ref.$separator; + $tab[] = $line->doc_ref; // NECA - print '0'.$separator; + $tab[] = '0'; // CSEC - print $separator; + $tab[] = ""; // CAFF - print $separator; + $tab[] = ""; // CDES - print $separator; + $tab[] = ""; // QTUE - print $separator; + $tab[] = ""; // MTDV - print '0'.$separator; + $tab[] = '0'; // CODV - print $separator; + $tab[] = ""; // TXDV - print '0'.$separator; + $tab[] = '0'; // MOPM - print $separator; + $tab[] = ""; // BONP - print $separator; + $tab[] = ""; // BQAF - print $separator; + $tab[] = ""; // ECES - print $separator; + $tab[] = ""; // TXTL - print $separator; + $tab[] = ""; // ECRM - print $separator; + $tab[] = ""; // DATK - print $separator; + $tab[] = ""; // HEUK - print $separator; + $tab[] = ""; - print $end_line; + $output = implode($separator, $tab).$end_line; + if ($exportFile) { + fwrite($exportFile, $output); + } else { + print $output; + } $last_codeinvoice = $line->doc_ref; } @@ -1902,10 +2131,11 @@ class AccountancyExport /** * Export format : Charlemagne * - * @param array $objectLines data - * @return void + * @param array $objectLines data + * @param resource $exportFile [=null] File resource to export or print if null + * @return void */ - public function exportCharlemagne($objectLines) + public function exportCharlemagne($objectLines, $exportFile = null) { global $langs; $langs->load('compta'); @@ -1913,67 +2143,82 @@ class AccountancyExport $separator = "\t"; $end_line = "\n"; - /* - * Charlemagne export need header - */ - print $langs->transnoentitiesnoconv('Date').$separator; - print self::trunc($langs->transnoentitiesnoconv('Journal'), 6).$separator; - print self::trunc($langs->transnoentitiesnoconv('Account'), 15).$separator; - print self::trunc($langs->transnoentitiesnoconv('LabelAccount'), 60).$separator; - print self::trunc($langs->transnoentitiesnoconv('Piece'), 20).$separator; - print self::trunc($langs->transnoentitiesnoconv('LabelOperation'), 60).$separator; - print $langs->transnoentitiesnoconv('Amount').$separator; - print 'S'.$separator; - print self::trunc($langs->transnoentitiesnoconv('Analytic').' 1', 15).$separator; - print self::trunc($langs->transnoentitiesnoconv('AnalyticLabel').' 1', 60).$separator; - print self::trunc($langs->transnoentitiesnoconv('Analytic').' 2', 15).$separator; - print self::trunc($langs->transnoentitiesnoconv('AnalyticLabel').' 2', 60).$separator; - print self::trunc($langs->transnoentitiesnoconv('Analytic').' 3', 15).$separator; - print self::trunc($langs->transnoentitiesnoconv('AnalyticLabel').' 3', 60).$separator; - print $end_line; + $tab = array(); + + $tab[] = $langs->transnoentitiesnoconv('Date'); + $tab[] = self::trunc($langs->transnoentitiesnoconv('Journal'), 6); + $tab[] = self::trunc($langs->transnoentitiesnoconv('Account'), 15); + $tab[] = self::trunc($langs->transnoentitiesnoconv('LabelAccount'), 60); + $tab[] = self::trunc($langs->transnoentitiesnoconv('Piece'), 20); + $tab[] = self::trunc($langs->transnoentitiesnoconv('LabelOperation'), 60); + $tab[] = $langs->transnoentitiesnoconv('Amount'); + $tab[] = 'S'; + $tab[] = self::trunc($langs->transnoentitiesnoconv('Analytic').' 1', 15); + $tab[] = self::trunc($langs->transnoentitiesnoconv('AnalyticLabel').' 1', 60); + $tab[] = self::trunc($langs->transnoentitiesnoconv('Analytic').' 2', 15); + $tab[] = self::trunc($langs->transnoentitiesnoconv('AnalyticLabel').' 2', 60); + $tab[] = self::trunc($langs->transnoentitiesnoconv('Analytic').' 3', 15); + $tab[] = self::trunc($langs->transnoentitiesnoconv('AnalyticLabel').' 3', 60); + + $output = implode($separator, $tab).$end_line; + if ($exportFile) { + fwrite($exportFile, $output); + } else { + print $output; + } foreach ($objectLines as $line) { - $date = dol_print_date($line->doc_date, '%Y%m%d'); - print $date.$separator; //Date + $date_document = dol_print_date($line->doc_date, '%Y%m%d'); - print self::trunc($line->code_journal, 6).$separator; //Journal code + $tab = array(); + + $tab[] = $date_document; //Date + + $tab[] = self::trunc($line->code_journal, 6); //Journal code if (!empty($line->subledger_account)) { $account = $line->subledger_account; } else { $account = $line->numero_compte; } - print self::trunc($account, 15).$separator; //Account number + $tab[] = self::trunc($account, 15); //Account number - print self::trunc($line->label_compte, 60).$separator; //Account label - print self::trunc($line->doc_ref, 20).$separator; //Piece + $tab[] = self::trunc($line->label_compte, 60); //Account label + $tab[] = self::trunc($line->doc_ref, 20); //Piece // Clean label operation to prevent problem on export with tab separator & other character $line->label_operation = str_replace(array("\t", "\n", "\r"), " ", $line->label_operation); - print self::trunc($line->label_operation, 60).$separator; //Operation label - print price(abs($line->debit - $line->credit)).$separator; //Amount - print $line->sens.$separator; //Direction - print $separator; //Analytic - print $separator; //Analytic - print $separator; //Analytic - print $separator; //Analytic - print $separator; //Analytic - print $separator; //Analytic - print $end_line; + $tab[] = self::trunc($line->label_operation, 60); //Operation label + $tab[] = price(abs($line->debit - $line->credit)); //Amount + $tab[] = $line->sens; //Direction + $tab[] = ""; //Analytic + $tab[] = ""; //Analytic + $tab[] = ""; //Analytic + $tab[] = ""; //Analytic + $tab[] = ""; //Analytic + $tab[] = ""; //Analytic + + $output = implode($separator, $tab).$end_line; + if ($exportFile) { + fwrite($exportFile, $output); + } else { + print $output; + } } } /** * Export format : Gestimum V3 * - * @param array $objectLines data - * - * @return void + * @param array $objectLines data + * @param resource $exportFile [=null] File resource to export or print if null + * @return void */ - public function exportGestimumV3($objectLines) + public function exportGestimumV3($objectLines, $exportFile = null) { global $langs; - $this->separator = ','; + $separator = ','; + $end_line = "\r\n"; $invoices_infos = array(); $supplier_invoices_infos = array(); @@ -1981,7 +2226,8 @@ class AccountancyExport if ($line->debit == 0 && $line->credit == 0) { //unset($array[$line]); } else { - $date = dol_print_date($line->doc_date, '%d/%m/%Y'); + $date_document = dol_print_date($line->doc_date, '%d/%m/%Y'); + $date_echeance = dol_print_date($line->date_lim_reglement, '%Y%m%d'); $invoice_ref = $line->doc_ref; $company_name = ""; @@ -2029,33 +2275,41 @@ class AccountancyExport } } - print $line->id . $this->separator; - print $date . $this->separator; - print substr($line->code_journal, 0, 4) . $this->separator; + $tab = array(); + + $tab[] = $line->id; + $tab[] = $date_document; + $tab[] = substr($line->code_journal, 0, 4); if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) { - print length_accountg($line->subledger_account) . $this->separator; + $tab[] = length_accountg($line->subledger_account); } else { - print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator; + $tab[] = substr(length_accountg($line->numero_compte), 0, 15); } //Libellé Auto - print $this->separator; - //print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator; + $tab[] = ""; + //print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"'; //Libellé manuel - print dol_trunc(str_replace('"', '', $invoice_ref . (!empty($company_name) ? ' - ' : '') . $company_name), 40, 'right', 'UTF-8', 1) . $this->separator; + $tab[] = dol_trunc(str_replace('"', '', $invoice_ref . (!empty($company_name) ? ' - ' : '') . $company_name), 40, 'right', 'UTF-8', 1); //Numéro de pièce - print dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1) . $this->separator; + $tab[] = dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1); //Devise - print 'EUR' . $this->separator; + $tab[] = 'EUR'; //Amount - print price2num(abs($line->debit - $line->credit)) . $this->separator; + $tab[] = price2num(abs($line->debit - $line->credit)); //Sens - print $line->sens . $this->separator; + $tab[] = $line->sens; //Code lettrage - print $this->separator; + $tab[] = ""; //Date Echéance - print $date; - print $this->end_line; + $tab[] = $date_echeance; + + $output = implode($separator, $tab).$end_line; + if ($exportFile) { + fwrite($exportFile, $output); + } else { + print $output; + } } } } @@ -2063,40 +2317,49 @@ class AccountancyExport /** * Export format : Gestimum V5 * - * @param array $objectLines data - * - * @return void + * @param array $objectLines data + * @param resource $exportFile [=null] File resource to export or print if null + * @return void */ - public function exportGestimumV5($objectLines) + public function exportGestimumV5($objectLines, $exportFile = null) { - $this->separator = ','; + $separator = ','; + $end_line = "\r\n"; foreach ($objectLines as $line) { if ($line->debit == 0 && $line->credit == 0) { //unset($array[$line]); } else { - $date = dol_print_date($line->doc_date, '%d%m%Y'); + $date_document = dol_print_date($line->doc_date, '%d%m%Y'); - print $line->id . $this->separator; - print $date . $this->separator; - print substr($line->code_journal, 0, 4) . $this->separator; + $tab = array(); + + $tab[] = $line->id; + $tab[] = $date_document; + $tab[] = substr($line->code_journal, 0, 4); if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) { // TODO No hard code value - print length_accountg($line->subledger_account) . $this->separator; + $tab[] = length_accountg($line->subledger_account); } else { - print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator; + $tab[] = substr(length_accountg($line->numero_compte), 0, 15); + } + $tab[] = ""; + $tab[] = '"'.dol_trunc(str_replace('"', '', $line->label_operation), 40, 'right', 'UTF-8', 1).'"'; + $tab[] = '"' . dol_trunc(str_replace('"', '', $line->doc_ref), 40, 'right', 'UTF-8', 1) . '"'; + $tab[] = '"' . dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1) . '"'; + $tab[] = price2num(abs($line->debit - $line->credit)); + $tab[] = $line->sens; + $tab[] = $date_document; + $tab[] = ""; + $tab[] = ""; + $tab[] = 'EUR'; + + $output = implode($separator, $tab).$end_line; + if ($exportFile) { + fwrite($exportFile, $output); + } else { + print $output; } - print $this->separator; - //print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator; - print '"' . dol_trunc(str_replace('"', '', $line->doc_ref), 40, 'right', 'UTF-8', 1) . '"' . $this->separator; - print '"' . dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1) . '"' . $this->separator; - print price2num(abs($line->debit - $line->credit)) . $this->separator; - print $line->sens . $this->separator; - print $date . $this->separator; - print $this->separator; - print $this->separator; - print 'EUR'; - print $this->end_line; } } } @@ -2106,14 +2369,14 @@ class AccountancyExport * * by OpenSolus [https://opensolus.fr] * - * @param array $objectLines data - * - * @return void + * @param array $objectLines data + * @param resource $exportFile [=null] File resource to export or print if null + * @return void */ - public function exportiSuiteExpert($objectLines) + public function exportiSuiteExpert($objectLines, $exportFile = null) { - $this->separator = ';'; - $this->end_line = "\r\n"; + $separator = ';'; + $end_line = "\r\n"; foreach ($objectLines as $line) { @@ -2154,8 +2417,12 @@ class AccountancyExport $tab[] = price($line->montant); $tab[] = $line->code_journal; - $separator = $this->separator; - print implode($separator, $tab) . $this->end_line; + $output = implode($separator, $tab).$end_line; + if ($exportFile) { + fwrite($exportFile, $output); + } else { + print $output; + } } } diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 0fd2fb2e61d..8643724030c 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -169,7 +169,7 @@ class AccountingAccount extends CommonObject global $conf; $this->db = $db; - $this->next_prev_filter = "fk_pcg_version IN (SELECT pcg_version FROM ".MAIN_DB_PREFIX."accounting_system WHERE rowid = ".((int) $conf->global->CHARTOFACCOUNTS).")"; // Used to add a filter in Form::showrefnav method + $this->next_prev_filter = "fk_pcg_version IN (SELECT pcg_version FROM ".MAIN_DB_PREFIX."accounting_system WHERE rowid = ".((int) getDolGlobalInt('CHARTOFACCOUNTS')).")"; // Used to add a filter in Form::showrefnav method } /** @@ -198,7 +198,7 @@ class AccountingAccount extends CommonObject $sql .= " AND a.entity = ".$conf->entity; } if (!empty($limittocurrentchart)) { - $sql .= ' AND a.fk_pcg_version IN (SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid = '.((int) $conf->global->CHARTOFACCOUNTS).')'; + $sql .= ' AND a.fk_pcg_version IN (SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid = '.((int) getDolGlobalInt('CHARTOFACCOUNTS')).')'; } if (!empty($limittoachartaccount)) { $sql .= " AND a.fk_pcg_version = '".$this->db->escape($limittoachartaccount)."'"; diff --git a/htdocs/accountancy/class/api_accountancy.class.php b/htdocs/accountancy/class/api_accountancy.class.php new file mode 100644 index 00000000000..f1870d7b8b2 --- /dev/null +++ b/htdocs/accountancy/class/api_accountancy.class.php @@ -0,0 +1,276 @@ + + * Copyright (C) 2019 Cedric Ancelin + * Copyright (C) 2023 Lionel Vessiller + * + * 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 . + */ + +use Luracast\Restler\RestException; + +/** + * API class for accountancy + * + * @access protected + * @class DolibarrApiAccess {@requires user,external} + * + */ +class Accountancy extends DolibarrApi +{ + /** + * + * @var array $FIELDS Mandatory fields, checked when create and update object + */ + public static $FIELDS = array(); + + /** + * @var BookKeeping $bookkeeping {@type BookKeeping} + */ + public $bookkeeping; + + /** + * @var AccountancyExport $accountancy_export {@type AccountancyExport} + */ + public $accountancyexport; + + /** + * Constructor + */ + public function __construct() + { + global $db, $langs; + $this->db = $db; + + require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; + require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php'; + + $langs->load('accountancy'); + + $this->bookkeeping = new BookKeeping($this->db); + $this->accountancyexport = new AccountancyExport($this->db); + } + + /** + * Accountancy export data + * + * @param string $period Period : 'lastmonth', 'currentmonth', 'last3months', 'last6months', 'currentyear', 'lastyear', 'fiscalyear', 'lastfiscalyear', 'actualandlastfiscalyear' or 'custom' (see above) + * @param string $date_min [=''] Start date of period if 'custom' is set in period parameter + * Date format is 'YYYY-MM-DD' + * @param string $date_max [=''] End date of period if 'custom' is set in period parameter + * Date format is 'YYYY-MM-DD' + * @param string $format [=''] by default uses '1' for 'Configurable (CSV)' for format number + * or '1000' for FEC + * or '1010' for FEC2 + * (see AccountancyExport class) + * @param int $lettering [=0] by default don't export or 1 to export lettering data (columns 'letterring_code' and 'date_lettering' returns empty or not) + * @param int $alreadyexport [=0] by default export data only if it's not yet exported or 1 already exported (always export data even if 'date_export" is set) + * @param int $notnotifiedasexport [=0] by default notified as exported or 1 not notified as exported (when the export is done, notified or not the column 'date_export') + * + * @return string + * + * @url GET exportdata + * + * @throws RestException 401 Insufficient rights + * @throws RestException 404 Accountancy export period not found + * @throws RestException 404 Accountancy export start or end date not defined + * @throws RestException 404 Accountancy export format not found + * @throws RestException 500 Error on accountancy export + */ + public function exportData($period, $date_min = '', $date_max = '', $format = '', $lettering = 0, $alreadyexport = 0, $notnotifiedasexport = 0) + { + global $conf, $langs; + + // check rights + if (!DolibarrApiAccess::$user->rights->accounting->mouvements->export) { + throw new RestException(401, 'No permission to export accounting'); + } + + // check parameters + $period_available_list = array('lastmonth', 'currentmonth', 'last3months', 'last6months', 'currentyear', 'lastyear', 'fiscalyear', 'lastfiscalyear', 'actualandlastfiscalyear', 'custom'); + if (!in_array($period, $period_available_list)) { + throw new RestException(404, 'Accountancy export period not found'); + } + if ($period == 'custom') { + if ($date_min == '' && $date_max == '') { + throw new RestException(404, 'Accountancy export start and end date for custom period not defined'); + } + } + if ($format == '') { + $format = AccountancyExport::$EXPORT_TYPE_CONFIGURABLE; // uses default + } + + // get objects + $bookkeeping = $this->bookkeeping; + $accountancyexport = $this->accountancyexport; + + // find export format code from format number + $format_number_available_list = $accountancyexport->getType(); + if (is_numeric($format)) { + $format_number = (int) $format; + } else { + $format_number = 0; + $format_label_available_list = array_flip($format_number_available_list); + if (isset($format_label_available_list[$format])) { + $format_number = $format_label_available_list[$format]; + } + } + + // get all format available and check if exists + if (!array_key_exists($format_number, $format_number_available_list)) { + throw new RestException(404, 'Accountancy export format not found'); + } + + $sortorder = 'ASC'; // by default + $sortfield = 't.piece_num, t.rowid'; // by default + + // set filter for each period available + $filter = array(); + $doc_date_start = null; + $doc_date_end= null; + $now = dol_now(); + $now_arr = dol_getdate($now); + $now_month = $now_arr['mon']; + $now_year = $now_arr['year']; + if ($period == 'custom') { + if ($date_min != '') { + $time_min = strtotime($date_min); + if ($time_min !== false) { + $doc_date_start = $time_min; + } + } + if ($date_max != '') { + $time_max = strtotime($date_max); + if ($time_max !== false) { + $doc_date_end = $time_max; + } + } + } elseif ($period == 'lastmonth') { + $prev_date_arr = dol_get_prev_month($now_month, $now_year); // get previous month and year if month is january + $doc_date_start = dol_mktime(0, 0, 0, $prev_date_arr['month'], 1, $prev_date_arr['year']); // first day of previous month + $doc_date_end = dol_get_last_day($prev_date_arr['year'], $prev_date_arr['month']); // last day of previous month + } elseif ($period == 'currentmonth') { + $doc_date_start = dol_mktime(0, 0, 0, $now_month, 1, $now_year); // first day of current month + $doc_date_end = dol_get_last_day($now_year, $now_month); // last day of current month + } elseif ($period == 'last3months' || $period == 'last6months') { + if ($period == 'last3months') { + // last 3 months + $nb_prev_month = 3; + } else { + // last 6 months + $nb_prev_month = 6; + } + $prev_month_date_list = array(); + $prev_month_date_list[] = dol_get_prev_month($now_month, $now_year); // get previous month for index = 0 + for ($i = 1; $i < $nb_prev_month; $i++) { + $prev_month_date_list[] = dol_get_prev_month($prev_month_date_list[$i-1]['month'], $prev_month_date_list[$i-1]['year']); // get i+1 previous month for index=i + } + $doc_date_start = dol_mktime(0, 0, 0, $prev_month_date_list[$nb_prev_month-1]['month'], 1, $prev_month_date_list[$nb_prev_month-1]['year']); // first day of n previous month for index=n-1 + $doc_date_end = dol_get_last_day($prev_month_date_list[0]['year'], $prev_month_date_list[0]['month']); // last day of previous month for index = 0 + } elseif ($period == 'currentyear' || $period == 'lastyear') { + $period_year = $now_year; + if ($period == 'lastyear') { + $period_year--; + } + $doc_date_start = dol_mktime(0, 0, 0, 1, 1, $period_year); // first day of year + $doc_date_end = dol_mktime(23, 59, 59, 12, 31, $period_year); // last day of year + } elseif ($period == 'fiscalyear' || $period == 'lastfiscalyear' || $period == 'actualandlastfiscalyear') { + // find actual fiscal year + $cur_fiscal_period = getCurrentPeriodOfFiscalYear($this->db, $conf); + $cur_fiscal_date_start = $cur_fiscal_period['date_start']; + $cur_fiscal_date_end = $cur_fiscal_period['date_end']; + + if ($period == 'fiscalyear') { + $doc_date_start = $cur_fiscal_date_start; + $doc_date_end = $cur_fiscal_date_end; + } else { + // get one day before current fiscal date start (to find previous fiscal period) + $prev_fiscal_date_search = dol_time_plus_duree($cur_fiscal_date_start, -1, 'd'); + + // find previous fiscal year from current fiscal year + $prev_fiscal_period = getCurrentPeriodOfFiscalYear($this->db, $conf, $prev_fiscal_date_search); + $prev_fiscal_date_start = $prev_fiscal_period['date_start']; + $prev_fiscal_date_end = $prev_fiscal_period['date_end']; + + if ($period == 'lastfiscalyear') { + $doc_date_start = $prev_fiscal_date_start; + $doc_date_end = $prev_fiscal_date_end; + } else { + // period == 'actualandlastfiscalyear' + $doc_date_start = $prev_fiscal_date_start; + $doc_date_end = $cur_fiscal_date_end; + } + } + } + if (is_numeric($doc_date_start)) { + $filter['t.doc_date>='] = $doc_date_start; + } + if (is_numeric($doc_date_end)) { + $filter['t.doc_date<='] = $doc_date_end; + } + + $result = $bookkeeping->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', $alreadyexport); + + if ($result < 0) { + throw new RestException(500, 'Error bookkeeping fetch all : '.$bookkeeping->errorsToString()); + } else { + // export files then exit + if (empty($lettering)) { + if (is_array($bookkeeping->lines)) { + foreach ($bookkeeping->lines as $k => $movement) { + unset($bookkeeping->lines[$k]->lettering_code); + unset($bookkeeping->lines[$k]->date_lettering); + } + } + } + + $error = 0; + $this->db->begin(); + + if (empty($notnotifiedasexport)) { + if (is_array($bookkeeping->lines)) { + foreach ($bookkeeping->lines as $movement) { + $now = dol_now(); + + $sql = " UPDATE " . MAIN_DB_PREFIX . "accounting_bookkeeping"; + $sql .= " SET date_export = '" . $this->db->idate($now) . "'"; + $sql .= " WHERE rowid = " . ((int) $movement->id); + + $result = $this->db->query($sql); + if (!$result) { + $accountancyexport->errors[] = $langs->trans('NotAllExportedMovementsCouldBeRecordedAsExportedOrValidated'); + $error++; + break; + } + } + } + } + + // export and only write file without downloading + if (!$error) { + $result = $accountancyexport->export($bookkeeping->lines, $format_number, 0, 1, 2); + if ($result < 0) { + $error++; + } + } + + if ($error) { + $this->db->rollback(); + throw new RestException(500, 'Error accountancy export : '.implode(',', $accountancyexport->errors)); + } else { + $this->db->commit(); + exit(); + } + } + } +} diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 7e2cdc56543..49bda65ba2b 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -2031,7 +2031,7 @@ class BookKeeping extends CommonObject require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; - $pcgver = $conf->global->CHARTOFACCOUNTS; + $pcgver = getDolGlobalInt('CHARTOFACCOUNTS'); $sql = "SELECT DISTINCT ab.numero_compte as account_number, aa.label as label, aa.rowid as rowid, aa.fk_pcg_version"; $sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab"; @@ -2093,7 +2093,7 @@ class BookKeeping extends CommonObject public function getRootAccount($account = null) { global $conf; - $pcgver = $conf->global->CHARTOFACCOUNTS; + $pcgver = getDolGlobalInt('CHARTOFACCOUNTS'); $sql = "SELECT root.rowid, root.account_number, root.label as label,"; $sql .= " parent.rowid as parent_rowid, parent.account_number as parent_account_number, parent.label as parent_label"; @@ -2135,7 +2135,7 @@ class BookKeeping extends CommonObject // phpcs:enable global $conf; - $pcgver = $conf->global->CHARTOFACCOUNTS; + $pcgver = getDolGlobalInt('CHARTOFACCOUNTS'); $sql = "SELECT aa.account_number, aa.label, aa.rowid, aa.fk_pcg_version, cat.label as category"; $sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as aa "; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 17ac1d211ae..e93bb4eccc4 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -75,7 +75,7 @@ $year_current = $year_start; // Validate History $action = GETPOST('action', 'aZ09'); -$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); +$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); // Security check if (!isModEnabled('accounting')) { @@ -102,9 +102,9 @@ if (($action == 'clean' || $action == 'validatehistory') && $user->hasRight('acc $sql1 .= ' (SELECT accnt.rowid '; $sql1 .= ' FROM '.MAIN_DB_PREFIX.'accounting_account as accnt'; $sql1 .= ' INNER JOIN '.MAIN_DB_PREFIX.'accounting_system as syst'; - $sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid='.((int) $conf->global->CHARTOFACCOUNTS).' AND accnt.entity = '.((int) $conf->entity).')'; - $sql1 .= ' AND fd.fk_facture IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'facture WHERE entity = '.((int) $conf->entity).')'; - $sql1 .= ' AND fk_code_ventilation <> 0'; + $sql1 .= " ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid = ".((int) getDolGlobalInt('CHARTOFACCOUNTS'))." AND accnt.entity = ".((int) $conf->entity).")"; + $sql1 .= " AND fd.fk_facture IN (SELECT rowid FROM ".MAIN_DB_PREFIX."facture WHERE entity = ".((int) $conf->entity).")"; + $sql1 .= " AND fk_code_ventilation <> 0"; dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG); $resql1 = $db->query($sql1); diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 0e5ecd25563..2079e28c15f 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -303,7 +303,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('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 diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 509e131f766..987d35512a5 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -102,7 +102,7 @@ $hookmanager->initHooks(array('accountancycustomerlist')); $formaccounting = new FormAccounting($db); $accountingAccount = new AccountingAccount($db); -$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); +$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); // Security check if (!isModEnabled('accounting')) { @@ -359,7 +359,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('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 diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index f11ccbf512e..c9ce105103c 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -58,7 +58,7 @@ $year_current = $year_start; // Validate History $action = GETPOST('action', 'aZ09'); -$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); +$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); // Security check if (!isModEnabled('accounting')) { @@ -85,7 +85,7 @@ if (($action == 'clean' || $action == 'validatehistory') && $user->hasRight('acc $sql1 .= ' (SELECT accnt.rowid '; $sql1 .= ' FROM '.MAIN_DB_PREFIX.'accounting_account as accnt'; $sql1 .= ' INNER JOIN '.MAIN_DB_PREFIX.'accounting_system as syst'; - $sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid='.((int) $conf->global->CHARTOFACCOUNTS).' AND accnt.entity = '.((int) $conf->entity).')'; + $sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid='.((int) getDolGlobalInt('CHARTOFACCOUNTS')).' AND accnt.entity = '.((int) $conf->entity).')'; $sql1 .= ' AND erd.fk_expensereport IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'expensereport WHERE entity = '.((int) $conf->entity).')'; $sql1 .= ' AND fk_code_ventilation <> 0'; dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG); diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index fbb92ebb18e..ba98ebcaaa7 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -234,7 +234,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('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 diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index e8822f2f669..253879eb462 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -95,7 +95,7 @@ $hookmanager->initHooks(array('accountancyexpensereportlist')); $formaccounting = new FormAccounting($db); $accounting = new AccountingAccount($db); -$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); +$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); // Security check if (!isModEnabled('accounting')) { @@ -283,7 +283,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('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 diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 87e67bbfcb6..63bd08a8066 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -73,7 +73,7 @@ $year_current = $year_start; // Validate History $action = GETPOST('action', 'aZ09'); -$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); +$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); // Security check if (!isModEnabled('accounting')) { @@ -100,9 +100,9 @@ if (($action == 'clean' || $action == 'validatehistory') && $user->rights->accou $sql1 .= ' (SELECT accnt.rowid '; $sql1 .= ' FROM '.MAIN_DB_PREFIX.'accounting_account as accnt'; $sql1 .= ' INNER JOIN '.MAIN_DB_PREFIX.'accounting_system as syst'; - $sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid='.$conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity.')'; - $sql1 .= ' AND fd.fk_facture_fourn IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'facture_fourn WHERE entity = '.$conf->entity.')'; - $sql1 .= ' AND fk_code_ventilation <> 0'; + $sql1 .= " ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid = ".getDolGlobalInt('CHARTOFACCOUNTS')." AND accnt.entity = ".((int) $conf->entity).")"; + $sql1 .= " AND fd.fk_facture_fourn IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'facture_fourn WHERE entity = ".((int) $conf->entity).")"; + $sql1 .= " AND fk_code_ventilation <> 0"; dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG); $resql1 = $db->query($sql1); diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 11c4bf290fd..2c4fece83f0 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -308,7 +308,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('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 diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 9c9ee109383..2b8fea60e51 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -104,7 +104,7 @@ $hookmanager->initHooks(array('accountancysupplierlist')); $formaccounting = new FormAccounting($db); $accountingAccount = new AccountingAccount($db); -$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); +$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); // Security check if (!isModEnabled('accounting')) { @@ -363,7 +363,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('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 diff --git a/htdocs/accountancy/tpl/export_journal.tpl.php b/htdocs/accountancy/tpl/export_journal.tpl.php index 8e3c914a6f5..767f95cb252 100644 --- a/htdocs/accountancy/tpl/export_journal.tpl.php +++ b/htdocs/accountancy/tpl/export_journal.tpl.php @@ -19,6 +19,7 @@ */ // $formatexportset must be defined +// $downloadMode =0 for direct download or =1 to download after writing files or =-1 not to download files // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { @@ -35,7 +36,7 @@ $siren = getDolGlobalString('MAIN_INFO_SIREN'); $date_export = "_".dol_print_date(dol_now(), '%Y%m%d%H%M%S'); $endaccountingperiod = dol_print_date(dol_now(), '%Y%m%d'); -if (empty($withAttachment)) { +if (empty($downloadMode)) { header('Content-Type: text/csv'); } @@ -70,6 +71,6 @@ if (($accountancyexport->getFormatCode($formatexportset) == 'fec' || $accountanc $completefilename = ($code ? $code."_" : "").($prefix ? $prefix."_" : "").$filename.($nodateexport ? "" : $date_export).".".$format; } -if (empty($withAttachment)) { +if (empty($downloadMode)) { header('Content-Disposition: attachment;filename=' . $completefilename); } diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index 6bf2a084563..867f4f47025 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -73,7 +73,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $objcanvas = null; // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('memberagenda')); +$hookmanager->initHooks(array('memberagenda', 'globalcard')); // Security check $result = restrictedArea($user, 'adherent', $id); diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index a4a4c0c71bb..f3074d94172 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -38,6 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/commonpeople.class.php'; /** @@ -45,6 +46,8 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; */ class Adherent extends CommonObject { + use CommonPeople; + /** * @var string ID to identify managed object */ @@ -3303,7 +3306,7 @@ class Adherent extends CommonObject */ public function getKanbanView($option = '', $arraydata = null) { - global $selected; + $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); $return = '
'; $return .= '
'; diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index ea7c68bbff8..cdb7f5a3086 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -996,6 +996,8 @@ class AdherentType extends CommonObject { global $langs, $user; + //$selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); + $return = '
'; $return .= '
'; $return .= ''; @@ -1004,7 +1006,6 @@ class AdherentType extends CommonObject $return .= '
'; $return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).''; - //$selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); //$return .= ''; if ($user->rights->adherent->configurer) { diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index db7b05b0832..f126403f597 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -222,7 +222,7 @@ class Members extends DolibarrApi } $sql = "SELECT t.rowid"; - $sql .= " FROM ".MAIN_DB_PREFIX."adherent as t"; + $sql .= " FROM ".MAIN_DB_PREFIX."adherent AS t LEFT JOIN ".MAIN_DB_PREFIX."adherent_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call if ($category > 0) { $sql .= ", ".MAIN_DB_PREFIX."categorie_member as c"; } diff --git a/htdocs/adherents/class/api_memberstypes.class.php b/htdocs/adherents/class/api_memberstypes.class.php index 109531de9d8..aa1ccf12f90 100644 --- a/htdocs/adherents/class/api_memberstypes.class.php +++ b/htdocs/adherents/class/api_memberstypes.class.php @@ -97,7 +97,7 @@ class MembersTypes extends DolibarrApi } $sql = "SELECT t.rowid"; - $sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as t"; + $sql .= " FROM ".MAIN_DB_PREFIX."adherent_type AS t LEFT JOIN ".MAIN_DB_PREFIX."adherent_type_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields $sql .= ' WHERE t.entity IN ('.getEntity('member_type').')'; // Add sql filters diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 37261676e98..c3c9f1b7863 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -500,7 +500,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); @@ -1068,7 +1068,7 @@ while ($i < $imaxinloop) { $memberstatic->type = $membertypestatic->label; $memberstatic->photo = $obj->photo; // Output Kanban - print $memberstatic->getKanbanView(''); + print $memberstatic->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == (min($num, $limit) - 1)) { print '
'; print ''; diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index e7195d4ee30..b79d4a2fc0f 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -287,7 +287,7 @@ if (count($arrayjs) && $mode == 'memberbycountry') { print "\tvar container = document.getElementById('".$mode."');\n"; print "\tvar geomap = new google.visualization.GeoMap(container);\n"; print "\tgeomap.draw(data, options);\n"; - print "};\n"; + print "}\n"; print "\n"; // print the div tag that will contain the map diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 10b711e943f..833c0518d9a 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -241,7 +241,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); @@ -647,7 +647,7 @@ while ($i < $imaxinloop) { $subscription->fk_bank = $accountstatic->getNomUrl(1); } // Output Kanban - print $subscription->getKanbanView(''); + print $subscription->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 622accdd5b1..ce16ba2db88 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -342,7 +342,7 @@ if (!$rowid && $action != 'create' && $action != 'edit') { } //output kanban $membertype->label = $objp->label; - print $membertype->getKanbanView(''); + print $membertype->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; @@ -634,7 +634,7 @@ if ($rowid > 0) { // Count total nb of records $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 7b2708e1906..7390e2e5fbe 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -404,7 +404,7 @@ print ''; print ''; print ''; -print ''."\n"; +print ''."\n"; // Name print ''; print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'.$langs->trans("CompanyInfo").'
'; @@ -572,12 +572,14 @@ print '
'; + print '
'; + // IDs of the company (country-specific) print '
'; print ''; -print ''; +print ''; $langs->load("companies"); @@ -688,7 +690,7 @@ print ''; print '
'; print '
'.$langs->trans("CompanyIds").''.$langs->trans("Value").'
'.$langs->trans("CompanyIds").'
'; print ''; -print ''; +print ''; print "\n"; print ''; print ''; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index bfd0f1a184a..e43b25b26f1 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2199,7 +2199,8 @@ if ($action == 'create') { print $societe->getNomUrl(1, 'supplier'); print ''; } else { - print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company(empty($societe->id) ? 0 : $societe->id, 'socid', '(s.fournisseur = 1 AND s.status = 1)', 'SelectThirdParty', 1, 0, null, 0, 'minwidth175 widthcentpercentminusxx maxwidth500'); + $filter = '((s.fournisseur:=:1) AND (s.status:=:1))'; + print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company(empty($societe->id) ? 0 : $societe->id, 'socid', $filter, 'SelectThirdParty', 1, 0, null, 0, 'minwidth175 widthcentpercentminusxx maxwidth500'); // reload page to retrieve supplier informations if (empty($conf->global->RELOAD_PAGE_ON_SUPPLIER_CHANGE_DISABLED)) { print ''; +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index d348252efeb..7b28d571bc5 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -708,7 +708,7 @@ $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // No $sql .= $hookmanager->resPrint; $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/recruitment/class/api_recruitment.class.php b/htdocs/recruitment/class/api_recruitment.class.php index b665bda1279..bcce3d9b92c 100644 --- a/htdocs/recruitment/class/api_recruitment.class.php +++ b/htdocs/recruitment/class/api_recruitment.class.php @@ -165,7 +165,7 @@ class Recruitment extends DolibarrApi if ($restrictonsocid && (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) { $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) } - $sql .= " FROM ".MAIN_DB_PREFIX.$tmpobject->table_element." as t"; + $sql .= " FROM ".MAIN_DB_PREFIX.$tmpobject->table_element." AS t LEFT JOIN ".MAIN_DB_PREFIX.$tmpobject->table_element."_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields if ($restrictonsocid && (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale @@ -272,7 +272,7 @@ class Recruitment extends DolibarrApi if ($restrictonsocid && (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) { $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) } - $sql .= " FROM ".MAIN_DB_PREFIX.$tmpobject->table_element." as t"; + $sql .= " FROM ".MAIN_DB_PREFIX.$tmpobject->table_element." AS t LEFT JOIN ".MAIN_DB_PREFIX.$tmpobject->table_element."_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields if ($restrictonsocid && (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index d44294ac9bd..065d56d8857 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -1116,7 +1116,7 @@ class RecruitmentJobPosition extends CommonObject */ public function getKanbanView($option = '', $arraydata = null) { - global $langs, $obj; + global $langs; $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); @@ -1138,7 +1138,9 @@ class RecruitmentJobPosition extends CommonObject $return .= ' | '.$langs->trans("Remuneration").' : '.$this->remuneration_suggested.''; } if (method_exists($this, 'getLibStatut')) { - $return .= '
'.$this->getLibStatut(3).' | '.$langs->trans("RecruitmentCandidatures", '', '', '', '', 5).' : '.$obj->nbapplications.'
'; + $return .= '
'.$this->getLibStatut(3).' | '.$langs->trans("RecruitmentCandidatures", '', '', '', '', 5).' : '; + $return .= $arraydata['nbapplications']; + $return .= '
'; } $return .= ''; $return .= ''; diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index deca6c40548..a878aab0c22 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -312,7 +312,7 @@ $sql = preg_replace('/,\s*$/', '', $sql); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); @@ -747,15 +747,16 @@ while ($i < $imaxinloop) { print ''; diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index 82bad29b8ea..5a759250ae6 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -289,7 +289,7 @@ $sql = preg_replace('/,\s*$/', '', $sql); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* 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); @@ -597,7 +597,7 @@ while ($i < $imaxinloop) { $selected = 0; } // Output Kanban - print $object->getKanbanView(''); + print $object->getKanbanView('', array('nbapplications'=>$obj->nbapplications, 'selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print ''; print ''; diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index b9050d190d2..8045b2857cb 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -542,7 +542,7 @@ class Dolresource extends CommonObject } $sql .= $this->db->order($sortfield, $sortorder); $this->num_all = 0; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $this->db->query($sql); $this->num_all = $this->db->num_rows($result); } diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 8ad57e0d93b..2395b6bf1b3 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -200,7 +200,7 @@ print ''; print ''; print ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $ret = $object->fetchAll('', '', 0, 0, $filter); if ($ret == -1) { dol_print_error($db, $object->error); diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 70c69761559..5a908a4d58e 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -303,7 +303,7 @@ $sql .= " pst.code"; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); @@ -663,7 +663,7 @@ while ($i < $imaxinloop) { $selected = 1; } } - print $salstatic->getKanbanView('', array('user' => $userstatic)); + print $salstatic->getKanbanView('', array('user' => $userstatic, 'selected' => $selected)); if ($i == ($imaxinloop - 1)) { print ''; print ''; diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index adee2a2ebf1..710a7b88c35 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -286,7 +286,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 @@ -574,7 +574,7 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $paymentsalstatic->getKanbanView(''); + print $paymentsalstatic->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 669f4349247..e79a28310f2 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -73,7 +73,7 @@ if (!$sortorder) { $object = new Societe($db); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('agendathirdparty')); +$hookmanager->initHooks(array('agendathirdparty', 'globalcard')); // Security check $socid = GETPOST('socid', 'int'); diff --git a/htdocs/societe/ajax/ajaxcompanies.php b/htdocs/societe/ajax/ajaxcompanies.php index 08d914d562a..aca9a4eaddb 100644 --- a/htdocs/societe/ajax/ajaxcompanies.php +++ b/htdocs/societe/ajax/ajaxcompanies.php @@ -20,7 +20,7 @@ /** * \file htdocs/societe/ajax/ajaxcompanies.php - * \brief File to return Ajax response on third parties request + * \brief File to return Ajax response on third parties request. Search is done on name|name_alias|code_client|code_fournisseur */ if (!defined('NOTOKENRENEWAL')) { @@ -53,107 +53,127 @@ if ($id > 0) { // Security check if ($user->socid > 0) { $socid = $user->socid; - $object->id = $socid; + if ($object->socid && $socid != $object->socid) { + accessforbidden('Not allowed to access thirdparty id '.$id.' with an external user on id '.$socid); + } } -restrictedArea($user, 'societe', $object->id, '&societe'); +restrictedArea($user, 'societe', $object, '&societe'); /* * View */ -// Ajout directives pour resoudre bug IE -//header('Cache-Control: Public, must-revalidate'); -//header('Pragma: public'); - //top_htmlhead("", "", 1); // Replaced with top_httphead. An ajax page does not need html header. -top_httphead(); +top_httphead('application/json'); //print ''."\n"; -// Generate list of companies -if (GETPOST('newcompany') || GETPOST('socid', 'int') || GETPOST('id_fourn', 'int')) { - $return_arr = array(); +$return_arr = array(); - // Define filter on text typed - $socid = GETPOST('newcompany'); - if (!$socid) { - $socid = GETPOST('socid', 'int'); - } - if (!$socid) { - $socid = GETPOST('id_fourn', 'int'); - } - - $sql = "SELECT s.rowid, s.nom"; - if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) { - $sql .= ", s.client, s.fournisseur, s.code_client, s.code_fournisseur"; - } - if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { - $sql .= ", s.address, s.zip, s.town"; - $sql .= ", dictp.code as country_code"; - } - $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; - if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as dictp ON dictp.rowid = s.fk_pays"; - } - $sql .= " WHERE s.entity IN (".getEntity('societe').")"; - if ($socid) { - $sql .= " AND ("; - // Add criteria on name/code - if (!empty($conf->global->COMPANY_DONOTSEARCH_ANYWHERE)) { // Can use index - $sql .= "nom LIKE '".$db->escape($socid)."%'"; - $sql .= " OR code_client LIKE '".$db->escape($socid)."%'"; - $sql .= " OR code_fournisseur LIKE '".$db->escape($socid)."%'"; - } else { - $sql .= "nom LIKE '%".$db->escape($socid)."%'"; - $sql .= " OR code_client LIKE '%".$db->escape($socid)."%'"; - $sql .= " OR code_fournisseur LIKE '%".$db->escape($socid)."%'"; - } - if (!empty($conf->global->SOCIETE_ALLOW_SEARCH_ON_ROWID)) { - $sql .= " OR rowid = ".((int) $socid); - } - $sql .= ")"; - } - //if (GETPOST("filter")) $sql.= " AND (".GETPOST("filter", "alpha").")"; // Add other filters - $sql .= " ORDER BY nom ASC"; - - //dol_syslog("ajaxcompanies", LOG_DEBUG); - $resql = $db->query($sql); - if ($resql) { - while ($row = $db->fetch_array($resql)) { - $label = ''; - if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) { - if (($row['client']) && (!empty($row['code_client']))) { - $label = $row['code_client'].' - '; - } - if (($row['fournisseur']) && (!empty($row['code_fournisseur']))) { - $label .= $row['code_fournisseur'].' - '; - } - } - - $label .= $row['nom']; - - if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { - $label .= ($row['address'] ? ' - '.$row['address'] : '').($row['zip'] ? ' - '.$row['zip'] : '').($row['town'] ? ' '.$row['town'] : ''); - if (!empty($row['country_code'])) { - $label .= ', '.$langs->trans('Country'.$row['country_code']); - } - } - if ($socid) { - $label = preg_replace('/('.preg_quote($socid, '/').')/i', '$1', $label, 1); - } - $row_array['label'] = $label; - $row_array['value'] = $row['nom']; - $row_array['key'] = $row['rowid']; - - array_push($return_arr, $row_array); - } - - echo json_encode($return_arr); - } else { - echo json_encode(array('nom'=>'Error', 'label'=>'Error', 'key'=>'Error', 'value'=>'Error')); - } -} else { - echo json_encode(array('nom'=>'ErrorBadParameter', 'label'=>'ErrorBadParameter', 'key'=>'ErrorBadParameter', 'value'=>'ErrorBadParameter')); +// Define filter on text typed +$socid = GETPOST('newcompany'); +if (!$socid) { + $socid = GETPOST('socid', 'int'); +} +if (!$socid) { + $socid = GETPOST('id_fourn', 'int'); +} + +// Generate list of companies +if (! $socid) { + echo json_encode(array('nom'=>'ErrorBadParameter', 'label'=>'ErrorBadParameter', 'key'=>'ErrorBadParameter', 'value'=>'ErrorBadParameter')); + exit; +} + +$sql = "SELECT s.rowid, s.nom, s.name_alias, s.code_client, s.code_fournisseur, s.address, s.zip, s.town, s.email, s.siren, s.siret, s.ape, s.idprof4, s.idprof5, s.idprof6, s.client, s.fournisseur, s.datec, s.logo"; +if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { + $sql .= ", dictp.code as country_code"; +} +$sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; +if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as dictp ON dictp.rowid = s.fk_pays"; +} +$sql .= " WHERE s.entity IN (".getEntity('societe').")"; +if ($socid) { + $sql .= " AND ("; + // Add criteria on name/code + if (!empty($conf->global->COMPANY_DONOTSEARCH_ANYWHERE)) { // Can use index + $sql .= "s.nom LIKE '".$db->escape($db->escapeforlike($socid))."%'"; + $sql .= " OR s.name_alias LIKE '".$db->escape($db->escapeforlike($socid))."%'"; + $sql .= " OR s.code_client LIKE '".$db->escape($db->escapeforlike($socid))."%'"; + $sql .= " OR s.code_fournisseur LIKE '".$db->escape($db->escapeforlike($socid))."%'"; + } else { + $sql .= "s.nom LIKE '%".$db->escape($db->escapeforlike($socid))."%'"; + $sql .= " OR s.name_alias LIKE '%".$db->escape($db->escapeforlike($socid))."%'"; + $sql .= " OR s.code_client LIKE '%".$db->escape($db->escapeforlike($socid))."%'"; + $sql .= " OR s.code_fournisseur LIKE '%".$db->escape($db->escapeforlike($socid))."%'"; + } + if (!empty($conf->global->SOCIETE_ALLOW_SEARCH_ON_ROWID)) { + $sql .= " OR s.rowid = ".((int) $socid); + } + $sql .= ")"; +} +// Protection for external user access +if ($user->socid > 0) { + $sql .= " AND s.rowid = ".((int) $user->socid); +} +//if (GETPOST("filter")) $sql.= " AND (".GETPOST("filter", "alpha").")"; // Add other filters +$sql .= " ORDER BY s.nom ASC"; + +//dol_syslog("ajaxcompanies", LOG_DEBUG); +$resql = $db->query($sql); +if ($resql) { + while ($row = $db->fetch_array($resql)) { + $label = ''; + if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) { + if (($row['client']) && (!empty($row['code_client']))) { + $label = $row['code_client'].' - '; + } + if (($row['fournisseur']) && (!empty($row['code_fournisseur']))) { + $label .= $row['code_fournisseur'].' - '; + } + } + + $label .= $row['nom']; + + if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { + $label .= ($row['address'] ? ' - '.$row['address'] : '').($row['zip'] ? ' - '.$row['zip'] : '').($row['town'] ? ' '.$row['town'] : ''); + if (!empty($row['country_code'])) { + $label .= ', '.$langs->trans('Country'.$row['country_code']); + } + } + if ($socid) { + $label = preg_replace('/('.preg_quote($socid, '/').')/i', '$1', $label, 1); + } + $row_array['label'] = $label; + + $row_array['value'] = $row['nom']; + $row_array['key'] = $row['rowid']; + + $row_array['name_alias'] = $row['name_alias']; + $row_array['client'] = $row['client']; + $row_array['fournisseur'] = $row['fournisseur']; + $row_array['code_client'] = $row['code_client']; + $row_array['code_fournisseur'] = $row['code_fournisseur']; + $row_array['address'] = $row['address']; + $row_array['zip'] = $row['zip']; + $row_array['town'] = $row['town']; + $row_array['email'] = $row['email']; + $row_array['siren'] = $row['siren']; + $row_array['siret'] = $row['siret']; + $row_array['ape'] = $row['ape']; + $row_array['idprof4'] = $row['idprof4']; + $row_array['idprof5'] = $row['idprof5']; + $row_array['idprof6'] = $row['idprof6']; + $row_array['datec'] = $row['datec']; + $row_array['logo'] = $row['logo']; + + array_push($return_arr, $row_array); + } + + echo json_encode($return_arr); +} else { + echo json_encode(array('nom'=>'Error', 'label'=>'Error', 'key'=>'Error', 'value'=>'Error')); } diff --git a/htdocs/societe/ajax/company.php b/htdocs/societe/ajax/company.php index 7bdfe6e0e34..f625b94bed7 100644 --- a/htdocs/societe/ajax/company.php +++ b/htdocs/societe/ajax/company.php @@ -19,7 +19,8 @@ /** * \file htdocs/societe/ajax/company.php - * \brief File to return Ajax response on thirdparty list request + * \brief File to return Ajax response on thirdparty list request. Used by the combo list of thirdparties. + * Search done on name, name_alias, barcode, tva_intra, ... */ if (!defined('NOTOKENRENEWAL')) { @@ -48,8 +49,8 @@ $outjson = (GETPOST('outjson', 'int') ? GETPOST('outjson', 'int') : 0); $action = GETPOST('action', 'aZ09'); $id = GETPOST('id', 'int'); $excludeids = GETPOST('excludeids', 'intcomma'); -$showtype = GETPOSTINT('showtype'); -$showcode = GETPOSTINT('showcode'); +$showtype = GETPOSTINT('showtype', 'alpha'); +$showcode = GETPOSTINT('showcode', 'alpha'); $object = new Societe($db); if ($id > 0) { @@ -69,6 +70,8 @@ restrictedArea($user, 'societe', $object->id, '&societe'); * View */ +top_httphead('application/json'); + //print ''."\n"; //print_r($_GET); @@ -90,10 +93,6 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) { } else { require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; - $langs->load("companies"); - - top_httphead(); - if (empty($htmlname)) { return; } @@ -124,9 +123,9 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) { $arrayresult = $form->select_thirdparty_list(0, $htmlname, $filter, 1, $showtype, 0, null, $searchkey, $outjson, 0, 'minwidth100', '', false, $excludeids, $showcode); - $db->close(); - if ($outjson) { print json_encode($arrayresult); } } + +$db->close(); diff --git a/htdocs/societe/canvas/company/actions_card_company.class.php b/htdocs/societe/canvas/company/actions_card_company.class.php index 1e034d46322..1ee7e003b2a 100644 --- a/htdocs/societe/canvas/company/actions_card_company.class.php +++ b/htdocs/societe/canvas/company/actions_card_company.class.php @@ -133,7 +133,7 @@ class ActionsCardCompany extends ActionsCardCommon $s .= ' '; if ($conf->use_javascript_ajax) { - $s .= ''.$langs->trans("VATIntraCheck").''; + $s .= ''.$langs->trans("VATIntraCheck").''; $this->tpl['tva_intra'] = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); } else { $this->tpl['tva_intra'] = $s.'object->country_id).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; @@ -161,7 +161,7 @@ class ActionsCardCompany extends ActionsCardCommon $s .= '   '; if ($conf->use_javascript_ajax) { - $s .= ''.$langs->trans("VATIntraCheck").''; + $s .= ''.$langs->trans("VATIntraCheck").''; $this->tpl['tva_intra'] = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); } else { $this->tpl['tva_intra'] = $s.'object->country_id).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 6cc50d51399..3f62deb8a98 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1368,10 +1368,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print 'global->SOCIETE_USEPREFIX) ? ' colspan="3"' : '').'>'; print ''; - print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alpahnohtml', 'minwidth300'); - /* Disabled. Must be implenteted by keeping the input text but calling ajax on a keydown of the input and output - data of duplicate into a div under the input. We need to keep the widgetForTranslation also for some countries. - */ + print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alpahnohtml', 'minwidth300'); // For some countries that need the company name in 2 languages + // This implementation of the feature to search already existing company has been disabled. It must be implemented by keeping the "input text" and we must call the search ajax societe/ajax/ajaxcompanies.php + // on a keydown of the input. We should show data about a duplicate found if we found less than 5 answers into a div under the input. /* print ''; print "\n".''; print "\n"; - $s .= ''.$langs->trans("VATIntraCheck").''; + $s .= ''.$langs->trans("VATIntraCheck").''; $s = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); } else { $s .= 'country_id).'" target="_blank" rel="noopener noreferrer">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; @@ -2495,7 +2494,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "}\n"; print ''; print "\n"; - $s .= ''.$langs->trans("VATIntraCheck").''; + $s .= ''.$langs->trans("VATIntraCheck").''; $s = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); } else { $s .= 'country_id).'" class="hideonsmartphone" target="_blank" rel="noopener noreferrer">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; @@ -2963,7 +2962,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "}\n"; print ''; print "\n"; - $s .= ''.$langs->trans("VATIntraCheck").''; + $s .= ''.$langs->trans("VATIntraCheck").''; $s = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); } else { $s .= 'country_id).'" class="hideonsmartphone" target="_blank" rel="noopener noreferrer">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; diff --git a/htdocs/societe/checkvat/checkVatPopup.php b/htdocs/societe/checkvat/checkVatPopup.php index dc88baf0c28..93a4668cf7c 100644 --- a/htdocs/societe/checkvat/checkVatPopup.php +++ b/htdocs/societe/checkvat/checkVatPopup.php @@ -149,7 +149,7 @@ if (!$vatNumber) { print '
'; print $langs->trans("VATIntraManualCheck", $langs->trans("VATIntraCheckURL"), $langs->transnoentitiesnoconv("VATIntraCheckURL")).'
'; print '
'; -print '
'; +print '
'; if ($messagetoshow) { print '

'; diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index e0386ddd1c6..c991db7e7ac 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -622,8 +622,7 @@ class Thirdparties extends DolibarrApi * @param string $sortorder Sort order * @param int $limit Limit for list * @param int $page Page number - * - * @return mixed + * @return array|void * * @url GET {id}/categories */ @@ -640,17 +639,17 @@ class Thirdparties extends DolibarrApi $categories = new Categorie($this->db); - $result = $categories->getListForItem($id, 'customer', $sortfield, $sortorder, $limit, $page); + $arrayofcateg = $categories->getListForItem($id, 'customer', $sortfield, $sortorder, $limit, $page); - if (is_numeric($result) && $result < 0) { + if (is_numeric($arrayofcateg) && $arrayofcateg < 0) { throw new RestException(503, 'Error when retrieve category list : '.$categories->error); } - if (is_numeric($result) && $result == 0) { // To fix a return of 0 instead of empty array of method getListForItem + if (is_numeric($arrayofcateg) && $arrayofcateg == 0) { // To fix a return of 0 instead of empty array of method getListForItem return array(); } - return $result; + return $arrayofcateg; } /** diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 4ab00102105..acc8694fbd2 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -41,6 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commonincoterm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commonsocialnetworks.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/commonpeople.class.php'; require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; @@ -51,6 +52,7 @@ class Societe extends CommonObject { use CommonIncoterm; use CommonSocialNetworks; + use CommonPeople; /** * @var string ID of module. diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 2f6159633fb..d0f20cd5296 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -740,7 +740,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records with no order and no limits $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); @@ -1564,7 +1564,7 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $companystatic->getKanbanView(''); + print $companystatic->getKanbanView('', array('selected' => in_array($obj->rowid, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index e4ce8015381..e7dabe47154 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -410,7 +410,7 @@ if ($result > 0) { // Count total nb of records $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('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 diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index dafe53a19d8..dae56b10c53 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -456,7 +456,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { if ($result < 0) { setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors'); } else { - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $nbtotalofrecords = $result; } } @@ -536,7 +536,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { // Count total nb of records $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $nbtotalofrecords = $prodcustprice->fetchAll('', '', 0, 0, $filter); } diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 4af74bdb2ce..8c467882a01 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -323,7 +323,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('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 diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 8f66ba035c4..80c144f43ba 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1273,7 +1273,8 @@ if ($action == 'create') { print ''; } else { print '
'.$langs->trans("FiscalYearInformation").''.$langs->trans("Value").''.$langs->trans("FiscalYearInformation").'
'; @@ -703,7 +705,7 @@ print load_fiche_titre($langs->trans("TypeOfSaleTaxes"), '', 'object_payment'); print ''; print ''; -print ''; +print ''; print ''; print "\n"; @@ -733,7 +735,7 @@ print "
'.$langs->trans("VATManagement").''.$langs->trans("Description").''.$langs->trans("VATManagement").' 
"; print '
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; @@ -777,7 +779,7 @@ print "
'.$form->textwithpicto($langs->transcountry("LocalTax1Management", $mysoc->country_code), $langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code)).''.$langs->trans("Description").''.$form->textwithpicto($langs->transcountry("LocalTax1Management", $mysoc->country_code), $langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code)).' 
"; print '
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; @@ -821,7 +823,7 @@ print "
'.$form->textwithpicto($langs->transcountry("LocalTax2Management", $mysoc->country_code), $langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)).''.$langs->trans("Description").''.$form->textwithpicto($langs->transcountry("LocalTax2Management", $mysoc->country_code), $langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)).' 
"; print '
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; if ($mysoc->useRevenueStamp()) { diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index ebbdf40ce8d..122d44ecc6c 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -101,7 +101,7 @@ $hookmanager->initHooks(array('admin', 'dictionaryadmin')); // Put here declaration of dictionaries properties // Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this. -$taborder = array(9, 15, 30, 0, 4, 3, 2, 0, 1, 8, 19, 16, 39, 27, 40, 38, 0, 5, 11, 0, 6, 24, 0, 29, 0, 33, 34, 32, 28, 17, 35, 36, 0, 10, 23, 12, 13, 7, 0, 14, 0, 22, 20, 18, 21, 41, 0, 37, 42, 0, 43, 0, 25, 0, 44, 0); +$taborder = array(9, 15, 30, 0, 4, 3, 2, 0, 1, 8, 19, 16, 39, 27, 40, 38, 0, 5, 11, 0, 6, 24, 0, 29, 0, 33, 34, 32, 28, 17, 35, 36, 0, 10, 31, 23, 12, 13, 7, 0, 14, 0, 22, 20, 18, 21, 41, 0, 37, 42, 0, 43, 0, 25, 0, 44, 0); // Name of SQL tables of dictionaries $tabname = array(); @@ -135,7 +135,7 @@ $tabname[27] = "c_stcomm"; $tabname[28] = "c_holiday_types"; $tabname[29] = "c_lead_status"; $tabname[30] = "c_format_cards"; -//$tabname[31]= "accounting_system"; +$tabname[31] = "c_invoice_subtype"; $tabname[32] = "c_hrm_public_holiday"; $tabname[33] = "c_hrm_department"; $tabname[34] = "c_hrm_function"; @@ -182,7 +182,7 @@ $tablib[27] = "DictionaryProspectStatus"; $tablib[28] = "DictionaryHolidayTypes"; $tablib[29] = "DictionaryOpportunityStatus"; $tablib[30] = "DictionaryFormatCards"; -//$tablib[31]= "DictionaryAccountancysystem"; +$tablib[31] = "DictionaryInvoiceSubtype"; $tablib[32] = "DictionaryPublicHolidays"; $tablib[33] = "DictionaryDepartment"; $tablib[34] = "DictionaryFunction"; @@ -205,7 +205,7 @@ $tabsql[3] = "SELECT r.rowid as rowid, r.code_region as state_code, r.nom as lib $tabsql[4] = "SELECT c.rowid as rowid, c.code, c.label, c.active, c.favorite, c.eec FROM ".MAIN_DB_PREFIX."c_country AS c"; $tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.label, c.active FROM ".MAIN_DB_PREFIX."c_civility AS c"; $tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.color, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a"; -$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, c.code as country_code, c.label as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_pays=c.rowid and c.active=1"; +$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, c.code as country_code, c.label as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_pays = c.rowid and c.active = 1"; $tabsql[8] = "SELECT t.id as rowid, t.code as code, t.libelle, t.fk_country as country_id, c.code as country_code, c.label as country, t.position, t.active FROM ".MAIN_DB_PREFIX."c_typent as t LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON t.fk_country=c.rowid"; $tabsql[9] = "SELECT c.code_iso as code, c.label, c.unicode, c.active FROM ".MAIN_DB_PREFIX."c_currencies AS c"; $tabsql[10] = "SELECT t.rowid, t.type_vat, t.code, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, c.label as country, c.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid"; @@ -229,7 +229,7 @@ $tabsql[27] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN $tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newbymonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.block_if_negative, h.sortorder, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid"; $tabsql[29] = "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status"; $tabsql[30] = "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards"; -//$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s"; +$tabsql[31] = "SELECT t.rowid, t.code, t.label, c.label as country, c.code as country_code, t.fk_country as country_id, t.active FROM ".MAIN_DB_PREFIX."c_invoice_subtype as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_country = c.rowid"; $tabsql[32] = "SELECT a.id as rowid, a.entity, a.code, a.fk_country as country_id, c.code as country_code, c.label as country, a.dayrule, a.day, a.month, a.year, a.active FROM ".MAIN_DB_PREFIX."c_hrm_public_holiday as a LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON a.fk_country=c.rowid AND c.active=1"; $tabsql[33] = "SELECT rowid, pos, code, label, active FROM ".MAIN_DB_PREFIX."c_hrm_department"; $tabsql[34] = "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PREFIX."c_hrm_function"; @@ -276,7 +276,7 @@ $tabsqlsort[27] = "code ASC"; $tabsqlsort[28] = "sortorder ASC, country ASC, code ASC"; $tabsqlsort[29] = "position ASC"; $tabsqlsort[30] = "code ASC"; -//$tabsqlsort[31]="pcg_version ASC"; +$tabsqlsort[31] = "country ASC, code ASC"; $tabsqlsort[32] = "country, year ASC, month ASC, day ASC"; $tabsqlsort[33] = "code ASC"; $tabsqlsort[34] = "code ASC"; @@ -323,7 +323,7 @@ $tabfield[27] = "code,libelle,picto"; $tabfield[28] = "code,label,affect,delay,newbymonth,country_id,country,block_if_negative,sortorder"; $tabfield[29] = "code,label,percent,position"; $tabfield[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; -//$tabfield[31]= "pcg_version,label"; +$tabfield[31] = "country_id,country,code,label"; $tabfield[32] = "code,dayrule,year,month,day,country_id,country"; $tabfield[33] = "code,label"; $tabfield[34] = "code,label"; @@ -370,7 +370,7 @@ $tabfieldvalue[27] = "code,libelle,picto"; $tabfieldvalue[28] = "code,label,affect,delay,newbymonth,country,block_if_negative,sortorder"; $tabfieldvalue[29] = "code,label,percent,position"; $tabfieldvalue[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; -//$tabfieldvalue[31]= "pcg_version,label"; +$tabfieldvalue[31] = "country,code,label"; $tabfieldvalue[32] = "code,dayrule,day,month,year,country"; $tabfieldvalue[33] = "code,label"; $tabfieldvalue[34] = "code,label"; @@ -417,8 +417,7 @@ $tabfieldinsert[27] = "code,libelle,picto"; $tabfieldinsert[28] = "code,label,affect,delay,newbymonth,fk_country,block_if_negative,sortorder"; $tabfieldinsert[29] = "code,label,percent,position"; $tabfieldinsert[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; -//$tabfieldinsert[31]= "pcg_version,label"; -//$tabfieldinsert[32]= "code,label,range_account,sens,category_type,formula,position,fk_country"; +$tabfieldinsert[31] = "fk_country,code,label"; $tabfieldinsert[32] = "code,dayrule,day,month,year,fk_country"; $tabfieldinsert[33] = "code,label"; $tabfieldinsert[34] = "code,label"; @@ -467,7 +466,7 @@ $tabrowid[27] = "id"; $tabrowid[28] = ""; $tabrowid[29] = ""; $tabrowid[30] = ""; -//$tabrowid[31]= ""; +$tabrowid[31]= ""; $tabrowid[32] = "id"; $tabrowid[33] = "rowid"; $tabrowid[34] = "rowid"; @@ -514,7 +513,7 @@ $tabcond[27] = isModEnabled("societe"); $tabcond[28] = isModEnabled('holiday'); $tabcond[29] = isModEnabled('project'); $tabcond[30] = (isModEnabled('label') || isModEnabled('barcode') || isModEnabled('adherent')); // stickers format dictionary -//$tabcond[31]= isModEnabled('accounting'); +$tabcond[31] = ((isModEnabled('facture') || isModEnabled('supplier_invoice')) && $mysoc->country_code == 'GR'); $tabcond[32] = (isModEnabled('holiday') || isModEnabled('hrm')); $tabcond[33] = isModEnabled('hrm'); $tabcond[34] = isModEnabled('hrm'); @@ -576,6 +575,7 @@ $tabcomplete = array( 'c_product_nature'=>array('picto'=>'product', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))), 'c_productbatch_qcstatus'=>array('picto'=>'lot', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))), 'c_asset_disposal_type'=>array('picto'=>'asset', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))), + 'c_invoice_subtype'=>array('picto'=>'bill', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))), ); @@ -721,7 +721,7 @@ if (empty($reshook)) { $ok = 1; foreach ($listfield as $f => $value) { // Discard check of mandatory fields for country for some tables - if ($value == 'country_id' && in_array($tablib[$id], array('DictionaryPublicHolidays', 'DictionaryVAT', 'DictionaryRegion', 'DictionaryCompanyType', 'DictionaryHolidayTypes', 'DictionaryRevenueStamp', 'DictionaryAccountancysystem', 'DictionaryAccountancyCategory'))) { + if ($value == 'country_id' && in_array($tablib[$id], array('DictionaryPublicHolidays', 'DictionaryVAT', 'DictionaryInvoiceSubtype', 'DictionaryRegion', 'DictionaryCompanyType', 'DictionaryHolidayTypes', 'DictionaryRevenueStamp', 'DictionaryAccountancysystem', 'DictionaryAccountancyCategory'))) { continue; // For some pages, country is not mandatory } if ($value == 'country' && in_array($tablib[$id], array('DictionaryPublicHolidays', 'DictionaryCanton', 'DictionaryCompanyType', 'DictionaryHolidayTypes', 'DictionaryRevenueStamp'))) { @@ -1208,7 +1208,7 @@ if ($search_country_id > 0) { $param .= '&search_country_id='.urlencode($search_country_id); } if ($search_code != '') { - $param .= '&search_code='.urlencode($search_country_id); + $param .= '&search_code='.urlencode($search_code); } if ($entity != '') { $param .= '&entity='.(int) $entity; @@ -1590,7 +1590,9 @@ if ($id > 0) { } print ''; @@ -1624,13 +1626,44 @@ if ($id > 0) { print '
'; } + $filterfound = 0; + foreach ($fieldlist as $field => $value) { + if ($value == 'entity') { + continue; + } + + $showfield = 1; // By default + if ($value == 'region_id' || $value == 'country_id') { + $showfield = 0; + } + + if ($showfield) { + if ($value == 'country') { + $filterfound++; + } elseif ($value == 'code') { + $filterfound++; + } + } + } + print '
'; print '
'.$form->textwithpicto($langs->trans("RevenueStamp"), $langs->trans("RevenueStampDesc")).''.$langs->trans("Description").''.$form->textwithpicto($langs->trans("RevenueStamp"), $langs->trans("RevenueStampDesc")).' 
'; if ($action != 'edit') { - print ''; + print ''; + } else { + print ''; } print '
'; // Title line with search input fields print ''."\n"; print ''; - $filterfound = 0; + + // Action button + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + $colspan++; + } + $colspan = 0; foreach ($fieldlist as $field => $value) { if ($value == 'entity') { @@ -1638,7 +1671,6 @@ if ($id > 0) { } $showfield = 1; // By default - if ($value == 'region_id' || $value == 'country_id') { $showfield = 0; } @@ -1648,13 +1680,11 @@ if ($id > 0) { print ''; - $filterfound++; $colspan++; } elseif ($value == 'code') { print ''; - $filterfound++; $colspan++; } else { print ''; $colspan++; } + print ''; $colspan++; - print ''; + $colspan++; } - print ''; - $colspan+=2; + print ''; // Title of lines print ''."\n"; print ''; + + // Action button + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print getTitleFieldOfList(''); + } + foreach ($fieldlist as $field => $value) { if ($value == 'entity') { continue; @@ -1917,9 +1959,13 @@ if ($id > 0) { print getTitleFieldOfList($langs->trans("Favorite"), 0, $_SERVER["PHP_SELF"], "favorite", ($page ? 'page='.$page.'&' : ''), $param, 'align="center"', $sortfield, $sortorder); } + // Status print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page ? 'page='.$page.'&' : ''), $param, 'align="center"', $sortfield, $sortorder); - print getTitleFieldOfList(''); - print getTitleFieldOfList(''); + + // Action button + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print getTitleFieldOfList(''); + } print ''; if ($num) { @@ -1927,9 +1973,76 @@ if ($id > 0) { while ($i < $num) { $obj = $db->fetch_object($resql); + // Can an entry be erased or disabled ? + // all true by default + $iserasable = 1; + $canbedisabled = 1; + $canbemodified = 1; + if (isset($obj->code) && $id != 10 && $id != 42) { + if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) { + $iserasable = 0; $canbedisabled = 0; + } elseif ($obj->code == 'RECEP') { + $iserasable = 0; $canbedisabled = 0; + } elseif ($obj->code == 'EF0') { + $iserasable = 0; $canbedisabled = 0; + } + } + if ($id == 25 && in_array($obj->code, array('banner', 'blogpost', 'other', 'page'))) { + $iserasable = 0; $canbedisabled = 0; + if (in_array($obj->code, array('banner'))) { + $canbedisabled = 1; + } + } + if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { + $iserasable = 0; + } + if (in_array(empty($obj->code) ? '' : $obj->code, array('AC_OTH', 'AC_OTH_AUTO')) || in_array(empty($obj->type) ? '' : $obj->type, array('systemauto'))) { + $canbedisabled = 0; $canbedisabled = 0; + } + $canbemodified = $iserasable; + + if (!empty($obj->code) && $obj->code == 'RECEP') { + $canbemodified = 1; + } + if ($tabname[$id] == "c_actioncomm") { + $canbemodified = 1; + } + + // Build Url. The table is id=, the id of line is rowid= + $rowidcol = $tabrowid[$id]; + // If rowidcol not defined + if (empty($rowidcol) || in_array($id, array(6, 7, 8, 13, 17, 19, 27, 32))) { + $rowidcol = 'rowid'; + } + $url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(isset($obj->{$rowidcol}) ? $obj->{$rowidcol} : (!empty($obj->code) ? urlencode($obj->code) : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : ''); + if (!empty($param)) { + $url .= '&'.$param; + } + if (!is_null($withentity)) { + $url .= '&entity='.$withentity; + } + $url .= '&'; + + //print_r($obj); print ''; + // Action button + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + } + if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) { $tmpaction = 'edit'; $parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); @@ -2171,56 +2284,6 @@ if ($id > 0) { } } - // Can an entry be erased or disabled ? - // all true by default - $iserasable = 1; - $canbedisabled = 1; - $canbemodified = 1; - if (isset($obj->code) && $id != 10 && $id != 42) { - if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) { - $iserasable = 0; $canbedisabled = 0; - } elseif ($obj->code == 'RECEP') { - $iserasable = 0; $canbedisabled = 0; - } elseif ($obj->code == 'EF0') { - $iserasable = 0; $canbedisabled = 0; - } - } - if ($id == 25 && in_array($obj->code, array('banner', 'blogpost', 'other', 'page'))) { - $iserasable = 0; $canbedisabled = 0; - if (in_array($obj->code, array('banner'))) { - $canbedisabled = 1; - } - } - if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { - $iserasable = 0; - } - if (in_array(empty($obj->code) ? '' : $obj->code, array('AC_OTH', 'AC_OTH_AUTO')) || in_array(empty($obj->type) ? '' : $obj->type, array('systemauto'))) { - $canbedisabled = 0; $canbedisabled = 0; - } - $canbemodified = $iserasable; - - if (!empty($obj->code) && $obj->code == 'RECEP') { - $canbemodified = 1; - } - if ($tabname[$id] == "c_actioncomm") { - $canbemodified = 1; - } - - // Build Url. The table is id=, the id of line is rowid= - $rowidcol = $tabrowid[$id]; - // If rowidcol not defined - if (empty($rowidcol) || in_array($id, array(6, 7, 8, 13, 17, 19, 27, 32))) { - $rowidcol = 'rowid'; - } - $url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(isset($obj->{$rowidcol}) ? $obj->{$rowidcol} : (!empty($obj->code) ? urlencode($obj->code) : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : ''); - if (!empty($param)) { - $url .= '&'.$param; - } - if (!is_null($withentity)) { - $url .= '&entity='.$withentity; - } - $url .= '&'; - // Favorite & EEC // Only activated on country dictionary if ($id == 4) { @@ -2259,23 +2322,20 @@ if ($id > 0) { } print ""; - // Modify link - if ($canbemodified) { - print ''; - } else { - print ''; - } - - // Delete link - if ($iserasable) { - print ''; - } else { - print ''; } print "\n"; diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 98a4eec28fb..452ae74d614 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -149,7 +149,7 @@ if (GETPOST('addfilter', 'alpha')) { if ($result > 0) { $object->fetchFilters(); } else { - setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error, 'errors'); + setEventMessages($emailcollectorfilter->error, $emailcollectorfilter->errors, 'errors'); } } @@ -161,7 +161,7 @@ if ($action == 'deletefilter') { if ($result > 0) { $object->fetchFilters(); } else { - setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error, 'errors'); + setEventMessages($emailcollectorfilter->error, $emailcollectorfilter->errors, 'errors'); } } } @@ -192,7 +192,7 @@ if (GETPOST('addoperation', 'alpha')) { $object->fetchActions(); } else { $error++; - setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors'); + setEventMessages($emailcollectoroperation->error, $emailcollectoroperation->errors, 'errors'); } } } @@ -216,7 +216,7 @@ if ($action == 'updateoperation') { $object->fetchActions(); } else { $error++; - setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors'); + setEventMessages($emailcollectoroperation->error, $emailcollectoroperation->errors, 'errors'); } } } @@ -228,7 +228,7 @@ if ($action == 'deleteoperation') { if ($result > 0) { $object->fetchActions(); } else { - setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors'); + setEventMessages($emailcollectoroperation->error, $emailcollectoroperation->errors, 'errors'); } } } @@ -242,7 +242,7 @@ if ($action == 'collecttest') { setEventMessages($object->lastresult, null, 'mesgs'); } else { $debuginfo = $object->debuginfo; - setEventMessages($object->error, null, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } $action = ''; @@ -257,7 +257,7 @@ if ($action == 'confirm_collect') { setEventMessages($object->lastresult, null, 'mesgs'); } else { $debuginfo = $object->debuginfo; - setEventMessages($object->error, null, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } $action = ''; diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 20d9ddf4ac9..6c916dff3db 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -275,7 +275,7 @@ $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $objec $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); @@ -555,7 +555,7 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/admin/expensereport_ik.php b/htdocs/admin/expensereport_ik.php index b26cefba580..7124a24c82a 100644 --- a/htdocs/admin/expensereport_ik.php +++ b/htdocs/admin/expensereport_ik.php @@ -184,7 +184,7 @@ foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab) { if ($range->range_active == 1) { if ($action == 'edit' && $range->ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) { echo ''; - echo ''; + echo ''; } else { echo ''.img_edit().''; if (!empty($range->ik->id)) { diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 280a3b06247..1a8f9ff90d5 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -298,7 +298,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 6dd34e990e7..c2874c7db3d 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -463,10 +463,10 @@ if (empty($reshook)) { $_POST['joinfiles'] = GETPOST('joinfiles-'.$rowid); } if ($field == 'content') { - $_POST['content'] = GETPOST('content-'.$rowid); + $_POST['content'] = GETPOST('content-'.$rowid, 'restricthtml'); } if ($field == 'content_lines') { - $_POST['content_lines'] = GETPOST('content_lines-'.$rowid); + $_POST['content_lines'] = GETPOST('content_lines-'.$rowid, 'restricthtml'); } if ($i) { @@ -494,7 +494,7 @@ if (empty($reshook)) { $i++; } - $sql .= " WHERE ".$rowidcol." = ".((int) $rowid); + $sql .= " WHERE ".$db->escape($rowidcol)." = ".((int) $rowid); if (!$user->admin) { // A non admin user can only edit its own template $sql .= " AND fk_user = ".((int) $user->id); } diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 05b76c9d6d5..94d33d6059c 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -127,10 +127,10 @@ foreach ($modulesdir as $dir) { // We discard modules according to features level (PS: if module is activated we always show it) $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod))); - if ($objMod->version == 'development' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) { + if ($objMod->version == 'development' && (empty($conf->global->$const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2))) { $modulequalified = 0; } - if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) { + if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1))) { $modulequalified = 0; } if (preg_match('/deprecated/', $objMod->version) && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) { diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index f5ec91027f8..c6ba25be465 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -396,10 +396,10 @@ foreach ($modulesdir as $dir) { // We discard modules according to features level (PS: if module is activated we always show it) $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod))); - if ($objMod->version == 'development' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) { + if ($objMod->version == 'development' && (empty($conf->global->$const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2))) { $modulequalified = 0; } - if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) { + if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1))) { $modulequalified = 0; } if (preg_match('/deprecated/', $objMod->version) && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) { @@ -598,7 +598,7 @@ if ($mode == 'common' || $mode == 'commonkanban') { if (getDolGlobalInt('MAIN_FEATURES_LEVEL')) { $array_version = array('stable'=>$langs->transnoentitiesnoconv("Stable")); - if ($conf->global->MAIN_FEATURES_LEVEL < 0) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 0) { $array_version['deprecated'] = $langs->trans("Deprecated"); } if ($conf->global->MAIN_FEATURES_LEVEL > 0) { diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index 5945ebfb5d5..c72ea2cea24 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -143,6 +143,15 @@ if ($action == 'add_currency') { } +$TAvailableCurrency = array(); +$sql = "SELECT code_iso, label, unicode, active FROM ".MAIN_DB_PREFIX."c_currencies"; +$resql = $db->query($sql); +if ($resql) { + while ($obj = $db->fetch_object($resql)) { + $TAvailableCurrency[$obj->code_iso] = array('code'=>$obj->code_iso, 'active'=>$obj->active); + } +} + $TCurrency = array(); $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."multicurrency WHERE entity = ".((int) $conf->entity); $resql = $db->query($sql); @@ -319,10 +328,15 @@ print ''; print ''; +// Main currency print ''; print ''; +print $form->textwithpicto(' ', $langs->trans("BaseCurrency")); +if (!empty($TAvailableCurrency[$conf->currency]) && empty($TAvailableCurrency[$conf->currency]['active'])) { + print img_warning('Warning: This code has been disabled into Home - Setup - Dictionaries - Currencies'); +} +print ''; print ''; print ''; @@ -332,7 +346,11 @@ foreach ($TCurrency as &$currency) { } print ''; - print ''; + print ''; print ''; //USTRD print ''; print ''; +print ''; print ''; */ diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index 3a1a176d818..bfe6c0e3b39 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -80,7 +80,7 @@ class DolibarrApi * * @param string $field Field name * @param string $value Value to check/clean - * @param stdClass $object Object + * @param Object $object Object * @return string Value cleaned */ protected function _checkValForAPI($field, $value, $object) @@ -278,7 +278,6 @@ class DolibarrApi * @param string $dbt_keyfield Field name for socid foreign key if not fk_soc. Not used if objectid is null (optional) * @param string $dbt_select Field name for select if not rowid. Not used if objectid is null (optional) * @return bool - * @throws RestException */ protected static function _checkAccessToResource($resource, $resource_id = 0, $dbtablename = '', $feature2 = '', $dbt_keyfield = 'fk_soc', $dbt_select = 'rowid') { diff --git a/htdocs/api/class/api_access.class.php b/htdocs/api/class/api_access.class.php index 6402bdcb72e..31693bfec9a 100644 --- a/htdocs/api/class/api_access.class.php +++ b/htdocs/api/class/api_access.class.php @@ -30,11 +30,11 @@ require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/iUs require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/Resources.php'; require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/Defaults.php'; require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/RestException.php'; -use \Luracast\Restler\iAuthenticate; -use \Luracast\Restler\iUseAuthentication; -use \Luracast\Restler\Resources; -use \Luracast\Restler\Defaults; -use \Luracast\Restler\RestException; +use Luracast\Restler\iAuthenticate; +use Luracast\Restler\iUseAuthentication; +use Luracast\Restler\Resources; +use Luracast\Restler\Defaults; +use Luracast\Restler\RestException; /** * Dolibarr API access class diff --git a/htdocs/asset/admin/setup.php b/htdocs/asset/admin/setup.php index 1b107746319..4d0a553d1e6 100644 --- a/htdocs/asset/admin/setup.php +++ b/htdocs/asset/admin/setup.php @@ -544,7 +544,7 @@ if ($action == 'edit') { print ''; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancysystem.class.php'; $accountsystem = new AccountancySystem($db); - $accountsystem->fetch($conf->global->CHARTOFACCOUNTS); + $accountsystem->fetch(getDolGlobalInt('CHARTOFACCOUNTS')); $sql = 'SELECT DISTINCT pcg_type FROM ' . MAIN_DB_PREFIX . 'accounting_account'; $sql .= " WHERE fk_pcg_version = '" . $db->escape($accountsystem->ref) . "'"; $sql .= ' AND entity in ('.getEntity('accounting_account', 0).')'; // Always limit to current entity. No sharing in accountancy. @@ -645,7 +645,7 @@ if ($action == 'edit') { print getDolGlobalString($constname); } } else { - print $conf->global->{$constname}; + print getDolGlobalString($constname); } print ''; } diff --git a/htdocs/asset/class/assetaccountancycodes.class.php b/htdocs/asset/class/assetaccountancycodes.class.php index 60b545ba6ce..6c33e3af901 100644 --- a/htdocs/asset/class/assetaccountancycodes.class.php +++ b/htdocs/asset/class/assetaccountancycodes.class.php @@ -174,7 +174,7 @@ class AssetAccountancyCodes extends CommonObject public function updateAccountancyCodes($user, $asset_id = 0, $asset_model_id = 0, $notrigger = 0) { global $langs, $hookmanager; - dol_syslog(__METHOD__ . " user_id={$user->id}, asset_id=$asset_id, asset_model_id=$asset_model_id, notrigger=$notrigger"); + dol_syslog(__METHOD__ . " user_id=".$user->id.", asset_id=".$asset_id.", asset_model_id=".$asset_model_id.", notrigger=".$notrigger); $error = 0; $this->errors = array(); diff --git a/htdocs/asset/class/assetdepreciationoptions.class.php b/htdocs/asset/class/assetdepreciationoptions.class.php index f2411ea4494..8d52fa1a6a4 100644 --- a/htdocs/asset/class/assetdepreciationoptions.class.php +++ b/htdocs/asset/class/assetdepreciationoptions.class.php @@ -418,7 +418,7 @@ class AssetDepreciationOptions extends CommonObject public function updateDeprecationOptions($user, $asset_id = 0, $asset_model_id = 0, $notrigger = 0) { global $langs, $hookmanager; - dol_syslog(__METHOD__ . " user_id={$user->id}, asset_id=$asset_id, asset_model_id=$asset_model_id, notrigger=$notrigger"); + dol_syslog(__METHOD__ . " user_id=".$user->id.", asset_id=".$asset_id.", asset_model_id=".$asset_model_id.", notrigger=".$notrigger); $error = 0; $this->errors = array(); diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index 8f8c551d66b..5ff5f6d0382 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -299,7 +299,7 @@ $sql .= !empty($hookmanager->resPrint) ? (" HAVING 1=1 " . $hookmanager->resPrin // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/asset/model/list.php b/htdocs/asset/model/list.php index 8ccf50a8ab1..d87a9ea55c8 100644 --- a/htdocs/asset/model/list.php +++ b/htdocs/asset/model/list.php @@ -301,7 +301,7 @@ $sql .= !empty($hookmanager->resPrint) ? (" HAVING 1=1 " . $hookmanager->resPrin // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* This old and fast method to get and count full list returns all record so use a high amount of memory. $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); diff --git a/htdocs/asterisk/wrapper.php b/htdocs/asterisk/wrapper.php index 2f5096f6436..433c22979da 100644 --- a/htdocs/asterisk/wrapper.php +++ b/htdocs/asterisk/wrapper.php @@ -188,7 +188,7 @@ if (!empty($number)) { } else { $txt = "Call Asterisk dialer for caller: ".$caller.", called: ".$called." clicktodiallogin: ".$login; dol_syslog($txt); - print ''."\n"; + print ''."\n"; print ''; fputs($oSocket, "Action: login\r\n"); fputs($oSocket, "Events: off\r\n"); diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index e27cd0a2e1c..10fc6c3030d 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -170,6 +170,13 @@ if (empty($reshook)) { $disable_stock_change = GETPOST('disable_stock_change', 'int'); $efficiency = price2num(GETPOST('efficiency', 'alpha')); $fk_unit = GETPOST('fk_unit', 'alphanohtml'); + + if (!empty($idprod) && $conf->workstation->enabled) { + $product = new Product($db); + $res = $product->fetch($idprod); + if ($res > 0 && $product->type == Product::TYPE_SERVICE) $fk_default_workstation = $product->fk_default_workstation; + } + if ($qty == '') { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); $error++; @@ -206,7 +213,7 @@ if (empty($reshook)) { } } - $result = $object->addLine($idprod, $qty, $qty_frozen, $disable_stock_change, $efficiency, -1, $bom_child_id, null, $fk_unit, $array_options); + $result = $object->addLine($idprod, $qty, $qty_frozen, $disable_stock_change, $efficiency, -1, $bom_child_id, null, $fk_unit, $array_options, $fk_default_workstation); if ($result <= 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -566,7 +573,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (!empty($object->table_element_line)) { // Products - $res = $object->fetchLinesbytypeproduct(0); + $res = $object->fetchLinesbytypeproduct(0); // Load all lines products into ->lines $object->calculateCosts(); print ($res == 0 && $object->status >= $object::STATUS_VALIDATED) ? '' : load_fiche_titre($langs->trans('BOMProductsList'), '', 'product'); @@ -615,7 +622,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Services $filtertype = 1; - $res = $object->fetchLinesbytypeproduct(1); + $res = $object->fetchLinesbytypeproduct(1); // Load all lines services into ->lines $object->calculateCosts(); print ($res == 0 && $object->status >= $object::STATUS_VALIDATED) ? '' : load_fiche_titre($langs->trans('BOMServicesList'), '', 'service'); diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 0819c4f1cd1..e8b648d94cd 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -385,7 +385,7 @@ $sql=preg_replace('/,\s*$/','', $sql); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); @@ -688,7 +688,7 @@ while ($i < $imaxinloop) { print '
'; } // Output kanban - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/bom/class/api_boms.class.php b/htdocs/bom/class/api_boms.class.php index 439d1c23031..67b0baac323 100644 --- a/htdocs/bom/class/api_boms.class.php +++ b/htdocs/bom/class/api_boms.class.php @@ -121,7 +121,7 @@ class Boms extends DolibarrApi if ($restrictonsocid && (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) { $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) } - $sql .= " FROM ".MAIN_DB_PREFIX.$tmpobject->table_element." as t"; + $sql .= " FROM ".MAIN_DB_PREFIX.$tmpobject->table_element." AS t LEFT JOIN ".MAIN_DB_PREFIX.$tmpobject->table_element."_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields if ($restrictonsocid && (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index f3975e58125..b54eb38ebd4 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -227,7 +227,6 @@ class BOM extends CommonObject public $unit_cost = 0; - /** * Constructor * @@ -569,10 +568,11 @@ class BOM extends CommonObject * @param int $fk_bom_child Id of BOM Child * @param string $import_key Import Key * @param string $fk_unit Unit - * @param array $array_options extrafields array + * @param array $array_options extrafields array + * @param int $fk_default_workstation Default workstation * @return int <0 if KO, Id of created object if OK */ - public function addLine($fk_product, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $fk_bom_child = null, $import_key = null, $fk_unit = '', $array_options = 0) + public function addLine($fk_product, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $fk_bom_child = null, $import_key = null, $fk_unit = '', $array_options = 0, $fk_default_workstation = null) { global $mysoc, $conf, $langs, $user; @@ -627,33 +627,34 @@ class BOM extends CommonObject } // Insert line - $this->line = new BOMLine($this->db); + $line = new BOMLine($this->db); - $this->line->context = $this->context; + $line->context = $this->context; - $this->line->fk_bom = $this->id; - $this->line->fk_product = $fk_product; - $this->line->qty = $qty; - $this->line->qty_frozen = $qty_frozen; - $this->line->disable_stock_change = $disable_stock_change; - $this->line->efficiency = $efficiency; - $this->line->fk_bom_child = $fk_bom_child; - $this->line->import_key = $import_key; - $this->line->position = $rankToUse; - $this->line->fk_unit = $fk_unit; + $line->fk_bom = $this->id; + $line->fk_product = $fk_product; + $line->qty = $qty; + $line->qty_frozen = $qty_frozen; + $line->disable_stock_change = $disable_stock_change; + $line->efficiency = $efficiency; + $line->fk_bom_child = $fk_bom_child; + $line->import_key = $import_key; + $line->position = $rankToUse; + $line->fk_unit = $fk_unit; + $line->fk_default_workstation = $fk_default_workstation; if (is_array($array_options) && count($array_options) > 0) { - $this->line->array_options = $array_options; + $line->array_options = $array_options; } - $result = $this->line->create($user); + $result = $line->create($user); if ($result > 0) { $this->calculateCosts(); $this->db->commit(); return $result; } else { - $this->error = $this->line->error; + $this->setErrorsFromObject($line); dol_syslog(get_class($this)."::addLine error=".$this->error, LOG_ERR); $this->db->rollback(); return -2; @@ -722,8 +723,7 @@ class BOM extends CommonObject $staticLine = clone $line; $line->oldcopy = $staticLine; - $this->line = $line; - $this->line->context = $this->context; + $line->context = $this->context; // Rank to use $rankToUse = (int) $position; @@ -741,32 +741,32 @@ class BOM extends CommonObject } - $this->line->fk_bom = $this->id; - $this->line->qty = $qty; - $this->line->qty_frozen = $qty_frozen; - $this->line->disable_stock_change = $disable_stock_change; - $this->line->efficiency = $efficiency; - $this->line->import_key = $import_key; - $this->line->position = $rankToUse; + $line->fk_bom = $this->id; + $line->qty = $qty; + $line->qty_frozen = $qty_frozen; + $line->disable_stock_change = $disable_stock_change; + $line->efficiency = $efficiency; + $line->import_key = $import_key; + $line->position = $rankToUse; if (!empty($fk_unit)) { - $this->line->fk_unit = $fk_unit; + $line->fk_unit = $fk_unit; } if (is_array($array_options) && count($array_options) > 0) { // We replace values in this->line->array_options only for entries defined into $array_options foreach ($array_options as $key => $value) { - $this->line->array_options[$key] = $array_options[$key]; + $line->array_options[$key] = $array_options[$key]; } } - $result = $this->line->update($user); + $result = $line->update($user); if ($result > 0) { $this->calculateCosts(); $this->db->commit(); return $result; } else { - $this->error = $this->line->error; + $this->setErrorsFromObject($line); dol_syslog(get_class($this)."::addLine error=".$this->error, LOG_ERR); $this->db->rollback(); return -2; @@ -801,10 +801,9 @@ class BOM extends CommonObject $staticLine = clone $line; $line->oldcopy = $staticLine; - $this->line = $line; - $this->line->context = $this->context; + $line->context = $this->context; - $result = $this->line->delete($user, $notrigger); + $result = $line->delete($user, $notrigger); //Positions (rank) reordering foreach ($this->lines as $bl) { @@ -819,7 +818,7 @@ class BOM extends CommonObject $this->db->commit(); return $result; } else { - $this->error = $this->line->error; + $this->setErrorsFromObject($line); dol_syslog(get_class($this)."::addLine error=".$this->error, LOG_ERR); $this->db->rollback(); return -2; @@ -1423,21 +1422,32 @@ class BOM extends CommonObject } } } else { - //Convert qty to hour - $unit = measuringUnitString($line->fk_unit, '', '', 1); - $qty = convertDurationtoHour($line->qty, $unit); + // Convert qty of line into hours + $unitforline = measuringUnitString($line->fk_unit, '', '', 1); + $qtyhourforline = convertDurationtoHour($line->qty, $unitforline); if (isModEnabled('workstation') && !empty($tmpproduct->fk_default_workstation)) { $workstation = new Workstation($this->db); $res = $workstation->fetch($tmpproduct->fk_default_workstation); - if ($res > 0) $line->total_cost = price2num($qty * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT'); + if ($res > 0) $line->total_cost = price2num($qtyhourforline * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT'); else { $this->error = $workstation->error; return -3; } } else { - $line->total_cost = price2num($qty * $tmpproduct->cost_price, 'MT'); + $defaultdurationofservice = $tmpproduct->duration; + $reg = array(); + $qtyhourservice = 0; + if (preg_match('/^(\d+)([a-z]+)$/', $defaultdurationofservice, $reg)) { + $qtyhourservice = convertDurationtoHour($reg[1], $reg[2]); + } + + if ($qtyhourservice) { + $line->total_cost = price2num($qtyhourforline / $qtyhourservice * $tmpproduct->cost_price, 'MT'); + } else { + $line->total_cost = price2num($line->qty * $tmpproduct->cost_price, 'MT'); + } } $this->total_cost += $line->total_cost; @@ -1670,6 +1680,7 @@ class BOMLine extends CommonObjectLine 'fk_unit' => array('type'=>'integer', 'label'=>'Unit', 'enabled'=>1, 'visible'=>1, 'position'=>120, 'notnull'=>-1,), 'position' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'default'=>0, 'position'=>200, 'notnull'=>1,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,), + 'fk_default_workstation' =>array('type'=>'integer', 'label'=>'DefaultWorkstation', 'enabled'=>1, 'visible'=>1, 'notnull'=>0, 'position'=>1050) ); /** diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index d000118e1b9..98e79fa0416 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -34,6 +34,8 @@ * $type, $text, $description, $line */ +/** var ObjectLine $line */ + require_once DOL_DOCUMENT_ROOT.'/workstation/class/workstation.class.php'; // Protection to avoid direct call of template @@ -78,10 +80,14 @@ $objectline = new BOMLine($object->db); $coldisplay = 0; print "\n"; print '
'; + +// Line nb if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { print ''; $coldisplay++; } + +// Product print ''; +// Qty print ''; } else { - //Unité + // Unit print ''; } } + +// Cost $total_cost = 0; $tmpbom->calculateCosts(); print ''; $this->total_cost += $line->total_cost; } elseif ($sub_bom_product->cost_price > 0) { - print ''; + print ''; $total_cost+= $sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty; } elseif ($sub_bom_product->pmp > 0) { // PMP if cost price isn't defined - print ''; + print ''; $total_cost.= $sub_bom_product->pmp * $sub_bom_line->qty * $line->qty; } else { // Minimum purchase price if cost price and PMP aren't defined $sql_supplier_price = 'SELECT MIN(price) AS min_price, quantity AS qty FROM '.MAIN_DB_PREFIX.'product_fournisseur_price'; diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index 732ddf20a93..1be9db2df49 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -311,7 +311,7 @@ $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPri // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* 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); @@ -641,7 +641,7 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/bookcal/booking_list.php b/htdocs/bookcal/booking_list.php index e416dd498ed..4bd9dbe116f 100644 --- a/htdocs/bookcal/booking_list.php +++ b/htdocs/bookcal/booking_list.php @@ -311,7 +311,7 @@ $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPri // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* 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); @@ -641,7 +641,7 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index 2bd7109c80b..a299da1c3ee 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -172,7 +172,7 @@ if (!$user->admin) { // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); @@ -350,7 +350,7 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/categories/class/api_categories.class.php b/htdocs/categories/class/api_categories.class.php index f5cda44ffb9..5b82bcd6d2c 100644 --- a/htdocs/categories/class/api_categories.class.php +++ b/htdocs/categories/class/api_categories.class.php @@ -141,7 +141,7 @@ class Categories extends DolibarrApi } $sql = "SELECT t.rowid"; - $sql .= " FROM ".MAIN_DB_PREFIX."categorie as t"; + $sql .= " FROM ".MAIN_DB_PREFIX."categorie AS t LEFT JOIN ".MAIN_DB_PREFIX."categories_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields $sql .= ' WHERE t.entity IN ('.getEntity('category').')'; if (!empty($type)) { $sql .= ' AND t.type='.array_search($type, Categories::$TYPES); diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 557e05fc53d..0a9ea52acd1 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -983,7 +983,7 @@ class Categorie extends CommonObject $offset = 0; $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $this->db->query($sql); $nbtotalofrecords = $this->db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 5999865232a..99bb64843d8 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -590,7 +590,8 @@ if ($type == Categorie::TYPE_CUSTOMER) { print '
'; + if ($filterfound) { + $searchpicto = $form->showFilterAndCheckAddButtons(0); + print $searchpicto; + } + print ''; print $form->select_country($search_country_id, 'search_country_id', '', 28, 'minwidth100 maxwidth150 maxwidthonsmartphone'); print ''; print ''; print ''; @@ -1669,20 +1699,32 @@ if ($id > 0) { print ''; - if ($filterfound) { - $searchpicto = $form->showFilterAndCheckAddButtons(0); - print $searchpicto; + + // Action button + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + if ($filterfound) { + $searchpicto = $form->showFilterAndCheckAddButtons(0); + print $searchpicto; + } + print '
'; + // Modify link + if ($canbemodified) { + print ''.img_edit().''; + } + // Delete link + if ($iserasable) { + if ($user->admin) { + print ''.img_delete().''; + } + } + print ''.img_edit().' '; - if ($user->admin) { - print ''.img_delete().''; + // Action button + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + // Modify link + if ($canbemodified) { + print ''.img_edit().''; + } + // Delete link + if ($iserasable) { + if ($user->admin) { + print ''.img_delete().''; + } } - //else print ''.img_delete().''; // Some dictionary can be edited by other profile than admin print ' 
'.$conf->currency; print ' ('.$langs->getCurrencySymbol($conf->currency).')'; -print $form->textwithpicto(' ', $langs->trans("BaseCurrency")).'1
'.$currency->code.' - '.$currency->name.''.$currency->code.' - '.$currency->name; + if (!empty($TAvailableCurrency[$currency->code]) && empty($TAvailableCurrency[$currency->code]['active'])) { + print img_warning('Warning: The code '.$currency->code.' has been disabled into Home - Setup - Dictionaries - Currencies'); + } + print ''; print '
'; print ''; diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index f86f6d5c27f..7893b271d06 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -188,7 +188,7 @@ print '
'.$langs->trans("USTRD").''; -print '
'.($i + 1).''; print '
'; $coldisplay++; @@ -113,6 +119,7 @@ if (!empty($extrafields)) { print '
'; $coldisplay++; echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price @@ -142,7 +149,7 @@ if ($filtertype != 1) { echo $line->efficiency; print ''; $coldisplay++; @@ -158,14 +165,16 @@ if ($filtertype != 1) { // Work station if (isModEnabled('workstation')) { $workstation = new Workstation($object->db); - $res = $workstation->fetch($tmpproduct->fk_default_workstation); + $res = $workstation->fetch($line->fk_default_workstation); - print ''; + print ''; $coldisplay++; if ($res > 0) echo $workstation->getNomUrl(); print ''; @@ -312,10 +321,12 @@ if ($resql) { print ''.price(price2num($sub_bom_line->total_cost, 'MT')).''.price(price2num($sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty, 'MT')).''; + print ''.price(price2num($sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty, 'MT')).''.price(price2num($sub_bom_product->pmp * $sub_bom_line->qty * $line->qty, 'MT')).''; + print ''.price(price2num($sub_bom_product->pmp * $sub_bom_line->qty * $line->qty, 'MT')).'
'; print ''; print ''; print '
'; print $langs->trans("AddCustomerIntoCategory").'  '; - print $form->select_company('', 'elemid', 's.client IN (1,3)'); + $filter = '(s.client:IN:1,3)'; + print $form->select_company('', 'elemid', $filter); print '
'; @@ -670,7 +671,8 @@ if ($type == Categorie::TYPE_SUPPLIER) { print ''; print ''; print ''; print '
'; print $langs->trans("AddSupplierIntoCategory").'  '; - print $form->select_company('', 'elemid', 's.fournisseur = 1'); + $filter ='(s.fournisseur:=:1)'; + print $form->select_company('', 'elemid', $filter); print '
'; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 2b35cc38c4c..16491ce4f88 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -2101,8 +2101,6 @@ class ActionComm extends CommonObject dol_syslog(get_class($this)."::build_exportfile select events", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { - // Note: Output of sql request is encoded in $conf->file->character_set_client - // This assignment in condition is not a bug. It allows walking the results. $diff = 0; while ($obj = $this->db->fetch_object($resql)) { $qualified = true; diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index 0067df7e5cf..4f7a944070b 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -134,7 +134,7 @@ class AgendaEvents extends DolibarrApi $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) } } - $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as t"; + $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm AS t LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_extrafields AS ef ON (ef.fk_object = t.id)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields if (isModEnabled("societe")) { if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 12303f87ed8..342d0ba1a25 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -570,7 +570,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 2cc3f6a7a9d..987551422e4 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -101,7 +101,7 @@ $sql .= " GROUP BY year, month, df"; $sql .= " ORDER BY year DESC, month DESC, df DESC"; $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('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 diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 7aa41457cae..f0fb4a9bf7d 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -593,7 +593,7 @@ if ($object->fetch($id) >= 0) { // Count total nb of records $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('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 diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index 3fea5458a2d..fe87b1fee65 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -208,7 +208,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 3a3fdfe50a0..e31b43f5a43 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1810,7 +1810,8 @@ if ($action == 'create') { //$warehouse_id = $soc->warehouse_id; } else { print '
'; - print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company('', 'socid', '((s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1)', 'SelectThirdParty', 1, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx'); + $filter = '((s.client:IN:1,2,3) AND (s.status:=:1))'; + print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx'); // reload page to retrieve customer informations if (empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED)) { print ''; @@ -5447,7 +5452,7 @@ function load_fiche_titre($titre, $morehtmlright = '', $picto = 'generic', $pict * Print a title with navigation controls for pagination * * @param string $titre Title to show (required) - * @param int $page Numero of page to show in navigation links (required) + * @param int|null $page Numero of page to show in navigation links (required) * @param string $file Url of page (required) * @param string $options More parameters for links ('' by default, does not include sortfield neither sortorder). Value must be 'urlencoded' before calling function. * @param string $sortfield Field to sort on ('' by default) @@ -5474,6 +5479,8 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', $savtotalnboflines = $totalnboflines; $totalnboflines = abs((int) $totalnboflines); + $page = (int) $page; + if ($picto == 'setup') { $picto = 'title_setup.png'; } @@ -5524,7 +5531,7 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', } // Show navigation bar $pagelist = ''; - if ($savlimit != 0 && ((int) $page > 0 || $num > $limit)) { + if ($savlimit != 0 && ($page > 0 || $num > $limit)) { if ($totalnboflines) { // If we know total nb of lines // Define nb of extra page links before and after selected page + ... + first or last $maxnbofpage = (empty($conf->dol_optimize_smallscreen) ? 4 : 0); @@ -5585,7 +5592,7 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', } if ($savlimit || $morehtmlright || $morehtmlrightbeforearrow) { - print_fleche_navigation((int) $page, $file, $options, $nextpage, $pagelist, $morehtmlright, $savlimit, $totalnboflines, $hideselectlimit, $morehtmlrightbeforearrow, $hidenavigation); // output the div and ul for previous/last completed with page numbers into $pagelist + print_fleche_navigation($page, $file, $options, $nextpage, $pagelist, $morehtmlright, $savlimit, $totalnboflines, $hideselectlimit, $morehtmlrightbeforearrow, $hidenavigation); // output the div and ul for previous/last completed with page numbers into $pagelist } // js to autoselect page field on focus @@ -11284,6 +11291,9 @@ function getElementProperties($element_type) $classpath = 'comm/action/class'; $subelement = 'Actioncomm'; $module = 'agenda'; + } elseif ($element_type == 'cronjob') { + $classpath = 'cron/class'; + $module = 'cron'; } elseif ($element_type == 'adherent_type') { $classpath = 'adherents/class'; $classfile = 'adherent_type'; @@ -11358,6 +11368,9 @@ function getElementProperties($element_type) $classpath = 'adherents/class'; $module = 'adherent'; $subelement = 'adherent'; + } elseif ($element_type == 'usergroup') { + $classpath = 'user/class'; + $module = 'user'; } elseif ($element_type == 'mo') { $classpath = 'mrp/class'; $classfile = 'mo'; @@ -11775,11 +11788,14 @@ function jsonOrUnserialize($stringtodecode) /** * forgeSQLFromUniversalSearchCriteria * - * @param string $filter String with universal search string. Must be (aaa:bbb:...) with aaa is a field name (with alias or not) and bbb is one of this operator '=', '<', '>', '<=', '>=', '!=', 'in', 'notin', 'like', 'notlike', 'is', 'isnot'. + * @param string $filter String with universal search string. Must be (aaa:bbb:...) with + * aaa is a field name (with alias or not) and + * bbb is one of this operator '=', '<', '>', '<=', '>=', '!=', 'in', 'notin', 'like', 'notlike', 'is', 'isnot'. * @param string $error Error message + * @param int $noand 0=Default, 1=Do not add the AND before the condition string. * @return string Return forged SQL string */ -function forgeSQLFromUniversalSearchCriteria($filter, &$error = '') +function forgeSQLFromUniversalSearchCriteria($filter, &$error = '', $noand = 0) { $regexstring = '\(([a-zA-Z0-9_\.]+:[<>!=insotlke]+:[^\(\)]+)\)'; // Must be (aaa:bbb:...) with aaa is a field name (with alias or not) and bbb is one of this operator '=', '<', '>', '<=', '>=', '!=', 'in', 'notin', 'like', 'notlike', 'is', 'isnot' @@ -11796,7 +11812,7 @@ function forgeSQLFromUniversalSearchCriteria($filter, &$error = '') return 'Filter syntax error'; // Bad syntax of the search string, we force a SQL not found } - return " AND (".preg_replace_callback('/'.$regexstring.'/i', 'dolForgeCriteriaCallback', $filter).")"; + return ($noand ? "" : " AND ")."(".preg_replace_callback('/'.$regexstring.'/i', 'dolForgeCriteriaCallback', $filter).")"; } /** diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index ce639624f1a..3ed3d03c527 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -2668,6 +2668,8 @@ function getModuleDirForApiClass($moduleobject) $moduledirforclass = 'fichinter'; } elseif ($moduleobject == 'mos') { $moduledirforclass = 'mrp'; + } elseif ($moduleobject == 'accounting') { + $moduledirforclass = 'accountancy'; } elseif (in_array($moduleobject, array('products', 'expensereports', 'users', 'tickets', 'boms', 'receptions'))) { $moduledirforclass = preg_replace('/s$/', '', $moduleobject); } diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php index 71e1d765de7..67b9f7e15b2 100644 --- a/htdocs/core/lib/images.lib.php +++ b/htdocs/core/lib/images.lib.php @@ -621,7 +621,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', } // Before PHP8, img was a resource, With PHP8, it is a GdImage - if (!is_resource($img) && !($img instanceof \GdImage)) { + if (!is_resource($img) && !($img instanceof GdImage)) { dol_syslog('Failed to detect type of image. We found infoImg[2]='.$infoImg[2], LOG_WARNING); return 0; } diff --git a/htdocs/core/lib/parsemd.lib.php b/htdocs/core/lib/parsemd.lib.php index 89e0936611f..284ea81e6d3 100644 --- a/htdocs/core/lib/parsemd.lib.php +++ b/htdocs/core/lib/parsemd.lib.php @@ -31,6 +31,14 @@ */ function dolMd2Html($content, $parser = 'parsedown', $replaceimagepath = null) { + // Replace a HTML string with a Markdown syntax + $content = preg_replace('/([^<]+)<\/a>/', '[\2](\1)', $content); + //$content = preg_replace('/([^<]+)<\/a>/', '[\3](\1){:target="\2"}', $content); + $content = preg_replace('/([^<]+)<\/a>/', '[\3](\1)', $content); + + // Replace HTML coments + $content = preg_replace('//ms', '', $content); // We remove HTML comment that are not MD comment because they will be escaped and output when setSafeMode is set to true. + if (is_array($replaceimagepath)) { foreach ($replaceimagepath as $key => $val) { $keytoreplace = ']('.$key; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 3b893e39256..bd735f7d033 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -241,7 +241,7 @@ function pdf_getEncryption($pathoffile) $content = file_get_contents($pathoffile); //ob_start(); - @($parser = new \TCPDF_PARSER(ltrim($content))); + @($parser = new TCPDF_PARSER(ltrim($content))); list($xref, $data) = $parser->getParsedData(); unset($parser); //ob_end_clean(); diff --git a/htdocs/core/lib/reception.lib.php b/htdocs/core/lib/reception.lib.php index e697908e8cb..16e036991f9 100644 --- a/htdocs/core/lib/reception.lib.php +++ b/htdocs/core/lib/reception.lib.php @@ -46,6 +46,13 @@ function reception_prepare_head(Reception $object) $head[$h][2] = 'reception'; $h++; + if ($object->statut == Reception::STATUS_DRAFT) { + $head[$h][0] = DOL_URL_ROOT."/reception/dispatch.php?id=".$object->id; + $head[$h][1] = $langs->trans("DispatchCard"); + $head[$h][2] = 'dispatch'; + $h++; + } + if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) { $objectsrc = $object; if ($object->origin == 'supplier_order' && $object->origin_id > 0) { diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 55a516377b2..f75bb21eae9 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -989,6 +989,8 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $checkonentitydone = 1; } + //var_dump($checkonentitydone); + if (!$checkonentitydone && !in_array($feature, $nocheck) && $objectid > 0) { // By default (case of $checkdefault), we check on object entity + link to third party on field $dbt_keyfield // If external user: Check permission for external users if ($user->socid > 0) { @@ -1000,7 +1002,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $sql .= " WHERE dbt.rowid IN (".$db->sanitize($objectid, 1).")"; $sql .= " AND dbt.".$dbt_keyfield." = ".((int) $user->socid); } elseif (isModEnabled("societe") && empty($user->rights->societe->client->voir)) { - // If internal user: Check permission for internal users that are restricted on their objects + // If internal user without permission to see all thirdparties: Check permission for internal users that are restricted on their objects if ($feature != 'ticket') { if (empty($dbt_keyfield)) { dol_print_error('', 'Param dbt_keyfield is required but not defined'); @@ -1022,7 +1024,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $sql .= " AND (sc.fk_user = ".((int) $user->id)." OR sc.fk_user IS NULL)"; } } elseif (isModEnabled('multicompany')) { - // If multicompany and internal users with all permissions, check user is in correct entity + // If multicompany, and user is an internal user with all permissions, check that object is in correct entity $sql = "SELECT COUNT(dbt.".$dbt_select.") as nb"; $sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; $sql .= " WHERE dbt.".$dbt_select." IN (".$db->sanitize($objectid, 1).")"; diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 64747c1bbf6..8058deb387b 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -409,10 +409,10 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if (is_dir($dirtheme."/".$subdir) && substr($subdir, 0, 1) <> '.' && substr($subdir, 0, 3) <> 'CVS' && !preg_match('/common|phones/i', $subdir)) { // Disable not stable themes (dir ends with _exp or _dev) - if ($conf->global->MAIN_FEATURES_LEVEL < 2 && preg_match('/_dev$/i', $subdir)) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2 && preg_match('/_dev$/i', $subdir)) { continue; } - if ($conf->global->MAIN_FEATURES_LEVEL < 1 && preg_match('/_exp$/i', $subdir)) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1 && preg_match('/_exp$/i', $subdir)) { continue; } diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 25c099a0fee..87a964c9419 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -581,10 +581,10 @@ function showWebsiteTemplates(Website $website) $subdirwithoutzip = preg_replace('/\.zip$/i', '', $subdir); // Disable not stable themes (dir ends with _exp or _dev) - if ($conf->global->MAIN_FEATURES_LEVEL < 2 && preg_match('/_dev$/i', $subdir)) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2 && preg_match('/_dev$/i', $subdir)) { continue; } - if ($conf->global->MAIN_FEATURES_LEVEL < 1 && preg_match('/_exp$/i', $subdir)) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1 && preg_match('/_exp$/i', $subdir)) { continue; } diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 5c469b85790..1b65074a82e 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -13,17 +13,17 @@ delete from llx_menu where menu_handler=__HANDLER__ and entity=__ENTITY__; -- Top-Menu -- old: (module, enabled, rowid, ...) insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 1__+MAX_llx_menu__, '', '1', __HANDLER__, 'top', 'home', '', 0, '/index.php?mainmenu=home&leftmenu=', 'Home', -1, '', '', '', 2, 10, __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 ( 2__+MAX_llx_menu__, 'societe|fournisseur|supplier_order|supplier_invoice', '(isModEnabled("societe") && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) || isModeEnabled('supplier_order') || isModEnabled('supplier_invoice')))', __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', 'isModEnabled("product") || isModEnabled("service")', __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->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 || isModEnabled("banque")', __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 || ($user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->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', 'isModEnabled("banque") || isModEnabled("prelevement")', __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__); -insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 9__+MAX_llx_menu__, 'comptabilite|accounting|asset', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->asset->enabled', __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=accountancy', 'MenuAccountancy', -1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->mouvements->lire || $user->rights->asset->read', '', 2, 54, __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 ( 2__+MAX_llx_menu__, 'societe|fournisseur|supplier_order|supplier_invoice', '(isModEnabled("societe") && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")))', __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->hasRight("societe","lire") || $user->hasRight("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', 'isModEnabled("product") || isModEnabled("service")', __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'ProductsPipeServices', -1, 'products', '$user->rights->produit->lire||$user->hasRight("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', 'isModEnabled("bom") || isModEnabled("mrp")', __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&leftmenu=', 'MRP', -1, 'mrp', '$user->hasRight("bom","read")||$user->hasRight("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', 'isModEnabled("project")', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->hasRight("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', 'isModEnabled("propal") || isModEnabled("commande") || isModEnabled("supplier_order") || isModEnabled("contrat") || isModEnabled("ficheinter")', __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->hasRight("societe","lire") || $user->hasRight("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', 'isModEnabled("comptabilite") || isModEnabled("accounting") || isModEnabled("facture") || isModEnabled("don") || isModEnabled("tax") || isModEnabled("salaries") || isModEnabled("supplier_invoice") || isModEnabled("loan") || isModEnabled("banque")', __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->hasRight("banque","lire") || $user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->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', 'isModEnabled("banque") || isModEnabled("prelevement")', __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->hasRight("banque","lire") || $user->hasRight("prelevement","bons","lire")', '', 0, 52, __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 ( 9__+MAX_llx_menu__, 'comptabilite|accounting|asset', 'isModEnabled("comptabilite") || isModEnabled("accounting") || isModEnabled("asset")', __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=accountancy', 'MenuAccountancy', -1, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","mouvements","lire") || $user->hasRight("asset","read")', '', 2, 54, __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 ( 8__+MAX_llx_menu__, '', '', __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&leftmenu=', 'Tools', -1, 'other', '', '', 2, 90, __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 ( 13__+MAX_llx_menu__, 'adherent', '$conf->adherent->enabled', __HANDLER__, 'top', 'members', '', 0, '/adherents/index.php?mainmenu=members&leftmenu=', 'Members', -1, 'members', '$user->rights->adherent->lire', '', 2, 19, __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 ( 15__+MAX_llx_menu__, 'hrm|holiday|deplacement|expensereport', '$conf->hrm->enabled || $conf->holiday->enabled || $conf->deplacement->enabled || $conf->expensereport->enabled', __HANDLER__, 'top', 'hrm', '', 0, '/hrm/index.php?mainmenu=hrm&leftmenu=', 'HRM', -1, 'holiday', '$user->rights->user->user->lire || $user->rights->holiday->read || $user->rights->deplacement->lire || $user->rights->expensereport->lire', '', 0, 80, __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 ( 13__+MAX_llx_menu__, 'adherent', 'isModEnabled("adherent")', __HANDLER__, 'top', 'members', '', 0, '/adherents/index.php?mainmenu=members&leftmenu=', 'Members', -1, 'members', '$user->hasRight("adherent","lire")', '', 2, 19, __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 ( 15__+MAX_llx_menu__, 'hrm|holiday|deplacement|expensereport', 'isModEnabled("hrm") || isModEnabled("holiday") || isModEnabled("deplacement") || isModEnabled("expensereport")', __HANDLER__, 'top', 'hrm', '', 0, '/hrm/index.php?mainmenu=hrm&leftmenu=', 'HRM', -1, 'holiday', '$user->hasRight("user","user","lire") || $user->hasRight("holiday","read") || $user->hasRight("deplacement","lire") || $user->hasRight("expensereport","lire")', '', 0, 80, __ENTITY__); -- Sub-Menus @@ -74,429 +74,432 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left -- Home - Menu users and groups insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 400__+MAX_llx_menu__, 'home', 'users', 1__+MAX_llx_menu__, '/user/home.php?mainmenu=home&leftmenu=users', 'MenuUsersAndGroups', 0, 'users', '', '', 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 ('', '$leftmenu=="users"', __HANDLER__, 'left', 401__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/list.php?mainmenu=home&leftmenu=users', 'Users', 1, 'users', '$user->rights->user->user->lire || $user->admin', '', 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 ('', '$leftmenu=="users"', __HANDLER__, 'left', 402__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/user/card.php?mainmenu=home&leftmenu=users&action=create', 'NewUser', 2, 'users', '($user->rights->user->user->creer || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)', '', 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 ('', '$leftmenu=="users"', __HANDLER__, 'left', 401__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/list.php?mainmenu=home&leftmenu=users', 'Users', 1, 'users', '$user->hasRight("user","user","lire") || $user->admin', '', 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 ('', '$leftmenu=="users"', __HANDLER__, 'left', 402__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/user/card.php?mainmenu=home&leftmenu=users&action=create', 'NewUser', 2, 'users', '($user->hasRight("user","user","creer") || $user->admin) && !(isModEnabled("multicompany") && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)', '', 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 ('', '$leftmenu=="users"', __HANDLER__, 'left', 404__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/user/hierarchy.php?mainmenu=home&leftmenu=users', 'HierarchicView', 1, 'users', '$user->rights->user->user->lire || $user->admin', '', 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 ('', '$leftmenu=="users"', __HANDLER__, 'left', 405__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/categories/index.php?mainmenu=home&leftmenu=users&type=7', 'UsersCategoriesShort', 1, 'categories', '$user->rights->user->user->lire || $user->admin', '', 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 ('', '$leftmenu=="users"', __HANDLER__, 'left', 404__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/user/hierarchy.php?mainmenu=home&leftmenu=users', 'HierarchicView', 1, 'users', '$user->hasRight("user","user","lire") || $user->admin', '', 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 ('', '$leftmenu=="users"', __HANDLER__, 'left', 405__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/categories/index.php?mainmenu=home&leftmenu=users&type=7', 'UsersCategoriesShort', 1, 'categories', '$user->hasRight("user","user","lire") || $user->admin', '', 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 ('', '$leftmenu=="users"', __HANDLER__, 'left', 407__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/group/list.php?mainmenu=home&leftmenu=users', 'Groups', 1, 'users', '(($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)', '', 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 ('', '$leftmenu=="users"', __HANDLER__, 'left', 408__+MAX_llx_menu__, 'home', '', 407__+MAX_llx_menu__, '/user/group/card.php?mainmenu=home&leftmenu=users&action=create', 'NewGroup', 2, 'users', '(($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)', '', 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 ('', '$leftmenu=="users"', __HANDLER__, 'left', 407__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/group/list.php?mainmenu=home&leftmenu=users', 'Groups', 1, 'users', '(($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->hasRight("user","user","lire")) || $user->admin) && !(isModEnabled("multicompany") && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)', '', 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 ('', '$leftmenu=="users"', __HANDLER__, 'left', 408__+MAX_llx_menu__, 'home', '', 407__+MAX_llx_menu__, '/user/group/card.php?mainmenu=home&leftmenu=users&action=create', 'NewGroup', 2, 'users', '(($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->write:$user->hasRight("user","user","creer")) || $user->admin) && !(isModEnabled("multicompany") && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)', '', 2, 0, __ENTITY__); -- Third parties -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 500__+MAX_llx_menu__, 'companies', 'thirdparties', 2__+MAX_llx_menu__, '/societe/index.php?mainmenu=companies&leftmenu=thirdparties', 'ThirdParty', 0, 'companies', '$user->rights->societe->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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 501__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&action=create', 'MenuNewThirdParty', 1, 'companies', '$user->rights->societe->creer', '', 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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 502__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&leftmenu=thirdparties', 'List', 1, 'companies', '$user->rights->societe->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 ('', 'isModEnabled("societe") && (isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))', __HANDLER__, 'left', 503__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&type=f&leftmenu=suppliers', 'ListSuppliersShort', 1, 'suppliers', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 2, 5, __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 ('', 'isModEnabled("societe") && (isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))', __HANDLER__, 'left', 504__+MAX_llx_menu__, 'companies', '', 503__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&leftmenu=supplier&action=create&type=f', 'NewSupplier', 2, 'suppliers', '$user->rights->societe->creer', '', 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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 506__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&type=p&leftmenu=prospects', 'ListProspectsShort', 1, 'companies', '$user->rights->societe->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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 507__+MAX_llx_menu__, 'companies', '', 506__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&leftmenu=prospects&action=create&type=p', 'MenuNewProspect', 2, 'companies', '$user->rights->societe->creer', '', 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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 509__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&type=c&leftmenu=customers', 'ListCustomersShort', 1, 'companies', '$user->rights->societe->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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 510__+MAX_llx_menu__, 'companies', '', 509__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&leftmenu=customers&action=create&type=c', 'MenuNewCustomer', 2, 'companies', '$user->rights->societe->creer', '', 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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 500__+MAX_llx_menu__, 'companies', 'thirdparties', 2__+MAX_llx_menu__, '/societe/index.php?mainmenu=companies&leftmenu=thirdparties', 'ThirdParty', 0, 'companies', '$user->hasRight("societe","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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 501__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&action=create', 'MenuNewThirdParty', 1, 'companies', '$user->hasRight("societe","creer")', '', 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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 502__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&leftmenu=thirdparties', 'List', 1, 'companies', '$user->hasRight("societe","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 ('', 'isModEnabled("societe") && (isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))', __HANDLER__, 'left', 503__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&type=f&leftmenu=suppliers', 'ListSuppliersShort', 1, 'suppliers', '$user->hasRight("societe","lire") && $user->rights->fournisseur->lire', '', 2, 5, __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 ('', 'isModEnabled("societe") && (isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))', __HANDLER__, 'left', 504__+MAX_llx_menu__, 'companies', '', 503__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&leftmenu=supplier&action=create&type=f', 'NewSupplier', 2, 'suppliers', '$user->hasRight("societe","creer")', '', 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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 506__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&type=p&leftmenu=prospects', 'ListProspectsShort', 1, 'companies', '$user->hasRight("societe","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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 507__+MAX_llx_menu__, 'companies', '', 506__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&leftmenu=prospects&action=create&type=p', 'MenuNewProspect', 2, 'companies', '$user->hasRight("societe","creer")', '', 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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 509__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&type=c&leftmenu=customers', 'ListCustomersShort', 1, 'companies', '$user->hasRight("societe","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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 510__+MAX_llx_menu__, 'companies', '', 509__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&leftmenu=customers&action=create&type=c', 'MenuNewCustomer', 2, 'companies', '$user->hasRight("societe","creer")', '', 2, 0, __ENTITY__); -- Third parties - Contacts -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 600__+MAX_llx_menu__, 'companies', 'contacts', 2__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts', 'ContactsAddresses', 0, 'companies', '$user->rights->societe->lire', '', 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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 601__+MAX_llx_menu__, 'companies', '', 600__+MAX_llx_menu__, '/contact/card.php?mainmenu=companies&leftmenu=contacts&action=create', 'NewContactAddress', 1, 'companies', '$user->rights->societe->creer', '', 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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 602__+MAX_llx_menu__, 'companies', '', 600__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts', 'List', 1, 'companies', '$user->rights->societe->lire', '', 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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 604__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts&type=p', 'ThirdPartyProspects', 2, 'companies', '$user->rights->societe->contact->lire', '', 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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 605__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts&type=c', 'ThirdPartyCustomers', 2, 'companies', '$user->rights->societe->contact->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 ('', 'isModEnabled("societe") && (isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))', __HANDLER__, 'left', 606__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts&type=f', 'ThirdPartySuppliers', 2, 'companies', '$user->rights->societe->contact->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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 607__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts&type=o', 'Others', 2, 'companies', '$user->rights->societe->contact->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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 600__+MAX_llx_menu__, 'companies', 'contacts', 2__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts', 'ContactsAddresses', 0, 'companies', '$user->hasRight("societe","lire")', '', 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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 601__+MAX_llx_menu__, 'companies', '', 600__+MAX_llx_menu__, '/contact/card.php?mainmenu=companies&leftmenu=contacts&action=create', 'NewContactAddress', 1, 'companies', '$user->hasRight("societe","creer")', '', 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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 602__+MAX_llx_menu__, 'companies', '', 600__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts', 'List', 1, 'companies', '$user->hasRight("societe","lire")', '', 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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 604__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts&type=p', 'ThirdPartyProspects', 2, 'companies', '$user->hasRight("societe","contact","lire")', '', 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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 605__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts&type=c', 'ThirdPartyCustomers', 2, 'companies', '$user->hasRight("societe","contact","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 ('', 'isModEnabled("societe") && (isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))', __HANDLER__, 'left', 606__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts&type=f', 'ThirdPartySuppliers', 2, 'companies', '$user->hasRight("societe","contact","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 ('', 'isModEnabled("societe")', __HANDLER__, 'left', 607__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts&type=o', 'Others', 2, 'companies', '$user->hasRight("societe","contact","lire")', '', 2, 4, __ENTITY__); -- Third parties - Category customer -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe") && $conf->categorie->enabled', __HANDLER__, 'left', 650__+MAX_llx_menu__, 'companies', 'cat', 2__+MAX_llx_menu__, '/categories/index.php?mainmenu=companies&leftmenu=cat&type=1', 'SuppliersCategoriesShort', 0, 'categories', '$user->rights->categorie->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 ('', 'isModEnabled("societe") && $conf->categorie->enabled', __HANDLER__, 'left', 651__+MAX_llx_menu__, 'companies', '', 650__+MAX_llx_menu__, '/categories/card.php?mainmenu=companies&action=create&type=1', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 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 ('', 'isModEnabled("societe") && isModEnabled("categorie")', __HANDLER__, 'left', 650__+MAX_llx_menu__, 'companies', 'cat', 2__+MAX_llx_menu__, '/categories/index.php?mainmenu=companies&leftmenu=cat&type=1', 'SuppliersCategoriesShort', 0, 'categories', '$user->hasRight("categorie","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 ('', 'isModEnabled("societe") && isModEnabled("categorie")', __HANDLER__, 'left', 651__+MAX_llx_menu__, 'companies', '', 650__+MAX_llx_menu__, '/categories/card.php?mainmenu=companies&action=create&type=1', 'NewCategory', 1, 'categories', '$user->hasRight("categorie","creer")', '', 2, 0, __ENTITY__); -- Third parties - Category supplier -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '(isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && $conf->categorie->enabled', __HANDLER__, 'left', 660__+MAX_llx_menu__, 'companies', 'cat', 2__+MAX_llx_menu__, '/categories/index.php?mainmenu=companies&leftmenu=cat&type=2', 'CustomersProspectsCategoriesShort', 0, 'categories', '$user->rights->categorie->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 ('', '(isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && $conf->categorie->enabled', __HANDLER__, 'left', 661__+MAX_llx_menu__, 'companies', '', 660__+MAX_llx_menu__, '/categories/card.php?mainmenu=companies&action=create&type=2', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 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 ('', '(isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && isModEnabled("categorie")', __HANDLER__, 'left', 660__+MAX_llx_menu__, 'companies', 'cat', 2__+MAX_llx_menu__, '/categories/index.php?mainmenu=companies&leftmenu=cat&type=2', 'CustomersProspectsCategoriesShort', 0, 'categories', '$user->hasRight("categorie","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 ('', '(isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && isModEnabled("categorie")', __HANDLER__, 'left', 661__+MAX_llx_menu__, 'companies', '', 660__+MAX_llx_menu__, '/categories/card.php?mainmenu=companies&action=create&type=2', 'NewCategory', 1, 'categories', '$user->hasRight("categorie","creer")', '', 2, 0, __ENTITY__); -- Third parties - Category contact -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe") && $conf->categorie->enabled', __HANDLER__, 'left', 670__+MAX_llx_menu__, 'companies', 'cat', 2__+MAX_llx_menu__, '/categories/index.php?mainmenu=companies&leftmenu=cat&type=4', 'ContactCategoriesShort', 0, 'categories', '$user->rights->categorie->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 ('', 'isModEnabled("societe") && $conf->categorie->enabled', __HANDLER__, 'left', 671__+MAX_llx_menu__, 'companies', '', 670__+MAX_llx_menu__, '/categories/card.php?mainmenu=companies&action=create&type=4', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 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 ('', 'isModEnabled("societe") && isModEnabled("categorie")', __HANDLER__, 'left', 670__+MAX_llx_menu__, 'companies', 'cat', 2__+MAX_llx_menu__, '/categories/index.php?mainmenu=companies&leftmenu=cat&type=4', 'ContactCategoriesShort', 0, 'categories', '$user->hasRight("categorie","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 ('', 'isModEnabled("societe") && isModEnabled("categorie")', __HANDLER__, 'left', 671__+MAX_llx_menu__, 'companies', '', 670__+MAX_llx_menu__, '/categories/card.php?mainmenu=companies&action=create&type=4', 'NewCategory', 1, 'categories', '$user->hasRight("categorie","creer")', '', 2, 0, __ENTITY__); -- Product - Product insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("product")', __HANDLER__, 'left', 2800__+MAX_llx_menu__, 'products', 'product', 3__+MAX_llx_menu__, '/product/index.php?mainmenu=products&leftmenu=product&type=0', 'Products', 0, 'products', '$user->rights->produit->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 ('', 'isModEnabled("product")', __HANDLER__, 'left', 2801__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/card.php?mainmenu=products&leftmenu=product&action=create&type=0', 'NewProduct', 1, 'products', '$user->rights->produit->creer', '', 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 ('', 'isModEnabled("product")', __HANDLER__, 'left', 2802__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/list.php?mainmenu=products&leftmenu=product&type=0', 'List', 1, 'products', '$user->rights->produit->lire', '', 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 ('', 'isModEnabled("product")', __HANDLER__, 'left', 2803__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassort.php?mainmenu=products&type=0', 'MenuStocks', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->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->productbatch->enabled', __HANDLER__, 'left', 2805__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassortlot.php?mainmenu=products&type=0&search_subjecttolotserial=1', 'StocksByLotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 5, __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->productbatch->enabled', __HANDLER__, 'left', 2806__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/stock/productlot_list.php?mainmenu=products', 'LotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 6, __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 ('', 'isModEnabled("productbatch")', __HANDLER__, 'left', 2805__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassortlot.php?mainmenu=products&type=0&search_subjecttolotserial=1', 'StocksByLotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 5, __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 ('', 'isModEnabled("productbatch")', __HANDLER__, 'left', 2806__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/stock/productlot_list.php?mainmenu=products', 'LotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 6, __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->variants->enabled', __HANDLER__, 'left', 2807__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/variants/list.php?mainmenu=products', 'VariantAttributes', 1, 'products', '$user->rights->produit->lire', '', 2, 7, __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 ('', 'isModEnabled("variants")', __HANDLER__, 'left', 2807__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/variants/list.php?mainmenu=products', 'VariantAttributes', 1, 'products', '$user->rights->produit->lire', '', 2, 7, __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->propal->enabled', __HANDLER__, 'left', 2804__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/stats/card.php?mainmenu=products&id=all&leftmenu=stats&type=0', 'Statistics', 1, 'main', '$user->rights->produit->lire', '', 2, 8, __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 ('', 'isModEnabled("propal")', __HANDLER__, 'left', 2804__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/stats/card.php?mainmenu=products&id=all&leftmenu=stats&type=0', 'Statistics', 1, 'main', '$user->rights->produit->lire', '', 2, 8, __ENTITY__); -- Product - Services -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("service")', __HANDLER__, 'left', 2900__+MAX_llx_menu__, 'products', 'service', 3__+MAX_llx_menu__, '/product/index.php?mainmenu=products&leftmenu=service&type=1', 'Services', 0, 'products', '$user->rights->service->lire', '', 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 ('', 'isModEnabled("service")', __HANDLER__, 'left', 2900__+MAX_llx_menu__, 'products', 'service', 3__+MAX_llx_menu__, '/product/index.php?mainmenu=products&leftmenu=service&type=1', 'Services', 0, 'products', '$user->hasRight("service","lire")', '', 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 ('', 'isModEnabled("service")', __HANDLER__, 'left', 2901__+MAX_llx_menu__, 'products', '', 2900__+MAX_llx_menu__, '/product/card.php?mainmenu=products&leftmenu=service&action=create&type=1', 'NewService', 1, 'products', '$user->rights->service->creer', '', 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 ('', 'isModEnabled("service")', __HANDLER__, 'left', 2902__+MAX_llx_menu__, 'products', '', 2900__+MAX_llx_menu__, '/product/list.php?mainmenu=products&leftmenu=service&type=1', 'List', 1, 'products', '$user->rights->service->lire', '', 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->propal->enabled', __HANDLER__, 'left', 2903__+MAX_llx_menu__, 'products', '', 2900__+MAX_llx_menu__, '/product/stats/card.php?mainmenu=products&id=all&leftmenu=stats&type=1', 'Statistics', 1, 'main', '$user->rights->service->lire', '', 2, 5, __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 ('', 'isModEnabled("service")', __HANDLER__, 'left', 2902__+MAX_llx_menu__, 'products', '', 2900__+MAX_llx_menu__, '/product/list.php?mainmenu=products&leftmenu=service&type=1', 'List', 1, 'products', '$user->hasRight("service","lire")', '', 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 ('', 'isModEnabled("propal")', __HANDLER__, 'left', 2903__+MAX_llx_menu__, 'products', '', 2900__+MAX_llx_menu__, '/product/stats/card.php?mainmenu=products&id=all&leftmenu=stats&type=1', 'Statistics', 1, 'main', '$user->hasRight("service","lire")', '', 2, 5, __ENTITY__); -- Product - Stocks -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->stock->enabled', __HANDLER__, 'left', 3100__+MAX_llx_menu__, 'products', 'stock', 3__+MAX_llx_menu__, '/product/stock/index.php?mainmenu=products&leftmenu=stock', 'Stock', 0, 'stocks', '$user->rights->stock->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->stock->enabled', __HANDLER__, 'left', 3101__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/card.php?mainmenu=products&action=create', 'MenuNewWarehouse', 1, 'stocks', '$user->rights->stock->creer', '', 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->stock->enabled', __HANDLER__, 'left', 3102__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/list.php?mainmenu=products', 'List', 1, 'stocks', '$user->rights->stock->lire', '', 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->stock->enabled', __HANDLER__, 'left', 3104__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/movement_list.php?mainmenu=products', 'Movements', 1, 'stocks', '$user->rights->stock->mouvement->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->stock->enabled && $conf->supplier_order->enabled', __HANDLER__, 'left', 3105__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/replenish.php?mainmenu=products', 'Replenishments', 1, 'stocks', '$user->rights->stock->mouvement->creer && $user->rights->fournisseur->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->stock->enabled', __HANDLER__, 'left', 3106__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/massstockmove.php?init=1&mainmenu=products', 'MassStockTransferShort', 1, 'stocks', '$user->rights->stock->mouvement->creer', '', 2, 5, __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 ('', 'isModEnabled("stock")', __HANDLER__, 'left', 3100__+MAX_llx_menu__, 'products', 'stock', 3__+MAX_llx_menu__, '/product/stock/index.php?mainmenu=products&leftmenu=stock', 'Stock', 0, 'stocks', '$user->rights->stock->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 ('', 'isModEnabled("stock")', __HANDLER__, 'left', 3101__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/card.php?mainmenu=products&action=create', 'MenuNewWarehouse', 1, 'stocks', '$user->rights->stock->creer', '', 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 ('', 'isModEnabled("stock")', __HANDLER__, 'left', 3102__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/list.php?mainmenu=products', 'List', 1, 'stocks', '$user->rights->stock->lire', '', 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 ('', 'isModEnabled("stock")', __HANDLER__, 'left', 3104__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/movement_list.php?mainmenu=products', 'Movements', 1, 'stocks', '$user->rights->stock->mouvement->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 ('', 'isModEnabled("stock") && isModEnabled("supplier_order")', __HANDLER__, 'left', 3105__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/replenish.php?mainmenu=products', 'Replenishments', 1, 'stocks', '$user->rights->stock->mouvement->creer && $user->rights->fournisseur->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 ('', 'isModEnabled("stock")', __HANDLER__, 'left', 3106__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/massstockmove.php?init=1&mainmenu=products', 'MassStockTransferShort', 1, 'stocks', '$user->rights->stock->mouvement->creer', '', 2, 5, __ENTITY__); -- Product - 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', 3200__+MAX_llx_menu__, 'products', 'cat', 3__+MAX_llx_menu__, '/categories/index.php?mainmenu=products&leftmenu=cat&type=0', 'Categories', 0, 'categories', '$user->rights->categorie->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->categorie->enabled', __HANDLER__, 'left', 3201__+MAX_llx_menu__, 'products', '', 3200__+MAX_llx_menu__, '/categories/card.php?mainmenu=products&action=create&type=0', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 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 ('', 'isModEnabled("categorie")', __HANDLER__, 'left', 3200__+MAX_llx_menu__, 'products', 'cat', 3__+MAX_llx_menu__, '/categories/index.php?mainmenu=products&leftmenu=cat&type=0', 'Categories', 0, 'categories', '$user->hasRight("categorie","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 ('', 'isModEnabled("categorie")', __HANDLER__, 'left', 3201__+MAX_llx_menu__, 'products', '', 3200__+MAX_llx_menu__, '/categories/card.php?mainmenu=products&action=create&type=0', 'NewCategory', 1, 'categories', '$user->hasRight("categorie","creer")', '', 2, 0, __ENTITY__); -- Product - Shipment -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->expedition->enabled', __HANDLER__, 'left', 1300__+MAX_llx_menu__, 'commercial', 'sendings', 3__+MAX_llx_menu__, '/expedition/index.php?mainmenu=commercial&leftmenu=sendings', 'Shipments', 0, 'sendings', '$user->rights->expedition->lire', '', 2, 6, __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->expedition->enabled && $leftmenu=="sendings"', __HANDLER__, 'left', 1301__+MAX_llx_menu__, 'commercial', '', 1300__+MAX_llx_menu__, '/expedition/card.php?mainmenu=commercial&action=create2&leftmenu=sendings', 'NewSending', 1, 'sendings', '$user->rights->expedition->creer', '', 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->expedition->enabled && $leftmenu=="sendings"', __HANDLER__, 'left', 1302__+MAX_llx_menu__, 'commercial', '', 1300__+MAX_llx_menu__, '/expedition/list.php?mainmenu=commercial&leftmenu=sendings', 'List', 1, 'sendings', '$user->rights->expedition->lire', '', 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->expedition->enabled && $leftmenu=="sendings"', __HANDLER__, 'left', 1303__+MAX_llx_menu__, 'commercial', '', 1300__+MAX_llx_menu__, '/expedition/stats/index.php?mainmenu=commercial&leftmenu=sendings', 'Statistics', 1, 'sendings', '$user->rights->expedition->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 ('', 'isModEnabled("expedition")', __HANDLER__, 'left', 1300__+MAX_llx_menu__, 'commercial', 'sendings', 3__+MAX_llx_menu__, '/expedition/index.php?mainmenu=commercial&leftmenu=sendings', 'Shipments', 0, 'sendings', '$user->rights->expedition->lire', '', 2, 6, __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 ('', 'isModEnabled("expedition") && $leftmenu=="sendings"', __HANDLER__, 'left', 1301__+MAX_llx_menu__, 'commercial', '', 1300__+MAX_llx_menu__, '/expedition/card.php?mainmenu=commercial&action=create2&leftmenu=sendings', 'NewSending', 1, 'sendings', '$user->rights->expedition->creer', '', 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 ('', 'isModEnabled("expedition") && $leftmenu=="sendings"', __HANDLER__, 'left', 1302__+MAX_llx_menu__, 'commercial', '', 1300__+MAX_llx_menu__, '/expedition/list.php?mainmenu=commercial&leftmenu=sendings', 'List', 1, 'sendings', '$user->rights->expedition->lire', '', 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 ('', 'isModEnabled("expedition") && $leftmenu=="sendings"', __HANDLER__, 'left', 1303__+MAX_llx_menu__, 'commercial', '', 1300__+MAX_llx_menu__, '/expedition/stats/index.php?mainmenu=commercial&leftmenu=sendings', 'Statistics', 1, 'sendings', '$user->rights->expedition->lire', '', 2, 2, __ENTITY__); -- Product - Reception -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->reception->enabled', __HANDLER__, 'left', 1350__+MAX_llx_menu__, 'commercial', 'receptions', 3__+MAX_llx_menu__, '/reception/index.php?mainmenu=commercial&leftmenu=receptions', 'Receptions', 0, 'receptions', '$user->rights->reception->lire', '', 2, 6, __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->reception->enabled && $leftmenu=="receptions"', __HANDLER__, 'left', 1351__+MAX_llx_menu__, 'commercial', '', 1350__+MAX_llx_menu__, '/reception/card.php?mainmenu=commercial&action=create2&leftmenu=receptions', 'NewSending', 1, 'receptions', '$user->rights->reception->creer', '', 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->reception->enabled && $leftmenu=="receptions"', __HANDLER__, 'left', 1352__+MAX_llx_menu__, 'commercial', '', 1350__+MAX_llx_menu__, '/reception/list.php?mainmenu=commercial&leftmenu=receptions', 'List', 1, 'receptions', '$user->rights->reception->lire', '', 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->reception->enabled && $leftmenu=="receptions"', __HANDLER__, 'left', 1353__+MAX_llx_menu__, 'commercial', '', 1350__+MAX_llx_menu__, '/reception/stats/index.php?mainmenu=commercial&leftmenu=receptions', 'Statistics', 1, 'receptions', '$user->rights->reception->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 ('', 'isModEnabled("reception")', __HANDLER__, 'left', 1350__+MAX_llx_menu__, 'commercial', 'receptions', 3__+MAX_llx_menu__, '/reception/index.php?mainmenu=commercial&leftmenu=receptions', 'Receptions', 0, 'receptions', '$user->rights->reception->lire', '', 2, 6, __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 ('', 'isModEnabled("reception") && $leftmenu=="receptions"', __HANDLER__, 'left', 1351__+MAX_llx_menu__, 'commercial', '', 1350__+MAX_llx_menu__, '/reception/card.php?mainmenu=commercial&action=create2&leftmenu=receptions', 'NewSending', 1, 'receptions', '$user->rights->reception->creer', '', 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 ('', 'isModEnabled("reception") && $leftmenu=="receptions"', __HANDLER__, 'left', 1352__+MAX_llx_menu__, 'commercial', '', 1350__+MAX_llx_menu__, '/reception/list.php?mainmenu=commercial&leftmenu=receptions', 'List', 1, 'receptions', '$user->rights->reception->lire', '', 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 ('', 'isModEnabled("reception") && $leftmenu=="receptions"', __HANDLER__, 'left', 1353__+MAX_llx_menu__, 'commercial', '', 1350__+MAX_llx_menu__, '/reception/stats/index.php?mainmenu=commercial&leftmenu=receptions', 'Statistics', 1, 'receptions', '$user->rights->reception->lire', '', 2, 2, __ENTITY__); -- Commercial - Proposals -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->propal->enabled', __HANDLER__, 'left', 1100__+MAX_llx_menu__, 'commercial', 'propals', 5__+MAX_llx_menu__, '/comm/propal/index.php?mainmenu=commercial&leftmenu=propals', 'Proposals', 0, 'propal', '$user->rights->propal->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->propal->enabled', __HANDLER__, 'left', 1101__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/card.php?mainmenu=commercial&action=create&leftmenu=propals', 'NewPropal', 1, 'propal', '$user->rights->propal->creer', '', 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->propal->enabled', __HANDLER__, 'left', 1102__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals', 'List', 1, 'propal', '$user->rights->propal->lire', '', 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->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1103__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=0', 'PropalsDraft', 1, 'propal', '$user->rights->propal->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->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1104__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=1', 'PropalsOpened', 1, 'propal', '$user->rights->propal->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->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1105__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=2', 'PropalStatusSigned', 1, 'propal', '$user->rights->propal->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->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1106__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=3', 'PropalStatusNotSigned', 1, 'propal', '$user->rights->propal->lire', '', 2, 5, __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->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1107__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=4', 'PropalStatusBilled', 1, 'propal', '$user->rights->propal->lire', '', 2, 6, __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->propal->enabled', __HANDLER__, 'left', 1110__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/stats/index.php?mainmenu=commercial&leftmenu=propals', 'Statistics', 1, 'propal', '$user->rights->propal->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 ('', 'isModEnabled("propal")', __HANDLER__, 'left', 1100__+MAX_llx_menu__, 'commercial', 'propals', 5__+MAX_llx_menu__, '/comm/propal/index.php?mainmenu=commercial&leftmenu=propals', 'Proposals', 0, 'propal', '$user->rights->propal->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 ('', 'isModEnabled("propal")', __HANDLER__, 'left', 1101__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/card.php?mainmenu=commercial&action=create&leftmenu=propals', 'NewPropal', 1, 'propal', '$user->rights->propal->creer', '', 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 ('', 'isModEnabled("propal")', __HANDLER__, 'left', 1102__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals', 'List', 1, 'propal', '$user->rights->propal->lire', '', 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 ('', 'isModEnabled("propal") && $leftmenu=="propals"', __HANDLER__, 'left', 1103__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=0', 'PropalsDraft', 1, 'propal', '$user->rights->propal->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 ('', 'isModEnabled("propal") && $leftmenu=="propals"', __HANDLER__, 'left', 1104__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=1', 'PropalsOpened', 1, 'propal', '$user->rights->propal->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 ('', 'isModEnabled("propal") && $leftmenu=="propals"', __HANDLER__, 'left', 1105__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=2', 'PropalStatusSigned', 1, 'propal', '$user->rights->propal->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 ('', 'isModEnabled("propal") && $leftmenu=="propals"', __HANDLER__, 'left', 1106__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=3', 'PropalStatusNotSigned', 1, 'propal', '$user->rights->propal->lire', '', 2, 5, __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 ('', 'isModEnabled("propal") && $leftmenu=="propals"', __HANDLER__, 'left', 1107__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=4', 'PropalStatusBilled', 1, 'propal', '$user->rights->propal->lire', '', 2, 6, __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 ('', 'isModEnabled("propal")', __HANDLER__, 'left', 1110__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/stats/index.php?mainmenu=commercial&leftmenu=propals', 'Statistics', 1, 'propal', '$user->rights->propal->lire', '', 2, 4, __ENTITY__); -- Commercial - Customer's orders -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->commande->enabled', __HANDLER__, 'left', 1200__+MAX_llx_menu__, 'commercial', 'orders', 5__+MAX_llx_menu__, '/commande/index.php?mainmenu=commercial&leftmenu=orders', 'CustomersOrders', 0, 'orders', '$user->rights->commande->lire', '', 2, 5, __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->commande->enabled', __HANDLER__, 'left', 1201__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/card.php?mainmenu=commercial&action=create&leftmenu=orders', 'NewOrder', 1, 'orders', '$user->rights->commande->creer', '', 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->commande->enabled', __HANDLER__, 'left', 1202__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders', 'List', 1, 'orders', '$user->rights->commande->lire', '', 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->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1203__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=0', 'StatusOrderDraftShort', 1, 'orders', '$user->rights->commande->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->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1204__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=1', 'StatusOrderValidated', 1, 'orders', '$user->rights->commande->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->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1205__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=2', 'StatusOrderOnProcessShort', 1, 'orders', '$user->rights->commande->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->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1206__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=3', 'StatusOrderToBill', 1, 'orders', '$user->rights->commande->lire', '', 2, 5, __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->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1207__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=4', 'StatusOrderProcessed', 1, 'orders', '$user->rights->commande->lire', '', 2, 6, __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->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1208__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=-1', 'StatusOrderCanceledShort', 1, 'orders', '$user->rights->commande->lire', '', 2, 7, __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->commande->enabled', __HANDLER__, 'left', 1209__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/stats/index.php?mainmenu=commercial&leftmenu=orders', 'Statistics', 1, 'orders', '$user->rights->commande->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->commande->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 2 && empty($user->socid)', __HANDLER__, 'left', 1210__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/list_det.php?mainmenu=commercial&leftmenu=orders', 'ListOrderLigne', 1, 'orders', '$user->rights->commande->lire', '', 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 ('', 'isModEnabled("commande")', __HANDLER__, 'left', 1200__+MAX_llx_menu__, 'commercial', 'orders', 5__+MAX_llx_menu__, '/commande/index.php?mainmenu=commercial&leftmenu=orders', 'CustomersOrders', 0, 'orders', '$user->rights->commande->lire', '', 2, 5, __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 ('', 'isModEnabled("commande")', __HANDLER__, 'left', 1201__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/card.php?mainmenu=commercial&action=create&leftmenu=orders', 'NewOrder', 1, 'orders', '$user->rights->commande->creer', '', 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 ('', 'isModEnabled("commande")', __HANDLER__, 'left', 1202__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders', 'List', 1, 'orders', '$user->rights->commande->lire', '', 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 ('', 'isModEnabled("commande") && $leftmenu=="orders"', __HANDLER__, 'left', 1203__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=0', 'StatusOrderDraftShort', 1, 'orders', '$user->rights->commande->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 ('', 'isModEnabled("commande") && $leftmenu=="orders"', __HANDLER__, 'left', 1204__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=1', 'StatusOrderValidated', 1, 'orders', '$user->rights->commande->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 ('', 'isModEnabled("commande") && $leftmenu=="orders"', __HANDLER__, 'left', 1205__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=2', 'StatusOrderOnProcessShort', 1, 'orders', '$user->rights->commande->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 ('', 'isModEnabled("commande") && $leftmenu=="orders"', __HANDLER__, 'left', 1206__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=3', 'StatusOrderToBill', 1, 'orders', '$user->rights->commande->lire', '', 2, 5, __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 ('', 'isModEnabled("commande") && $leftmenu=="orders"', __HANDLER__, 'left', 1207__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=4', 'StatusOrderProcessed', 1, 'orders', '$user->rights->commande->lire', '', 2, 6, __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 ('', 'isModEnabled("commande") && $leftmenu=="orders"', __HANDLER__, 'left', 1208__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=-1', 'StatusOrderCanceledShort', 1, 'orders', '$user->rights->commande->lire', '', 2, 7, __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 ('', 'isModEnabled("commande")', __HANDLER__, 'left', 1209__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/stats/index.php?mainmenu=commercial&leftmenu=orders', 'Statistics', 1, 'orders', '$user->rights->commande->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 ('', 'isModEnabled("commande") && $conf->global->MAIN_FEATURES_LEVEL >= 2 && empty($user->socid)', __HANDLER__, 'left', 1210__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/list_det.php?mainmenu=commercial&leftmenu=orders', 'ListOrderLigne', 1, 'orders', '$user->rights->commande->lire', '', 2, 1, __ENTITY__); -- Commercial - Supplier's proposals -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->supplier_proposal->enabled', __HANDLER__, 'left', 1650__+MAX_llx_menu__, 'commercial', 'propals_supplier', 3__+MAX_llx_menu__, '/supplier_proposal/index.php?leftmenu=propals_supplier', 'SupplierProposalsShort', 0, 'supplier_proposal', '$user->rights->supplier_proposal->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->supplier_proposal->enabled', __HANDLER__, 'left', 1651__+MAX_llx_menu__, 'commercial', '', 1650__+MAX_llx_menu__, '/supplier_proposal/card.php?action=create&leftmenu=supplier_proposals', 'SupplierProposalNew', 1, 'supplier_proposal', '$user->rights->supplier_proposal->creer', '', 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->supplier_proposal->enabled', __HANDLER__, 'left', 1652__+MAX_llx_menu__, 'commercial', '', 1650__+MAX_llx_menu__, '/supplier_proposal/list.php?leftmenu=supplier_proposals', 'List', 1, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 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->supplier_proposal->enabled', __HANDLER__, 'left', 1653__+MAX_llx_menu__, 'commercial', '', 1650__+MAX_llx_menu__, '/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier', 'Statistics', 1, 'supplier_proposal', '$user->rights->supplier_proposal->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 ('', 'isModEnabled("supplier_proposal")', __HANDLER__, 'left', 1650__+MAX_llx_menu__, 'commercial', 'propals_supplier', 3__+MAX_llx_menu__, '/supplier_proposal/index.php?leftmenu=propals_supplier', 'SupplierProposalsShort', 0, 'supplier_proposal', '$user->rights->supplier_proposal->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 ('', 'isModEnabled("supplier_proposal")', __HANDLER__, 'left', 1651__+MAX_llx_menu__, 'commercial', '', 1650__+MAX_llx_menu__, '/supplier_proposal/card.php?action=create&leftmenu=supplier_proposals', 'SupplierProposalNew', 1, 'supplier_proposal', '$user->rights->supplier_proposal->creer', '', 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 ('', 'isModEnabled("supplier_proposal")', __HANDLER__, 'left', 1652__+MAX_llx_menu__, 'commercial', '', 1650__+MAX_llx_menu__, '/supplier_proposal/list.php?leftmenu=supplier_proposals', 'List', 1, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 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 ('', 'isModEnabled("supplier_proposal")', __HANDLER__, 'left', 1653__+MAX_llx_menu__, 'commercial', '', 1650__+MAX_llx_menu__, '/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier', 'Statistics', 1, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 2, __ENTITY__); -- Commercial - Supplier's orders -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->supplier_order->enabled', __HANDLER__, 'left', 5100__+MAX_llx_menu__, 'commercial', 'orders_suppliers', 5__+MAX_llx_menu__, '/fourn/commande/index.php?mainmenu=commercial&leftmenu=orders_suppliers', 'SuppliersOrders', 0, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 6, __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->supplier_order->enabled', __HANDLER__, 'left', 5101__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/card.php?mainmenu=commercial&action=create&leftmenu=orders_suppliers', 'NewSupplierOrderShort', 1, 'orders', '($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)', '', 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->supplier_order->enabled', __HANDLER__, 'left', 5102__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers', 'List', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 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->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5103__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=0', 'StatusOrderDraftShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->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->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5104__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=1', 'StatusOrderValidated', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->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->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5105__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=2', 'StatusOrderApprovedShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->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->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5106__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=3', 'StatusOrderOnProcessShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 5, __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->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5107__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=4', 'StatusOrderReceivedPartiallyShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->creer)', '', 2, 6, __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->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5108__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=5', 'StatusOrderReceivedAll', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 7, __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->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5109__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=6,7', 'StatusOrderCanceled', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 8, __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->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5110__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=9', 'StatusOrderRefused', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 9, __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->supplier_order->enabled', __HANDLER__, 'left', 5111__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/commande/stats/index.php?mainmenu=commercial&leftmenu=orders_suppliers&mode=supplier', 'Statistics', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 7, __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 ('', 'isModEnabled("supplier_order")', __HANDLER__, 'left', 5100__+MAX_llx_menu__, 'commercial', 'orders_suppliers', 5__+MAX_llx_menu__, '/fourn/commande/index.php?mainmenu=commercial&leftmenu=orders_suppliers', 'SuppliersOrders', 0, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 6, __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 ('', 'isModEnabled("supplier_order")', __HANDLER__, 'left', 5101__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/card.php?mainmenu=commercial&action=create&leftmenu=orders_suppliers', 'NewSupplierOrderShort', 1, 'orders', '($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)', '', 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 ('', 'isModEnabled("supplier_order")', __HANDLER__, 'left', 5102__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers', 'List', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 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 ('', 'isModEnabled("supplier_order") && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5103__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=0', 'StatusOrderDraftShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->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 ('', 'isModEnabled("supplier_order") && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5104__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=1', 'StatusOrderValidated', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->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 ('', 'isModEnabled("supplier_order") && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5105__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=2', 'StatusOrderApprovedShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->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 ('', 'isModEnabled("supplier_order") && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5106__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=3', 'StatusOrderOnProcessShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 5, __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 ('', 'isModEnabled("supplier_order") && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5107__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=4', 'StatusOrderReceivedPartiallyShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->creer)', '', 2, 6, __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 ('', 'isModEnabled("supplier_order") && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5108__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=5', 'StatusOrderReceivedAll', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 7, __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 ('', 'isModEnabled("supplier_order") && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5109__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=6,7', 'StatusOrderCanceled', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 8, __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 ('', 'isModEnabled("supplier_order") && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5110__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=9', 'StatusOrderRefused', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 9, __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 ('', 'isModEnabled("supplier_order")', __HANDLER__, 'left', 5111__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/commande/stats/index.php?mainmenu=commercial&leftmenu=orders_suppliers&mode=supplier', 'Statistics', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 7, __ENTITY__); -- Commercial - Contracts -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->contrat->enabled', __HANDLER__, 'left', 1400__+MAX_llx_menu__, 'commercial', 'contracts', 5__+MAX_llx_menu__, '/contrat/index.php?mainmenu=commercial&leftmenu=contracts', 'Contracts', 0, 'contracts', '$user->rights->contrat->lire', '', 2, 7, __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->contrat->enabled', __HANDLER__, 'left', 1401__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/card.php?mainmenu=commercial&action=create&leftmenu=contracts', 'NewContract', 1, 'contracts', '$user->rights->contrat->creer', '', 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->contrat->enabled', __HANDLER__, 'left', 1402__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/list.php?mainmenu=commercial&leftmenu=contracts', 'List', 1, 'contracts', '$user->rights->contrat->lire', '', 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->contrat->enabled', __HANDLER__, 'left', 1403__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts', 'MenuServices', 1, 'contracts', '$user->rights->contrat->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->contrat->enabled && $leftmenu=="contracts"', __HANDLER__, 'left', 1404__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&search_status=0', 'MenuInactiveServices', 2, 'contracts', '$user->rights->contrat->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->contrat->enabled && $leftmenu=="contracts"', __HANDLER__, 'left', 1405__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&search_status=4', 'MenuRunningServices', 2, 'contracts', '$user->rights->contrat->lire', '', 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->contrat->enabled && $leftmenu=="contracts"', __HANDLER__, 'left', 1406__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&search_status=4&filter=expired', 'MenuExpiredServices', 2, 'contracts', '$user->rights->contrat->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->contrat->enabled && $leftmenu=="contracts"', __HANDLER__, 'left', 1407__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&search_status=5', 'MenuClosedServices', 2, 'contracts', '$user->rights->contrat->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 ('', 'isModEnabled("contrat")', __HANDLER__, 'left', 1400__+MAX_llx_menu__, 'commercial', 'contracts', 5__+MAX_llx_menu__, '/contrat/index.php?mainmenu=commercial&leftmenu=contracts', 'Contracts', 0, 'contracts', '$user->rights->contrat->lire', '', 2, 7, __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 ('', 'isModEnabled("contrat")', __HANDLER__, 'left', 1401__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/card.php?mainmenu=commercial&action=create&leftmenu=contracts', 'NewContract', 1, 'contracts', '$user->rights->contrat->creer', '', 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 ('', 'isModEnabled("contrat")', __HANDLER__, 'left', 1402__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/list.php?mainmenu=commercial&leftmenu=contracts', 'List', 1, 'contracts', '$user->rights->contrat->lire', '', 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 ('', 'isModEnabled("contrat")', __HANDLER__, 'left', 1403__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts', 'MenuServices', 1, 'contracts', '$user->rights->contrat->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 ('', 'isModEnabled("contrat") && $leftmenu=="contracts"', __HANDLER__, 'left', 1404__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&search_status=0', 'MenuInactiveServices', 2, 'contracts', '$user->rights->contrat->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 ('', 'isModEnabled("contrat") && $leftmenu=="contracts"', __HANDLER__, 'left', 1405__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&search_status=4', 'MenuRunningServices', 2, 'contracts', '$user->rights->contrat->lire', '', 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 ('', 'isModEnabled("contrat") && $leftmenu=="contracts"', __HANDLER__, 'left', 1406__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&search_status=4&filter=expired', 'MenuExpiredServices', 2, 'contracts', '$user->rights->contrat->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 ('', 'isModEnabled("contrat") && $leftmenu=="contracts"', __HANDLER__, 'left', 1407__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&search_status=5', 'MenuClosedServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 3, __ENTITY__); -- Commercial - Interventions -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->ficheinter->enabled', __HANDLER__, 'left', 1500__+MAX_llx_menu__, 'commercial', 'ficheinter', 5__+MAX_llx_menu__, '/fichinter/list.php?mainmenu=commercial&leftmenu=ficheinter', 'Interventions', 0, 'interventions', '$user->rights->ficheinter->lire', '', 2, 8, __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->ficheinter->enabled', __HANDLER__, 'left', 1501__+MAX_llx_menu__, 'commercial', '', 1500__+MAX_llx_menu__, '/fichinter/card.php?mainmenu=commercial&action=create&leftmenu=ficheinter', 'NewIntervention', 1, 'interventions', '$user->rights->ficheinter->creer', '', 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->ficheinter->enabled', __HANDLER__, 'left', 1502__+MAX_llx_menu__, 'commercial', '', 1500__+MAX_llx_menu__, '/fichinter/list.php?mainmenu=commercial&leftmenu=ficheinter', 'List', 1, 'interventions', '$user->rights->ficheinter->lire', '', 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->ficheinter->enabled', __HANDLER__, 'left', 1503__+MAX_llx_menu__, 'commercial', '', 1500__+MAX_llx_menu__, '/fichinter/stats/index.php?mainmenu=commercial&leftmenu=ficheinter', 'Statistics', 1, 'interventions', '$user->rights->ficheinter->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 ('', 'isModEnabled("ficheinter")', __HANDLER__, 'left', 1500__+MAX_llx_menu__, 'commercial', 'ficheinter', 5__+MAX_llx_menu__, '/fichinter/list.php?mainmenu=commercial&leftmenu=ficheinter', 'Interventions', 0, 'interventions', '$user->rights->ficheinter->lire', '', 2, 8, __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 ('', 'isModEnabled("ficheinter")', __HANDLER__, 'left', 1501__+MAX_llx_menu__, 'commercial', '', 1500__+MAX_llx_menu__, '/fichinter/card.php?mainmenu=commercial&action=create&leftmenu=ficheinter', 'NewIntervention', 1, 'interventions', '$user->rights->ficheinter->creer', '', 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 ('', 'isModEnabled("ficheinter")', __HANDLER__, 'left', 1502__+MAX_llx_menu__, 'commercial', '', 1500__+MAX_llx_menu__, '/fichinter/list.php?mainmenu=commercial&leftmenu=ficheinter', 'List', 1, 'interventions', '$user->rights->ficheinter->lire', '', 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 ('', 'isModEnabled("ficheinter")', __HANDLER__, 'left', 1503__+MAX_llx_menu__, 'commercial', '', 1500__+MAX_llx_menu__, '/fichinter/stats/index.php?mainmenu=commercial&leftmenu=ficheinter', 'Statistics', 1, 'interventions', '$user->rights->ficheinter->lire', '', 2, 2, __ENTITY__); -- Billing - Supplier invoice -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->supplier_invoice->enabled', __HANDLER__, 'left', 1600__+MAX_llx_menu__, 'billing', 'supplier_bills', 6__+MAX_llx_menu__, '/fourn/facture/list.php?mainmenu=billing&leftmenu=suppliers_bills', 'BillsSuppliers', 0, 'bills', '$user->rights->fournisseur->facture->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->supplier_invoice->enabled', __HANDLER__, 'left', 1601__+MAX_llx_menu__, 'billing', '', 1600__+MAX_llx_menu__, '/fourn/facture/card.php?mainmenu=billing&action=create&leftmenu=suppliers_bills', 'NewBill', 1, 'bills', '$user->rights->fournisseur->facture->creer', '', 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->supplier_invoice->enabled', __HANDLER__, 'left', 1602__+MAX_llx_menu__, 'billing', '', 1600__+MAX_llx_menu__, '/fourn/facture/list.php?mainmenu=billing&leftmenu=suppliers_bills', 'List', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 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 ('', 'isModEnabled("supplier_invoice")', __HANDLER__, 'left', 1600__+MAX_llx_menu__, 'billing', 'supplier_bills', 6__+MAX_llx_menu__, '/fourn/facture/list.php?mainmenu=billing&leftmenu=suppliers_bills', 'BillsSuppliers', 0, 'bills', '$user->rights->fournisseur->facture->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 ('', 'isModEnabled("supplier_invoice")', __HANDLER__, 'left', 1601__+MAX_llx_menu__, 'billing', '', 1600__+MAX_llx_menu__, '/fourn/facture/card.php?mainmenu=billing&action=create&leftmenu=suppliers_bills', 'NewBill', 1, 'bills', '$user->rights->fournisseur->facture->creer', '', 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 ('', 'isModEnabled("supplier_invoice")', __HANDLER__, 'left', 1602__+MAX_llx_menu__, 'billing', '', 1600__+MAX_llx_menu__, '/fourn/facture/list.php?mainmenu=billing&leftmenu=suppliers_bills', 'List', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 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->supplier_invoice->enabled', __HANDLER__, 'left', 1603__+MAX_llx_menu__, 'billing', 'suppliers_bills_payment', 1600__+MAX_llx_menu__, '/fourn/facture/paiement.php?mainmenu=billing&leftmenu=suppliers_bills_payment', 'Payments', 1, 'bills', '$user->rights->fournisseur->facture->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->supplier_invoice->enabled', __HANDLER__, 'left', 1605__+MAX_llx_menu__, 'billing', 'suppliers_bills_reports', 1603__+MAX_llx_menu__, '/fourn/facture/rapport.php?mainmenu=billing&leftmenu=suppliers_bills_reports', 'Reporting', 2, 'bills', '$user->rights->fournisseur->facture->lire', '', 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->supplier_invoice->enabled', __HANDLER__, 'left', 1604__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1600__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&leftmenu=customers_bills_stats&mode=supplier', 'Statistics', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 8, __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 ('', 'isModEnabled("supplier_invoice")', __HANDLER__, 'left', 1603__+MAX_llx_menu__, 'billing', 'suppliers_bills_payment', 1600__+MAX_llx_menu__, '/fourn/facture/paiement.php?mainmenu=billing&leftmenu=suppliers_bills_payment', 'Payments', 1, 'bills', '$user->rights->fournisseur->facture->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 ('', 'isModEnabled("supplier_invoice")', __HANDLER__, 'left', 1605__+MAX_llx_menu__, 'billing', 'suppliers_bills_reports', 1603__+MAX_llx_menu__, '/fourn/facture/rapport.php?mainmenu=billing&leftmenu=suppliers_bills_reports', 'Reporting', 2, 'bills', '$user->rights->fournisseur->facture->lire', '', 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 ('', 'isModEnabled("supplier_invoice")', __HANDLER__, 'left', 1604__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1600__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&leftmenu=customers_bills_stats&mode=supplier', 'Statistics', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 8, __ENTITY__); -- Billing - Customer invoice -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->facture->enabled', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'billing', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->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->facture->enabled', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/card.php?mainmenu=billing&action=create&leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 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->facture->enabled', __HANDLER__, 'left', 1705__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', 'List', 1, 'bills', '$user->rights->facture->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 ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'billing', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->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 ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/card.php?mainmenu=billing&action=create&leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 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 ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1705__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', 'List', 1, 'bills', '$user->rights->facture->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->facture->enabled', __HANDLER__, 'left', 1720__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_draft&search_status=0', 'BillShortStatusDraft', 2, 'bills', '$user->rights->facture->lire', '', 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->facture->enabled', __HANDLER__, 'left', 1721__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_notpaid&search_status=1', 'BillShortStatusNotPaid', 2, 'bills', '$user->rights->facture->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->facture->enabled', __HANDLER__, 'left', 1722__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_paid&search_status=2', 'BillShortStatusPaid', 2, 'bills', '$user->rights->facture->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->facture->enabled', __HANDLER__, 'left', 1723__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_canceled&search_status=3', 'BillShortStatusCanceled', 2, 'bills', '$user->rights->facture->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 ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1720__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_draft&search_status=0', 'BillShortStatusDraft', 2, 'bills', '$user->rights->facture->lire', '', 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 ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1721__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_notpaid&search_status=1', 'BillShortStatusNotPaid', 2, 'bills', '$user->rights->facture->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 ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1722__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_paid&search_status=2', 'BillShortStatusPaid', 2, 'bills', '$user->rights->facture->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 ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1723__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_canceled&search_status=3', 'BillShortStatusCanceled', 2, 'bills', '$user->rights->facture->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->facture->enabled', __HANDLER__, 'left', 1702__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/invoicetemplate_list.php?mainmenu=billing&leftmenu=customers_bills', 'ListOfTemplates', 1, 'bills', '$user->rights->facture->lire', '', 2, 5, __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 ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1702__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/invoicetemplate_list.php?mainmenu=billing&leftmenu=customers_bills', 'ListOfTemplates', 1, 'bills', '$user->rights->facture->lire', '', 2, 5, __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->facture->enabled', __HANDLER__, 'left', 1704__+MAX_llx_menu__, 'billing', 'customers_bills_payment', 1700__+MAX_llx_menu__, '/compta/paiement/list.php?mainmenu=billing&leftmenu=customers_bills_payment', 'Payments', 1, 'bills', '$user->rights->facture->lire', '', 2, 6, __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->facture->enabled', __HANDLER__, 'left', 1710__+MAX_llx_menu__, 'billing', 'customers_bills_reports', 1704__+MAX_llx_menu__, '/compta/paiement/rapport.php?mainmenu=billing&leftmenu=customers_bills_reports', 'Reportings', 2, 'bills', '$user->rights->facture->lire', '', 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->facture->enabled', __HANDLER__, 'left', 1714__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1700__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&leftmenu=customers_bills_stats', 'Statistics', 1, 'bills', '$user->rights->facture->lire', '', 2, 8, __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 ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1704__+MAX_llx_menu__, 'billing', 'customers_bills_payment', 1700__+MAX_llx_menu__, '/compta/paiement/list.php?mainmenu=billing&leftmenu=customers_bills_payment', 'Payments', 1, 'bills', '$user->rights->facture->lire', '', 2, 6, __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 ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1710__+MAX_llx_menu__, 'billing', 'customers_bills_reports', 1704__+MAX_llx_menu__, '/compta/paiement/rapport.php?mainmenu=billing&leftmenu=customers_bills_reports', 'Reportings', 2, 'bills', '$user->rights->facture->lire', '', 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 ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1714__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1700__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&leftmenu=customers_bills_stats', 'Statistics', 1, 'bills', '$user->rights->facture->lire', '', 2, 8, __ENTITY__); -- Billing - Orders to bill -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->commande->enabled', __HANDLER__, 'left', 1900__+MAX_llx_menu__, 'billing', 'orders', 6__+MAX_llx_menu__, '/commande/list.php?mainmenu=billing&leftmenu=orders&search_status=3', 'MenuOrdersToBill', 0, 'orders', '$user->rights->commande->lire', '', 0, 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 ('', 'isModEnabled("commande")', __HANDLER__, 'left', 1900__+MAX_llx_menu__, 'billing', 'orders', 6__+MAX_llx_menu__, '/commande/list.php?mainmenu=billing&leftmenu=orders&search_status=3', 'MenuOrdersToBill', 0, 'orders', '$user->rights->commande->lire', '', 0, 3, __ENTITY__); -- Donations -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->don->enabled', __HANDLER__, 'left', 2000__+MAX_llx_menu__, 'billing', 'donations', 6__+MAX_llx_menu__, '/don/index.php?mainmenu=billing&leftmenu=donations', 'Donations', 0, 'donations', '$user->rights->don->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->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2001__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/card.php?mainmenu=billing&leftmenu=donations&action=create', 'NewDonation', 1, 'donations', '$user->rights->don->creer', '', 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->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2002__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/list.php?mainmenu=billing&leftmenu=donations', 'List', 1, 'donations', '$user->rights->don->lire', '', 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->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2003__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/stats/index.php?mainmenu=billing&leftmenu=donations', 'Statistics', 1, 'donations', '$user->rights->don->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 ('', 'isModEnabled("don")', __HANDLER__, 'left', 2000__+MAX_llx_menu__, 'billing', 'donations', 6__+MAX_llx_menu__, '/don/index.php?mainmenu=billing&leftmenu=donations', 'Donations', 0, 'donations', '$user->rights->don->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 ('', 'isModEnabled("don") && $leftmenu=="donations"', __HANDLER__, 'left', 2001__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/card.php?mainmenu=billing&leftmenu=donations&action=create', 'NewDonation', 1, 'donations', '$user->rights->don->creer', '', 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 ('', 'isModEnabled("don") && $leftmenu=="donations"', __HANDLER__, 'left', 2002__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/list.php?mainmenu=billing&leftmenu=donations', 'List', 1, 'donations', '$user->rights->don->lire', '', 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 ('', 'isModEnabled("don") && $leftmenu=="donations"', __HANDLER__, 'left', 2003__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/stats/index.php?mainmenu=billing&leftmenu=donations', 'Statistics', 1, 'donations', '$user->rights->don->lire', '', 2, 2, __ENTITY__); -- Special expenses -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->tax->enabled || $conf->salaries->enabled || $conf->loan->enabled || isModEnabled("banque")', __HANDLER__, 'left', 2200__+MAX_llx_menu__, 'billing', 'tax', 6__+MAX_llx_menu__, '/compta/charges/index.php?mainmenu=billing&leftmenu=tax', 'MenuTaxesAndSpecialExpenses', 0, 'compta', '(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (isModEnabled("banque") && $user->rights->banque->lire)', '', 0, 6, __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 ('', 'isModEnabled("tax") || isModEnabled("salaries") || isModEnabled("loan") || isModEnabled("banque")', __HANDLER__, 'left', 2200__+MAX_llx_menu__, 'billing', 'tax', 6__+MAX_llx_menu__, '/compta/charges/index.php?mainmenu=billing&leftmenu=tax', 'MenuTaxesAndSpecialExpenses', 0, 'compta', '(isModEnabled("tax") && $user->rights->tax->charges->lire) || (isModEnabled("salaries") && ! empty($user->rights->salaries->read)) || (isModEnabled("loan") && $user->rights->loan->read) || (isModEnabled("banque") && $user->hasRight("banque","lire"))', '', 0, 6, __ENTITY__); -- Social contributions -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->tax->enabled', __HANDLER__, 'left', 2250__+MAX_llx_menu__, 'billing', 'tax_social', 2200__+MAX_llx_menu__, '/compta/sociales/list.php?mainmenu=billing&leftmenu=tax_social', 'SocialContributions', 1, '', '$user->rights->tax->charges->lire', '', 0, 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->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2251__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/card.php?mainmenu=billing&leftmenu=tax_social&action=create', 'MenuNewSocialContribution', 2, '', '$user->rights->tax->charges->creer', '', 0, 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->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2252__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/payments.php?mainmenu=billing&leftmenu=tax_social', 'Payments', 2, '', '$user->rights->tax->charges->lire', '', 0, 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 ('', 'isModEnabled("tax")', __HANDLER__, 'left', 2250__+MAX_llx_menu__, 'billing', 'tax_social', 2200__+MAX_llx_menu__, '/compta/sociales/list.php?mainmenu=billing&leftmenu=tax_social', 'SocialContributions', 1, '', '$user->rights->tax->charges->lire', '', 0, 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 ('', 'isModEnabled("tax") && $leftmenu=="tax_social"', __HANDLER__, 'left', 2251__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/card.php?mainmenu=billing&leftmenu=tax_social&action=create', 'MenuNewSocialContribution', 2, '', '$user->rights->tax->charges->creer', '', 0, 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 ('', 'isModEnabled("tax") && $leftmenu=="tax_social"', __HANDLER__, 'left', 2252__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/payments.php?mainmenu=billing&leftmenu=tax_social', 'Payments', 2, '', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); -- VAT/TVA/IVA -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->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS)', __HANDLER__, 'left', 2300__+MAX_llx_menu__, 'billing', 'tax_vat', 2200__+MAX_llx_menu__, '/compta/tva/list.php?mainmenu=billing&leftmenu=tax_vat', 'VAT', 1, 'companies', '$user->rights->tax->charges->lire', '', 0, 7, __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->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2301__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/card.php?mainmenu=billing&leftmenu=tax_vat&action=create', 'New', 2, 'companies', '$user->rights->tax->charges->creer', '', 0, 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->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2302__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/list.php?mainmenu=billing&leftmenu=tax_vat', 'List', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 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->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2303__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/index.php?mainmenu=billing&leftmenu=tax_vat', 'ReportByMonth', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 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->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2304__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/clients.php?mainmenu=billing&leftmenu=tax_vat', 'ReportByThirdparties', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 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->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2305__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/quadri_detail.php?mainmenu=billing&leftmenu=tax_vat', 'ReportByQuarter', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 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 ('', 'isModEnabled("tax") && empty($conf->global->TAX_DISABLE_VAT_MENUS)', __HANDLER__, 'left', 2300__+MAX_llx_menu__, 'billing', 'tax_vat', 2200__+MAX_llx_menu__, '/compta/tva/list.php?mainmenu=billing&leftmenu=tax_vat', 'VAT', 1, 'companies', '$user->rights->tax->charges->lire', '', 0, 7, __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 ('', 'isModEnabled("tax") && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2301__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/card.php?mainmenu=billing&leftmenu=tax_vat&action=create', 'New', 2, 'companies', '$user->rights->tax->charges->creer', '', 0, 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 ('', 'isModEnabled("tax") && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2302__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/list.php?mainmenu=billing&leftmenu=tax_vat', 'List', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 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 ('', 'isModEnabled("tax") && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2303__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/index.php?mainmenu=billing&leftmenu=tax_vat', 'ReportByMonth', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 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 ('', 'isModEnabled("tax") && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2304__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/clients.php?mainmenu=billing&leftmenu=tax_vat', 'ReportByThirdparties', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 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 ('', 'isModEnabled("tax") && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2305__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/quadri_detail.php?mainmenu=billing&leftmenu=tax_vat', 'ReportByQuarter', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 4, __ENTITY__); -- Salary -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->salaries->enabled', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'billing', 'tax_sal', 6__+MAX_llx_menu__, '/salaries/list.php?mainmenu=billing&leftmenu=tax_salary', 'Salaries', 0, 'salaries', '$user->rights->salaries->read', '', 0, 10, __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->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2211__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/card.php?mainmenu=billing&leftmenu=tax_salary&action=create', 'NewPayment', 1, 'companies', '$user->rights->salaries->write', '', 0, 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->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/list.php?mainmenu=billing&leftmenu=tax_salary', 'Payments', 1, 'companies', '$user->rights->salaries->read', '', 0, 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->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2213__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/stats/index.php?mainmenu=billing&leftmenu=tax_salary', 'Statistics', 1, 'companies', '$user->rights->salaries->read', '', 0, 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 ('', 'isModEnabled("salaries")', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'billing', 'tax_sal', 6__+MAX_llx_menu__, '/salaries/list.php?mainmenu=billing&leftmenu=tax_salary', 'Salaries', 0, 'salaries', '$user->rights->salaries->read', '', 0, 10, __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 ('', 'isModEnabled("salaries") && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2211__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/card.php?mainmenu=billing&leftmenu=tax_salary&action=create', 'NewPayment', 1, 'companies', '$user->rights->salaries->write', '', 0, 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 ('', 'isModEnabled("salaries") && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/list.php?mainmenu=billing&leftmenu=tax_salary', 'Payments', 1, 'companies', '$user->rights->salaries->read', '', 0, 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 ('', 'isModEnabled("salaries") && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2213__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/stats/index.php?mainmenu=billing&leftmenu=tax_salary', 'Statistics', 1, 'companies', '$user->rights->salaries->read', '', 0, 4, __ENTITY__); -- Loan -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->loan->enabled', __HANDLER__, 'left', 2220__+MAX_llx_menu__, 'billing', 'tax_loan', 6__+MAX_llx_menu__, '/loan/list.php?mainmenu=billing&leftmenu=tax_loan', 'Loans', 0, 'loan', '$user->rights->loan->read', '', 0, 20, __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->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2221__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/card.php?mainmenu=billing&leftmenu=tax_loan&action=create', 'NewLoan', 1, 'loan', '$user->rights->loan->write', '', 0, 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->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2222__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/payment/list.php?mainmenu=billing&leftmenu=tax_loan', 'Payments', 1, 'companies', '$user->rights->loan->read', '', 0, 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->loan->enabled && $leftmenu=="tax_loan" && ! empty($conf->global->LOAN_SHOW_CALCULATOR)', __HANDLER__, 'left', 2223__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/calc.php?mainmenu=billing&leftmenu=tax_loan', 'Calculator', 1, 'companies', '$user->rights->loan->calc', '', 0, 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 ('', 'isModEnabled("loan")', __HANDLER__, 'left', 2220__+MAX_llx_menu__, 'billing', 'tax_loan', 6__+MAX_llx_menu__, '/loan/list.php?mainmenu=billing&leftmenu=tax_loan', 'Loans', 0, 'loan', '$user->rights->loan->read', '', 0, 20, __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 ('', 'isModEnabled("loan") && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2221__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/card.php?mainmenu=billing&leftmenu=tax_loan&action=create', 'NewLoan', 1, 'loan', '$user->rights->loan->write', '', 0, 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 ('', 'isModEnabled("loan") && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2222__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/payment/list.php?mainmenu=billing&leftmenu=tax_loan', 'Payments', 1, 'companies', '$user->rights->loan->read', '', 0, 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 ('', 'isModEnabled("loan") && $leftmenu=="tax_loan" && ! empty($conf->global->LOAN_SHOW_CALCULATOR)', __HANDLER__, 'left', 2223__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/calc.php?mainmenu=billing&leftmenu=tax_loan', 'Calculator', 1, 'companies', '$user->rights->loan->calc', '', 0, 4, __ENTITY__); -- Various payments -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("banque") && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)', __HANDLER__, 'left', 2350__+MAX_llx_menu__, 'billing', 'tax_various', 6__+MAX_llx_menu__, '/compta/bank/various_payment/list.php?mainmenu=billing&leftmenu=tax_various', 'MenuVariousPayment', 0, 'banks', '$user->rights->banque->lire', '', 0, 30, __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 ('', 'isModEnabled("banque") && $leftmenu=="tax_various"', __HANDLER__, 'left', 2351__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/compta/bank/various_payment/card.php?mainmenu=billing&leftmenu=tax_various&action=create', 'New', 1, 'various_payment', '$user->rights->banque->modifier', '', 0, 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 ('', 'isModEnabled("banque") && $leftmenu=="tax_various"', __HANDLER__, 'left', 2352__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/compta/bank/various_payment/list.php?mainmenu=billing&leftmenu=tax_various', 'List', 1, 'various_payment', '$user->rights->banque->lire', '', 0, 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 ('', 'isModEnabled("banque") && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)', __HANDLER__, 'left', 2350__+MAX_llx_menu__, 'billing', 'tax_various', 6__+MAX_llx_menu__, '/compta/bank/various_payment/list.php?mainmenu=billing&leftmenu=tax_various', 'MenuVariousPayment', 0, 'banks', '$user->hasRight("banque","lire")', '', 0, 30, __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 ('', 'isModEnabled("banque") && $leftmenu=="tax_various"', __HANDLER__, 'left', 2351__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/compta/bank/various_payment/card.php?mainmenu=billing&leftmenu=tax_various&action=create', 'New', 1, 'various_payment', '$user->hasRight("banque","modifier")', '', 0, 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 ('', 'isModEnabled("banque") && $leftmenu=="tax_various"', __HANDLER__, 'left', 2352__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/compta/bank/various_payment/list.php?mainmenu=billing&leftmenu=tax_various', 'List', 1, 'various_payment', '$user->hasRight("banque","lire")', '', 0, 3, __ENTITY__); -- Accounting (Double entries) -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->accounting->enabled', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'accountancy', 9__+MAX_llx_menu__, '/accountancy/index.php?mainmenu=accountancy&leftmenu=accountancy', 'MenuAccountancy', 0, 'main', '! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire', '', 0, 7, __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 ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'accountancy', 9__+MAX_llx_menu__, '/accountancy/index.php?mainmenu=accountancy&leftmenu=accountancy', 'MenuAccountancy', 0, 'main', 'isModEnabled("accounting") || $user->hasRight("accounting","bind","write") || $user->hasRight("accounting","bind","write") || $user->hasRight("compta","resultat","lire")', '', 0, 7, __ENTITY__); -- Setup -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->accounting->enabled', __HANDLER__, 'left', 2451__+MAX_llx_menu__, 'accountancy', 'accountancy_admin', 2400__+MAX_llx_menu__, '/accountancy/index.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Setup', 1, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 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 ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2451__+MAX_llx_menu__, 'accountancy', 'accountancy_admin', 2400__+MAX_llx_menu__, '/accountancy/index.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Setup', 1, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 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->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2453__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_general', 2451__+MAX_llx_menu__, '/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'General', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 10, __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->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2454__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_journal', 2451__+MAX_llx_menu__, '/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin', 'AccountingJournals', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 20, __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->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2455__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chartmodel', 2451__+MAX_llx_menu__, '/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Pcg_version', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 30, __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->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2456__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chart', 2451__+MAX_llx_menu__, '/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Chartofaccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 40, __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->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2457__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chartsubledger',2451__+MAX_llx_menu__, '/accountancy/admin/subaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'ChartOfSubaccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 41, __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->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2458__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chart_group', 2451__+MAX_llx_menu__, '/accountancy/admin/categories_list.php?id=32&mainmenu=accountancy&leftmenu=accountancy_admin', 'AccountingCategory', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 45, __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->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2459__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_default', 2451__+MAX_llx_menu__, '/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuDefaultAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 50, __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 ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2453__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_general', 2451__+MAX_llx_menu__, '/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'General', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 10, __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 ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2454__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_journal', 2451__+MAX_llx_menu__, '/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin', 'AccountingJournals', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 20, __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 ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2455__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chartmodel', 2451__+MAX_llx_menu__, '/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Pcg_version', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 30, __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 ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2456__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chart', 2451__+MAX_llx_menu__, '/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Chartofaccounts', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 40, __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 ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2457__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chartsubledger',2451__+MAX_llx_menu__, '/accountancy/admin/subaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'ChartOfSubaccounts', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 41, __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 ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2458__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chart_group', 2451__+MAX_llx_menu__, '/accountancy/admin/categories_list.php?id=32&mainmenu=accountancy&leftmenu=accountancy_admin', 'AccountingCategory', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 45, __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 ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2459__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_default', 2451__+MAX_llx_menu__, '/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuDefaultAccounts', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 50, __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->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2460__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_vat', 2451__+MAX_llx_menu__, '/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuBankAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 51, __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 ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2460__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_vat', 2451__+MAX_llx_menu__, '/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuBankAccounts', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 51, __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->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2461__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_vat', 2451__+MAX_llx_menu__, '/admin/dict.php?id=10&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuVatAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 52, __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->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2462__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_tax', 2451__+MAX_llx_menu__, '/admin/dict.php?id=7&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuTaxAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 53, __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->accounting->enabled && $conf->expensereport->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2463__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_expensereport', 2451__+MAX_llx_menu__, '/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuExpenseReportAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 54, __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->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2464__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_product', 2451__+MAX_llx_menu__, '/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuProductsAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 55, __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 ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2461__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_vat', 2451__+MAX_llx_menu__, '/admin/dict.php?id=10&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuVatAccounts', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 52, __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 ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2462__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_tax', 2451__+MAX_llx_menu__, '/admin/dict.php?id=7&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuTaxAccounts', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 53, __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 ('', 'isModEnabled("accounting") && isModEnabled("expensereport") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2463__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_expensereport', 2451__+MAX_llx_menu__, '/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuExpenseReportAccounts', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 54, __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 ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2464__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_product', 2451__+MAX_llx_menu__, '/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuProductsAccounts', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 55, __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->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2465__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_export', 2451__+MAX_llx_menu__, '/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'ExportOptions', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 60, __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->accounting->enabled && $leftmenu=="accountancy_admin" && $conf->global->MAIN_FEATURES_LEVEL > 1', __HANDLER__, 'left', 2466__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_closure', 2451__+MAX_llx_menu__, '/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuClosureAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 70, __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 ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2465__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_export', 2451__+MAX_llx_menu__, '/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'ExportOptions', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 60, __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 ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin" && $conf->global->MAIN_FEATURES_LEVEL > 1', __HANDLER__, 'left', 2466__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_closure', 2451__+MAX_llx_menu__, '/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuClosureAccounts', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 70, __ENTITY__); -- Accounting period -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->accounting->enabled && $leftmenu=="accountancy_admin" && $conf->global->MAIN_FEATURES_LEVEL > 0', __HANDLER__, 'left', 2450__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_period', 2451__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'FiscalPeriod', 1, 'admin', '', '', 2, 80, __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 ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin" && $conf->global->MAIN_FEATURES_LEVEL > 0', __HANDLER__, 'left', 2450__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_period', 2451__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'FiscalPeriod', 1, 'admin', '', '', 2, 80, __ENTITY__); -- Binding -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->accounting->enabled && $conf->facture->enabled && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 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->accounting->enabled && $conf->facture->enabled && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 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->accounting->enabled && $conf->facture->enabled && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2403__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 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->accounting->enabled && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)', __HANDLER__, 'left', 2410__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_supplier', 2400__+MAX_llx_menu__, '/accountancy/supplier/index.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier', 'SuppliersVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 5, __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->accounting->enabled && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES) && $leftmenu=="accountancy_dispatch_supplier"', __HANDLER__, 'left', 2411__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 6, __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->accounting->enabled && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES) && $leftmenu=="accountancy_dispatch_supplier"', __HANDLER__, 'left', 2412__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 7, __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->accounting->enabled && $conf->expensereport->enabled && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)', __HANDLER__, 'left', 2420__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_expensereport', 2400__+MAX_llx_menu__, '/accountancy/expensereport/index.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport', 'ExpenseReportsVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 5, __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->accounting->enabled && $conf->expensereport->enabled && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS) && $leftmenu=="accountancy_dispatch_expensereport"', __HANDLER__, 'left', 2421__+MAX_llx_menu__, 'accountancy', '', 2420__+MAX_llx_menu__, '/accountancy/expensereport/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 6, __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->accounting->enabled && $conf->expensereport->enabled && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS) && $leftmenu=="accountancy_dispatch_expensereport"', __HANDLER__, 'left', 2422__+MAX_llx_menu__, 'accountancy', '', 2420__+MAX_llx_menu__, '/accountancy/expensereport/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 7, __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 ('', 'isModEnabled("accounting") && isModEnabled("facture") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 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 ('', 'isModEnabled("accounting") && isModEnabled("facture") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 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 ('', 'isModEnabled("accounting") && isModEnabled("facture") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2403__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 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 ('', 'isModEnabled("accounting") && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)', __HANDLER__, 'left', 2410__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_supplier', 2400__+MAX_llx_menu__, '/accountancy/supplier/index.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier', 'SuppliersVentilation', 1, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 5, __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 ('', 'isModEnabled("accounting") && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES) && $leftmenu=="accountancy_dispatch_supplier"', __HANDLER__, 'left', 2411__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 6, __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 ('', 'isModEnabled("accounting") && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES) && $leftmenu=="accountancy_dispatch_supplier"', __HANDLER__, 'left', 2412__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 7, __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 ('', 'isModEnabled("accounting") && isModEnabled("expensereport") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)', __HANDLER__, 'left', 2420__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_expensereport', 2400__+MAX_llx_menu__, '/accountancy/expensereport/index.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport', 'ExpenseReportsVentilation', 1, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 5, __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 ('', 'isModEnabled("accounting") && isModEnabled("expensereport") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS) && $leftmenu=="accountancy_dispatch_expensereport"', __HANDLER__, 'left', 2421__+MAX_llx_menu__, 'accountancy', '', 2420__+MAX_llx_menu__, '/accountancy/expensereport/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 6, __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 ('', 'isModEnabled("accounting") && isModEnabled("expensereport") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS) && $leftmenu=="accountancy_dispatch_expensereport"', __HANDLER__, 'left', 2422__+MAX_llx_menu__, 'accountancy', '', 2420__+MAX_llx_menu__, '/accountancy/expensereport/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 7, __ENTITY__); -- Export accounting documents -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->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2436__+MAX_llx_menu__, 'accountancy', 'accountancy_files', 2400__+MAX_llx_menu__, '/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files', 'AccountantFiles', 1, 'accountancy', '$user->rights->compta->resultat->lire || $user->rights->accounting->mouvements->lire', '', 0, 16, __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 ('', 'isModEnabled("comptabilite") || isModEnabled("accounting")', __HANDLER__, 'left', 2436__+MAX_llx_menu__, 'accountancy', 'accountancy_files', 2400__+MAX_llx_menu__, '/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files', 'AccountantFiles', 1, 'accountancy', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","mouvements","lire")', '', 0, 16, __ENTITY__); -- Journals ---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->accounting->enabled', __HANDLER__, 'left', 2705__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '', 'Journalization', 1, 'main', '$user->rights->accounting->comptarapport->lire', '', 0, 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->accounting->enabled', __HANDLER__, 'left', 2707__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/bankjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=3', 'BankJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 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->accounting->enabled', __HANDLER__, 'left', 2708__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/expensereportsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=6', 'ExpenseReportJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 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->accounting->enabled', __HANDLER__, 'left', 2709__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/purchasesjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=2', 'PurchasesJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 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->accounting->enabled', __HANDLER__, 'left', 2706__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/sellsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=1', 'SellsJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 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 ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2705__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '', 'Journalization', 1, 'main', '$user->hasRight("accounting","comptarapport","lire")', '', 0, 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 ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2707__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/bankjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=3', 'BankJournal', 2, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 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 ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2708__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/expensereportsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=6', 'ExpenseReportJournal', 2, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 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 ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2709__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/purchasesjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=2', 'PurchasesJournal', 2, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 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 ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2706__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/sellsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=1', 'SellsJournal', 2, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 4, __ENTITY__); -- Balance -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->accounting->enabled', __HANDLER__, 'left', 2430__+MAX_llx_menu__, 'accountancy', 'balance', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance', 'AccountBalance', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 10, __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 ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2430__+MAX_llx_menu__, 'accountancy', 'balance', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance', 'AccountBalance', 1, 'accountancy', '$user->hasRight("accounting","mouvements","lire")', '', 0, 10, __ENTITY__); -- General Ledger -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->accounting->enabled', __HANDLER__, 'left', 2432__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_bookeeping', 'Bookkeeping', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 12, __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 ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2432__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_bookkeeping', 'Bookkeeping', 1, 'accountancy', '$user->hasRight("accounting","mouvements","lire")', '', 0, 12, __ENTITY__); -- Journals -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->accounting->enabled', __HANDLER__, 'left', 2434__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_bookeeping', 'Journals', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 15, __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 ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2433__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_bookkeeping', 'Journals', 1, 'accountancy', '$user->hasRight("accounting","mouvements","lire")', '', 0, 13, __ENTITY__); + +-- Export accountancy +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2435__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/export.php?mainmenu=accountancy&leftmenu=accountancy_bookkeeping', 'MenuExportAccountancy', 1, 'accountancy', '$user->hasRight("accounting","mouvements","lire")', '', 0, 15, __ENTITY__); -- Closure -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->accounting->enabled', __HANDLER__, 'left', 2437__+MAX_llx_menu__, 'accountancy', 'accountancy_closure', 2400__+MAX_llx_menu__, '/accountancy/closure/index.php?mainmenu=accountancy&leftmenu=accountancy_closure', 'MenuAccountancyClosure', 1, 'accountancy', '$user->rights->accounting->fiscalyear->write', '', 0, 17, __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 ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2437__+MAX_llx_menu__, 'accountancy', 'accountancy_closure', 2400__+MAX_llx_menu__, '/accountancy/closure/index.php?mainmenu=accountancy&leftmenu=accountancy_closure', 'MenuAccountancyClosure', 1, 'accountancy', '$user->hasRight("accounting","fiscalyear","write")', '', 0, 16, __ENTITY__); -- Reports -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->accounting->enabled', __HANDLER__, 'left', 2440__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2400__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'Reportings', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 17, __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->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2441__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'MenuReportInOut', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 18, __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->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2443__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByPredefinedAccountGroups', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 19, __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->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2442__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/result.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByPersonalizedAccountGroups', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 20, __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->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2444__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/stats/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ReportTurnover', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 21, __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->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2445__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/casoc.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByCompanies', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 22, __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->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2446__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/cabyuser.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByUsers', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 23, __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->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2447__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByProductsAndServices', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 24, __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 ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2440__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2400__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'Reportings', 1, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 17, __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 ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2441__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'MenuReportInOut', 2, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 18, __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 ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2443__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByPredefinedAccountGroups', 3, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 19, __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 ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2442__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/result.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByPersonalizedAccountGroups', 3, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 20, __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 ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2444__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/stats/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ReportTurnover', 2, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 21, __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 ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2445__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/casoc.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByCompanies', 3, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 22, __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 ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2446__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/cabyuser.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByUsers', 3, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 23, __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 ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2447__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByProductsAndServices', 3, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 24, __ENTITY__); -- Accounting simple -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->comptabilite->enabled', __HANDLER__, 'left', 2700__+MAX_llx_menu__, 'accountancy', 'ca', 9__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=ca', 'Reportings', 0, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 11, __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->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2711__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=ca', 'MenuReportInOut', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 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->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2712__+MAX_llx_menu__, 'accountancy', '', 2701__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?mainmenu=accountancy&leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 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->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2713__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/stats/index.php?mainmenu=accountancy&leftmenu=ca', 'ReportTurnover', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 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->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2714__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/casoc.php?mainmenu=accountancy&leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 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->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2715__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyuser.php?mainmenu=accountancy&leftmenu=ca', 'ByUsers', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 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->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2716__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?mainmenu=accountancy&leftmenu=ca', 'ByProductsAndServices', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 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 ('', 'isModEnabled("comptabilite")', __HANDLER__, 'left', 2700__+MAX_llx_menu__, 'accountancy', 'ca', 9__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=ca', 'Reportings', 0, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 11, __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 ('', 'isModEnabled("comptabilite") && $leftmenu=="ca"', __HANDLER__, 'left', 2711__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=ca', 'MenuReportInOut', 1, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 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 ('', 'isModEnabled("comptabilite") && $leftmenu=="ca"', __HANDLER__, 'left', 2712__+MAX_llx_menu__, 'accountancy', '', 2701__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?mainmenu=accountancy&leftmenu=ca', 'ByCompanies', 2, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 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 ('', 'isModEnabled("comptabilite") && $leftmenu=="ca"', __HANDLER__, 'left', 2713__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/stats/index.php?mainmenu=accountancy&leftmenu=ca', 'ReportTurnover', 1, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 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 ('', 'isModEnabled("comptabilite") && $leftmenu=="ca"', __HANDLER__, 'left', 2714__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/casoc.php?mainmenu=accountancy&leftmenu=ca', 'ByCompanies', 2, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 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 ('', 'isModEnabled("comptabilite") && $leftmenu=="ca"', __HANDLER__, 'left', 2715__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyuser.php?mainmenu=accountancy&leftmenu=ca', 'ByUsers', 2, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 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 ('', 'isModEnabled("comptabilite") && $leftmenu=="ca"', __HANDLER__, 'left', 2716__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?mainmenu=accountancy&leftmenu=ca', 'ByProductsAndServices', 2, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 1, __ENTITY__); -- Assets -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->asset->enabled', __HANDLER__, 'left', 3000__+MAX_llx_menu__, 'accountancy', 'asset', 9__+MAX_llx_menu__, '/asset/list.php?mainmenu=accountancy&leftmenu=asset', 'MenuAssets', 1, 'assets', '$user->rights->asset->read', '', 0, 20, __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->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3001__+MAX_llx_menu__, 'asset', '', 3000__+MAX_llx_menu__, '/asset/card.php?mainmenu=accountancy&leftmenu=asset&action=create', 'MenuNewAsset', 2, 'assets', '$user->rights->asset->write', '', 0, 21, __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->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3003__+MAX_llx_menu__, 'asset', '', 3000__+MAX_llx_menu__, '/asset/list.php?mainmenu=accountancy&leftmenu=asset', 'MenuListAssets', 2, 'assets', '$user->rights->asset->read', '', 0, 22, __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->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3004__+MAX_llx_menu__, 'asset', 'asset_type', 3000__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy&leftmenu=asset', 'MenuTypeAssets', 2, 'assets', '($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->asset->model_advance->read:$user->rights->asset->read)', '', 0, 23, __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->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3005__+MAX_llx_menu__, 'asset', '', 3004__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy&action=create', 'MenuNewTypeAssets', 3, 'assets', '($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->asset->model_advance->write:$user->rights->asset->write)', '', 0, 24, __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->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3006__+MAX_llx_menu__, 'asset', '', 3004__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy', 'MenuListTypeAssets', 3, 'assets', '($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->asset->model_advance->read:$user->rights->asset->read)', '', 0, 25, __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 ('', 'isModEnabled("asset")', __HANDLER__, 'left', 3000__+MAX_llx_menu__, 'accountancy', 'asset', 9__+MAX_llx_menu__, '/asset/list.php?mainmenu=accountancy&leftmenu=asset', 'MenuAssets', 1, 'assets', '$user->hasRight("asset","read")', '', 0, 20, __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 ('', 'isModEnabled("asset") && $leftmenu=="asset"', __HANDLER__, 'left', 3001__+MAX_llx_menu__, 'asset', '', 3000__+MAX_llx_menu__, '/asset/card.php?mainmenu=accountancy&leftmenu=asset&action=create', 'MenuNewAsset', 2, 'assets', '$user->hasRight("asset","write")', '', 0, 21, __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 ('', 'isModEnabled("asset") && $leftmenu=="asset"', __HANDLER__, 'left', 3003__+MAX_llx_menu__, 'asset', '', 3000__+MAX_llx_menu__, '/asset/list.php?mainmenu=accountancy&leftmenu=asset', 'MenuListAssets', 2, 'assets', '$user->hasRight("asset","read")', '', 0, 22, __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 ('', 'isModEnabled("asset") && $leftmenu=="asset"', __HANDLER__, 'left', 3004__+MAX_llx_menu__, 'asset', 'asset_type', 3000__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy&leftmenu=asset', 'MenuTypeAssets', 2, 'assets', '($conf->global->MAIN_USE_ADVANCED_PERMS?$user->hasRight("asset","model_advance","read"):$user->hasRight("asset","read"))', '', 0, 23, __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 ('', 'isModEnabled("asset") && $leftmenu=="asset"', __HANDLER__, 'left', 3005__+MAX_llx_menu__, 'asset', '', 3004__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy&action=create', 'MenuNewTypeAssets', 3, 'assets', '($conf->global->MAIN_USE_ADVANCED_PERMS?$user->hasRight("asset","model_advance","write"):$user->hasRight("asset","write"))', '', 0, 24, __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 ('', 'isModEnabled("asset") && $leftmenu=="asset"', __HANDLER__, 'left', 3006__+MAX_llx_menu__, 'asset', '', 3004__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy', 'MenuListTypeAssets', 3, 'assets', '($conf->global->MAIN_USE_ADVANCED_PERMS?$user->hasRight("asset","model_advance","read"):$user->hasRight("asset","read"))', '', 0, 25, __ENTITY__); -- Check deposit -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque") && (isModEnabled("facture") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1711__+MAX_llx_menu__, 'accountancy', 'checks', 14__+MAX_llx_menu__, '/compta/paiement/cheque/index.php?mainmenu=bank&leftmenu=checks', 'MenuChequeDeposits', 0, 'bills', '$user->rights->banque->lire', '', 2, 9, __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 ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque")pty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1712__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/card.php?mainmenu=bank&leftmenu=checks&action=new', 'NewCheckDeposit', 1, 'compta', '$user->rights->banque->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 ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque") && (isModEnabled("facture") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1713__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/list.php?mainmenu=bank&leftmenu=checks', 'List', 1, 'bills', '$user->rights->banque->lire', '', 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 ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque") && (isModEnabled("facture") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1711__+MAX_llx_menu__, 'accountancy', 'checks', 14__+MAX_llx_menu__, '/compta/paiement/cheque/index.php?mainmenu=bank&leftmenu=checks', 'MenuChequeDeposits', 0, 'bills', '$user->hasRight("banque","lire")', '', 2, 9, __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 ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque") && (isModEnabled("facture")) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1712__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/card.php?mainmenu=bank&leftmenu=checks&action=new', 'NewCheckDeposit', 1, 'compta', '$user->hasRight("banque","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 ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque") && (isModEnabled("facture") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1713__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/list.php?mainmenu=bank&leftmenu=checks', 'List', 1, 'bills', '$user->hasRight("banque","lire")', '', 2, 1, __ENTITY__); -- PaymentByDirectDebit -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement")', __HANDLER__, 'left', 2500__+MAX_llx_menu__, 'accountancy', 'withdraw', 14__+MAX_llx_menu__, '/compta/prelevement/index.php?mainmenu=bank&leftmenu=withdraw', 'PaymentByDirectDebit', 0, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 9, __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 ('', 'isModEnabled("prelevement") && $leftmenu=="withdraw"', __HANDLER__, 'left', 2502__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/create.php?mainmenu=bank&leftmenu=withdraw', 'NewStandingOrder', 1, 'withdrawals', '$user->rights->prelevement->bons->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 ('', 'isModEnabled("prelevement") && $leftmenu=="withdraw"', __HANDLER__, 'left', 2503__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/orders_list.php?mainmenu=bank&leftmenu=withdraw', 'WithdrawalsReceipts', 1, 'withdrawals', '$user->rights->prelevement->bons->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 ('', 'isModEnabled("prelevement") && $leftmenu=="withdraw"', __HANDLER__, 'left', 2504__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/list.php?mainmenu=bank&leftmenu=withdraw', 'WithdrawalsLines', 1, 'withdrawals', '$user->rights->prelevement->bons->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 ('', 'isModEnabled("prelevement") && $leftmenu=="withdraw"', __HANDLER__, 'left', 2506__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/rejets.php?mainmenu=bank&leftmenu=withdraw', 'Rejects', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 5, __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 ('', 'isModEnabled("prelevement") && $leftmenu=="withdraw"', __HANDLER__, 'left', 2507__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/stats.php?mainmenu=bank&leftmenu=withdraw', 'Statistics', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 6, __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 ('', 'isModEnabled("prelevement")', __HANDLER__, 'left', 2500__+MAX_llx_menu__, 'accountancy', 'withdraw', 14__+MAX_llx_menu__, '/compta/prelevement/index.php?mainmenu=bank&leftmenu=withdraw', 'PaymentByDirectDebit', 0, 'withdrawals', '$user->hasRight("prelevement","bons","lire")', '', 2, 9, __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 ('', 'isModEnabled("prelevement") && $leftmenu=="withdraw"', __HANDLER__, 'left', 2502__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/create.php?mainmenu=bank&leftmenu=withdraw', 'NewStandingOrder', 1, 'withdrawals', '$user->hasRight("prelevement","bons","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 ('', 'isModEnabled("prelevement") && $leftmenu=="withdraw"', __HANDLER__, 'left', 2503__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/orders_list.php?mainmenu=bank&leftmenu=withdraw', 'WithdrawalsReceipts', 1, 'withdrawals', '$user->hasRight("prelevement","bons","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 ('', 'isModEnabled("prelevement") && $leftmenu=="withdraw"', __HANDLER__, 'left', 2504__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/list.php?mainmenu=bank&leftmenu=withdraw', 'WithdrawalsLines', 1, 'withdrawals', '$user->hasRight("prelevement","bons","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 ('', 'isModEnabled("prelevement") && $leftmenu=="withdraw"', __HANDLER__, 'left', 2506__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/rejets.php?mainmenu=bank&leftmenu=withdraw', 'Rejects', 1, 'withdrawals', '$user->hasRight("prelevement","bons","lire")', '', 2, 5, __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 ('', 'isModEnabled("prelevement") && $leftmenu=="withdraw"', __HANDLER__, 'left', 2507__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/stats.php?mainmenu=bank&leftmenu=withdraw', 'Statistics', 1, 'withdrawals', '$user->hasRight("prelevement","bons","lire")', '', 2, 6, __ENTITY__); -- PaymentByCreditTransfer -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement")', __HANDLER__, 'left', 2510__+MAX_llx_menu__, 'accountancy', 'banktransfer', 14__+MAX_llx_menu__, '/compta/prelevement/index.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'PaymentByBankTransfer', 0, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 9, __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 ('', 'isModEnabled("prelevement") && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2512__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/create.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'NewStandingOrder', 1, 'withdrawals', '$user->rights->prelevement->bons->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 ('', 'isModEnabled("prelevement") && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2513__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/orders_list.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'WithdrawalsReceipts', 1, 'withdrawals', '$user->rights->prelevement->bons->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 ('', 'isModEnabled("prelevement") && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2514__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/list.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'WithdrawalsLines', 1, 'withdrawals', '$user->rights->prelevement->bons->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 ('', 'isModEnabled("prelevement") && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2516__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/rejets.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'Rejects', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 5, __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 ('', 'isModEnabled("prelevement") && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2517__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/stats.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'Statistics', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 6, __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 ('', 'isModEnabled("prelevement")', __HANDLER__, 'left', 2510__+MAX_llx_menu__, 'accountancy', 'banktransfer', 14__+MAX_llx_menu__, '/compta/prelevement/index.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'PaymentByBankTransfer', 0, 'withdrawals', '$user->hasRight("prelevement","bons","lire")', '', 2, 9, __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 ('', 'isModEnabled("prelevement") && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2512__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/create.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'NewStandingOrder', 1, 'withdrawals', '$user->hasRight("prelevement","bons","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 ('', 'isModEnabled("prelevement") && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2513__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/orders_list.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'WithdrawalsReceipts', 1, 'withdrawals', '$user->hasRight("prelevement","bons","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 ('', 'isModEnabled("prelevement") && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2514__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/list.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'WithdrawalsLines', 1, 'withdrawals', '$user->hasRight("prelevement","bons","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 ('', 'isModEnabled("prelevement") && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2516__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/rejets.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'Rejects', 1, 'withdrawals', '$user->hasRight("prelevement","bons","lire")', '', 2, 5, __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 ('', 'isModEnabled("prelevement") && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2517__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/stats.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'Statistics', 1, 'withdrawals', '$user->hasRight("prelevement","bons","lire")', '', 2, 6, __ENTITY__); -- Bank -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("banque")', __HANDLER__, 'left', 2600__+MAX_llx_menu__, 'accountancy', 'bank', 14__+MAX_llx_menu__, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', 0, 'banks', '$user->rights->banque->lire', '', 0, 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 ('', 'isModEnabled("banque") && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2601__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/card.php?mainmenu=bank&action=create&leftmenu=bank', 'MenuNewFinancialAccount', 1, 'banks', '$user->rights->banque->configurer', '', 0, 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 ('', 'isModEnabled("banque") && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2602__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/categ.php?mainmenu=bank&leftmenu=bank', 'Rubriques', 1, 'categories', '$user->rights->banque->configurer', '', 0, 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 ('', 'isModEnabled("banque") && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2603__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/bankentries_list.php?mainmenu=bank&leftmenu=bank', 'ListTransactions', 1, 'banks', '$user->rights->banque->lire', '', 0, 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 ('', 'isModEnabled("banque") && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2604__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/budget.php?mainmenu=bank&leftmenu=bank', 'ListTransactionsByCategory', 1, 'banks', '$user->rights->banque->lire', '', 0, 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 ('', 'isModEnabled("banque") && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2606__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/transfer.php?mainmenu=bank&leftmenu=bank', 'BankTransfers', 1, 'banks', '$user->rights->banque->transfer', '', 0, 5, __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 ('', 'isModEnabled("banque")', __HANDLER__, 'left', 2600__+MAX_llx_menu__, 'accountancy', 'bank', 14__+MAX_llx_menu__, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', 0, 'banks', '$user->hasRight("banque","lire")', '', 0, 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 ('', 'isModEnabled("banque") && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2601__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/card.php?mainmenu=bank&action=create&leftmenu=bank', 'MenuNewFinancialAccount', 1, 'banks', '$user->hasRight("banque","configurer")', '', 0, 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 ('', 'isModEnabled("banque") && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2602__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/categ.php?mainmenu=bank&leftmenu=bank', 'Rubriques', 1, 'categories', '$user->hasRight("banque","configurer")', '', 0, 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 ('', 'isModEnabled("banque") && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2603__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/bankentries_list.php?mainmenu=bank&leftmenu=bank', 'ListTransactions', 1, 'banks', '$user->hasRight("banque","lire")', '', 0, 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 ('', 'isModEnabled("banque") && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2604__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/budget.php?mainmenu=bank&leftmenu=bank', 'ListTransactionsByCategory', 1, 'banks', '$user->hasRight("banque","lire")', '', 0, 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 ('', 'isModEnabled("banque") && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2606__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/transfer.php?mainmenu=bank&leftmenu=bank', 'BankTransfers', 1, 'banks', '$user->hasRight("banque","transfer")', '', 0, 5, __ENTITY__); -- Bank - 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', 2650__+MAX_llx_menu__, 'accountancy', 'cat', 14__+MAX_llx_menu__, '/categories/index.php?mainmenu=bank&leftmenu=bank&type=5', 'Categories', 0, 'categories', '$user->rights->categorie->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->categorie->enabled', __HANDLER__, 'left', 2651__+MAX_llx_menu__, 'accountancy', '', 2650__+MAX_llx_menu__, '/categories/card.php?mainmenu=bank&leftmenu=bank&action=create&type=5', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 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 ('', 'isModEnabled("categorie")', __HANDLER__, 'left', 2650__+MAX_llx_menu__, 'accountancy', 'cat', 14__+MAX_llx_menu__, '/categories/index.php?mainmenu=bank&leftmenu=bank&type=5', 'Categories', 0, 'categories', '$user->hasRight("categorie","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 ('', 'isModEnabled("categorie")', __HANDLER__, 'left', 2651__+MAX_llx_menu__, 'accountancy', '', 2650__+MAX_llx_menu__, '/categories/card.php?mainmenu=bank&leftmenu=bank&action=create&type=5', 'NewCategory', 1, 'categories', '$user->hasRight("categorie","creer")', '', 2, 0, __ENTITY__); -- 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->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 ('', 'isModEnabled("project")', __HANDLER__, 'left', 3600__+MAX_llx_menu__, 'project', 'projects', 7__+MAX_llx_menu__, '/projet/index.php?mainmenu=project&leftmenu=projects', 'LeadsOrProjects', 0, 'projects', '$user->hasRight("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 ('', 'isModEnabled("project")', __HANDLER__, 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/card.php?mainmenu=project&leftmenu=projects&action=create', 'New', 1, 'projects', '$user->hasRight("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 ('', 'isModEnabled("project")', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects', 'List', 1, 'projects', '$user->hasRight("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 ('', 'isModEnabled("project") && $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->hasRight("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 ('', 'isModEnabled("project") && $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->hasRight("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 ('', 'isModEnabled("project")', __HANDLER__, 'left', 3605__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/stats/index.php?mainmenu=project&leftmenu=projects', 'Statistics', 1, 'projects', '$user->hasRight("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', 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 ('', 'isModEnabled("project") && !$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->hasRight("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 ('', 'isModEnabled("project") && !$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->hasRight("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 ('', 'isModEnabled("project") && !$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->hasRight("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 ('', 'isModEnabled("project") && !$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->hasRight("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', 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 ('', 'isModEnabled("project") && !$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->hasRight("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__); -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', 3805__+MAX_llx_menu__, 'project', '', 3804__+MAX_llx_menu__, '/categories/card.php?mainmenu=project&action=create&type=6', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 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 ('', 'isModEnabled("categorie")', __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->hasRight("categorie","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 ('', 'isModEnabled("categorie")', __HANDLER__, 'left', 3805__+MAX_llx_menu__, 'project', '', 3804__+MAX_llx_menu__, '/categories/card.php?mainmenu=project&action=create&type=6', 'NewCategory', 1, 'categories', '$user->hasRight("categorie","creer")', '', 2, 0, __ENTITY__); -- BOM -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->bom->enabled', __HANDLER__, 'left', 5400__+MAX_llx_menu__, 'mrp', 'bom', 16__+MAX_llx_menu__, '/bom/bom_list.php?mainmenu=mrp&leftmenu=bom', 'MenuBOM', 1, 'mrp', '$user->rights->bom->read', '', 0, 20, __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->bom->enabled', __HANDLER__, 'left', 5401__+MAX_llx_menu__, 'mrp', '', 5400__+MAX_llx_menu__, '/bom/bom_card.php?mainmenu=mrp&leftmenu=bom&action=create', 'NewBOM', 2, 'mrp', '$user->rights->bom->write', '', 0, 21, __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->bom->enabled', __HANDLER__, 'left', 5403__+MAX_llx_menu__, 'mrp', '', 5400__+MAX_llx_menu__, '/bom/bom_list.php?mainmenu=mrp&leftmenu=bom', 'List', 2, 'mrp', '$user->rights->bom->read', '', 0, 22, __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 ('', 'isModEnabled("bom")', __HANDLER__, 'left', 5400__+MAX_llx_menu__, 'mrp', 'bom', 16__+MAX_llx_menu__, '/bom/bom_list.php?mainmenu=mrp&leftmenu=bom', 'MenuBOM', 1, 'mrp', '$user->hasRight("bom","read")', '', 0, 20, __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 ('', 'isModEnabled("bom")', __HANDLER__, 'left', 5401__+MAX_llx_menu__, 'mrp', '', 5400__+MAX_llx_menu__, '/bom/bom_card.php?mainmenu=mrp&leftmenu=bom&action=create', 'NewBOM', 2, 'mrp', '$user->hasRight("bom","write")', '', 0, 21, __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 ('', 'isModEnabled("bom")', __HANDLER__, 'left', 5403__+MAX_llx_menu__, 'mrp', '', 5400__+MAX_llx_menu__, '/bom/bom_list.php?mainmenu=mrp&leftmenu=bom', 'List', 2, 'mrp', '$user->hasRight("bom","read")', '', 0, 22, __ENTITY__); -- MRP/MO -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->bom->enabled', __HANDLER__, 'left', 5450__+MAX_llx_menu__, 'mrp', 'mrp', 16__+MAX_llx_menu__, '/mrp/mo_list.php?mainmenu=mrp&leftmenu=mrp', 'MenuMRP', 1, 'mrp', '$user->rights->mrp->read', '', 0, 20, __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->bom->enabled', __HANDLER__, 'left', 5451__+MAX_llx_menu__, 'mrp', '', 5450__+MAX_llx_menu__, '/mrp/mo_card.php?mainmenu=mrp&leftmenu=mrp&action=create', 'NewMO', 2, 'mrp', '$user->rights->mrp->write', '', 0, 21, __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->bom->enabled', __HANDLER__, 'left', 5453__+MAX_llx_menu__, 'mrp', '', 5450__+MAX_llx_menu__, '/mrp/mo_list.php?mainmenu=mrp&leftmenu=mrp', 'List', 2, 'mrp', '$user->rights->mrp->read', '', 0, 22, __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 ('', 'isModEnabled("bom")', __HANDLER__, 'left', 5450__+MAX_llx_menu__, 'mrp', 'mrp', 16__+MAX_llx_menu__, '/mrp/mo_list.php?mainmenu=mrp&leftmenu=mrp', 'MenuMRP', 1, 'mrp', '$user->hasRight("mrp","read")', '', 0, 20, __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 ('', 'isModEnabled("bom")', __HANDLER__, 'left', 5451__+MAX_llx_menu__, 'mrp', '', 5450__+MAX_llx_menu__, '/mrp/mo_card.php?mainmenu=mrp&leftmenu=mrp&action=create', 'NewMO', 2, 'mrp', '$user->hasRight("mrp","write")', '', 0, 21, __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 ('', 'isModEnabled("bom")', __HANDLER__, 'left', 5453__+MAX_llx_menu__, 'mrp', '', 5450__+MAX_llx_menu__, '/mrp/mo_list.php?mainmenu=mrp&leftmenu=mrp', 'List', 2, 'mrp', '$user->hasRight("mrp","read")', '', 0, 22, __ENTITY__); -- Tools insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($user->socid)', __HANDLER__, 'left', 3900__+MAX_llx_menu__, 'tools', 'email_templates', 8__+MAX_llx_menu__, '/admin/mails_templates.php?mainmenu=tools&leftmenu=email_templates', 'EMailTemplates', 0, '', '', '', 0, 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 ('', 'isModEnabled("mailing")', __HANDLER__, 'left', 3910__+MAX_llx_menu__, 'tools', 'mailing', 8__+MAX_llx_menu__, '/comm/mailing/index.php?mainmenu=tools&leftmenu=mailing', 'EMailings', 0, 'mails', '$user->rights->mailing->lire', '', 0, 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 ('', 'isModEnabled("mailing")', __HANDLER__, 'left', 3911__+MAX_llx_menu__, 'tools', '', 3910__+MAX_llx_menu__, '/comm/mailing/card.php?mainmenu=tools&leftmenu=mailing&action=create', 'NewMailing', 1, 'mails', '$user->rights->mailing->creer', '', 0, 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 ('', 'isModEnabled("mailing")', __HANDLER__, 'left', 3912__+MAX_llx_menu__, 'tools', '', 3910__+MAX_llx_menu__, '/comm/mailing/list.php?mainmenu=tools&leftmenu=mailing', 'List', 1, 'mails', '$user->rights->mailing->lire', '', 0, 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->export->enabled', __HANDLER__, 'left', 4100__+MAX_llx_menu__, 'tools', 'export', 8__+MAX_llx_menu__, '/exports/index.php?mainmenu=tools&leftmenu=export', 'FormatedExport', 0, 'exports', '$user->rights->export->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->export->enabled', __HANDLER__, 'left', 4101__+MAX_llx_menu__, 'tools', '', 4100__+MAX_llx_menu__, '/exports/export.php?mainmenu=tools&leftmenu=export', 'NewExport', 1, 'exports', '$user->rights->export->creer', '', 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->import->enabled', __HANDLER__, 'left', 4130__+MAX_llx_menu__, 'tools', 'import', 8__+MAX_llx_menu__, '/imports/index.php?mainmenu=tools&leftmenu=import', 'FormatedImport', 0, 'exports', '$user->rights->import->run', '', 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->import->enabled', __HANDLER__, 'left', 4131__+MAX_llx_menu__, 'tools', '', 4130__+MAX_llx_menu__, '/imports/import.php?mainmenu=tools&leftmenu=import', 'NewImport', 1, 'exports', '$user->rights->import->run', '', 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 ('', 'isModEnabled("mailing")', __HANDLER__, 'left', 3910__+MAX_llx_menu__, 'tools', 'mailing', 8__+MAX_llx_menu__, '/comm/mailing/index.php?mainmenu=tools&leftmenu=mailing', 'EMailings', 0, 'mails', '$user->hasRight("mailing","lire")', '', 0, 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 ('', 'isModEnabled("mailing")', __HANDLER__, 'left', 3911__+MAX_llx_menu__, 'tools', '', 3910__+MAX_llx_menu__, '/comm/mailing/card.php?mainmenu=tools&leftmenu=mailing&action=create', 'NewMailing', 1, 'mails', '$user->hasRight("mailing","creer")', '', 0, 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 ('', 'isModEnabled("mailing")', __HANDLER__, 'left', 3912__+MAX_llx_menu__, 'tools', '', 3910__+MAX_llx_menu__, '/comm/mailing/list.php?mainmenu=tools&leftmenu=mailing', 'List', 1, 'mails', '$user->hasRight("mailing","lire")', '', 0, 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 ('', 'isModEnabled("export")', __HANDLER__, 'left', 4100__+MAX_llx_menu__, 'tools', 'export', 8__+MAX_llx_menu__, '/exports/index.php?mainmenu=tools&leftmenu=export', 'FormatedExport', 0, 'exports', '$user->rights->export->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 ('', 'isModEnabled("export")', __HANDLER__, 'left', 4101__+MAX_llx_menu__, 'tools', '', 4100__+MAX_llx_menu__, '/exports/export.php?mainmenu=tools&leftmenu=export', 'NewExport', 1, 'exports', '$user->rights->export->creer', '', 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 ('', 'isModEnabled("import")', __HANDLER__, 'left', 4130__+MAX_llx_menu__, 'tools', 'import', 8__+MAX_llx_menu__, '/imports/index.php?mainmenu=tools&leftmenu=import', 'FormatedImport', 0, 'exports', '$user->rights->import->run', '', 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 ('', 'isModEnabled("import")', __HANDLER__, 'left', 4131__+MAX_llx_menu__, 'tools', '', 4130__+MAX_llx_menu__, '/imports/import.php?mainmenu=tools&leftmenu=import', 'NewImport', 1, 'exports', '$user->rights->import->run', '', 2, 0, __ENTITY__); -- Members -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->adherent->enabled', __HANDLER__, 'left', 4200__+MAX_llx_menu__, 'members', 'members', 13__+MAX_llx_menu__, '/adherents/index.php?mainmenu=members&leftmenu=members', 'Members', 0, 'members', '$user->rights->adherent->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->adherent->enabled', __HANDLER__, 'left', 4201__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/card.php?mainmenu=members&leftmenu=members&action=create', 'NewMember', 1, 'members', '$user->rights->adherent->creer', '', 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->adherent->enabled', __HANDLER__, 'left', 4202__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/list.php', 'List', 1, 'members', '$user->rights->adherent->lire', '', 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->adherent->enabled', __HANDLER__, 'left', 4203__+MAX_llx_menu__, 'members', '', 4202__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=-1', 'MenuMembersToValidate', 2, 'members', '$user->rights->adherent->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->adherent->enabled', __HANDLER__, 'left', 4204__+MAX_llx_menu__, 'members', '', 4202__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1', 'MenuMembersValidated', 2, 'members', '$user->rights->adherent->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->adherent->enabled', __HANDLER__, 'left', 4205__+MAX_llx_menu__, 'members', '', 4204__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1&filter=waitingsubscription', 'WaitingSubscription', 2, 'members', '$user->rights->adherent->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->adherent->enabled', __HANDLER__, 'left', 4206__+MAX_llx_menu__, 'members', '', 4204__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1&filter=outofdate', 'UpToDate', 2, 'members', '$user->rights->adherent->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->adherent->enabled', __HANDLER__, 'left', 4207__+MAX_llx_menu__, 'members', '', 4204__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1&filter=uptodate', 'OutOfDate', 2, 'members', '$user->rights->adherent->lire', '', 2, 5, __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->adherent->enabled', __HANDLER__, 'left', 4208__+MAX_llx_menu__, 'members', '', 4202__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=0', 'MenuMembersResiliated', 2, 'members', '$user->rights->adherent->lire', '', 2, 6, __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->adherent->enabled', __HANDLER__, 'left', 4209__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/stats/geo.php?mainmenu=members&leftmenu=members&mode=memberbycountry', 'MenuMembersStats', 1, 'members', '$user->rights->adherent->lire', '', 2, 7, __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 ('', '! empty($conf->global->MEMBER_LINK_TO_HTPASSWDFILE) && $conf->adherent->enabled', __HANDLER__, 'left', 4502__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/htpasswd.php?mainmenu=members&leftmenu=export', 'Filehtpasswd', 1, 'members', '$user->rights->adherent->export', '', 2, 9, __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->adherent->enabled', __HANDLER__, 'left', 4503__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/cartes/carte.php?mainmenu=members&leftmenu=export', 'MembersCards', 1, 'members', '$user->rights->adherent->export', '', 2, 10, __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 ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4200__+MAX_llx_menu__, 'members', 'members', 13__+MAX_llx_menu__, '/adherents/index.php?mainmenu=members&leftmenu=members', 'Members', 0, 'members', '$user->hasRight("adherent","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 ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4201__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/card.php?mainmenu=members&leftmenu=members&action=create', 'NewMember', 1, 'members', '$user->hasRight("adherent","creer")', '', 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 ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4202__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/list.php', 'List', 1, 'members', '$user->hasRight("adherent","lire")', '', 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 ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4203__+MAX_llx_menu__, 'members', '', 4202__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=-1', 'MenuMembersToValidate', 2, 'members', '$user->hasRight("adherent","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 ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4204__+MAX_llx_menu__, 'members', '', 4202__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1', 'MenuMembersValidated', 2, 'members', '$user->hasRight("adherent","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 ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4205__+MAX_llx_menu__, 'members', '', 4204__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1&filter=waitingsubscription', 'WaitingSubscription', 2, 'members', '$user->hasRight("adherent","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 ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4206__+MAX_llx_menu__, 'members', '', 4204__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1&filter=outofdate', 'UpToDate', 2, 'members', '$user->hasRight("adherent","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 ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4207__+MAX_llx_menu__, 'members', '', 4204__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1&filter=uptodate', 'OutOfDate', 2, 'members', '$user->hasRight("adherent","lire")', '', 2, 5, __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 ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4208__+MAX_llx_menu__, 'members', '', 4202__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=0', 'MenuMembersResiliated', 2, 'members', '$user->hasRight("adherent","lire")', '', 2, 6, __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 ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4209__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/stats/geo.php?mainmenu=members&leftmenu=members&mode=memberbycountry', 'MenuMembersStats', 1, 'members', '$user->hasRight("adherent","lire")', '', 2, 7, __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 ('', '! empty($conf->global->MEMBER_LINK_TO_HTPASSWDFILE) && isModEnabled("adherent")', __HANDLER__, 'left', 4502__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/htpasswd.php?mainmenu=members&leftmenu=export', 'Filehtpasswd', 1, 'members', '$user->hasRight("adherent","export")', '', 2, 9, __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 ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4503__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/cartes/carte.php?mainmenu=members&leftmenu=export', 'MembersCards', 1, 'members', '$user->hasRight("adherent","export")', '', 2, 10, __ENTITY__); -- Members - Subscriptions -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->adherent->enabled', __HANDLER__, 'left', 4300__+MAX_llx_menu__, 'members', '', 13__+MAX_llx_menu__, '/adherents/index.php?mainmenu=members&leftmenu=members', 'Subscriptions', 0, 'compta', '$user->rights->adherent->cotisation->lire', '', 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->adherent->enabled', __HANDLER__, 'left', 4301__+MAX_llx_menu__, 'members', '', 4300__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&statut=-1&leftmenu=accountancy', 'NewSubscription', 1, 'compta', '$user->rights->adherent->cotisation->creer', '', 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->adherent->enabled', __HANDLER__, 'left', 4302__+MAX_llx_menu__, 'members', '', 4300__+MAX_llx_menu__, '/adherents/subscription/list.php?mainmenu=members&leftmenu=members', 'List', 1, 'compta', '$user->rights->adherent->cotisation->lire', '', 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->adherent->enabled', __HANDLER__, 'left', 4303__+MAX_llx_menu__, 'members', '', 4300__+MAX_llx_menu__, '/adherents/stats/index.php?mainmenu=members&leftmenu=members', 'MenuMembersStats', 1, 'members', '$user->rights->adherent->lire', '', 2, 7, __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->adherent->enabled', __HANDLER__, 'left', 4700__+MAX_llx_menu__, 'members', 'setup', 13__+MAX_llx_menu__, '/adherents/type.php?mainmenu=members&leftmenu=setup', 'MembersTypes', 0, 'members', '$user->rights->adherent->configurer', '', 2, 5, __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->adherent->enabled', __HANDLER__, 'left', 4701__+MAX_llx_menu__, 'members', '', 4700__+MAX_llx_menu__, '/adherents/type.php?mainmenu=members&leftmenu=setup&action=create', 'New', 1, 'members', '$user->rights->adherent->configurer', '', 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->adherent->enabled', __HANDLER__, 'left', 4702__+MAX_llx_menu__, 'members', '', 4700__+MAX_llx_menu__, '/adherents/type.php?mainmenu=members&leftmenu=setup', 'List', 1, 'members', '$user->rights->adherent->configurer', '', 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 ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4300__+MAX_llx_menu__, 'members', '', 13__+MAX_llx_menu__, '/adherents/index.php?mainmenu=members&leftmenu=members', 'Subscriptions', 0, 'compta', '$user->hasRight("adherent","cotisation","lire")', '', 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 ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4301__+MAX_llx_menu__, 'members', '', 4300__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&statut=-1&leftmenu=accountancy', 'NewSubscription', 1, 'compta', '$user->hasRight("adherent","cotisation","creer")', '', 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 ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4302__+MAX_llx_menu__, 'members', '', 4300__+MAX_llx_menu__, '/adherents/subscription/list.php?mainmenu=members&leftmenu=members', 'List', 1, 'compta', '$user->hasRight("adherent","cotisation","lire")', '', 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 ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4303__+MAX_llx_menu__, 'members', '', 4300__+MAX_llx_menu__, '/adherents/stats/index.php?mainmenu=members&leftmenu=members', 'MenuMembersStats', 1, 'members', '$user->hasRight("adherent","lire")', '', 2, 7, __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 ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4700__+MAX_llx_menu__, 'members', 'setup', 13__+MAX_llx_menu__, '/adherents/type.php?mainmenu=members&leftmenu=setup', 'MembersTypes', 0, 'members', '$user->hasRight("adherent","configurer")', '', 2, 5, __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 ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4701__+MAX_llx_menu__, 'members', '', 4700__+MAX_llx_menu__, '/adherents/type.php?mainmenu=members&leftmenu=setup&action=create', 'New', 1, 'members', '$user->hasRight("adherent","configurer")', '', 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 ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4702__+MAX_llx_menu__, 'members', '', 4700__+MAX_llx_menu__, '/adherents/type.php?mainmenu=members&leftmenu=setup', 'List', 1, 'members', '$user->hasRight("adherent","configurer")', '', 2, 1, __ENTITY__); -- Members - Category member -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->adherent->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 5200__+MAX_llx_menu__, 'members', 'cat', 13__+MAX_llx_menu__, '/categories/index.php?mainmenu=members&leftmenu=cat&type=3', 'MembersCategoriesShort', 0, 'categories', '$user->rights->categorie->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->adherent->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 5201__+MAX_llx_menu__, 'members', '', 5200__+MAX_llx_menu__, '/categories/card.php?mainmenu=members&action=create&type=3', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 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 ('', 'isModEnabled("adherent") && isModEnabled("categorie")', __HANDLER__, 'left', 5200__+MAX_llx_menu__, 'members', 'cat', 13__+MAX_llx_menu__, '/categories/index.php?mainmenu=members&leftmenu=cat&type=3', 'MembersCategoriesShort', 0, 'categories', '$user->hasRight("categorie","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 ('', 'isModEnabled("adherent") && isModEnabled("categorie")', __HANDLER__, 'left', 5201__+MAX_llx_menu__, 'members', '', 5200__+MAX_llx_menu__, '/categories/card.php?mainmenu=members&action=create&type=3', 'NewCategory', 1, 'categories', '$user->hasRight("categorie","creer")', '', 2, 0, __ENTITY__); -- HRM - Employee -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->hrm->enabled', __HANDLER__, 'left', 4600__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist', 'Employees', 0, 'hrm', '$user->rights->user->user->lire', '', 0, 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->hrm->enabled', __HANDLER__, 'left', 4601__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/card.php?mainmenu=hrm&action=create&employee=1', 'NewEmployee', 1, 'hrm', '$user->rights->user->user->creer', '', 0, 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->hrm->enabled', __HANDLER__, 'left', 4602__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist', 'List', 1, 'hrm', '$user->rights->user->user->lire', '', 0, 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 ('', 'isModEnabled("hrm")', __HANDLER__, 'left', 4600__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist', 'Employees', 0, 'hrm', '$user->hasRight("user","user","lire")', '', 0, 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 ('', 'isModEnabled("hrm")', __HANDLER__, 'left', 4601__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/card.php?mainmenu=hrm&action=create&employee=1', 'NewEmployee', 1, 'hrm', '$user->hasRight("user","user","creer")', '', 0, 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 ('', 'isModEnabled("hrm")', __HANDLER__, 'left', 4602__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist', 'List', 1, 'hrm', '$user->hasRight("user","user","lire")', '', 0, 2, __ENTITY__); -- HRM - Holiday -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->holiday->enabled', __HANDLER__, 'left', 5000__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/holiday/list.php?mainmenu=hrm&leftmenu=hrm', 'CPTitreMenu', 0, 'holiday', '$user->rights->holiday->read', '', 0, 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->holiday->enabled', __HANDLER__, 'left', 5001__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/card.php?mainmenu=hrm&action=create', 'New', 1, 'holiday', '$user->rights->holiday->write', '', 0, 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->holiday->enabled', __HANDLER__, 'left', 5002__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/card_group.php?mainmenu=hrm&action=create', 'NewHolidayForGroup', 1, 'holiday', '$user->rights->holiday->write', '', 0, 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->holiday->enabled', __HANDLER__, 'left', 5003__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/list.php?mainmenu=hrm&leftmenu=hrm', 'List', 1, 'holiday', '$user->rights->holiday->read', '', 0, 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->holiday->enabled', __HANDLER__, 'left', 5004__+MAX_llx_menu__, 'hrm', '', 5002__+MAX_llx_menu__, '/holiday/list.php?mainmenu=hrm&search_statut=2&leftmenu=hrm', 'ListToApprove', 2, 'trips', '$user->rights->holiday->read', '', 0, 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->holiday->enabled', __HANDLER__, 'left', 5005__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/define_holiday.php?mainmenu=hrm', 'MenuConfCP', 1, 'holiday', '$user->rights->holiday->define_holiday', '', 0, 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->holiday->enabled', __HANDLER__, 'left', 5006__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/view_log.php?mainmenu=hrm', 'MenuLogCP', 1, 'holiday', '$user->rights->holiday->define_holiday', '', 0, 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 ('', 'isModEnabled("holiday")', __HANDLER__, 'left', 5000__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/holiday/list.php?mainmenu=hrm&leftmenu=hrm', 'CPTitreMenu', 0, 'holiday', '$user->hasRight("holiday","read")', '', 0, 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 ('', 'isModEnabled("holiday")', __HANDLER__, 'left', 5001__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/card.php?mainmenu=hrm&action=create', 'New', 1, 'holiday', '$user->hasRight("holiday","write")', '', 0, 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 ('', 'isModEnabled("holiday")', __HANDLER__, 'left', 5002__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/card_group.php?mainmenu=hrm&action=create', 'NewHolidayForGroup', 1, 'holiday', '$user->hasRight("holiday","write")', '', 0, 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 ('', 'isModEnabled("holiday")', __HANDLER__, 'left', 5003__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/list.php?mainmenu=hrm&leftmenu=hrm', 'List', 1, 'holiday', '$user->hasRight("holiday","read")', '', 0, 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 ('', 'isModEnabled("holiday")', __HANDLER__, 'left', 5004__+MAX_llx_menu__, 'hrm', '', 5002__+MAX_llx_menu__, '/holiday/list.php?mainmenu=hrm&search_statut=2&leftmenu=hrm', 'ListToApprove', 2, 'trips', '$user->hasRight("holiday","read")', '', 0, 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 ('', 'isModEnabled("holiday")', __HANDLER__, 'left', 5005__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/define_holiday.php?mainmenu=hrm', 'MenuConfCP', 1, 'holiday', '$user->hasRight("holiday","define_holiday")', '', 0, 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 ('', 'isModEnabled("holiday")', __HANDLER__, 'left', 5006__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/view_log.php?mainmenu=hrm', 'MenuLogCP', 1, 'holiday', '$user->hasRight("holiday","define_holiday")', '', 0, 3, __ENTITY__); -- HRM - Trips and expenses (old module) -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->deplacement->enabled', __HANDLER__, 'left', 2100__+MAX_llx_menu__, 'accountancy', 'tripsandexpenses', 15__+MAX_llx_menu__, '/compta/deplacement/index.php?mainmenu=accountancy&leftmenu=tripsandexpenses', 'TripsAndExpenses', 0, 'trips', '$user->rights->deplacement->lire', '', 0, 5, __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->deplacement->enabled', __HANDLER__, 'left', 2101__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/card.php?mainmenu=accountancy&action=create&leftmenu=tripsandexpenses', 'New', 1, 'trips', '$user->rights->deplacement->creer', '', 0, 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->deplacement->enabled', __HANDLER__, 'left', 2102__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/list.php?mainmenu=accountancy&leftmenu=tripsandexpenses', 'List', 1, 'trips', '$user->rights->deplacement->lire', '', 0, 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->deplacement->enabled', __HANDLER__, 'left', 2103__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/stats/index.php?mainmenu=accountancy&leftmenu=tripsandexpenses', 'Statistics', 1, 'trips', '$user->rights->deplacement->lire', '', 0, 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 ('', 'isModEnabled("deplacement")', __HANDLER__, 'left', 2100__+MAX_llx_menu__, 'accountancy', 'tripsandexpenses', 15__+MAX_llx_menu__, '/compta/deplacement/index.php?mainmenu=accountancy&leftmenu=tripsandexpenses', 'TripsAndExpenses', 0, 'trips', '$user->hasRight("deplacement","lire")', '', 0, 5, __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 ('', 'isModEnabled("deplacement")', __HANDLER__, 'left', 2101__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/card.php?mainmenu=accountancy&action=create&leftmenu=tripsandexpenses', 'New', 1, 'trips', '$user->hasRight("deplacement","creer")', '', 0, 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 ('', 'isModEnabled("deplacement")', __HANDLER__, 'left', 2102__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/list.php?mainmenu=accountancy&leftmenu=tripsandexpenses', 'List', 1, 'trips', '$user->hasRight("deplacement","lire")', '', 0, 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 ('', 'isModEnabled("deplacement")', __HANDLER__, 'left', 2103__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/stats/index.php?mainmenu=accountancy&leftmenu=tripsandexpenses', 'Statistics', 1, 'trips', '$user->hasRight("deplacement","lire")', '', 0, 2, __ENTITY__); -- HRM - Expense reports -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->expensereport->enabled', __HANDLER__, 'left', 5300__+MAX_llx_menu__, 'hrm', 'expensereport', 15__+MAX_llx_menu__, '/expensereport/index.php?mainmenu=hrm&leftmenu=expensereport', 'TripsAndExpenses', 0, 'trips', '$user->rights->expensereport->lire', '', 0, 5, __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->expensereport->enabled', __HANDLER__, 'left', 5301__+MAX_llx_menu__, 'hrm', '', 5300__+MAX_llx_menu__, '/expensereport/card.php?mainmenu=hrm&action=create&leftmenu=expensereport', 'New', 1, 'trips', '$user->rights->expensereport->creer', '', 0, 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->expensereport->enabled', __HANDLER__, 'left', 5302__+MAX_llx_menu__, 'hrm', '', 5300__+MAX_llx_menu__, '/expensereport/list.php?mainmenu=hrm&leftmenu=expensereport', 'List', 1, 'trips', '$user->rights->expensereport->lire', '', 0, 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->expensereport->enabled', __HANDLER__, 'left', 5303__+MAX_llx_menu__, 'hrm', '', 5302__+MAX_llx_menu__, '/expensereport/list.php?mainmenu=hrm&search_status=2&leftmenu=expensereport', 'ListToApprove', 2, 'trips', '$user->rights->expensereport->approve', '', 0, 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->expensereport->enabled', __HANDLER__, 'left', 5304__+MAX_llx_menu__, 'hrm', '', 5300__+MAX_llx_menu__, '/expensereport/stats/index.php?mainmenu=hrm&leftmenu=expensereport', 'Statistics', 1, 'trips', '$user->rights->expensereport->lire', '', 0, 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 ('', 'isModEnabled("expensereport")', __HANDLER__, 'left', 5300__+MAX_llx_menu__, 'hrm', 'expensereport', 15__+MAX_llx_menu__, '/expensereport/index.php?mainmenu=hrm&leftmenu=expensereport', 'TripsAndExpenses', 0, 'trips', '$user->hasRight("expensereport","lire")', '', 0, 5, __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 ('', 'isModEnabled("expensereport")', __HANDLER__, 'left', 5301__+MAX_llx_menu__, 'hrm', '', 5300__+MAX_llx_menu__, '/expensereport/card.php?mainmenu=hrm&action=create&leftmenu=expensereport', 'New', 1, 'trips', '$user->hasRight("expensereport","creer")', '', 0, 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 ('', 'isModEnabled("expensereport")', __HANDLER__, 'left', 5302__+MAX_llx_menu__, 'hrm', '', 5300__+MAX_llx_menu__, '/expensereport/list.php?mainmenu=hrm&leftmenu=expensereport', 'List', 1, 'trips', '$user->hasRight("expensereport","lire")', '', 0, 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 ('', 'isModEnabled("expensereport")', __HANDLER__, 'left', 5303__+MAX_llx_menu__, 'hrm', '', 5302__+MAX_llx_menu__, '/expensereport/list.php?mainmenu=hrm&search_status=2&leftmenu=expensereport', 'ListToApprove', 2, 'trips', '$user->hasRight("expensereport","approve")', '', 0, 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 ('', 'isModEnabled("expensereport")', __HANDLER__, 'left', 5304__+MAX_llx_menu__, 'hrm', '', 5300__+MAX_llx_menu__, '/expensereport/stats/index.php?mainmenu=hrm&leftmenu=expensereport', 'Statistics', 1, 'trips', '$user->hasRight("expensereport","lire")', '', 0, 2, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 74df629b787..733ad4ef51b 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1773,6 +1773,9 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef // Account Balance $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("AccountBalance"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); + // Export accountancy + $newmenu->add("/accountancy/bookkeeping/export.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("MenuExportAccountancy"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); + // Closure $newmenu->add("/accountancy/closure/index.php?mainmenu=accountancy&leftmenu=accountancy_closure", $langs->trans("MenuAccountancyClosure"), 1, $user->hasRight('accounting', 'fiscalyear', 'write'), '', $mainmenu, 'closure'); diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index e98b00b658b..6f9136798ed 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -683,11 +683,6 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if ((float) DOL_VERSION >= 6.0) { @include_once DOL_DOCUMENT_ROOT.'/core/lib/parsemd.lib.php'; - // Replace a HTML string with a Markdown syntax - $content = preg_replace('/([^<]+)<\/a>/', '[\2](\1)', $content); - //$content = preg_replace('/([^<]+)<\/a>/', '[\3](\1){:target="\2"}', $content); - $content = preg_replace('/([^<]+)<\/a>/', '[\3](\1)', $content); - $content = dolMd2Html( $content, 'parsedown', @@ -788,6 +783,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if ((float) DOL_VERSION >= 6.0) { @include_once DOL_DOCUMENT_ROOT.'/core/lib/parsemd.lib.php'; + $content = dolMd2Html($content, 'parsedown', array('doc/'=>dol_buildpath(strtolower($this->name).'/doc/', 1))); } else { $content = nl2br($content); diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php index afa3b56b4f5..d62a1eb6ada 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -1181,7 +1181,7 @@ class pdf_standard_asset extends ModelePDFAsset * @param int $hidedetails Do not show line details * @param int $hidedesc Do not show desc * @param int $hideref Do not show ref - * @return null + * @return void */ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) { diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 1cf3864d333..b078993e718 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -706,6 +706,7 @@ class pdf_einstein extends ModelePDFCommandes protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs) { // phpcs:enable + return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index cb460cff14a..f0a70560499 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -927,6 +927,7 @@ class pdf_eratosthene extends ModelePDFCommandes */ protected function drawPaymentsTable(&$pdf, $object, $posy, $outputlangs) { + return 0; } /** @@ -1733,7 +1734,7 @@ class pdf_eratosthene extends ModelePDFCommandes * @param int $hidedetails Do not show line details * @param int $hidedesc Do not show desc * @param int $hideref Do not show ref - * @return null + * @return void */ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) { diff --git a/htdocs/core/modules/commande/modules_commande.php b/htdocs/core/modules/commande/modules_commande.php index d6ecda2b2e7..839be6c9627 100644 --- a/htdocs/core/modules/commande/modules_commande.php +++ b/htdocs/core/modules/commande/modules_commande.php @@ -39,6 +39,23 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; */ abstract class ModelePDFCommandes extends CommonDocGenerator { + public $posxpicture; + public $posxtva; + public $posxup; + public $posxqty; + public $posxunit; + public $posxdesc; + public $posxdiscount; + public $postotalht; + + public $tva; + public $tva_array; + public $localtax1; + public $localtax2; + + public $atleastoneratenotnull = 0; + public $atleastonediscount = 0; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index 7ae6356aabc..c84c9b7e6a0 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -933,7 +933,7 @@ class pdf_storm extends ModelePDFDeliveryOrder * @param int $hidedetails Do not show line details * @param int $hidedesc Do not show desc * @param int $hideref Do not show ref - * @return null + * @return void */ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) { diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index f6c648f2ff0..16d38e9efeb 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -1236,7 +1236,7 @@ class pdf_espadon extends ModelePdfExpedition * @param int $hidedetails Do not show line details * @param int $hidedesc Do not show desc * @param int $hideref Do not show ref - * @return null + * @return void */ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) { diff --git a/htdocs/core/modules/export/export_csviso.modules.php b/htdocs/core/modules/export/export_csviso.modules.php index 6fd66aec769..4e12c32f66c 100644 --- a/htdocs/core/modules/export/export_csviso.modules.php +++ b/htdocs/core/modules/export/export_csviso.modules.php @@ -78,7 +78,7 @@ class ExportCsvIso extends ExportCsv global $conf; $conf->global->EXPORT_CSV_FORCE_CHARSET = 'ISO-8859-1'; - parent::write_title($array_export_fields_label, $array_selected_sorted, $outputlangs, $array_types); + return parent::write_title($array_export_fields_label, $array_selected_sorted, $outputlangs, $array_types); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -96,6 +96,6 @@ class ExportCsvIso extends ExportCsv global $conf; $conf->global->EXPORT_CSV_FORCE_CHARSET = 'ISO-8859-1'; - parent::write_record($array_selected_sorted, $objp, $outputlangs, $array_types); + return parent::write_record($array_selected_sorted, $objp, $outputlangs, $array_types); } } diff --git a/htdocs/core/modules/export/export_csvutf8.modules.php b/htdocs/core/modules/export/export_csvutf8.modules.php index fc79bc79825..a98f3f5f7f8 100644 --- a/htdocs/core/modules/export/export_csvutf8.modules.php +++ b/htdocs/core/modules/export/export_csvutf8.modules.php @@ -76,7 +76,7 @@ class ExportCsvUtf8 extends ExportCsv global $conf; $conf->global->EXPORT_CSV_FORCE_CHARSET = 'UTF-8'; - parent::write_title($array_export_fields_label, $array_selected_sorted, $outputlangs, $array_types); + return parent::write_title($array_export_fields_label, $array_selected_sorted, $outputlangs, $array_types); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -94,6 +94,6 @@ class ExportCsvUtf8 extends ExportCsv global $conf; $conf->global->EXPORT_CSV_FORCE_CHARSET = 'UTF-8'; - parent::write_record($array_selected_sorted, $objp, $outputlangs, $array_types); + return parent::write_record($array_selected_sorted, $objp, $outputlangs, $array_types); } } diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index e564ccf5a91..3e75ec686ee 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -2448,7 +2448,7 @@ class pdf_sponge extends ModelePDFFactures * @param int $hidedetails Do not show line details * @param int $hidedesc Do not show desc * @param int $hideref Do not show ref - * @return null + * @return void */ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) { diff --git a/htdocs/core/modules/facture/modules_facture.php b/htdocs/core/modules/facture/modules_facture.php index ff541550d4e..8fda383291d 100644 --- a/htdocs/core/modules/facture/modules_facture.php +++ b/htdocs/core/modules/facture/modules_facture.php @@ -42,6 +42,15 @@ abstract class ModelePDFFactures extends CommonDocGenerator */ public $error = ''; + public $posxpicture; + public $posxtva; + public $posxup; + public $posxqty; + public $posxunit; + public $posxdesc; + public $posxdiscount; + public $postotalht; + public $tva; public $tva_array; public $localtax1; diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 1c62db7db57..37452cd5a61 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -51,7 +51,7 @@ class ImportCsv extends ModeleImports public $errors = array(); /** - * @var int ID + * @var string Code of driver */ public $id; @@ -450,9 +450,9 @@ class ImportCsv extends ModeleImports //var_dump($arrayrecord[0]['val']); /*include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancysystem.class.php'; $tmpchartofaccount = new AccountancySystem($this->db); - $tmpchartofaccount->fetch($conf->global->CHARTOFACCOUNTS); + $tmpchartofaccount->fetch(getDolGlobalInt('CHARTOFACCOUNTS')); //var_dump($tmpchartofaccount->ref.' - '.$arrayrecord[0]['val']); - if ((! ($conf->global->CHARTOFACCOUNTS > 0)) || $tmpchartofaccount->ref != $arrayrecord[0]['val']) + if ((! (getDolGlobalInt('CHARTOFACCOUNTS') > 0)) || $tmpchartofaccount->ref != $arrayrecord[0]['val']) { $this->errors[$error]['lib']=$langs->trans('ErrorImportOfChartLimitedToCurrentChart', $tmpchartofaccount->ref); $this->errors[$error]['type']='RESTRICTONCURRENCTCHART'; diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 4ced5a7dff4..10393084fbd 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -55,7 +55,7 @@ class ImportXlsx extends ModeleImports public $errors = array(); /** - * @var int ID + * @var string Code of driver */ public $id; @@ -341,6 +341,7 @@ class ImportXlsx extends ModeleImports // phpcs:enable $this->workbook->disconnectWorksheets(); unset($this->workbook); + return 0; } @@ -493,9 +494,9 @@ class ImportXlsx extends ModeleImports //var_dump($arrayrecord[0]['val']); /*include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancysystem.class.php'; $tmpchartofaccount = new AccountancySystem($this->db); - $tmpchartofaccount->fetch($conf->global->CHARTOFACCOUNTS); + $tmpchartofaccount->fetch(getDolGlobalInt('CHARTOFACCOUNTS')); //var_dump($tmpchartofaccount->ref.' - '.$arrayrecord[0]['val']); - if ((! ($conf->global->CHARTOFACCOUNTS > 0)) || $tmpchartofaccount->ref != $arrayrecord[0]['val']) + if ((! (getDolGlobalInt('CHARTOFACCOUNTS') > 0)) || $tmpchartofaccount->ref != $arrayrecord[0]['val']) { $this->errors[$error]['lib']=$langs->trans('ErrorImportOfChartLimitedToCurrentChart', $tmpchartofaccount->ref); $this->errors[$error]['type']='RESTRICTONCURRENCTCHART'; diff --git a/htdocs/core/modules/import/modules_import.php b/htdocs/core/modules/import/modules_import.php index c57d42c8094..5b665c8e2cf 100644 --- a/htdocs/core/modules/import/modules_import.php +++ b/htdocs/core/modules/import/modules_import.php @@ -43,7 +43,7 @@ class ModeleImports public $error = ''; /** - * @var int id of driver + * @var string Code of driver */ public $id; @@ -129,7 +129,7 @@ class ModeleImports /** * getDriverId * - * @return string Id + * @return int Id */ public function getDriverId() { diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index 7a4ffabd4ab..07591de93a7 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -57,7 +57,7 @@ class modAccounting extends DolibarrModules $this->picto = 'accountancy'; // Data directories to create when module is enabled - $this->dirs = array('/accounting/temp'); + $this->dirs = array('/accounting/temp', '/accounting/export'); // Config pages $this->config_page_url = array('accounting.php?mainmenu=accountancy&leftmenu=accountancy_admin'); diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 64fca2dde60..f38be7f58ec 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -135,7 +135,7 @@ class modFacture extends DolibarrModules 'objectname'=>'Facture', 'method'=>'sendEmailsRemindersOnInvoiceDueDate', 'parameters'=>"10,all,EmailTemplateCode", - 'comment'=>'Send an emails when we reach the due date - n days of an invoice. First param is n, the number of days before due date to send the remind, second parameter is "all" or a payment mode code, last parameter is the code of email template to use (an email template with the EmailTemplateCode must exists. The version of the email template in the language of the thirdparty will be used in priority. Language of the thirdparty will be also used to update the PDF of the sent invoice).', + 'comment'=>'Send an email when we reach the invoice due date (or invoice date) - n days. First param is n, the number of days before due date (or invoice date) to send the remind (or after if value is negative), second parameter is "all" or a payment mode code, third parameter is the code of the email template to use (an email template with the EmailTemplateCode must exists. The version of the email template in the language of the thirdparty will be used in priority. Language of the thirdparty will be also used to update the PDF of the sent invoice). The last parameter is "duedate" or "invoicedate" to define which date of the invoice to use.', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index a1c4ff54654..2d7a7e8f9fc 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -337,7 +337,7 @@ class pdf_standard extends ModelePDFMovement $sql .= $this->db->order($sortfield, $sortorder); $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $this->db->query($sql); $nbtotalofrecords = $this->db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index e625d685727..7ddd983c907 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -713,6 +713,7 @@ class pdf_vinci extends ModelePDFMo protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs) { // phpcs:enable + return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore @@ -1365,7 +1366,7 @@ class pdf_vinci extends ModelePDFMo * @param int $hidedetails Do not show line details * @param int $hidedesc Do not show desc * @param int $hideref Do not show ref - * @return null + * @return void */ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) { diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index e9da62a42bb..7e745d2cc7a 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -903,6 +903,7 @@ class pdf_azur extends ModelePDFPropales protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs) { // phpcs:enable + return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 56184668f20..e7fbdd1fc5f 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1875,7 +1875,7 @@ class pdf_cyan extends ModelePDFPropales * @param int $hidedetails Do not show line details * @param int $hidedesc Do not show desc * @param int $hideref Do not show ref - * @return null + * @return void */ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) { diff --git a/htdocs/core/modules/propale/modules_propale.php b/htdocs/core/modules/propale/modules_propale.php index f69fd5e763e..089c0adfa22 100644 --- a/htdocs/core/modules/propale/modules_propale.php +++ b/htdocs/core/modules/propale/modules_propale.php @@ -41,6 +41,23 @@ abstract class ModelePDFPropales extends CommonDocGenerator */ public $error = ''; + public $posxpicture; + public $posxtva; + public $posxup; + public $posxqty; + public $posxunit; + public $posxdesc; + public $posxdiscount; + public $postotalht; + + public $tva; + public $tva_array; + public $localtax1; + public $localtax2; + + public $atleastonediscount = 0; + public $atleastoneratenotnull = 0; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 457679abbb9..0601ab06b0a 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -24,15 +24,36 @@ * \ingroup banque * \brief File to build payment reports */ + require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; /** - * Classe permettant de generer les rapports de paiement + * Class to manage reporting of payments */ -class pdf_paiement +class pdf_paiement extends CommonDocGenerator { + public $tab_top; + + public $line_height; + + public $line_per_page; + + public $tab_height; + + public $posxdate; + + public $posxpaymenttype; + public $posxinvoice; + public $posxbankaccount; + public $posxinvoiceamount; + public $posxpaymentamount; + + public $doc_type; + + /** * Constructor * diff --git a/htdocs/core/modules/reception/mod_reception_moonstone.php b/htdocs/core/modules/reception/mod_reception_moonstone.php index 40aaa63a7a8..c9e52d8d10f 100644 --- a/htdocs/core/modules/reception/mod_reception_moonstone.php +++ b/htdocs/core/modules/reception/mod_reception_moonstone.php @@ -77,13 +77,13 @@ class mod_reception_moonstone extends ModelNumRefReception */ public function getExample() { - global $conf, $langs, $mysoc; + global $langs, $mysoc; $old_code_client = $mysoc->code_client; $old_code_type = $mysoc->typent_code; $mysoc->code_client = 'CCCCCCCCCC'; $mysoc->typent_code = 'TTTTTTTTTT'; - $numExample = $this->getNextValue($mysoc, ''); + $numExample = $this->getNextValue($mysoc, null); $mysoc->code_client = $old_code_client; $mysoc->typent_code = $old_code_type; @@ -96,13 +96,13 @@ class mod_reception_moonstone extends ModelNumRefReception /** * Return next value * - * @param Societe $objsoc Third party object - * @param Object $reception Reception object - * @return string Value if OK, 0 if KO + * @param Societe $objsoc Third party object + * @param Object|null $reception Reception object + * @return string Value if OK, 0 if KO */ public function getNextValue($objsoc, $reception) { - global $db, $conf; + global $db; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -113,7 +113,11 @@ class mod_reception_moonstone extends ModelNumRefReception return 0; } - $date = $reception->date_reception; + if (!empty($reception)) { + $date = $reception->date_reception; + } else { + $date = dol_now(); + } $numFinal = get_next_value($db, $mask, 'reception', 'ref', '', $objsoc, $date); 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 41bbf8c32f9..123048bbb2d 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -1448,7 +1448,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes * @param int $hidedetails Do not show line details * @param int $hidedesc Do not show desc * @param int $hideref Do not show ref - * @return null + * @return void */ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) { 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 92bd19f52f4..00d819a0156 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -870,6 +870,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs) { // phpcs:enable + return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore @@ -1497,7 +1498,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders * @param int $hidedetails Do not show line details * @param int $hidedesc Do not show desc * @param int $hideref Do not show ref - * @return null + * @return void */ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) { 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 ba4dcd4c2ae..8c6c144f2e4 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -752,6 +752,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs) { // phpcs:enable + return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore 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 18cb0796ed0..bede0cc948e 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -603,10 +603,10 @@ class pdf_standard extends ModelePDFSuppliersPayments /** * Show top header of page. * - * @param TCPDF $pdf Object PDF - * @param FactureFournisseur $object Object to show - * @param int $showaddress 0=no, 1=yes - * @param Translate $outputlangs Object lang for output + * @param TCPDF $pdf Object PDF + * @param PaiementFourn $object Object to show + * @param int $showaddress 0=no, 1=yes + * @param Translate $outputlangs Object lang for output * @return void */ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs) @@ -814,11 +814,11 @@ class pdf_standard extends ModelePDFSuppliersPayments /** * Show footer of page. Need this->emetteur object * - * @param TCPDF $pdf PDF - * @param FactureFournisseur $object Object to show - * @param Translate $outputlangs Object lang for output - * @param int $hidefreetext 1=Hide free text - * @return int Return height of bottom margin including footer text + * @param TCPDF $pdf PDF + * @param PaiementFourn $object Object to show + * @param Translate $outputlangs Object lang for output + * @param int $hidefreetext 1=Hide free text + * @return int Return height of bottom margin including footer text */ protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0) { 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 5a2eaeddf47..0974a0df56f 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -739,6 +739,7 @@ class pdf_aurore extends ModelePDFSupplierProposal protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs) { // phpcs:enable + return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 71c8b33c5a3..7a0070cbb0d 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -41,7 +41,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; header('Cache-Control: Public, must-revalidate'); -header("Content-type: text/html; charset=".$conf->file->character_set_client); if (GETPOST('dol_hide_topmenu')) { $conf->dol_hide_topmenu = 1; diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 80018133d1b..dab33001c19 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -458,11 +458,12 @@ if (!empty($usemargins) && $user->rights->margins->creer) { } var price = 0; - remisejs=price2numjs(remise.val()); + remisejs = price2numjs(remise.val()); - if (remisejs != 100) // If a discount not 100 or no discount - { - if (remisejs == '') remisejs=0; + if (remisejs != 100) { // If a discount not 100 or no discount + if (remisejs == '') { + remisejs = 0; + } bpjs=price2numjs(buying_price.val()); ratejs=price2numjs(rate.val()); diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 153773a6519..182f15b5aa5 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -414,7 +414,7 @@ if ($outputalsopricetotalwithtax) { if ($this->statut == 0 && !empty($object_rights->creer) && $action != 'selectlines') { $situationinvoicelinewithparent = 0; - if ($line->fk_prev_id != null && in_array($object->element, array('facture', 'facturedet'))) { + if (isset($line->fk_prev_id) && in_array($object->element, array('facture', 'facturedet'))) { if ($object->type == $object::TYPE_SITUATION) { // The constant TYPE_SITUATION exists only for object invoice // Set constant to disallow editing during a situation cycle $situationinvoicelinewithparent = 1; diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index f43a2c63d9e..6a54ee53e79 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -36,7 +36,6 @@ if ($size > 10000) { require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; header('Cache-Control: Public, must-revalidate'); -header("Content-type: text/html; charset=".$conf->file->character_set_client); if (GETPOST('dol_hide_topmenu')) { $conf->dol_hide_topmenu = 1; diff --git a/htdocs/core/tpl/passwordreset.tpl.php b/htdocs/core/tpl/passwordreset.tpl.php index 3b1bed10338..96cde6cf032 100644 --- a/htdocs/core/tpl/passwordreset.tpl.php +++ b/htdocs/core/tpl/passwordreset.tpl.php @@ -38,7 +38,6 @@ if ($size > 10000) { require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; header('Cache-Control: Public, must-revalidate'); -header("Content-type: text/html; charset=".$conf->file->character_set_client); if (GETPOST('dol_hide_topmenu')) { $conf->dol_hide_topmenu = 1; diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 010ea7b6f32..c1cea5abe7d 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -969,6 +969,49 @@ class Cronjob extends CommonObject } + /** + * getTooltipContentArray + * @param array $params params to construct tooltip data + * @since v18 + * @return array + */ + public function getTooltipContentArray($params) + { + global $langs; + + $langs->load('cron'); + $datas = []; + + $datas['picto'] = img_picto('', 'object_'.$this->picto).' '.$langs->trans("CronTask").''; + if (isset($this->status)) { + $datas['picto'] .= ' '.$this->getLibStatut(5); + } + $datas['ref'] = '
'.$langs->trans('Ref').': '.dol_escape_htmltag($this->ref); + $datas['label'] = '
'.$langs->trans('Title').': '.$langs->trans($this->label); + if ($this->label != $langs->trans($this->label)) { + $datas['label'] .= ' ('.$this->label.')'; + } + if (!empty($this->params)) { + $datas['params'] = '
'.$langs->trans('Parameters').': '.dol_escape_htmltag($this->params); + } + $datas['space'] = '
'; + + if (!empty($this->datestart) && $this->datestart >= dol_now()) { + $datas['crondtstart'] = '
'.$langs->trans('CronDtStart').': '.dol_print_date($this->datestart, 'dayhour', 'tzuserrel'); + } + if (!empty($this->dateend)) { + $datas['crondtend'] = '
'.$langs->trans('CronDtEnd').': '.dol_print_date($this->dateend, 'dayhour', 'tzuserrel'); + } + if (!empty($this->datelastrun)) { + $datas['cronlastlaunch'] = '
'.$langs->trans('CronDtLastLaunch').': '.dol_print_date($this->datelastrun, 'dayhour', 'tzuserrel'); + } + if (!empty($this->datenextrun)) { + $datas['crondtnextlaunch'] = '
'.$langs->trans('CronDtNextLaunch').': '.dol_print_date($this->datenextrun, 'dayhour', 'tzuserrel'); + } + + return $datas; + } + /** * Return a link to the object card (with optionaly the picto) * @@ -982,8 +1025,6 @@ class Cronjob extends CommonObject public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) { global $db, $conf, $langs; - global $dolibarr_main_authentication, $dolibarr_main_demo; - global $menumanager; if (!empty($conf->dol_no_mouse_hover)) { $notooltip = 1; // Force disable tooltips @@ -991,31 +1032,18 @@ class Cronjob extends CommonObject $result = ''; - $label = img_picto('', 'object_'.$this->picto).' '.$langs->trans("CronTask").''; - if (isset($this->status)) { - $label .= ' '.$this->getLibStatut(5); - } - $label .= '
'.$langs->trans('Ref').': '.dol_escape_htmltag($this->ref); - $label .= '
'.$langs->trans('Title').': '.$langs->trans($this->label); - if ($this->label != $langs->trans($this->label)) { - $label .= ' ('.$this->label.')'; - } - if (!empty($this->params)) { - $label .= '
'.$langs->trans('Parameters').': '.dol_escape_htmltag($this->params); - } - $label .= '
'; - - if (!empty($this->datestart)) { - $label .= '
'.$langs->trans('CronDtStart').': '.dol_print_date($this->datestart, 'dayhour', 'tzuserrel'); - } - if (!empty($this->dateend)) { - $label .= '
'.$langs->trans('CronDtEnd').': '.dol_print_date($this->dateend, 'dayhour', 'tzuserrel'); - } - if (!empty($this->datelastrun)) { - $label .= '
'.$langs->trans('CronDtLastLaunch').': '.dol_print_date($this->datelastrun, 'dayhour', 'tzuserrel'); - } - if (!empty($this->datenextrun)) { - $label .= '
'.$langs->trans('CronDtNextLaunch').': '.dol_print_date($this->datenextrun, 'dayhour', 'tzuserrel'); + $params = [ + 'id' => $this->id, + 'objecttype' => $this->element, + ]; + $classfortooltip = 'classfortooltip'; + $dataparams = ''; + if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { + $classfortooltip = 'classforajaxtooltip'; + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } $url = DOL_URL_ROOT.'/cron/card.php?id='.$this->id; @@ -1037,8 +1065,8 @@ class Cronjob extends CommonObject $label = $langs->trans("ShowCronJob"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); + $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; } else { $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); } @@ -1049,7 +1077,7 @@ class Cronjob extends CommonObject $result .= $linkstart; if ($withpicto) { - $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); + $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), (($withpicto != 2) ? 'class="paddingright"' : ''), 0, 0, $notooltip ? 0 : 1); } if ($withpicto != 2) { $result .= $this->ref; diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 021e33dd20a..8ef23101ac4 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -302,7 +302,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('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 diff --git a/htdocs/debugbar/class/DataCollector/DolConfigCollector.php b/htdocs/debugbar/class/DataCollector/DolConfigCollector.php index 0920b140dbc..a4028bdc745 100644 --- a/htdocs/debugbar/class/DataCollector/DolConfigCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolConfigCollector.php @@ -21,7 +21,7 @@ * \ingroup debugbar */ -use \DebugBar\DataCollector\ConfigCollector; +use DebugBar\DataCollector\ConfigCollector; /** * DolConfigCollector class diff --git a/htdocs/debugbar/class/DataCollector/DolExceptionsCollector.php b/htdocs/debugbar/class/DataCollector/DolExceptionsCollector.php index 38d2b971dde..5835bbde179 100644 --- a/htdocs/debugbar/class/DataCollector/DolExceptionsCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolExceptionsCollector.php @@ -21,7 +21,7 @@ * \ingroup debugbar */ -use \DebugBar\DataCollector\ExceptionsCollector; +use DebugBar\DataCollector\ExceptionsCollector; /** * DolExceptionsCollector class diff --git a/htdocs/debugbar/class/DataCollector/DolMemoryCollector.php b/htdocs/debugbar/class/DataCollector/DolMemoryCollector.php index 3372e89c2b6..5d6e5310438 100644 --- a/htdocs/debugbar/class/DataCollector/DolMemoryCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolMemoryCollector.php @@ -21,7 +21,7 @@ * \ingroup debugbar */ -use \DebugBar\DataCollector\MemoryCollector; +use DebugBar\DataCollector\MemoryCollector; /** * DolMemoryCollector class diff --git a/htdocs/debugbar/class/DataCollector/DolMessagesCollector.php b/htdocs/debugbar/class/DataCollector/DolMessagesCollector.php index 733009e77c6..3c605687b95 100644 --- a/htdocs/debugbar/class/DataCollector/DolMessagesCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolMessagesCollector.php @@ -21,7 +21,7 @@ * \ingroup debugbar */ -use \DebugBar\DataCollector\MessagesCollector; +use DebugBar\DataCollector\MessagesCollector; /** * DolMessagesCollector class diff --git a/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php b/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php index d7e8f9a858a..0a19ca67f61 100644 --- a/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php @@ -21,7 +21,7 @@ * \ingroup debugbar */ -use \DebugBar\DataCollector\RequestDataCollector; +use DebugBar\DataCollector\RequestDataCollector; /** * DolRequestDataCollector class diff --git a/htdocs/debugbar/class/DataCollector/DolTimeDataCollector.php b/htdocs/debugbar/class/DataCollector/DolTimeDataCollector.php index d16622d329f..4fdbb65c65c 100644 --- a/htdocs/debugbar/class/DataCollector/DolTimeDataCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolTimeDataCollector.php @@ -21,7 +21,7 @@ * \ingroup debugbar */ -use \DebugBar\DataCollector\TimeDataCollector; +use DebugBar\DataCollector\TimeDataCollector; /** * DolTimeDataCollector class diff --git a/htdocs/debugbar/class/DebugBar.php b/htdocs/debugbar/class/DebugBar.php index bf293ea6e5f..fa7d4bd0e4f 100644 --- a/htdocs/debugbar/class/DebugBar.php +++ b/htdocs/debugbar/class/DebugBar.php @@ -23,7 +23,7 @@ dol_include_once('/debugbar/class/autoloader.php'); -use \DebugBar\DebugBar; +use DebugBar\DebugBar; dol_include_once('/debugbar/class/DataCollector/DolMessagesCollector.php'); dol_include_once('/debugbar/class/DataCollector/DolRequestDataCollector.php'); diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 2c3e3ec6e11..9ad6f04f545 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -440,7 +440,8 @@ if ($action == 'create') { } else { print '
'.$langs->trans('ThirdParty').''; - print $form->select_company($soc->id, 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); + $filter = '((s.client:IN:1,3) AND (status:=:1))'; + print $form->select_company($soc->id, 'socid', $filter, 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); // Option to reload page to retrieve customer informations. Note, this clear other input if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED)) { print ''; diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index adf75194fde..776c1e62fe2 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -970,7 +970,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); @@ -1694,7 +1694,7 @@ if ($resql) { $thirdpartytmp->fournisseur = $obj->fournisseur; $objectstatic->socid = $thirdpartytmp->getNomUrl('supplier', 0, 0, -1); // Output Kanban - print $objectstatic->getKanbanView(''); + print $objectstatic->getKanbanView('', array('selected' => in_array($objectstatic->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print ''; print '
'; print '
'; } - $recuitment = new RecruitmentJobPosition($db); - $recuitment->fetch($obj->fk_recruitmentjobposition); - $object->fk_recruitmentjobposition = $recuitment->getNomUrl(); + // TODO Use a cache for $recruitment + $recruitment = new RecruitmentJobPosition($db); + $recruitment->fetch($obj->fk_recruitmentjobposition); + $object->phone = $obj->phone; if ($massactionbutton || $massaction) { $selected = 0; } // Output Kanban - print $object->getKanbanView(''); + print $object->getKanbanView('', array('jobpositionlink'=>$recruitment->getNomUrl(1), 'selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print '
'; - print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company('', 'socid', 's.fournisseur=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); + $filter = '(s.fournisseur:=:1)'; + print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company('', 'socid', $filter, 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); // reload page to retrieve customer informations if (!empty($conf->global->RELOAD_PAGE_ON_SUPPLIER_CHANGE)) { print '