commit
f005ce7690
1
.gitignore
vendored
1
.gitignore
vendored
@ -16,6 +16,7 @@ default.properties
|
||||
.DS_Store
|
||||
.idea
|
||||
*.iml
|
||||
*.orig
|
||||
Thumbs.db
|
||||
/dolibarr_genesis.mp4
|
||||
# Log files
|
||||
|
||||
15
.travis.yml
15
.travis.yml
@ -38,8 +38,8 @@ env:
|
||||
|
||||
jobs:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- php: nightly
|
||||
#allow_failures:
|
||||
#- php: nightly
|
||||
include:
|
||||
- if: type = push
|
||||
php: '5.6'
|
||||
@ -73,13 +73,6 @@ before_install:
|
||||
phpenv config-rm xdebug.ini
|
||||
echo
|
||||
|
||||
- |
|
||||
if [ "$DB" = 'postgresql' ]; then
|
||||
echo "Check pgloader version"
|
||||
pgloader --version
|
||||
echo
|
||||
fi
|
||||
|
||||
install:
|
||||
- |
|
||||
echo "Updating Composer"
|
||||
@ -178,6 +171,10 @@ before_script:
|
||||
mysql --version | head -
|
||||
mysql -e "SELECT VERSION();" | head -
|
||||
psql --version
|
||||
if [ "$DB" = 'postgresql' ]; then
|
||||
echo "Check pgloader version"
|
||||
pgloader --version
|
||||
fi
|
||||
echo
|
||||
|
||||
- |
|
||||
|
||||
147
ChangeLog
147
ChangeLog
@ -3,11 +3,82 @@ English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
|
||||
***** ChangeLog for 14.0.0 compared to 13.0.0 *****
|
||||
|
||||
For users:
|
||||
----------
|
||||
|
||||
|
||||
For developers:
|
||||
---------------
|
||||
|
||||
|
||||
|
||||
WARNING:
|
||||
|
||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||
* The ICS value for direct debit or credit transfer is now store on each bank account instead of into the global setup.
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 13.0.1 compared to 13.0.0 *****
|
||||
|
||||
FIX: 10.0 before crediting a withdrawal receipt, check whether it has been credited already.
|
||||
FIX: 11.0 when a mandatory extrafield of type sellist contains '0' it should be considered empty and trigger an error message upon insertion
|
||||
FIX: 11.0 when a new intervention is created from an object, a new $extrafields object is instantiated but not initialized
|
||||
FIX: create MO, Column 'tms' cannot be null
|
||||
FIX: #14290 #15900
|
||||
FIX: #16076
|
||||
FIX: #16077
|
||||
FIX: #16079
|
||||
FIX: #16080
|
||||
FIX: 16084
|
||||
FIX: #16107
|
||||
FIX: #16118 Timezone problem on some fields
|
||||
FIX: #16131
|
||||
FIX: #16135
|
||||
FIX: #16143
|
||||
FIX: #16156
|
||||
FIX: #16160
|
||||
FIX: #16185
|
||||
FIX: #16189, fix download/see check deposit PDF
|
||||
FIX: #16215
|
||||
FIX: Accountancy - label_operation is used instead of label_compte
|
||||
FIX: Add critical price patch
|
||||
FIX: Assignement of actors on tasks
|
||||
FIX: Bad dates on info tabs
|
||||
FIX: cash fence for takepos with multientity
|
||||
FIX: CSRF errors on margin forms
|
||||
FIX: encoding status in graph of vendor proposals
|
||||
FIX: Fix detect dispached product and set to received completely when the supplier order have services (support STOCK_SUPPORTS_SERVICES)
|
||||
FIX: Hide/Unhide external ICSS calendars
|
||||
FIX: link to create event when task is in a project with a thirdparty
|
||||
FIX: Localtax must be converted with price2num
|
||||
FIX: manage price min for PRODUIT_CUSTOMER_PRICES
|
||||
FIX: Missing language ico
|
||||
FIX: Must not be able to edit vat of all lines if not draft
|
||||
FIX: Bad "htdocs" found into a path
|
||||
FIX: removed no more used proc update_modified_column_date_m on pgsql (its presence triggered errors)
|
||||
FIX: Vulnerability report by Ricardo Matias
|
||||
FIX: select default mail template
|
||||
FIX: Select transport mode function when creating a supplier invoice and add unique key to the table llx_c_transport_mode in migrate sql
|
||||
FIX: Merge of thirdparties : "unknow column fk_soc" + "Delivery" label
|
||||
FIX: SQL Error in group by with postgres or mysql strict mode
|
||||
FIX: takepos : load date function
|
||||
FIX: Timeout during import
|
||||
FIX: Trigger on expense report was not fired
|
||||
FIX: User creation of expense report not visible
|
||||
FIX: warning when adding a line if $remise_percent is an empty string
|
||||
FIX: status late on purchase orders
|
||||
FIX: ODT generation very slow
|
||||
|
||||
|
||||
***** ChangeLog for 13.0.0 compared to 12.0.0 *****
|
||||
|
||||
For users:
|
||||
----------
|
||||
NEW: Add module "Credit transfer SEPA" to manage payment of vendors using bank credit transfer SEPA files.
|
||||
NEW: Module "Credit transfer SEPA" to manage payment of vendors using bank credit transfer SEPA files.
|
||||
NEW: Module Intracomm report
|
||||
NEW: Module Reception (for a more accurate management of your receptions) moved from experimental to stable.
|
||||
NEW: Module Recruitment to manage Job position and applications.
|
||||
NEW: Several security issues after a private bug bounty campaign.
|
||||
@ -22,7 +93,6 @@ NEW: Solve blocking feature. Can increase stock of a Kit without changing subpro
|
||||
NEW: add a widget to show the customers with outstanding limits reached
|
||||
NEW: add 2 rules for emailcollector: Message send/not sent from Dolibarr
|
||||
NEW: add a counter of number of words for pages in website module
|
||||
NEW: add alert before changing thirdparty in TakePOS
|
||||
NEW: add a page to list Stock at a given date in the past
|
||||
NEW: add a start date to begin binding in accountancy
|
||||
NEW: add a statistics page to list popularity of products on invoices
|
||||
@ -34,12 +104,12 @@ NEW: add column vat rate in page to define accounting account on product/service
|
||||
NEW: add costprice in fields of products list
|
||||
NEW: add an import profile for CUSTOMER ORDER, PO, PROPOSAL MODULE, SUPPLIER INVOICE
|
||||
NEW: add employee link in expense report binding page
|
||||
NEW: add EORI No. as ProfID5
|
||||
NEW: add EORI No. as ProfID5 #15382
|
||||
NEW: add export for various payments
|
||||
NEW: add Extrafields labels and values in mail on create ticket
|
||||
NEW: add Extrafields support on ECM module
|
||||
NEW: add filter rules "is answer" and "is not answer" in email collector
|
||||
NEW: add focus when editing on product/stock/product.php Close #14548
|
||||
NEW: add focus when editing on product/stock/product.php -> close #14548
|
||||
NEW: add free text on each terminal of cash desk
|
||||
NEW: add global search for customer payments and vendor payments
|
||||
NEW: add global search for miscellaneous payments
|
||||
@ -67,7 +137,6 @@ NEW: add search param for close date on order list
|
||||
NEW: add show preview for mail attachement on form mail
|
||||
NEW: add State/Province origin for products
|
||||
NEW: add the workflow interaction close intervention on closing ticket
|
||||
NEW: add third order printer to TakePOS
|
||||
NEW: add tracking number in list and search_all items
|
||||
NEW: add vcard for adherent and user
|
||||
NEW: add week number for month view in agenda
|
||||
@ -75,7 +144,6 @@ NEW: Algeria data (VAT and forme_juridique)
|
||||
NEW: allow click on all header numbers on commerce area
|
||||
NEW: allow to reopen interventions (green button)
|
||||
NEW: allow zero quantity on supplier/vendor order line
|
||||
NEW: appearance tab in TakePOS with more visual parameters
|
||||
NEW: better currency rate editor
|
||||
NEW: can build vendor invoice from vendor orders
|
||||
NEW: can change a product in lines of a recurring invoice or contract
|
||||
@ -88,21 +156,16 @@ NEW: can edit the list of sending email profiles
|
||||
NEW: can enable/disable users in bulk actions
|
||||
NEW: can filter on accounting system ref in export of chart of account
|
||||
NEW: can filter on container type, language and tags in the list of web pages
|
||||
NEW: can hide eatby, sellby dates with option PRODUCT_DISABLE_SELLBY and PRODUCT_DISABLE_EATBY
|
||||
NEW: can hide eatby, sellby dates with option PRODUCT_DISABLE_EATBY and PRODUCT_DISABLE_SELLBY
|
||||
NEW: can import proposals, sales orders, supplier invoices
|
||||
NEW: can set a dedicated SMTP config for sending email from public ticket interface
|
||||
NEW: can set tags/categories to website pages
|
||||
NEW: can set type of price without tax per default for new sale price creation
|
||||
NEW: can use desired stock of a given warehouse for replenishment
|
||||
NEW: change thirdparty with barcode scan in TakePOS
|
||||
NEW: common behavior for monthly leave list view
|
||||
NEW: convert all subscription in datetime
|
||||
NEW: can create a thirdparty customer from TakePOS
|
||||
NEW: date shipment from order accepts hours
|
||||
NEW: price level compatibility for variant
|
||||
NEW: delayed payment in TakePOS
|
||||
NEW: display date range if exist in TakePOS
|
||||
NEW: display resiliate status in TakePOS for member
|
||||
NEW: display stat for BOM on "object referent"/linked Object product tab
|
||||
NEW: Email configuration - allow auto signed certificate when smtp ssl activated
|
||||
NEW: enable free emails input with select2
|
||||
@ -124,29 +187,24 @@ NEW: link on balance to the ledger
|
||||
NEW: MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER const in email collector
|
||||
NEW: manage errors on update extra fields in ticket card
|
||||
NEW: mass-actions for the event list view
|
||||
NEW: Module Intracomm report
|
||||
NEW: more filter for "View change logs"
|
||||
NEW: multicurrency total in TakePOS
|
||||
NEW: multiselect type and date to date filter
|
||||
NEW: Nature of product is now a dictionay
|
||||
NEW: new line template: hidden conf to fill service dates from the last service line
|
||||
NEW: PDF model storm for delivery
|
||||
NEW: possibilty to group payments by mode and show their subtotal
|
||||
NEW: Print payment method and change in TakePOS
|
||||
NEW: Priority and transparency from external calendar events
|
||||
NEW: Products - Nature of product is now a dictionary #13287
|
||||
NEW: Products Import/Export 'default warehouse' and 'use batch number' fields
|
||||
NEW: Purchase price table: added filterable table columns
|
||||
NEW: rate editor for multicurrency
|
||||
NEW: ref_ext field for Commande lines, order lines, Attributes and Combinations, Invoice lines, payments, order lines
|
||||
NEW: remove new lines in mail on add ticket message
|
||||
NEW: restrict thirdparty to customer in TakePOS
|
||||
NEW: Rule "email to" accept wildcard *
|
||||
NEW: Save filter of the project homepage
|
||||
NEW: save filter of the project homepage
|
||||
NEW: select-able columns on customer and supplier invoice paymnet list
|
||||
NEW: select-able columns on miscellaneous payments + more data columns
|
||||
NEW: select-able columns on social taxes list
|
||||
NEW: send context and remove new lines on create ticket
|
||||
NEW: show available stock in TakePOS
|
||||
NEW: show category filter on lists only when user have rights to read categories
|
||||
NEW: show header number and make it clickable in warehouse area, payment area, shipment area
|
||||
NEW: show image of user in the combo select of users
|
||||
@ -159,15 +217,27 @@ NEW: show tags and status in search list of website pages
|
||||
NEW: show user on external calender events (when found)
|
||||
NEW: subject title with company name instead of application title in ticket message
|
||||
NEW: Support for Samba4 AD
|
||||
NEW: TakePOS appearance tab with more visual parameters
|
||||
NEW: TakePOS add alert before changing thirdparty
|
||||
NEW: TakePOS add third order printer
|
||||
NEW: TakePOS can change thirdparty with barcode scan
|
||||
NEW: TakePOS can create a thirdparty customer from TakePOS frontend
|
||||
NEW: TakePOS connector compatibility with RECEIPT PRINTERS module
|
||||
NEW: TakePOS add delayed payment
|
||||
NEW: TakePOS display date range if exist
|
||||
NEW: TakePOS display resiliate status for members
|
||||
NEW: TakePOS Gift Receipt
|
||||
NEW: TakePOS Multicurrency compatibility
|
||||
NEW: TakePOS multicurrency compatibility
|
||||
NEW: TakePOS multicurrency total
|
||||
NEW: TakePOS print payment method and change
|
||||
NEW: TakePOS restrict thirdparty to customer
|
||||
NEW: TakePOS show available stock
|
||||
NEW: TakePOS Weighing Scale compatibility with TakePOS connector #14725
|
||||
NEW: Third-Party Import new fields: mother company,outstanding debt limit,bank account,incoterms
|
||||
NEW: Thirdparty Import new fields: mother company,outstanding debt limit,bank account,incoterms
|
||||
NEW: Thirdparty module : box on customer/supplier tab for invoice outsantding amount late
|
||||
NEW: ticket classification on create from email collector
|
||||
NEW: Ticket classification on create from email collector
|
||||
NEW: Ticket message notifications when edited from public interface
|
||||
NEW: translate classification labels in ticket
|
||||
NEW: Ticket translate classification labels in ticket
|
||||
NEW: VAT rate for Angola #15606
|
||||
NEW: VAT and juridical status for Algeria
|
||||
NEW: VAT report - Invert constant to show by default zero VAT in reports
|
||||
@ -181,11 +251,10 @@ NEW: add option "If the feature to manage kits of module Stock is used, show det
|
||||
|
||||
For developers:
|
||||
---------------
|
||||
NEW: add substitution key __MEMBER_TYPE__
|
||||
NEW: add substitution key __TYPE__
|
||||
NEW: add __MEMBER_TYPE__ and __TYPE__ substitution key
|
||||
NEW: add function dolButtonToOpenUrlInDialogPopup() to be able to open page into a popup
|
||||
NEW: show line number on intervention card (via MAIN_VIEW_LINE_NUMBER)
|
||||
NEW: Add some fields to link website page to an other object
|
||||
NEW: add some fields to link website page to an other object
|
||||
NEW: fill ECM src object fields in dol_add_file_process
|
||||
NEW: conf to allow to show the full tree in warehouse popup
|
||||
NEW: can use parameter ?THEME_DARKMODEENABLED=2 for a preview of theme in dark mode
|
||||
@ -194,14 +263,11 @@ NEW: can add event to log into blockedlog module with a constant
|
||||
NEW: add property cssview when declaring fields of an object
|
||||
NEW: can use dynamic code into the 'enabled' property of DAO fields
|
||||
NEW: field ref_ext in llx_commandedet
|
||||
NEW: field ref_ext for Attributes and Combinations
|
||||
NEW: fields ref_ext for Attributes and Combinations
|
||||
NEW: OAuth SCOPE for Admin SDK
|
||||
NEW: retrieve discount from invoice from API
|
||||
NEW: standardizes API thirdparties by email like other object
|
||||
NEW: Thirdparty REST API: endpoint to set price level
|
||||
NEW: use new category API for project list view
|
||||
NEW: Triggers Attributes and Attributes values
|
||||
NEW: added incoterms data into the substitution array
|
||||
NEW: add incoterms data into the substitution array
|
||||
NEW: add send context for ticket
|
||||
NEW: add a message in error_log after detection of SQL or script injection
|
||||
NEW: add validation of MX domain for emails
|
||||
@ -211,19 +277,20 @@ NEW: add param to not show links when output tags
|
||||
|
||||
APIs
|
||||
NEW: API get contacts list of a given order
|
||||
NEW: API endpoint getContacts and Clean results
|
||||
NEW: API endpoint getContacts and clean results
|
||||
NEW: API can update a payment
|
||||
NEW: API get member by thirdparty
|
||||
NEW: API get thirdparty by barcode
|
||||
NEW: API get users by email / login
|
||||
NEW: allow to edit field "demand reason" through API
|
||||
NEW: fetch contact by email with REST API
|
||||
NEW: get state by REST API
|
||||
NEW: get state dictionary by REST API
|
||||
NEW: improve Product API for product variants
|
||||
NEW: get state dictionnary by REST API
|
||||
NEW: improve Product API for variant products
|
||||
NEW: retrieve discount from invoice from API
|
||||
NEW: Thirdparty REST API: endpoint to set price level
|
||||
NEW: use new category API for project list view
|
||||
|
||||
HOOKs
|
||||
NEW: Hook on propal card
|
||||
NEW: add hook on propal card
|
||||
NEW: add hooks on newpayment page to allow external payment modules
|
||||
NEW: add hooks on stats pages
|
||||
NEW: add formConfirm hook on product page
|
||||
@ -238,7 +305,7 @@ Following changes may create regressions for some external modules, but were nec
|
||||
* All properties ->titre have been renamed into ->title
|
||||
* Property $paiementid in API 'api_supplier_invoices.php' has been renamed into into $payment_mode_id
|
||||
* Property 'num_paiement' has been renamed 'num_payment' everywhere for better code consistency.
|
||||
* The deprecated subsitution key __SIGNATURE__ has been removed. Use __USER_SIGNATURE__ if you used the old syntax in your email templates.
|
||||
* The deprecated subsitution key __SIGNATURE__ has been removed. Replace it with __USER_SIGNATURE__ if you used the old syntax in your email templates.
|
||||
* The hidden option HOLIDAY_MORE_PUBLIC_HOLIDAYS has been removed. Use instead the dictionary table if you need to define custom days of holiday.
|
||||
* If you build a class that implement CommonObject to use the incoterm properties or methods (->fk_incoterm, ->label_incoterm, ->location_incoterm),
|
||||
you must now also include declaration of the Trait 'CommonIncoterm' in your class. All incoterm functions were moved into this Trait.
|
||||
@ -250,7 +317,9 @@ Following changes may create regressions for some external modules, but were nec
|
||||
* Function showStripePaymentUrl, getStripePaymentUrl, showPaypalPaymentUrl and getPaypalPaymentUrl has been removed. The generic one showOnlinePaymentUrl and getOnlinePaymentUrl are always used.
|
||||
* Context for hook showSocinfoOnPrint has been moved from "showsocinfoonprint" to "main"
|
||||
* Library htdocs/includes/phpoffice/phpexcel as been removed (replaced with htdocs/includes/phpoffice/PhpSpreadsheet)
|
||||
|
||||
* Database transaction in your triggers must be correctly balanced (one close for one open). If not, an error will be returned by the trigger, even if trigger did return error code.
|
||||
* Dolibarr v13 is still compatible with any PHP version between 5.6.0 and 7.4.*; Unit tests are OK with PHP 8.0 but some warnings or troubles may appears with PHP 8.0.
|
||||
* All your Ajax services must contains such a line at begin of file: if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Disables token renewal
|
||||
|
||||
***** ChangeLog for 12.0.4 compared to 12.0.3 *****
|
||||
FIX: make formConfirm an addreplace-type hook
|
||||
|
||||
10
build/README
10
build/README
@ -7,6 +7,9 @@ Building packages
|
||||
##################################################
|
||||
|
||||
All sub-directories of "build" directory contains files (setup or binary tools) required to build automatically Dolibarr packages.
|
||||
The build directory and all its contents is absolutely not required to make Dolibarr working.
|
||||
It is here only to build Dolibarr packages, and those generated packages will not contains this "build" directory.
|
||||
|
||||
|
||||
There are several tools:
|
||||
|
||||
@ -17,8 +20,7 @@ There are several tools:
|
||||
--------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Prerequisites to build tgz, debian, rpm package:
|
||||
|
||||
Prerequisites to build tgz, debian and rpm packages:
|
||||
> apt-get install tar dpkg dpatch p7zip-full rpm zip
|
||||
|
||||
|
||||
@ -58,10 +60,6 @@ Prerequisites to build autoexe DoliWamp package:
|
||||
|
||||
--------------------------------------------------------------------------------------------------
|
||||
|
||||
Note:
|
||||
The build directory and all its contents is absolutely not required to make Dolibarr working.
|
||||
It is here only to build Dolibarr packages, and those generated packages will not contains this "build" directory.
|
||||
|
||||
|
||||
You can find in "build", following sub-directories:
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ Priority: optional
|
||||
Maintainer: Laurent Destailleur (eldy) <eldy@users.sourceforge.net>
|
||||
# Uploaders: Laurent Destailleur (eldy) <eldy@users.sourceforge.net> # Only if differs from Maintainer
|
||||
Standards-Version: 3.9.6
|
||||
Homepage: http://www.dolibarr.org
|
||||
Homepage: https://www.dolibarr.org
|
||||
Build-Depends: debhelper (>= 9), po-debconf
|
||||
# This package need at least debian 7 or ubuntu 13.04 or any distribution based on this version
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ setup_empty_conf() {
|
||||
mkdir -p /etc/dolibarr
|
||||
touch /etc/dolibarr/conf.php
|
||||
chown root:www-data /etc/dolibarr/conf.php
|
||||
chmod 664 /etc/dolibarr/conf.php
|
||||
chmod 660 /etc/dolibarr/conf.php
|
||||
}
|
||||
|
||||
is_new_upstream_version() {
|
||||
|
||||
@ -105,8 +105,8 @@ if (empty($includecustom)) {
|
||||
}
|
||||
}
|
||||
|
||||
print "Release : ".$release."\n";
|
||||
print "Working on files into : ".DOL_DOCUMENT_ROOT."\n";
|
||||
print "Release : ".$release."\n";
|
||||
print "Include custom in signature : ".$includecustom."\n";
|
||||
print "Include constants in signature : ";
|
||||
foreach ($includeconstants as $countrycode => $tmp) {
|
||||
|
||||
15
dev/README
15
dev/README
@ -1,13 +1,14 @@
|
||||
README (English)
|
||||
--------------------------------
|
||||
This directory contains sub-directories to provide tools or
|
||||
documentation for developers.
|
||||
Note: All files in this directory are in VCS only and are not
|
||||
provided with a standard release.
|
||||
|
||||
This directory contains sub-directories to provide tools or documentation for developers.
|
||||
|
||||
Note: All files in this directory are in the source repository only and are not provided with a standard release. They are useless to make Dolibarr working.
|
||||
|
||||
You may find a more complete documentation on Dolibarr on the wiki:
|
||||
|
||||
There is also some documentation on Dolibarr Wiki:
|
||||
https://wiki.dolibarr.org/
|
||||
and
|
||||
https://doxygen.dolibarr.org/
|
||||
|
||||
and on
|
||||
|
||||
https://doxygen.dolibarr.org/
|
||||
|
||||
@ -29,8 +29,8 @@ $path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||
exit;
|
||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Global variables
|
||||
@ -49,7 +49,10 @@ $langs->load("main"); // To load language file for default language
|
||||
|
||||
// Load user and its permissions
|
||||
$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
|
||||
if (! $result > 0) { dol_print_error('', $user->error); exit; }
|
||||
if (! $result > 0) {
|
||||
dol_print_error('', $user->error);
|
||||
exit;
|
||||
}
|
||||
$user->getrights();
|
||||
|
||||
|
||||
@ -82,12 +85,12 @@ $obj->lines[]=$line1;
|
||||
|
||||
// Create invoice
|
||||
$idobject=$obj->create($user);
|
||||
if ($idobject > 0)
|
||||
{
|
||||
if ($idobject > 0) {
|
||||
// Change status to validated
|
||||
$result=$obj->validate($user);
|
||||
if ($result > 0) print "OK Object created with id ".$idobject."\n";
|
||||
else {
|
||||
if ($result > 0) {
|
||||
print "OK Object created with id ".$idobject."\n";
|
||||
} else {
|
||||
$error++;
|
||||
dol_print_error($db, $obj->error);
|
||||
}
|
||||
@ -99,8 +102,7 @@ if ($idobject > 0)
|
||||
|
||||
// -------------------- END OF YOUR CODE --------------------
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
if (! $error) {
|
||||
$db->commit();
|
||||
print '--- end ok'."\n";
|
||||
} else {
|
||||
|
||||
@ -29,8 +29,8 @@ $path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||
exit;
|
||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Global variables
|
||||
@ -49,7 +49,10 @@ $langs->load("main"); // To load language file for default language
|
||||
|
||||
// Load user and its permissions
|
||||
$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
|
||||
if (! $result > 0) { dol_print_error('', $user->error); exit; }
|
||||
if (! $result > 0) {
|
||||
dol_print_error('', $user->error);
|
||||
exit;
|
||||
}
|
||||
$user->getrights();
|
||||
|
||||
|
||||
@ -80,12 +83,12 @@ $com->lines[]=$orderline1;
|
||||
|
||||
// Create order
|
||||
$idobject=$com->create($user);
|
||||
if ($idobject > 0)
|
||||
{
|
||||
if ($idobject > 0) {
|
||||
// Change status to validated
|
||||
$result=$com->valid($user);
|
||||
if ($result > 0) print "OK Object created with id ".$idobject."\n";
|
||||
else {
|
||||
if ($result > 0) {
|
||||
print "OK Object created with id ".$idobject."\n";
|
||||
} else {
|
||||
$error++;
|
||||
dol_print_error($db, $com->error);
|
||||
}
|
||||
@ -97,8 +100,7 @@ if ($idobject > 0)
|
||||
|
||||
// -------------------- END OF YOUR CODE --------------------
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
if (! $error) {
|
||||
$db->commit();
|
||||
print '--- end ok'."\n";
|
||||
} else {
|
||||
|
||||
@ -29,8 +29,8 @@ $path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||
exit;
|
||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Global variables
|
||||
@ -49,7 +49,10 @@ $langs->load("main"); // To load language file for default language
|
||||
|
||||
// Load user and its permissions
|
||||
$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
|
||||
if (! $result > 0) { dol_print_error('', $user->error); exit; }
|
||||
if (! $result > 0) {
|
||||
dol_print_error('', $user->error);
|
||||
exit;
|
||||
}
|
||||
$user->getrights();
|
||||
|
||||
|
||||
@ -79,8 +82,7 @@ $myproduct->weight_units = 0;
|
||||
|
||||
// Create product in database
|
||||
$idobject = $myproduct->create($user);
|
||||
if ($idobject > 0)
|
||||
{
|
||||
if ($idobject > 0) {
|
||||
print "OK Object created with id ".$idobject."\n";
|
||||
} else {
|
||||
$error++;
|
||||
@ -89,8 +91,7 @@ if ($idobject > 0)
|
||||
|
||||
// -------------------- END OF YOUR CODE --------------------
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
if (! $error) {
|
||||
$db->commit();
|
||||
print '--- end ok'."\n";
|
||||
} else {
|
||||
|
||||
@ -29,8 +29,8 @@ $path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||
exit;
|
||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Global variables
|
||||
@ -49,7 +49,10 @@ $langs->load("main"); // To load language file for default language
|
||||
|
||||
// Load user and its permissions
|
||||
$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
|
||||
if (! $result > 0) { dol_print_error('', $user->error); exit; }
|
||||
if (! $result > 0) {
|
||||
dol_print_error('', $user->error);
|
||||
exit;
|
||||
}
|
||||
$user->getrights();
|
||||
|
||||
|
||||
@ -69,18 +72,17 @@ $obj->nom = 'ABCDEF';
|
||||
|
||||
// Create user
|
||||
$idobject=$obj->create($user);
|
||||
if ($idobject > 0)
|
||||
{
|
||||
if ($idobject > 0) {
|
||||
// Change status to validated
|
||||
$result=$obj->setStatut(1);
|
||||
if ($result > 0) print "OK Object created with id ".$idobject."\n";
|
||||
else {
|
||||
if ($result > 0) {
|
||||
print "OK Object created with id ".$idobject."\n";
|
||||
} else {
|
||||
$error++;
|
||||
dol_print_error($db, $obj->error);
|
||||
}
|
||||
} elseif ($obj->error == 'ErrorLoginAlreadyExists')
|
||||
{
|
||||
print "User with login ".$obj->login." already exists\n";
|
||||
} elseif ($obj->error == 'ErrorLoginAlreadyExists') {
|
||||
print "User with login ".$obj->login." already exists\n";
|
||||
} else {
|
||||
$error++;
|
||||
dol_print_error($db, $obj->error);
|
||||
@ -89,8 +91,7 @@ if ($idobject > 0)
|
||||
|
||||
// -------------------- END OF YOUR CODE --------------------
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
if (! $error) {
|
||||
$db->commit();
|
||||
print '--- end ok'."\n";
|
||||
} else {
|
||||
|
||||
@ -29,8 +29,8 @@ $path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||
exit;
|
||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Global variables
|
||||
@ -49,14 +49,17 @@ $langs->load("main"); // To load language file for default language
|
||||
|
||||
// Load user and its permissions
|
||||
$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
|
||||
if (! $result > 0) { dol_print_error('', $user->error); exit; }
|
||||
if (! $result > 0) {
|
||||
dol_print_error('', $user->error);
|
||||
exit;
|
||||
}
|
||||
$user->getrights();
|
||||
|
||||
|
||||
print "***** ".$script_file." (".$version.") *****\n";
|
||||
if (! isset($argv[1])) { // Check parameters
|
||||
print "Usage: ".$script_file." id_thirdparty ...\n";
|
||||
exit;
|
||||
print "Usage: ".$script_file." id_thirdparty ...\n";
|
||||
exit;
|
||||
}
|
||||
print '--- start'."\n";
|
||||
print 'Argument id_thirdparty='.$argv[1]."\n";
|
||||
|
||||
49
dev/examples/git/pre-commit
Normal file
49
dev/examples/git/pre-commit
Normal file
@ -0,0 +1,49 @@
|
||||
#!/bin/sh
|
||||
|
||||
PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"`
|
||||
STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php`
|
||||
|
||||
# Determine if a file list is passed
|
||||
if [ "$#" -eq 1 ]
|
||||
then
|
||||
oIFS=$IFS
|
||||
IFS='
|
||||
'
|
||||
SFILES="$1"
|
||||
IFS=$oIFS
|
||||
fi
|
||||
SFILES=${SFILES:-$STAGED_FILES_CMD}
|
||||
|
||||
echo "Checking PHP Lint..."
|
||||
for FILE in $SFILES
|
||||
do
|
||||
php -l -d display_errors=0 $PROJECT/$FILE
|
||||
if [ $? != 0 ]
|
||||
then
|
||||
echo "Fix the error before commit."
|
||||
exit 1
|
||||
fi
|
||||
FILES="$FILES $PROJECT/$FILE"
|
||||
done
|
||||
|
||||
if [ "$FILES" != "" ]
|
||||
then
|
||||
echo "Running PHPCS Code Sniffer..."
|
||||
#~/vendor/bin/phpcs --version
|
||||
#phpcs --standard=PSR2 --encoding=utf-8 -n -p $FILES
|
||||
# Check Dolibarr standard
|
||||
~/vendor/bin/phpcs -s -p -d memory_limit=-1 --parallel=2 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true $FILES
|
||||
# Check your own standard
|
||||
#~/vendor/bin/phpcs -s -p -d memory_limit=-1 --parallel=2 --extensions=php --colors --tab-width=4 --standard=htdocs/custom/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true $FILES
|
||||
|
||||
if [ $? != 0 ]
|
||||
then
|
||||
# fix standard errors
|
||||
~/vendor/bin/phpcbf -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true $FILES
|
||||
#~/vendor/bin/phpcbf -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=htdocs/custom/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true $FILES
|
||||
echo "Fix the error before commit."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
exit $?
|
||||
Binary file not shown.
@ -1,3 +1,7 @@
|
||||
Barcode EAN 13
|
||||
|
||||
FR
|
||||
==
|
||||
Signification des chiffres.
|
||||
|
||||
- 2 chiffres pour le code pays ou code systeme
|
||||
@ -9,6 +13,24 @@ Cette regle subit de nombreuses entorses pour ameliorer l'usage des chiffres dis
|
||||
Voici la liste des codes pays ou systeme :
|
||||
|
||||
|
||||
|
||||
EN
|
||||
==
|
||||
Meaning of the numbers.
|
||||
|
||||
- 2 digits for the country code or system code
|
||||
- 5 digits for the company identifier
|
||||
- 5 digits for item identifier
|
||||
- 1 digit for checksum
|
||||
|
||||
This rule has been twisted many times to improve the use of the available numbers.
|
||||
Here is the list of country codes or system:
|
||||
|
||||
|
||||
|
||||
List
|
||||
====
|
||||
|
||||
00 <20> 13 UCC (Etats-Unis et Canada)
|
||||
20 <20> 29 Codification interne en magasin
|
||||
30 <20> 37 GENCOD-EAN France
|
||||
@ -104,4 +126,4 @@ Voici la liste des codes pays ou systeme :
|
||||
978 - 979 Livres (ISBN)
|
||||
980 Refus de remboursement
|
||||
981 - 982 Coupons (monnaie courante)
|
||||
99 Coupons
|
||||
99 Coupons
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
* Page with license compatibility
|
||||
https://www.gnu.org/licenses/quick-guide-gplv3.fr.html
|
||||
[EN] https://www.gnu.org/licenses/quick-guide-gplv3.en.html
|
||||
[FR] https://www.gnu.org/licenses/quick-guide-gplv3.fr.html
|
||||
|
||||
* FAQ on GPL license
|
||||
https://www.fsf.org/licensing/licenses/gpl-faq.html
|
||||
|
||||
@ -5,13 +5,13 @@ server {
|
||||
|
||||
root /path/to/your/htdocs;
|
||||
|
||||
# Optionnal
|
||||
# Optional
|
||||
error_log /path/to/your/log/directory/nginx.error.log;
|
||||
access_log /path/to/your/log/directory/nginx.access.log;
|
||||
|
||||
index index.php index.html index.htm;
|
||||
|
||||
# Optionnal
|
||||
# Optional
|
||||
server_name your-fqdn.tld;
|
||||
|
||||
location / {
|
||||
@ -23,6 +23,6 @@ server {
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_read_timeout 600;
|
||||
include fastcgi_params;
|
||||
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||
fastcgi_pass unix:/var/run/php5-fpm.sock; // /var/run/php/php7.0-fpm.sock
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,18 +6,15 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
This directory contains several subdirectories with entries for
|
||||
informations on Dolibarr.<br>
|
||||
But if you are looking for other resources (downloads, documentation, addons, ...), you can find this
|
||||
on Internet on web following sites:<br>
|
||||
<br>
|
||||
* <a href="https://wiki.dolibarr.org">Dolibarr wiki (documentation)</a><br>
|
||||
This directory contains several subdirectories with entries for informations on Dolibarr.<br>
|
||||
But if you are looking for other resources (downloads, documentation, addons, ...), you can find this on Internet on web following sites:<br>
|
||||
|
||||
<br>
|
||||
* <a href="https://www.dolibarr.org">Dolibarr portal (official website)</a><br>
|
||||
<br>
|
||||
* <a href="https://demo.dolibarr.org">Dolibarr demo (online)</a><br>
|
||||
* <a href="https://wiki.dolibarr.org">Dolibarr wiki (documentation)</a><br>
|
||||
<br>
|
||||
* <a href="https://www.nltechno.com/pages/dolibarrwinbin.php">DoliWamp, the Dolibarr for Windows</a><br>
|
||||
* <a href="https://demo.dolibarr.org">Dolibarr demo (online)</a><br>
|
||||
<br>
|
||||
* <a href="https://www.dolistore.com">DoliStore (official addons/plugins market place)</a><br>
|
||||
|
||||
|
||||
@ -444,9 +444,6 @@ if ($id)
|
||||
// Form to add a new line
|
||||
if ($tabname[$id])
|
||||
{
|
||||
$alabelisused = 0;
|
||||
$var = false;
|
||||
|
||||
$fieldlist = explode(',', $tabfield[$id]);
|
||||
|
||||
// Line for title
|
||||
@ -481,7 +478,6 @@ if ($id)
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') $alabelisused = 1;
|
||||
}
|
||||
|
||||
print '<td>';
|
||||
@ -612,7 +608,7 @@ if ($id)
|
||||
print ' <input type="submit" class="button button-cancel" name="actioncancel" value="'.$langs->trans("Cancel").'"></td>';
|
||||
} else {
|
||||
$tmpaction = 'view';
|
||||
$parameters = array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
$error = $hookmanager->error; $errors = $hookmanager->errors;
|
||||
|
||||
@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
$error = 0;
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("bills", "accountancy"));
|
||||
$langs->loadLangs(array("bills", "accountancy", "compta"));
|
||||
|
||||
$mesg = '';
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
@ -41,7 +41,9 @@ $id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$rowid = GETPOST('rowid', 'int');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$accountingaccount = GETPOST('accountingaccount', 'alpha');
|
||||
|
||||
$account_number = GETPOST('account_number', 'string');
|
||||
$label = GETPOST('label', 'alpha');
|
||||
|
||||
// Security check
|
||||
if ($user->socid > 0) accessforbidden();
|
||||
@ -65,104 +67,118 @@ if (GETPOST('cancel', 'alpha'))
|
||||
if ($action == 'add' && $user->rights->accounting->chartofaccount)
|
||||
{
|
||||
if (!$cancel) {
|
||||
$sql = 'SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid='.$conf->global->CHARTOFACCOUNTS;
|
||||
|
||||
dol_syslog('accountancy/admin/card.php:: $sql='.$sql);
|
||||
$result = $db->query($sql);
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
// Clean code
|
||||
|
||||
// To manage zero or not at the end of the accounting account
|
||||
if ($conf->global->ACCOUNTING_MANAGE_ZERO == 1)
|
||||
if (!$account_number)
|
||||
{
|
||||
$account_number = GETPOST('account_number', 'string');
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountNumber")), null, 'errors');
|
||||
$action = 'create';
|
||||
} elseif (!$label)
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
|
||||
$action = 'create';
|
||||
} else {
|
||||
$account_number = clean_account(GETPOST('account_number', 'string'));
|
||||
}
|
||||
$sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid='.((int) $conf->global->CHARTOFACCOUNTS);
|
||||
|
||||
if (GETPOST('account_parent', 'int') <= 0)
|
||||
{
|
||||
$account_parent = 0;
|
||||
} else {
|
||||
$account_parent = GETPOST('account_parent', 'int');
|
||||
}
|
||||
dol_syslog('accountancy/admin/card.php:: $sql=' . $sql);
|
||||
$result = $db->query($sql);
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
$object->fk_pcg_version = $obj->pcg_version;
|
||||
$object->pcg_type = GETPOST('pcg_type', 'alpha');
|
||||
$object->account_number = $account_number;
|
||||
$object->account_parent = $account_parent;
|
||||
$object->account_category = GETPOST('account_category', 'alpha');
|
||||
$object->label = GETPOST('label', 'alpha');
|
||||
$object->labelshort = GETPOST('labelshort', 'alpha');
|
||||
$object->active = 1;
|
||||
// Clean code
|
||||
|
||||
$res = $object->create($user);
|
||||
if ($res == - 3) {
|
||||
$error = 1;
|
||||
$action = "create";
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
} elseif ($res == - 4) {
|
||||
$error = 2;
|
||||
$action = "create";
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
} elseif ($res < 0)
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = "create";
|
||||
}
|
||||
if (!$error)
|
||||
{
|
||||
setEventMessages("RecordCreatedSuccessfully", null, 'mesgs');
|
||||
$urltogo = $backtopage ? $backtopage : dol_buildpath('/accountancy/admin/account.php', 1);
|
||||
header("Location: ".$urltogo);
|
||||
exit;
|
||||
// To manage zero or not at the end of the accounting account
|
||||
if ($conf->global->ACCOUNTING_MANAGE_ZERO == 1) {
|
||||
$account_number = $account_number;
|
||||
} else {
|
||||
$account_number = clean_account($account_number);
|
||||
}
|
||||
|
||||
if (GETPOST('account_parent', 'int') <= 0) {
|
||||
$account_parent = 0;
|
||||
} else {
|
||||
$account_parent = GETPOST('account_parent', 'int');
|
||||
}
|
||||
|
||||
$object->fk_pcg_version = $obj->pcg_version;
|
||||
$object->pcg_type = GETPOST('pcg_type', 'alpha');
|
||||
$object->account_number = $account_number;
|
||||
$object->account_parent = $account_parent;
|
||||
$object->account_category = GETPOST('account_category', 'alpha');
|
||||
$object->label = $label;
|
||||
$object->labelshort = GETPOST('labelshort', 'alpha');
|
||||
$object->active = 1;
|
||||
|
||||
$res = $object->create($user);
|
||||
if ($res == -3) {
|
||||
$error = 1;
|
||||
$action = "create";
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
} elseif ($res == -4) {
|
||||
$error = 2;
|
||||
$action = "create";
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
} elseif ($res < 0) {
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = "create";
|
||||
}
|
||||
if (!$error) {
|
||||
setEventMessages("RecordCreatedSuccessfully", null, 'mesgs');
|
||||
$urltogo = $backtopage ? $backtopage : dol_buildpath('/accountancy/admin/account.php', 1);
|
||||
header("Location: " . $urltogo);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'edit' && $user->rights->accounting->chartofaccount) {
|
||||
if (!$cancel) {
|
||||
$result = $object->fetch($id);
|
||||
|
||||
$sql = 'SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid='.$conf->global->CHARTOFACCOUNTS;
|
||||
|
||||
dol_syslog('accountancy/admin/card.php:: $sql='.$sql);
|
||||
$result2 = $db->query($sql);
|
||||
$obj = $db->fetch_object($result2);
|
||||
|
||||
// Clean code
|
||||
|
||||
// To manage zero or not at the end of the accounting account
|
||||
if ($conf->global->ACCOUNTING_MANAGE_ZERO == 1)
|
||||
if (!$account_number)
|
||||
{
|
||||
$account_number = GETPOST('account_number', 'string');
|
||||
} else {
|
||||
$account_number = clean_account(GETPOST('account_number', 'string'));
|
||||
}
|
||||
|
||||
if (GETPOST('account_parent', 'int') <= 0)
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountNumber")), null, 'errors');
|
||||
$action = 'update';
|
||||
} elseif (!$label)
|
||||
{
|
||||
$account_parent = 0;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
|
||||
$action = 'update';
|
||||
} else {
|
||||
$account_parent = GETPOST('account_parent', 'int');
|
||||
}
|
||||
$result = $object->fetch($id);
|
||||
|
||||
$object->fk_pcg_version = $obj->pcg_version;
|
||||
$object->pcg_type = GETPOST('pcg_type', 'alpha');
|
||||
$object->account_number = $account_number;
|
||||
$object->account_parent = $account_parent;
|
||||
$object->account_category = GETPOST('account_category', 'alpha');
|
||||
$object->label = GETPOST('label', 'alpha');
|
||||
$object->labelshort = GETPOST('labelshort', 'alpha');
|
||||
$sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS;
|
||||
|
||||
$result = $object->update($user);
|
||||
dol_syslog('accountancy/admin/card.php:: $sql=' . $sql);
|
||||
$result2 = $db->query($sql);
|
||||
$obj = $db->fetch_object($result2);
|
||||
|
||||
if ($result > 0) {
|
||||
$urltogo = $backtopage ? $backtopage : ($_SERVER["PHP_SELF"]."?id=".$id);
|
||||
header("Location: ".$urltogo);
|
||||
exit();
|
||||
} else {
|
||||
$mesg = $object->error;
|
||||
// Clean code
|
||||
|
||||
// To manage zero or not at the end of the accounting account
|
||||
if ($conf->global->ACCOUNTING_MANAGE_ZERO == 1) {
|
||||
$account_number = $account_number;
|
||||
} else {
|
||||
$account_number = clean_account($account_number);
|
||||
}
|
||||
|
||||
if (GETPOST('account_parent', 'int') <= 0) {
|
||||
$account_parent = 0;
|
||||
} else {
|
||||
$account_parent = GETPOST('account_parent', 'int');
|
||||
}
|
||||
|
||||
$object->fk_pcg_version = $obj->pcg_version;
|
||||
$object->pcg_type = GETPOST('pcg_type', 'alpha');
|
||||
$object->account_number = $account_number;
|
||||
$object->account_parent = $account_parent;
|
||||
$object->account_category = GETPOST('account_category', 'alpha');
|
||||
$object->label = $label;
|
||||
$object->labelshort = GETPOST('labelshort', 'alpha');
|
||||
|
||||
$result = $object->update($user);
|
||||
|
||||
if ($result > 0) {
|
||||
$urltogo = $backtopage ? $backtopage : ($_SERVER["PHP_SELF"] . "?id=" . $id);
|
||||
header("Location: " . $urltogo);
|
||||
exit();
|
||||
} else {
|
||||
$mesg = $object->error;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$urltogo = $backtopage ? $backtopage : ($_SERVER["PHP_SELF"]."?id=".$id);
|
||||
@ -222,7 +238,7 @@ if ($action == 'create') {
|
||||
|
||||
// Account number
|
||||
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans("AccountNumber").'</span></td>';
|
||||
print '<td><input name="account_number" size="30" value="'.$accountingaccount.'"></td></tr>';
|
||||
print '<td><input name="account_number" size="30" value="'.$account_number.'"></td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Label").'</span></td>';
|
||||
|
||||
@ -438,8 +438,6 @@ if ($id)
|
||||
// Form to add a new line
|
||||
if ($tabname[$id])
|
||||
{
|
||||
$alabelisused = 0;
|
||||
|
||||
$fieldlist = explode(',', $tabfield[$id]);
|
||||
|
||||
// Line for title
|
||||
@ -496,7 +494,6 @@ if ($id)
|
||||
else print $valuetoshow;
|
||||
print '</td>';
|
||||
}
|
||||
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') $alabelisused = 1;
|
||||
}
|
||||
|
||||
print '<td>';
|
||||
|
||||
@ -100,7 +100,7 @@ if ($action == 'update') {
|
||||
if ($action == 'setlistsorttodo') {
|
||||
$setlistsorttodo = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_TODO", $setlistsorttodo, 'yesno', 0, '', $conf->entity);
|
||||
if (!$res > 0) {
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
@ -114,9 +114,10 @@ if ($action == 'setlistsorttodo') {
|
||||
if ($action == 'setlistsortdone') {
|
||||
$setlistsortdone = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_DONE", $setlistsortdone, 'yesno', 0, '', $conf->entity);
|
||||
if (!$res > 0) {
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
@ -127,9 +128,10 @@ if ($action == 'setlistsortdone') {
|
||||
if ($action == 'setmanagezero') {
|
||||
$setmanagezero = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_MANAGE_ZERO", $setmanagezero, 'yesno', 0, '', $conf->entity);
|
||||
if (!$res > 0) {
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
@ -140,9 +142,10 @@ if ($action == 'setmanagezero') {
|
||||
if ($action == 'setdisabledirectinput') {
|
||||
$setdisabledirectinput = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity);
|
||||
if (!$res > 0) {
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
@ -153,9 +156,10 @@ if ($action == 'setdisabledirectinput') {
|
||||
if ($action == 'setenabledraftexport') {
|
||||
$setenabledraftexport = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport, 'yesno', 0, '', $conf->entity);
|
||||
if (!$res > 0) {
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
@ -166,9 +170,10 @@ if ($action == 'setenabledraftexport') {
|
||||
if ($action == 'setenablesubsidiarylist') {
|
||||
$setenablesubsidiarylist = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTANCY_COMBO_FOR_AUX", $setenablesubsidiarylist, 'yesno', 0, '', $conf->entity);
|
||||
if (!$res > 0) {
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
@ -179,9 +184,10 @@ if ($action == 'setenablesubsidiarylist') {
|
||||
if ($action == 'setdisablebindingonsales') {
|
||||
$setdisablebindingonsales = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_SALES", $setdisablebindingonsales, 'yesno', 0, '', $conf->entity);
|
||||
if (!$res > 0) {
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
@ -192,9 +198,10 @@ if ($action == 'setdisablebindingonsales') {
|
||||
if ($action == 'setdisablebindingonpurchases') {
|
||||
$setdisablebindingonpurchases = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_PURCHASES", $setdisablebindingonpurchases, 'yesno', 0, '', $conf->entity);
|
||||
if (!$res > 0) {
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
@ -205,9 +212,10 @@ if ($action == 'setdisablebindingonpurchases') {
|
||||
if ($action == 'setdisablebindingonexpensereports') {
|
||||
$setdisablebindingonexpensereports = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS", $setdisablebindingonexpensereports, 'yesno', 0, '', $conf->entity);
|
||||
if (!$res > 0) {
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
@ -215,9 +223,11 @@ if ($action == 'setdisablebindingonexpensereports') {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$title = $langs->trans('ConfigAccountingExpert');
|
||||
|
||||
@ -407,8 +407,6 @@ if ($id)
|
||||
// Form to add a new line
|
||||
if ($tabname[$id])
|
||||
{
|
||||
$alabelisused = 0;
|
||||
|
||||
$fieldlist = explode(',', $tabfield[$id]);
|
||||
|
||||
// Line for title
|
||||
@ -437,7 +435,6 @@ if ($id)
|
||||
else print $valuetoshow;
|
||||
print '</td>';
|
||||
}
|
||||
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') $alabelisused = 1;
|
||||
}
|
||||
|
||||
print '<td>';
|
||||
|
||||
@ -372,26 +372,26 @@ if ($result)
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans('Options').'</td><td>'.$langs->trans('Description').'</td>';
|
||||
print "</tr>\n";
|
||||
print '<tr class="oddeven"><td class="titlefield"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_SELL"'.($accounting_product_mode == 'ACCOUNTANCY_SELL' ? ' checked' : '').'> '.$langs->trans('OptionModeProductSell').'</td>';
|
||||
print '<tr class="oddeven"><td><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_SELL"'.($accounting_product_mode == 'ACCOUNTANCY_SELL' ? ' checked' : '').'> '.$langs->trans('OptionModeProductSell').'</td>';
|
||||
print '<td>'.$langs->trans('OptionModeProductSellDesc');
|
||||
print "</td></tr>\n";
|
||||
if ($mysoc->isInEEC())
|
||||
{
|
||||
print '<tr class="oddeven"><td class="titlefield"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_SELL_INTRA"'.($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA' ? ' checked' : '').'> '.$langs->trans('OptionModeProductSellIntra').'</td>';
|
||||
print '<tr class="oddeven"><td><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_SELL_INTRA"'.($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA' ? ' checked' : '').'> '.$langs->trans('OptionModeProductSellIntra').'</td>';
|
||||
print '<td>'.$langs->trans('OptionModeProductSellIntraDesc');
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
print '<tr class="oddeven"><td class="titlefield"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_SELL_EXPORT"'.($accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT' ? ' checked' : '').'> '.$langs->trans('OptionModeProductSellExport').'</td>';
|
||||
print '<tr class="oddeven"><td><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_SELL_EXPORT"'.($accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT' ? ' checked' : '').'> '.$langs->trans('OptionModeProductSellExport').'</td>';
|
||||
print '<td>'.$langs->trans('OptionModeProductSellExportDesc');
|
||||
print "</td></tr>\n";
|
||||
print '<tr class="oddeven"><td class="titlefield"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY"'.($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '').'> '.$langs->trans('OptionModeProductBuy').'</td>';
|
||||
print '<tr class="oddeven"><td><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY"'.($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '').'> '.$langs->trans('OptionModeProductBuy').'</td>';
|
||||
print '<td>'.$langs->trans('OptionModeProductBuyDesc')."</td></tr>\n";
|
||||
if ($mysoc->isInEEC())
|
||||
{
|
||||
print '<tr class="oddeven"><td class="titlefield"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY_INTRA"'.($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA' ? ' checked' : '').'> '.$langs->trans('OptionModeProductBuyIntra').'</td>';
|
||||
print '<tr class="oddeven"><td><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY_INTRA"'.($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA' ? ' checked' : '').'> '.$langs->trans('OptionModeProductBuyIntra').'</td>';
|
||||
print '<td>'.$langs->trans('OptionModeProductBuyDesc')."</td></tr>\n";
|
||||
}
|
||||
print '<tr class="oddeven"><td class="titlefield"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY_EXPORT"'.($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT' ? ' checked' : '').'> '.$langs->trans('OptionModeProductBuyExport').'</td>';
|
||||
print '<tr class="oddeven"><td><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY_EXPORT"'.($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT' ? ' checked' : '').'> '.$langs->trans('OptionModeProductBuyExport').'</td>';
|
||||
print '<td>'.$langs->trans('OptionModeProductBuyDesc')."</td></tr>\n";
|
||||
print "</table>\n";
|
||||
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -37,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("accountancy"));
|
||||
$langs->loadLangs(array("accountancy", "compta"));
|
||||
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
@ -88,6 +87,7 @@ if (empty($search_date_start) && !GETPOSTISSET('formfilteraction'))
|
||||
} 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)
|
||||
@ -306,7 +306,7 @@ if ($action != 'export_csv')
|
||||
|
||||
$accountingaccountstatic->fetch(null, $line->numero_compte, true);
|
||||
if (!empty($accountingaccountstatic->account_number)) {
|
||||
$accounting_account = $accountingaccountstatic->getNomUrl(0, 1);
|
||||
$accounting_account = $accountingaccountstatic->getNomUrl(0, 1, 0, '', 0, -1, 0, 'accountcard');
|
||||
} else {
|
||||
$accounting_account = length_accountg($line->numero_compte);
|
||||
}
|
||||
@ -321,8 +321,19 @@ if ($action != 'export_csv')
|
||||
$root_account_description = $tmparrayforrootaccount['label'];
|
||||
$root_account_number = $tmparrayforrootaccount['account_number'];
|
||||
|
||||
//var_dump($tmparrayforrootaccount);
|
||||
//var_dump($accounting_account);
|
||||
//var_dump($accountingaccountstatic);
|
||||
if (empty($accountingaccountstatic->label) && $accountingaccountstatic->id > 0) {
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/card.php?action=update&token='.newToken().'&id='.$accountingaccountstatic->id.'">'.img_edit().'</a>';
|
||||
$link = '<a class="editfielda reposition" href="' . DOL_URL_ROOT . '/accountancy/admin/card.php?action=update&token=' . newToken() . '&id=' . $accountingaccountstatic->id . '">' . img_edit() . '</a>';
|
||||
} elseif ($accounting_account == 'NotDefined') {
|
||||
$link = '<a href="' . DOL_URL_ROOT . '/accountancy/admin/card.php?action=create&token=' . newToken() . '&accountingaccount=' . length_accountg($line->numero_compte) . '">' . img_edit_add() . '</a>';
|
||||
} elseif (empty($tmparrayforrootaccount['label'])) {
|
||||
// $tmparrayforrootaccount['label'] not defined = the account has not parent with a parent.
|
||||
// This is useless, we should not create a new account when an account has no parent, we must edit it to fix its parent.
|
||||
// BUG 1: Accounts on level root or level 1 must not have a parent 2 level higher, so shoule not show a link to create another account.
|
||||
// BUG 2: Adding a link to create a new accounting account here is useless because it is not add as parent of the orphelin.
|
||||
//$link = '<a href="' . DOL_URL_ROOT . '/accountancy/admin/card.php?action=create&token=' . newToken() . '&accountingaccount=' . length_accountg($line->numero_compte) . '">' . img_edit_add() . '</a>';
|
||||
}
|
||||
|
||||
if (!empty($show_subgroup))
|
||||
@ -360,8 +371,22 @@ if ($action != 'export_csv')
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$accounting_account.'</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) print '<td class="nowraponall right">'.price($opening_balance).'</td>';
|
||||
print '<td class="nowraponall right">'.price($line->debit).'</td>';
|
||||
print '<td class="nowraponall right">'.price($line->credit).'</td>';
|
||||
|
||||
$urlzoom = '';
|
||||
if ($line->numero_compte) {
|
||||
$urlzoom = DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start='.urlencode($line->numero_compte).'&search_accountancy_code_end='.urlencode($line->numero_compte);
|
||||
if (GETPOSTISSET('date_startmonth')) {
|
||||
$urlzoom .= '&search_date_startmonth='.GETPOST('date_startmonth', 'int').'&search_date_startday='.GETPOST('date_startday', 'int').'&search_date_startyear='.GETPOST('date_startyear', 'int');
|
||||
}
|
||||
if (GETPOSTISSET('date_endmonth')) {
|
||||
$urlzoom .= '&search_date_endmonth='.GETPOST('date_endmonth', 'int').'&search_date_endday='.GETPOST('date_endday', 'int').'&search_date_endyear='.GETPOST('date_endyear', 'int');
|
||||
}
|
||||
}
|
||||
// Debit
|
||||
print '<td class="nowraponall right"><a href="'.$urlzoom.'">'.price($line->debit).'</a></td>';
|
||||
// Credit
|
||||
print '<td class="nowraponall right"><a href="'.$urlzoom.'">'.price($line->credit).'</a></td>';
|
||||
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="nowraponall right">'.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).'</td>';
|
||||
} else {
|
||||
|
||||
@ -63,9 +63,11 @@ $accountingjournal->fetch(null, $journal_code);
|
||||
$journal_label = $accountingjournal->label;
|
||||
|
||||
$subledger_account = GETPOST('subledger_account', 'alphanohtml');
|
||||
if ($subledger_account == - 1) {
|
||||
if ($subledger_account == -1) {
|
||||
$subledger_account = null;
|
||||
}
|
||||
$subledger_label = GETPOST('subledger_label', 'alphanohtml');
|
||||
|
||||
$label_operation = GETPOST('label_operation', 'alphanohtml');
|
||||
$debit = price2num(GETPOST('debit', 'alpha'));
|
||||
$credit = price2num(GETPOST('credit', 'alpha'));
|
||||
@ -108,6 +110,7 @@ if ($action == "confirm_update") {
|
||||
} else {
|
||||
$object->numero_compte = $accountingaccount_number;
|
||||
$object->subledger_account = $subledger_account;
|
||||
$object->subledger_label = $subledger_label;
|
||||
$object->label_compte = $accountingaccount_label;
|
||||
$object->label_operation = $label_operation;
|
||||
$object->debit = $debit;
|
||||
@ -160,6 +163,7 @@ if ($action == "confirm_update") {
|
||||
|
||||
$object->numero_compte = $accountingaccount_number;
|
||||
$object->subledger_account = $subledger_account;
|
||||
$object->subledger_label = $subledger_label;
|
||||
$object->label_compte = $accountingaccount_label;
|
||||
$object->label_operation = $label_operation;
|
||||
$object->debit = $debit;
|
||||
@ -224,9 +228,10 @@ if ($action == "confirm_update") {
|
||||
$action = 'create';
|
||||
$error++;
|
||||
}
|
||||
if (!GETPOST('next_num_mvt', 'alpha'))
|
||||
if (!GETPOST('doc_ref', 'alpha'))
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("NumPiece")), null, 'errors');
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Piece")), null, 'errors');
|
||||
$action = 'create';
|
||||
$error++;
|
||||
}
|
||||
|
||||
@ -371,7 +376,7 @@ if ($action == 'create')
|
||||
print '</tr>';
|
||||
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Piece").'</td>';
|
||||
print '<td class="fieldrequired">'.$langs->trans("Piece").'</td>';
|
||||
print '<td><input type="text" class="minwidth200" name="doc_ref" value="'.GETPOST('doc_ref', 'alpha').'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -577,7 +582,7 @@ if ($action == 'create')
|
||||
|
||||
print '<br>';
|
||||
|
||||
$result = $object->fetchAllPerMvt($piece_num, $mode);
|
||||
$result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
} else {
|
||||
@ -594,7 +599,8 @@ if ($action == 'create')
|
||||
print '<input type="hidden" name="fk_docdet" value="'.$object->fk_docdet.'">'."\n";
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">'."\n";
|
||||
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
if (count($object->linesmvt) > 0) {
|
||||
$total_debit = 0;
|
||||
$total_credit = 0;
|
||||
@ -616,18 +622,22 @@ if ($action == 'create')
|
||||
$total_credit += $line->credit;
|
||||
|
||||
if ($action == 'update' && $line->id == $id) {
|
||||
print '<!-- td columns in edit mode -->';
|
||||
print '<td>';
|
||||
print $formaccounting->select_account((GETPOSTISSET("accountingaccount_number") ? GETPOST("accountingaccount_number", "alpha") : $line->numero_compte), 'accountingaccount_number', 1, array(), 1, 1, '');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
// 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))
|
||||
{
|
||||
// TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because:
|
||||
// It does not use the setup of "key pressed" to select a thirdparty and this hang browser on large databases.
|
||||
// Also, it is not possible to use a value that is not in the list.
|
||||
// Also, the label is not automatically filled when a value is selected.
|
||||
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
|
||||
print $formaccounting->select_auxaccount((GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account), 'subledger_account', 1);
|
||||
} else {
|
||||
print '<input type="text" class="maxwidth150" name="subledger_account" value="'.(GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account).'">';
|
||||
print '<input type="text" class="maxwidth150" name="subledger_account" value="'.(GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">';
|
||||
}
|
||||
// Add also input for subledger label
|
||||
print '<br><input type="text" class="maxwidth150" name="subledger_label" value="'.(GETPOSTISSET("subledger_label") ? GETPOST("subledger_label", "alpha") : $line->subledger_label).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">';
|
||||
print '</td>';
|
||||
print '<td><input type="text" class="minwidth200" name="label_operation" value="'.(GETPOSTISSET("label_operation") ? GETPOST("label_operation", "alpha") : $line->label_operation).'"></td>';
|
||||
print '<td class="right"><input type="text" size="6" class="right" name="debit" value="'.(GETPOSTISSET("debit") ? GETPOST("debit", "alpha") : price($line->debit)).'"></td>';
|
||||
@ -639,20 +649,24 @@ if ($action == 'create')
|
||||
} else {
|
||||
$accountingaccount->fetch(null, $line->numero_compte, true);
|
||||
print '<td>'.$accountingaccount->getNomUrl(0, 1, 1, '', 0).'</td>';
|
||||
print '<td>'.length_accounta($line->subledger_account).'</td>';
|
||||
print '<td>'.length_accounta($line->subledger_account);
|
||||
if ($line->subledger_label) {
|
||||
print ' - <span class="opacitymedium">'.$line->subledger_label.'</span>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>'.$line->label_operation.'</td>';
|
||||
print '<td class="nowrap right">'.price($line->debit).'</td>';
|
||||
print '<td class="nowrap right">'.price($line->credit).'</td>';
|
||||
|
||||
print '<td class="center">';
|
||||
print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=update&id='.$line->id.'&piece_num='.$line->piece_num.'&mode='.$mode.'">';
|
||||
print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=update&id='.$line->id.'&piece_num='.urlencode($line->piece_num).'&mode='.urlencode($mode).'&token='.urlencode(newToken()).'">';
|
||||
print img_edit('', 0, 'class="marginrightonly"');
|
||||
print '</a> ';
|
||||
|
||||
$actiontodelete = 'delete';
|
||||
if ($mode == '_tmp' || $action != 'delmouv') $actiontodelete = 'confirm_delete';
|
||||
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action='.$actiontodelete.'&id='.$line->id.'&piece_num='.$line->piece_num.'&mode='.$mode.'">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action='.$actiontodelete.'&id='.$line->id.'&piece_num='.urlencode($line->piece_num).'&mode='.urlencode($mode).'&token='.urlencode(newToken()).'">';
|
||||
print img_delete();
|
||||
|
||||
print '</a>';
|
||||
@ -671,18 +685,21 @@ if ($action == 'create')
|
||||
|
||||
if ($action == "" || $action == 'add') {
|
||||
print '<tr class="oddeven">';
|
||||
print '<!-- td columns in add mode -->';
|
||||
print '<td>';
|
||||
print $formaccounting->select_account('', 'accountingaccount_number', 1, array(), 1, 1, '');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
// 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))
|
||||
{
|
||||
// TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because:
|
||||
// It does not use the setup of "key pressed" to select a thirdparty and this hang browser on large databases.
|
||||
// Also, it is not possible to use a value that is not in the list.
|
||||
// Also, the label is not automatically filled when a value is selected.
|
||||
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
|
||||
print $formaccounting->select_auxaccount('', 'subledger_account', 1);
|
||||
} else {
|
||||
print '<input type="text" class="maxwidth150" name="subledger_account" value="">';
|
||||
print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">';
|
||||
}
|
||||
print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">';
|
||||
print '</td>';
|
||||
print '<td><input type="text" class="minwidth200" name="label_operation" value="'.$label_operation.'"/></td>';
|
||||
print '<td class="right"><input type="text" size="6" class="right" name="debit" value=""/></td>';
|
||||
|
||||
@ -36,7 +36,7 @@ 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"));
|
||||
$langs->loadLangs(array("accountancy", "compta"));
|
||||
|
||||
$socid = GETPOST('socid', 'int');
|
||||
|
||||
@ -87,7 +87,7 @@ $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_reconciled_option', '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);
|
||||
@ -140,6 +140,7 @@ if (!in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !GE
|
||||
|
||||
$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),
|
||||
@ -148,7 +149,6 @@ $arrayfields = array(
|
||||
't.debit'=>array('label'=>$langs->trans("Debit"), 'checked'=>1),
|
||||
't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1),
|
||||
't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1),
|
||||
't.code_journal'=>array('label'=>$langs->trans("Codejournal"), '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),
|
||||
@ -661,11 +661,11 @@ if (empty($reshook)) {
|
||||
}
|
||||
$newcardbutton .= '<span class="valignmiddle marginrightonly">'.$langs->trans("IncludeDocsAlreadyExported").'</span>';
|
||||
|
||||
$newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file'.($param ? '&'.$param : ''), $user->rights->accounting->mouvements->export);
|
||||
if (!empty($user->rights->accounting->mouvements->export)) $newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file'.($param ? '&'.$param : ''), $user->rights->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/listbysubaccount.php', '', 1, array('morecss' => 'marginleftonly'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbysubaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly'));
|
||||
|
||||
$url = './card.php?action=create';
|
||||
if (!empty($socid)) $url .= '&socid='.$socid;
|
||||
@ -688,11 +688,17 @@ print '<table class="tagtable liste centpercent">';
|
||||
|
||||
// Filters lines
|
||||
print '<tr class="liste_titre_filter">';
|
||||
|
||||
// Movement number
|
||||
if (!empty($arrayfields['t.piece_num']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre"><input type="text" name="search_mvt_num" size="6" value="'.dol_escape_htmltag($search_mvt_num).'"></td>';
|
||||
}
|
||||
// Code journal
|
||||
if (!empty($arrayfields['t.code_journal']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre center"><input type="text" name="search_ledger_code" size="3" value="'.(is_array($search_ledger_code) ? join('|', $search_ledger_code) : $search_ledger_code).'"></td>';
|
||||
}
|
||||
// Date document
|
||||
if (!empty($arrayfields['t.doc_date']['checked']))
|
||||
{
|
||||
@ -778,14 +784,7 @@ if (!empty($arrayfields['t.lettering_code']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre center">';
|
||||
print '<input type="text" size="3" class="flat" name="search_lettering_code" value="'.$search_lettering_code.'"/>';
|
||||
print '<br><span class="nowrap"><input type="checkbox" name="search_reconciled_option" value="notreconciled"'.($search_not_reconciled == 'notreconciled' ? ' checked' : '').'>'.$langs->trans("NotReconciled").'</span>';
|
||||
print '</td>';
|
||||
}
|
||||
// Code journal
|
||||
if (!empty($arrayfields['t.code_journal']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre center">';
|
||||
print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1);
|
||||
print '<br><span class="nowrap"><input type="checkbox" name="search_not_reconciled" value="notreconciled"'.($search_not_reconciled == 'notreconciled' ? ' checked' : '').'>'.$langs->trans("NotReconciled").'</span>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -839,6 +838,7 @@ print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
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);
|
||||
@ -847,7 +847,6 @@ if (!empty($arrayfields['t.label_operation']['checked'])) print_liste_field_tit
|
||||
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 ');
|
||||
if (!empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
// Hook fields
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||
@ -913,6 +912,16 @@ while ($i < min($num, $limit))
|
||||
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 '<td class="center">'.$journaltoshow.'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Document date
|
||||
if (!empty($arrayfields['t.doc_date']['checked']))
|
||||
{
|
||||
@ -1040,16 +1049,6 @@ while ($i < min($num, $limit))
|
||||
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 '<td class="center">'.$journaltoshow.'</td>';
|
||||
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
|
||||
|
||||
@ -48,6 +48,14 @@ $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(0, 0, 0, $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_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(0, 0, 0, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
|
||||
|
||||
$search_accountancy_code = GETPOST("search_accountancy_code");
|
||||
$search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha');
|
||||
@ -66,7 +74,7 @@ $search_ledger_code = GETPOST('search_ledger_code', 'array');
|
||||
$search_debit = GETPOST('search_debit', 'alpha');
|
||||
$search_credit = GETPOST('search_credit', 'alpha');
|
||||
$search_lettering_code = GETPOST('search_lettering_code', 'alpha');
|
||||
$search_not_reconciled = GETPOST('search_reconciled_option', 'alpha');
|
||||
$search_not_reconciled = GETPOST('search_not_reconciled', 'alpha');
|
||||
|
||||
if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) {
|
||||
$action = 'delbookkeepingyear';
|
||||
@ -120,14 +128,15 @@ if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('searc
|
||||
|
||||
$arrayfields = array(
|
||||
// 't.subledger_account'=>array('label'=>$langs->trans("SubledgerAccount"), 'checked'=>1),
|
||||
't.code_journal'=>array('label'=>$langs->trans("Codejournal"), 'checked'=>1),
|
||||
'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.label_operation'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
|
||||
't.debit'=>array('label'=>$langs->trans("Debit"), 'checked'=>1),
|
||||
't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1),
|
||||
't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1),
|
||||
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1),
|
||||
);
|
||||
|
||||
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.lettering_code']);
|
||||
@ -181,6 +190,14 @@ if (empty($reshook))
|
||||
$search_date_endyear = '';
|
||||
$search_date_endmonth = '';
|
||||
$search_date_endday = '';
|
||||
$search_date_export_start = '';
|
||||
$search_date_export_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_debit = '';
|
||||
$search_credit = '';
|
||||
$search_lettering_code = '';
|
||||
@ -253,6 +270,14 @@ if (empty($reshook))
|
||||
$filter['t.reconciled_option'] = $search_not_reconciled;
|
||||
$param .= '&search_not_reconciled='.urlencode($search_not_reconciled);
|
||||
}
|
||||
if (!empty($search_date_export_start)) {
|
||||
$filter['t.date_export>='] = $search_date_export_start;
|
||||
$param .= '&search_date_export_startmonth='.$search_date_export_startmonth.'&search_date_export_startday='.$search_date_export_startday.'&search_date_export_startyear='.$search_date_export_startyear;
|
||||
}
|
||||
if (!empty($search_date_export_end)) {
|
||||
$filter['t.date_export<='] = $search_date_export_end;
|
||||
$param .= '&search_date_export_endmonth='.$search_date_export_endmonth.'&search_date_export_endday='.$search_date_export_endday.'&search_date_export_endyear='.$search_date_export_endyear;
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) {
|
||||
@ -403,7 +428,7 @@ $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $obj
|
||||
if (empty($reshook)) {
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbysubaccount.php', '', 1, array('morecss' => 'marginleftonly'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbysubaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create');
|
||||
}
|
||||
|
||||
@ -448,6 +473,11 @@ print '<table class="tagtable liste centpercent">';
|
||||
// Filters lines
|
||||
print '<tr class="liste_titre_filter">';
|
||||
|
||||
// Movement number
|
||||
if (!empty($arrayfields['t.piece_num']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre"><input type="text" name="search_mvt_num" size="6" value="'.dol_escape_htmltag($search_mvt_num).'"></td>';
|
||||
}
|
||||
// Code journal
|
||||
if (!empty($arrayfields['t.code_journal']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
@ -465,11 +495,6 @@ if (!empty($arrayfields['t.doc_date']['checked'])) {
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
// Movement number
|
||||
if (!empty($arrayfields['t.piece_num']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre"><input type="text" name="search_mvt_num" size="6" value="'.dol_escape_htmltag($search_mvt_num).'"></td>';
|
||||
}
|
||||
// Ref document
|
||||
if (!empty($arrayfields['t.doc_ref']['checked'])) {
|
||||
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_doc_ref" value="'.dol_escape_htmltag($search_doc_ref).'"/></td>';
|
||||
@ -491,7 +516,18 @@ if (!empty($arrayfields['t.lettering_code']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre center">';
|
||||
print '<input type="text" size="3" class="flat" name="search_lettering_code" value="'.$search_lettering_code.'"/>';
|
||||
print '<br><span class="nowrap"><input type="checkbox" name="search_reconciled_option" value="notreconciled"'.($search_not_reconciled == 'notreconciled' ? ' checked' : '').'>'.$langs->trans("NotReconciled").'</span>';
|
||||
print '<br><span class="nowrap"><input type="checkbox" name="search_not_reconciled" value="notreconciled"'.($search_not_reconciled == 'notreconciled' ? ' checked' : '').'>'.$langs->trans("NotReconciled").'</span>';
|
||||
print '</td>';
|
||||
}
|
||||
// Date export
|
||||
if (!empty($arrayfields['t.date_export']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_export_start, 'search_date_export_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_export_end, 'search_date_export_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -508,14 +544,15 @@ print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
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.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.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.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 ');
|
||||
if (!empty($arrayfields['t.date_export']['checked'])) print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
// 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
|
||||
@ -546,13 +583,12 @@ while ($i < min($num, $limit))
|
||||
|
||||
// Is it a break ?
|
||||
if ($accountg != $displayed_account_number || !isset($displayed_account_number)) {
|
||||
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
$colnumber = 3;
|
||||
$colnumberend = 7;
|
||||
} else {
|
||||
$colnumber = 4;
|
||||
$colnumberend = 7;
|
||||
}
|
||||
$colnumber = 5;
|
||||
$colnumberend = 7;
|
||||
|
||||
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) $colnumber--;
|
||||
if (empty($arrayfields['t.date_export']['checked'])) $colnumber--;
|
||||
|
||||
$colspan = $totalarray['nbfield'] - $colnumber;
|
||||
$colspanend = $totalarray['nbfield'] - $colnumberend;
|
||||
// Show a subtotal by accounting account
|
||||
@ -585,7 +621,7 @@ while ($i < min($num, $limit))
|
||||
|
||||
// Show the break account
|
||||
print "<tr>";
|
||||
print '<td colspan="'.($totalarray['nbfield'] ? $totalarray['nbfield'] : 9).'" style="font-weight:bold; border-bottom: 1pt solid black;">';
|
||||
print '<td colspan="'.($totalarray['nbfield'] ? $totalarray['nbfield'] : 10).'" style="font-weight:bold; border-bottom: 1pt solid black;">';
|
||||
if ($line->numero_compte != "" && $line->numero_compte != '-1') print length_accountg($line->numero_compte).' : '.$object->get_compte_desc($line->numero_compte);
|
||||
else print '<span class="error">'.$langs->trans("Unknown").'</span>';
|
||||
print '</td>';
|
||||
@ -601,6 +637,17 @@ while ($i < min($num, $limit))
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Piece number
|
||||
if (!empty($arrayfields['t.piece_num']['checked']))
|
||||
{
|
||||
print '<td>';
|
||||
$object->id = $line->id;
|
||||
$object->piece_num = $line->piece_num;
|
||||
print $object->getNomUrl(1, '', 0, '', 1);
|
||||
print '</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Journal code
|
||||
if (!empty($arrayfields['t.code_journal']['checked']))
|
||||
{
|
||||
@ -618,17 +665,6 @@ while ($i < min($num, $limit))
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Piece number
|
||||
if (!empty($arrayfields['t.piece_num']['checked']))
|
||||
{
|
||||
print '<td>';
|
||||
$object->id = $line->id;
|
||||
$object->piece_num = $line->piece_num;
|
||||
print $object->getNomUrl(1, '', 0, '', 1);
|
||||
print '</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Document ref
|
||||
if (!empty($arrayfields['t.doc_ref']['checked']))
|
||||
{
|
||||
@ -735,6 +771,13 @@ while ($i < min($num, $limit))
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Exported operation date
|
||||
if (!empty($arrayfields['t.date_export']['checked']))
|
||||
{
|
||||
print '<td class="center">'.dol_print_date($line->date_export, 'dayhour').'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
|
||||
@ -763,14 +806,6 @@ while ($i < min($num, $limit))
|
||||
}
|
||||
|
||||
if ($num > 0) {
|
||||
// Show sub-total of last shown account
|
||||
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
$colnumber = 3;
|
||||
$colnumberend = 7;
|
||||
} else {
|
||||
$colnumber = 4;
|
||||
$colnumberend = 7;
|
||||
}
|
||||
$colspan = $totalarray['nbfield'] - $colnumber;
|
||||
$colspanend = $totalarray['nbfield'] - $colnumberend;
|
||||
print '<tr class="liste_total">';
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2020 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* 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
|
||||
@ -39,15 +39,23 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
$langs->loadLangs(array("accountancy", "compta"));
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$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_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(0, 0, 0, $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_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(0, 0, 0, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
|
||||
|
||||
$search_accountancy_code = GETPOST("search_accountancy_code");
|
||||
$search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha');
|
||||
@ -66,23 +74,29 @@ $search_ledger_code = GETPOST('search_ledger_code', 'array');
|
||||
$search_debit = GETPOST('search_debit', 'alpha');
|
||||
$search_credit = GETPOST('search_credit', 'alpha');
|
||||
$search_lettering_code = GETPOST('search_lettering_code', 'alpha');
|
||||
$search_not_reconciled = GETPOST('search_reconciled_option', 'alpha');
|
||||
$search_not_reconciled = GETPOST('search_not_reconciled', 'alpha');
|
||||
|
||||
if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) {
|
||||
$action = 'delbookkeepingyear';
|
||||
}
|
||||
|
||||
// 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);
|
||||
$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');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
if (empty($page) || $page < 0) { $page = 0; }
|
||||
if (empty($page) || $page < 0) {
|
||||
$page = 0;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if ($sortorder == "") $sortorder = "ASC";
|
||||
if ($sortfield == "") $sortfield = "t.doc_date,t.rowid";
|
||||
if ($sortorder == "") {
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
if ($sortfield == "") {
|
||||
$sortfield = "t.doc_date,t.rowid";
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$object = new BookKeeping($db);
|
||||
@ -105,11 +119,12 @@ if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('searc
|
||||
} 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
|
||||
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)
|
||||
{
|
||||
if ($month_end < 1) {
|
||||
$month_end = 12;
|
||||
$year_end--;
|
||||
}
|
||||
@ -120,17 +135,20 @@ if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('searc
|
||||
|
||||
$arrayfields = array(
|
||||
// 't.subledger_account'=>array('label'=>$langs->trans("SubledgerAccount"), 'checked'=>1),
|
||||
't.code_journal'=>array('label'=>$langs->trans("Codejournal"), 'checked'=>1),
|
||||
'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.label_operation'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
|
||||
't.debit'=>array('label'=>$langs->trans("Debit"), 'checked'=>1),
|
||||
't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1),
|
||||
't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1),
|
||||
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1),
|
||||
);
|
||||
|
||||
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.lettering_code']);
|
||||
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
|
||||
unset($arrayfields['t.lettering_code']);
|
||||
}
|
||||
|
||||
if ($search_date_start && empty($search_date_startyear)) {
|
||||
$tmparray = dol_getdate($search_date_start);
|
||||
@ -149,19 +167,23 @@ if ($search_date_end && empty($search_date_endyear)) {
|
||||
/*
|
||||
* Action
|
||||
*/
|
||||
if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; }
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; }
|
||||
if (GETPOST('cancel', 'alpha')) {
|
||||
$action = 'list'; $massaction = '';
|
||||
}
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
|
||||
$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 ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
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
|
||||
{
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
|
||||
$search_doc_date = '';
|
||||
$search_accountancy_code = '';
|
||||
$search_accountancy_code_start = '';
|
||||
@ -180,6 +202,14 @@ if (empty($reshook))
|
||||
$search_date_endyear = '';
|
||||
$search_date_endmonth = '';
|
||||
$search_date_endday = '';
|
||||
$search_date_export_start = '';
|
||||
$search_date_export_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_debit = '';
|
||||
$search_credit = '';
|
||||
$search_lettering_code = '';
|
||||
@ -252,6 +282,14 @@ if (empty($reshook))
|
||||
$filter['t.reconciled_option'] = $search_not_reconciled;
|
||||
$param .= '&search_not_reconciled='.urlencode($search_not_reconciled);
|
||||
}
|
||||
if (!empty($search_date_export_start)) {
|
||||
$filter['t.date_export>='] = $search_date_export_start;
|
||||
$param .= '&search_date_export_startmonth='.$search_date_export_startmonth.'&search_date_export_startday='.$search_date_export_startday.'&search_date_export_startyear='.$search_date_export_startyear;
|
||||
}
|
||||
if (!empty($search_date_export_end)) {
|
||||
$filter['t.date_export<='] = $search_date_export_end;
|
||||
$param .= '&search_date_export_endmonth='.$search_date_export_endmonth.'&search_date_export_endday='.$search_date_export_endday.'&search_date_export_endyear='.$search_date_export_endyear;
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) {
|
||||
@ -279,8 +317,7 @@ if ($action == 'delbookkeepingyearconfirm' && $user->rights->accounting->mouveme
|
||||
$deljournal = 0;
|
||||
}
|
||||
|
||||
if (!empty($delmonth) || !empty($delyear) || !empty($deljournal))
|
||||
{
|
||||
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');
|
||||
@ -289,7 +326,7 @@ if ($action == 'delbookkeepingyearconfirm' && $user->rights->accounting->mouveme
|
||||
}
|
||||
|
||||
// Make a redirect to avoid to launch the delete later after a back button
|
||||
header("Location: listbysubaccount.php".($param ? '?'.$param : ''));
|
||||
header("Location: ".$_SERVER["PHP_SELF"].($param ? '?'.$param : ''));
|
||||
exit;
|
||||
} else {
|
||||
setEventMessages("NoRecordDeleted", null, 'warnings');
|
||||
@ -306,7 +343,7 @@ if ($action == 'delmouvconfirm' && $user->rights->accounting->mouvements->suppri
|
||||
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
|
||||
}
|
||||
|
||||
header("Location: listbysubaccount.php?noreset=1".($param ? '&'.$param : ''));
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?noreset=1".($param ? '&'.$param : ''));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@ -393,7 +430,9 @@ if ($action == 'delbookkeepingyear') {
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
if ($optioncss != '') {
|
||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
}
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
@ -403,14 +442,17 @@ $parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) {
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php', '', 1, array('morecss' => 'marginleftonly'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbysubaccount.php', '', 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/listbysubaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create');
|
||||
}
|
||||
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
}
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.urlencode($limit);
|
||||
}
|
||||
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
@ -418,11 +460,16 @@ print info_admin($langs->trans("WarningRecordWithoutSubledgerAreExcluded"));
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
if ($massactionbutton) $selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
|
||||
if ($massactionbutton) {
|
||||
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
|
||||
}
|
||||
|
||||
// Reverse sort order
|
||||
if (preg_match('/^asc/i', $sortorder)) $sortorder = "asc";
|
||||
else $sortorder = "desc";
|
||||
if (preg_match('/^asc/i', $sortorder)) {
|
||||
$sortorder = "asc";
|
||||
} else {
|
||||
$sortorder = "desc";
|
||||
}
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
@ -439,8 +486,11 @@ $moreforfilter .= '</div>';
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
|
||||
else $moreforfilter = $hookmanager->resPrint;
|
||||
if (empty($reshook)) {
|
||||
$moreforfilter .= $hookmanager->resPrint;
|
||||
} else {
|
||||
$moreforfilter = $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||
print $moreforfilter;
|
||||
@ -452,6 +502,11 @@ print '<table class="tagtable liste centpercent">';
|
||||
// Filters lines
|
||||
print '<tr class="liste_titre_filter">';
|
||||
|
||||
// Movement number
|
||||
if (!empty($arrayfields['t.piece_num']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre"><input type="text" name="search_mvt_num" size="6" value="'.dol_escape_htmltag($search_mvt_num).'"></td>';
|
||||
}
|
||||
// Code journal
|
||||
if (!empty($arrayfields['t.code_journal']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
@ -469,11 +524,6 @@ if (!empty($arrayfields['t.doc_date']['checked'])) {
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
// Movement number
|
||||
if (!empty($arrayfields['t.piece_num']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre"><input type="text" name="search_mvt_num" size="6" value="'.dol_escape_htmltag($search_mvt_num).'"></td>';
|
||||
}
|
||||
// Ref document
|
||||
if (!empty($arrayfields['t.doc_ref']['checked'])) {
|
||||
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_doc_ref" value="'.dol_escape_htmltag($search_doc_ref).'"/></td>';
|
||||
@ -491,11 +541,21 @@ if (!empty($arrayfields['t.credit']['checked'])) {
|
||||
print '<td class="liste_titre right"><input type="text" class="flat" name="search_credit" size="4" value="'.dol_escape_htmltag($search_credit).'"></td>';
|
||||
}
|
||||
// Lettering code
|
||||
if (!empty($arrayfields['t.lettering_code']['checked']))
|
||||
{
|
||||
if (!empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print '<input type="text" size="3" class="flat" name="search_lettering_code" value="'.$search_lettering_code.'"/>';
|
||||
print '<br><span class="nowrap"><input type="checkbox" name="search_reconciled_option" value="notreconciled"'.($search_not_reconciled == 'notreconciled' ? ' checked' : '').'>'.$langs->trans("NotReconciled").'</span>';
|
||||
print '<br><span class="nowrap"><input type="checkbox" name="search_not_reconciled" value="notreconciled"'.($search_not_reconciled == 'notreconciled' ? ' checked' : '').'>'.$langs->trans("NotReconciled").'</span>';
|
||||
print '</td>';
|
||||
}
|
||||
// Date export
|
||||
if (!empty($arrayfields['t.date_export']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_export_start, 'search_date_export_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_export_end, 'search_date_export_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -512,14 +572,33 @@ print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
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.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.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.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 ');
|
||||
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.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 ');
|
||||
}
|
||||
if (!empty($arrayfields['t.date_export']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
// 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
|
||||
@ -538,8 +617,7 @@ $displayed_account_number = null; // Start with undefined to be able to distingu
|
||||
// --------------------------------------------------------------------
|
||||
$i = 0;
|
||||
$totalarray = array();
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
while ($i < min($num, $limit)) {
|
||||
$line = $object->lines[$i];
|
||||
|
||||
$total_debit += $line->debit;
|
||||
@ -550,15 +628,15 @@ while ($i < min($num, $limit))
|
||||
|
||||
// Is it a break ?
|
||||
if ($accountg != $displayed_account_number || !isset($displayed_account_number)) {
|
||||
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
$colnumber = 3;
|
||||
$colnumberend = 7;
|
||||
} else {
|
||||
$colnumber = 4;
|
||||
$colnumberend = 7;
|
||||
}
|
||||
$colnumber = 5;
|
||||
$colnumberend = 7;
|
||||
|
||||
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) $colnumber--;
|
||||
if (empty($arrayfields['t.date_export']['checked'])) $colnumber--;
|
||||
|
||||
$colspan = $totalarray['nbfield'] - $colnumber;
|
||||
$colspanend = $totalarray['nbfield'] - $colnumberend;
|
||||
|
||||
// Show a subtotal by accounting account
|
||||
if (isset($displayed_account_number)) {
|
||||
print '<tr class="liste_total">';
|
||||
@ -571,8 +649,7 @@ while ($i < min($num, $limit))
|
||||
$balance = $sous_total_debit - $sous_total_credit;
|
||||
print '<tr class="liste_total">';
|
||||
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("Balance").':</td>';
|
||||
if ($balance > 0)
|
||||
{
|
||||
if ($balance > 0) {
|
||||
print '<td class="nowraponall right">';
|
||||
print price($sous_total_debit - $sous_total_credit);
|
||||
print '</td>';
|
||||
@ -589,14 +666,18 @@ while ($i < min($num, $limit))
|
||||
|
||||
// Show the break account
|
||||
print "<tr>";
|
||||
print '<td colspan="'.($totalarray['nbfield'] ? $totalarray['nbfield'] : 9).'" style="font-weight:bold; border-bottom: 1pt solid black;">';
|
||||
print '<td colspan="'.($totalarray['nbfield'] ? $totalarray['nbfield'] : 10).'" style="font-weight:bold; border-bottom: 1pt solid black;">';
|
||||
if ($line->subledger_account != "" && $line->subledger_account != '-1') {
|
||||
print $object->get_compte_desc($line->numero_compte).' : '.length_accounta($line->subledger_account);
|
||||
} else {
|
||||
// Should not happen: subledger account must be null or a non empty value
|
||||
print '<span class="error">'.$langs->trans("Unknown");
|
||||
if ($line->subledger_label) print ' ('.$line->subledger_label.')';
|
||||
$htmltext = 'EmptyStringForSubledgerAccountButSubledgerLabelDefined';
|
||||
if ($line->subledger_label) {
|
||||
print ' ('.$line->subledger_label.')';
|
||||
$htmltext = 'EmptyStringForSubledgerAccountButSubledgerLabelDefined';
|
||||
} else {
|
||||
$htmltext = 'EmptyStringForSubledgerAccountAndSubledgerLabel';
|
||||
}
|
||||
print $form->textwithpicto('', $htmltext);
|
||||
print '</span>';
|
||||
}
|
||||
@ -613,39 +694,40 @@ while ($i < min($num, $limit))
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// 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 '<td class="center">'.$journaltoshow.'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Document date
|
||||
if (!empty($arrayfields['t.doc_date']['checked']))
|
||||
{
|
||||
print '<td class="center">'.dol_print_date($line->doc_date, 'day').'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Piece number
|
||||
if (!empty($arrayfields['t.piece_num']['checked']))
|
||||
{
|
||||
if (!empty($arrayfields['t.piece_num']['checked'])) {
|
||||
print '<td>';
|
||||
$object->id = $line->id;
|
||||
$object->piece_num = $line->piece_num;
|
||||
print $object->getNomUrl(1, '', 0, '', 1);
|
||||
print '</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
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 '<td class="center">'.$journaltoshow.'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Document date
|
||||
if (!empty($arrayfields['t.doc_date']['checked'])) {
|
||||
print '<td class="center">'.dol_print_date($line->doc_date, 'day').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Document ref
|
||||
if (!empty($arrayfields['t.doc_ref']['checked']))
|
||||
{
|
||||
if ($line->doc_type == 'customer_invoice')
|
||||
{
|
||||
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';
|
||||
@ -657,8 +739,7 @@ while ($i < min($num, $limit))
|
||||
$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')
|
||||
{
|
||||
} elseif ($line->doc_type == 'supplier_invoice') {
|
||||
$langs->loadLangs(array('bills'));
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
@ -670,8 +751,7 @@ while ($i < min($num, $limit))
|
||||
$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')
|
||||
{
|
||||
} elseif ($line->doc_type == 'expense_report') {
|
||||
$langs->loadLangs(array('trips'));
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
||||
@ -683,8 +763,7 @@ while ($i < min($num, $limit))
|
||||
$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')
|
||||
{
|
||||
} 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);
|
||||
@ -698,8 +777,7 @@ while ($i < min($num, $limit))
|
||||
// Picto + Ref
|
||||
print '<td class="nobordernopadding">';
|
||||
|
||||
if ($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice' || $line->doc_type == 'expense_report')
|
||||
{
|
||||
if ($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice' || $line->doc_type == 'expense_report') {
|
||||
print $objectstatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1);
|
||||
print $documentlink;
|
||||
} elseif ($line->doc_type == 'bank') {
|
||||
@ -712,7 +790,9 @@ while ($i < min($num, $limit))
|
||||
print '</td></tr></table>';
|
||||
|
||||
print "</td>\n";
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Label operation
|
||||
@ -720,30 +800,47 @@ while ($i < min($num, $limit))
|
||||
// Affiche un lien vers la facture client/fournisseur
|
||||
$doc_ref = preg_replace('/\(.*\)/', '', $line->doc_ref);
|
||||
print strlen(length_accounta($line->subledger_account)) == 0 ? '<td>'.$line->label_operation.'</td>' : '<td>'.$line->label_operation.'<br><span style="font-size:0.8em">('.length_accounta($line->subledger_account).')</span></td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Amount debit
|
||||
if (!empty($arrayfields['t.debit']['checked']))
|
||||
{
|
||||
if (!empty($arrayfields['t.debit']['checked'])) {
|
||||
print '<td class="nowrap right">'.($line->debit ? price($line->debit) : '').'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totaldebit';
|
||||
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 '<td class="nowrap right">'.($line->credit ? price($line->credit) : '').'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalcredit';
|
||||
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']))
|
||||
{
|
||||
if (!empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
print '<td class="center">'.$line->lettering_code.'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Exported operation date
|
||||
if (!empty($arrayfields['t.date_export']['checked']))
|
||||
{
|
||||
print '<td class="center">'.dol_print_date($line->date_export, 'dayhour').'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -763,7 +860,9 @@ while ($i < min($num, $limit))
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Comptabilise le sous-total
|
||||
$sous_total_debit += $line->debit;
|
||||
@ -775,14 +874,6 @@ while ($i < min($num, $limit))
|
||||
}
|
||||
|
||||
if ($num > 0) {
|
||||
// Show sub-total of last shown account
|
||||
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
$colnumber = 3;
|
||||
$colnumberend = 7;
|
||||
} else {
|
||||
$colnumber = 4;
|
||||
$colnumberend = 7;
|
||||
}
|
||||
$colspan = $totalarray['nbfield'] - $colnumber;
|
||||
$colspanend = $totalarray['nbfield'] - $colnumberend;
|
||||
print '<tr class="liste_total">';
|
||||
@ -795,8 +886,7 @@ if ($num > 0) {
|
||||
$balance = $sous_total_debit - $sous_total_credit;
|
||||
print '<tr class="liste_total">';
|
||||
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("Balance").':</td>';
|
||||
if ($balance > 0)
|
||||
{
|
||||
if ($balance > 0) {
|
||||
print '<td class="nowraponall right">';
|
||||
print price($sous_total_debit - $sous_total_credit);
|
||||
print '</td>';
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -37,14 +37,17 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta", "accountancy"));
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$show_files = GETPOST('show_files', 'int');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
// $socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int');
|
||||
// Security check
|
||||
$socid = GETPOSTINT("socid");
|
||||
// if ($user->socid) $socid=$user->socid;
|
||||
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$limit = GETPOSTISSET('limit') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
@ -54,10 +57,12 @@ if (empty($page) || $page == - 1) {
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if ($sortorder == "")
|
||||
if ($sortorder == "") {
|
||||
$sortorder = "ASC";
|
||||
if ($sortfield == "")
|
||||
}
|
||||
if ($sortfield == "") {
|
||||
$sortfield = "bk.doc_date";
|
||||
}
|
||||
|
||||
/*
|
||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
|
||||
@ -74,23 +79,18 @@ if (!empty($lettering)) {
|
||||
/*
|
||||
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_date_start = '';
|
||||
$search_date_end = '';
|
||||
$search_date_start = '';
|
||||
$search_date_end = '';
|
||||
//$search_doc_type = '';
|
||||
$search_doc_ref = '';
|
||||
}
|
||||
*/
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST("socid", 'int');
|
||||
// if ($user->socid) $socid=$user->socid;
|
||||
|
||||
$lettering = new Lettering($db);
|
||||
$object = new Societe($db);
|
||||
$object->id = $socid;
|
||||
$result = $object->fetch($socid);
|
||||
if ($result < 0)
|
||||
{
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
@ -208,30 +208,30 @@ if ($resql) {
|
||||
print '<table class="liste centpercent">'."\n";
|
||||
|
||||
/*
|
||||
print '<tr class="liste_titre">';
|
||||
//print '<td><input type="text" name="search_doc_type" value="' . $search_doc_type . '"></td>';
|
||||
print '<tr class="liste_titre">';
|
||||
//print '<td><input type="text" name="search_doc_type" value="' . $search_doc_type . '"></td>';
|
||||
|
||||
// Date
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $langs->trans('From') . ' ';
|
||||
print $form->selectDate($search_date_start, 'date_creation_start', 0, 0, 1);
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $langs->trans('to') . ' ';
|
||||
print $form->selectDate($search_date_end, 'date_creation_end', 0, 0, 1);
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
// Date
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $langs->trans('From') . ' ';
|
||||
print $form->selectDate($search_date_start, 'date_creation_start', 0, 0, 1);
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $langs->trans('to') . ' ';
|
||||
print $form->selectDate($search_date_end, 'date_creation_end', 0, 0, 1);
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
|
||||
// Piece
|
||||
print '<td><input type="text" name="search_doc_ref" value="' . $search_doc_ref . '"></td>';
|
||||
// Piece
|
||||
print '<td><input type="text" name="search_doc_ref" value="' . $search_doc_ref . '"></td>';
|
||||
|
||||
print '<td colspan="6"> </td>';
|
||||
print '<td class="right">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '<td colspan="6"> </td>';
|
||||
print '<td class="right">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
*/
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -251,7 +251,9 @@ if ($resql) {
|
||||
$tmp = '';
|
||||
|
||||
while ($obj = $db->fetch_object($resql)) {
|
||||
if ($tmp != $obj->lettering_code || empty($tmp)) $tmp = $obj->lettering_code;
|
||||
if ($tmp != $obj->lettering_code || empty($tmp)) {
|
||||
$tmp = $obj->lettering_code;
|
||||
}
|
||||
/*if ($tmp != $obj->lettering_code || empty($obj->lettering_code))*/ $solde += ($obj->credit - $obj->debit);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@ -41,7 +41,11 @@ $massaction = GETPOST('massaction', 'alpha');
|
||||
$show_files = GETPOST('show_files', 'int');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$socid = GETPOST('socid', 'int') ? ((int) GETPOST('socid', 'int')) : ((int) GETPOST('id', 'int'));
|
||||
// $socid = GETPOST('socid', 'int') ? ((int) GETPOST('socid', 'int')) : ((int) GETPOST('id', 'int'));
|
||||
// Security check
|
||||
$socid = GETPOSTINT("socid");
|
||||
// if ($user->socid) $socid=$user->socid;
|
||||
|
||||
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
@ -53,10 +57,12 @@ if (empty($page) || $page == - 1) {
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if ($sortorder == "")
|
||||
if ($sortorder == "") {
|
||||
$sortorder = "ASC";
|
||||
if ($sortfield == "")
|
||||
}
|
||||
if ($sortfield == "") {
|
||||
$sortfield = "bk.doc_date";
|
||||
}
|
||||
|
||||
/*
|
||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
|
||||
@ -73,24 +79,18 @@ if (!empty($lettering)) {
|
||||
/*
|
||||
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_date_start = '';
|
||||
$search_date_end = '';
|
||||
$search_date_start = '';
|
||||
$search_date_end = '';
|
||||
//$search_doc_type='';
|
||||
$search_doc_ref='';
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST("socid", 'int');
|
||||
// if ($user->socid) $socid=$user->socid;
|
||||
|
||||
$lettering = new Lettering($db);
|
||||
$object = new Societe($db);
|
||||
$object->id = $socid;
|
||||
$result = $object->fetch($socid);
|
||||
if ($result < 0)
|
||||
{
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
@ -159,8 +159,7 @@ $solde = 0;
|
||||
// Count total nb of records and calc total sum
|
||||
$nbtotalofrecords = '';
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql)
|
||||
{
|
||||
if (!$resql) {
|
||||
dol_print_error($db);
|
||||
exit;
|
||||
}
|
||||
@ -206,30 +205,30 @@ if ($resql) {
|
||||
print '<table class="liste centpercent">'."\n";
|
||||
|
||||
/*
|
||||
print '<tr class="liste_titre">';
|
||||
//print '<td><input type="text" name="search_doc_type" value="' . $search_doc_type . '"></td>';
|
||||
print '<tr class="liste_titre">';
|
||||
//print '<td><input type="text" name="search_doc_type" value="' . $search_doc_type . '"></td>';
|
||||
|
||||
// Date
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $langs->trans('From') . ' ';
|
||||
print $form->selectDate($search_date_start, 'date_creation_start', 0, 0, 1);
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $langs->trans('to') . ' ';
|
||||
print $form->selectDate($search_date_end, 'date_creation_end', 0, 0, 1);
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
// Date
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $langs->trans('From') . ' ';
|
||||
print $form->selectDate($search_date_start, 'date_creation_start', 0, 0, 1);
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $langs->trans('to') . ' ';
|
||||
print $form->selectDate($search_date_end, 'date_creation_end', 0, 0, 1);
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
|
||||
// Piece
|
||||
print '<td><input type="text" name="search_doc_ref" value="' . $search_doc_ref . '"></td>';
|
||||
// Piece
|
||||
print '<td><input type="text" name="search_doc_ref" value="' . $search_doc_ref . '"></td>';
|
||||
|
||||
print '<td colspan="6"> </td>';
|
||||
print '<td class="right">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '<td colspan="6"> </td>';
|
||||
print '<td class="right">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
*/
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -248,7 +247,9 @@ if ($resql) {
|
||||
$solde = 0;
|
||||
$tmp = '';
|
||||
while ($obj = $db->fetch_object($resql)) {
|
||||
if ($tmp != $obj->lettering_code || empty($tmp)) $tmp = $obj->lettering_code;
|
||||
if ($tmp != $obj->lettering_code || empty($tmp)) {
|
||||
$tmp = $obj->lettering_code;
|
||||
}
|
||||
/*if ($tmp != $obj->lettering_code || empty($obj->lettering_code))*/ $solde += ($obj->credit - $obj->debit);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@ -57,8 +57,8 @@ class AccountancyExport
|
||||
public static $EXPORT_TYPE_OPENCONCERTO = 100;
|
||||
public static $EXPORT_TYPE_LDCOMPTA = 110;
|
||||
public static $EXPORT_TYPE_LDCOMPTA10 = 120;
|
||||
public static $EXPORT_TYPE_GESTINUMV3 = 130;
|
||||
public static $EXPORT_TYPE_GESTINUMV5 = 135;
|
||||
public static $EXPORT_TYPE_GESTIMUMV3 = 130;
|
||||
public static $EXPORT_TYPE_GESTIMUMV5 = 135;
|
||||
public static $EXPORT_TYPE_FEC = 1000;
|
||||
public static $EXPORT_TYPE_FEC2 = 1010;
|
||||
|
||||
@ -119,8 +119,8 @@ class AccountancyExport
|
||||
self::$EXPORT_TYPE_CHARLEMAGNE => $langs->trans('Modelcsv_charlemagne'),
|
||||
self::$EXPORT_TYPE_LDCOMPTA => $langs->trans('Modelcsv_LDCompta'),
|
||||
self::$EXPORT_TYPE_LDCOMPTA10 => $langs->trans('Modelcsv_LDCompta10'),
|
||||
self::$EXPORT_TYPE_GESTINUMV3 => $langs->trans('Modelcsv_Gestinum_v3'),
|
||||
self::$EXPORT_TYPE_GESTINUMV5 => $langs->trans('Modelcsv_Gestinum_v5'),
|
||||
self::$EXPORT_TYPE_GESTIMUMV3 => $langs->trans('Modelcsv_Gestinum_v3'),
|
||||
self::$EXPORT_TYPE_GESTIMUMV5 => $langs->trans('Modelcsv_Gestinum_v5'),
|
||||
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
|
||||
self::$EXPORT_TYPE_FEC2 => $langs->trans('Modelcsv_FEC2'),
|
||||
);
|
||||
@ -154,8 +154,8 @@ class AccountancyExport
|
||||
self::$EXPORT_TYPE_CHARLEMAGNE => 'charlemagne',
|
||||
self::$EXPORT_TYPE_LDCOMPTA => 'ldcompta',
|
||||
self::$EXPORT_TYPE_LDCOMPTA10 => 'ldcompta10',
|
||||
self::$EXPORT_TYPE_GESTINUMV3 => 'gestinumv3',
|
||||
self::$EXPORT_TYPE_GESTINUMV5 => 'gestinumv5',
|
||||
self::$EXPORT_TYPE_GESTIMUMV3 => 'gestimumv3',
|
||||
self::$EXPORT_TYPE_GESTIMUMV5 => 'gestimumv5',
|
||||
self::$EXPORT_TYPE_FEC => 'fec',
|
||||
self::$EXPORT_TYPE_FEC2 => 'fec2',
|
||||
);
|
||||
@ -227,11 +227,13 @@ class AccountancyExport
|
||||
self::$EXPORT_TYPE_LDCOMPTA10 => array(
|
||||
'label' => $langs->trans('Modelcsv_LDCompta10'),
|
||||
),
|
||||
self::$EXPORT_TYPE_GESTINUMV3 => array(
|
||||
self::$EXPORT_TYPE_GESTIMUMV3 => array(
|
||||
'label' => $langs->trans('Modelcsv_Gestinumv3'),
|
||||
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
|
||||
),
|
||||
self::$EXPORT_TYPE_GESTINUMV5 => array(
|
||||
self::$EXPORT_TYPE_GESTIMUMV5 => array(
|
||||
'label' => $langs->trans('Modelcsv_Gestinumv5'),
|
||||
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
|
||||
),
|
||||
self::$EXPORT_TYPE_FEC => array(
|
||||
'label' => $langs->trans('Modelcsv_FEC'),
|
||||
@ -320,10 +322,10 @@ class AccountancyExport
|
||||
case self::$EXPORT_TYPE_LDCOMPTA10 :
|
||||
$this->exportLDCompta10($TData);
|
||||
break;
|
||||
case self::$EXPORT_TYPE_GESTINUMV3 :
|
||||
case self::$EXPORT_TYPE_GESTIMUMV3 :
|
||||
$this->exportGestimumV3($TData);
|
||||
break;
|
||||
case self::$EXPORT_TYPE_GESTINUMV5 :
|
||||
case self::$EXPORT_TYPE_GESTIMUMV5 :
|
||||
$this->exportGestimumV5($TData);
|
||||
break;
|
||||
case self::$EXPORT_TYPE_FEC :
|
||||
@ -820,6 +822,8 @@ class AccountancyExport
|
||||
*/
|
||||
public function exportFEC($objectLines)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$separator = "\t";
|
||||
$end_line = "\r\n";
|
||||
|
||||
@ -855,55 +859,55 @@ class AccountancyExport
|
||||
$date_limit_payment = dol_print_date($line->date_lim_reglement, '%Y%m%d');
|
||||
|
||||
// FEC:JournalCode
|
||||
print $line->code_journal.$separator;
|
||||
print $line->code_journal . $separator;
|
||||
|
||||
// FEC:JournalLib
|
||||
print $line->journal_label.$separator;
|
||||
print dol_string_unaccent($langs->transnoentities($line->journal_label)) . $separator;
|
||||
|
||||
// FEC:EcritureNum
|
||||
print $line->piece_num.$separator;
|
||||
print $line->piece_num . $separator;
|
||||
|
||||
// FEC:EcritureDate
|
||||
print $date_document.$separator;
|
||||
print $date_document . $separator;
|
||||
|
||||
// FEC:CompteNum
|
||||
print length_accountg($line->numero_compte).$separator;
|
||||
print $line->numero_compte . $separator;
|
||||
|
||||
// FEC:CompteLib
|
||||
print dol_string_unaccent($line->label_compte).$separator;
|
||||
print dol_string_unaccent($line->label_compte) . $separator;
|
||||
|
||||
// FEC:CompAuxNum
|
||||
print length_accounta($line->subledger_account).$separator;
|
||||
print $line->subledger_account . $separator;
|
||||
|
||||
// FEC:CompAuxLib
|
||||
print dol_string_unaccent($line->subledger_label).$separator;
|
||||
print dol_string_unaccent($line->subledger_label) . $separator;
|
||||
|
||||
// FEC:PieceRef
|
||||
print $line->doc_ref.$separator;
|
||||
print $line->doc_ref . $separator;
|
||||
|
||||
// FEC:PieceDate
|
||||
print $date_creation.$separator;
|
||||
print dol_string_unaccent($date_creation) . $separator;
|
||||
|
||||
// FEC:EcritureLib
|
||||
print dol_string_unaccent($line->label_operation).$separator;
|
||||
print dol_string_unaccent($line->label_operation) . $separator;
|
||||
|
||||
// FEC:Debit
|
||||
print price2fec($line->debit).$separator;
|
||||
print price2fec($line->debit) . $separator;
|
||||
|
||||
// FEC:Credit
|
||||
print price2fec($line->credit).$separator;
|
||||
print price2fec($line->credit) . $separator;
|
||||
|
||||
// FEC:EcritureLet
|
||||
print $line->lettering_code.$separator;
|
||||
print $line->lettering_code . $separator;
|
||||
|
||||
// FEC:DateLet
|
||||
print $date_lettering.$separator;
|
||||
print $date_lettering . $separator;
|
||||
|
||||
// FEC:ValidDate
|
||||
print $date_validation.$separator;
|
||||
print $date_validation . $separator;
|
||||
|
||||
// FEC:Montantdevise
|
||||
print $line->multicurrency_amount.$separator;
|
||||
print $line->multicurrency_amount . $separator;
|
||||
|
||||
// FEC:Idevise
|
||||
print $line->multicurrency_code.$separator;
|
||||
@ -924,6 +928,8 @@ class AccountancyExport
|
||||
*/
|
||||
public function exportFEC2($objectLines)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$separator = "\t";
|
||||
$end_line = "\r\n";
|
||||
|
||||
@ -962,7 +968,7 @@ class AccountancyExport
|
||||
print $line->code_journal . $separator;
|
||||
|
||||
// FEC:JournalLib
|
||||
print $line->journal_label . $separator;
|
||||
print dol_string_unaccent($langs->transnoentities($line->journal_label)) . $separator;
|
||||
|
||||
// FEC:EcritureNum
|
||||
print $line->piece_num . $separator;
|
||||
@ -1634,81 +1640,85 @@ class AccountancyExport
|
||||
$invoices_infos = array();
|
||||
$supplier_invoices_infos = array();
|
||||
foreach ($objectLines as $line) {
|
||||
$date = dol_print_date($line->doc_date, '%d/%m/%Y');
|
||||
|
||||
$invoice_ref = $line->doc_ref;
|
||||
$company_name = "";
|
||||
|
||||
if (($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice') && $line->fk_doc > 0) {
|
||||
if (($line->doc_type == 'customer_invoice' && !isset($invoices_infos[$line->fk_doc])) ||
|
||||
($line->doc_type == 'supplier_invoice' && !isset($supplier_invoices_infos[$line->fk_doc]))) {
|
||||
if ($line->doc_type == 'customer_invoice') {
|
||||
// Get new customer invoice ref and company name
|
||||
$sql = 'SELECT f.facnumber, s.nom FROM ' . MAIN_DB_PREFIX . 'facture as f';
|
||||
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON f.fk_soc = s.rowid';
|
||||
$sql .= ' WHERE f.rowid = ' . $line->fk_doc;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
if ($obj = $this->db->fetch_object($resql)) {
|
||||
// Save invoice infos
|
||||
$invoices_infos[$line->fk_doc] = array('ref' => $obj->facnumber, 'company_name' => $obj->nom);
|
||||
$invoice_ref = $obj->facnumber;
|
||||
$company_name = $obj->nom;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Get new supplier invoice ref and company name
|
||||
$sql = 'SELECT ff.ref, s.nom FROM ' . MAIN_DB_PREFIX . 'facture_fourn as ff';
|
||||
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON ff.fk_soc = s.rowid';
|
||||
$sql .= ' WHERE ff.rowid = ' . $line->fk_doc;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
if ($obj = $this->db->fetch_object($resql)) {
|
||||
// Save invoice infos
|
||||
$supplier_invoices_infos[$line->fk_doc] = array('ref' => $obj->ref, 'company_name' => $obj->nom);
|
||||
$invoice_ref = $obj->ref;
|
||||
$company_name = $obj->nom;
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($line->doc_type == 'customer_invoice') {
|
||||
// Retrieve invoice infos
|
||||
$invoice_ref = $invoices_infos[$line->fk_doc]['ref'];
|
||||
$company_name = $invoices_infos[$line->fk_doc]['company_name'];
|
||||
} else {
|
||||
// Retrieve invoice infos
|
||||
$invoice_ref = $supplier_invoices_infos[$line->fk_doc]['ref'];
|
||||
$company_name = $supplier_invoices_infos[$line->fk_doc]['company_name'];
|
||||
}
|
||||
}
|
||||
|
||||
print $line->id . $this->separator;
|
||||
print $date . $this->separator;
|
||||
print substr($line->code_journal, 0, 4) . $this->separator;
|
||||
|
||||
if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) {
|
||||
print length_accountg($line->subledger_account) . $this->separator;
|
||||
if ($line->debit == 0 && $line->credit == 0) {
|
||||
unset($array[$line]);
|
||||
} else {
|
||||
print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator;
|
||||
$date = dol_print_date($line->doc_date, '%d/%m/%Y');
|
||||
|
||||
$invoice_ref = $line->doc_ref;
|
||||
$company_name = "";
|
||||
|
||||
if (($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice') && $line->fk_doc > 0) {
|
||||
if (($line->doc_type == 'customer_invoice' && !isset($invoices_infos[$line->fk_doc])) ||
|
||||
($line->doc_type == 'supplier_invoice' && !isset($supplier_invoices_infos[$line->fk_doc]))) {
|
||||
if ($line->doc_type == 'customer_invoice') {
|
||||
// Get new customer invoice ref and company name
|
||||
$sql = 'SELECT f.ref, s.nom FROM ' . MAIN_DB_PREFIX . 'facture as f';
|
||||
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON f.fk_soc = s.rowid';
|
||||
$sql .= ' WHERE f.rowid = ' . $line->fk_doc;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
if ($obj = $this->db->fetch_object($resql)) {
|
||||
// Save invoice infos
|
||||
$invoices_infos[$line->fk_doc] = array('ref' => $obj->ref, 'company_name' => $obj->nom);
|
||||
$invoice_ref = $obj->ref;
|
||||
$company_name = $obj->nom;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Get new supplier invoice ref and company name
|
||||
$sql = 'SELECT ff.ref, s.nom FROM ' . MAIN_DB_PREFIX . 'facture_fourn as ff';
|
||||
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON ff.fk_soc = s.rowid';
|
||||
$sql .= ' WHERE ff.rowid = ' . $line->fk_doc;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
if ($obj = $this->db->fetch_object($resql)) {
|
||||
// Save invoice infos
|
||||
$supplier_invoices_infos[$line->fk_doc] = array('ref' => $obj->ref, 'company_name' => $obj->nom);
|
||||
$invoice_ref = $obj->ref;
|
||||
$company_name = $obj->nom;
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($line->doc_type == 'customer_invoice') {
|
||||
// Retrieve invoice infos
|
||||
$invoice_ref = $invoices_infos[$line->fk_doc]['ref'];
|
||||
$company_name = $invoices_infos[$line->fk_doc]['company_name'];
|
||||
} else {
|
||||
// Retrieve invoice infos
|
||||
$invoice_ref = $supplier_invoices_infos[$line->fk_doc]['ref'];
|
||||
$company_name = $supplier_invoices_infos[$line->fk_doc]['company_name'];
|
||||
}
|
||||
}
|
||||
|
||||
print $line->id . $this->separator;
|
||||
print $date . $this->separator;
|
||||
print substr($line->code_journal, 0, 4) . $this->separator;
|
||||
|
||||
if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) {
|
||||
print length_accountg($line->subledger_account) . $this->separator;
|
||||
} else {
|
||||
print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator;
|
||||
}
|
||||
//Libellé Auto
|
||||
print $this->separator;
|
||||
//print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator;
|
||||
//Libellé manuel
|
||||
print dol_trunc(str_replace('"', '', $invoice_ref . (!empty($company_name) ? ' - ' : '') . $company_name), 40, 'right', 'UTF-8', 1) . $this->separator;
|
||||
//Numéro de pièce
|
||||
print dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1) . $this->separator;
|
||||
//Devise
|
||||
print 'EUR' . $this->separator;
|
||||
//Montant
|
||||
print price2num(abs($line->montant)) . $this->separator;
|
||||
//Sens
|
||||
print $line->sens . $this->separator;
|
||||
//Code lettrage
|
||||
print $this->separator;
|
||||
//Date Echéance
|
||||
print $date;
|
||||
print $this->end_line;
|
||||
}
|
||||
//Libellé Auto
|
||||
print $this->separator;
|
||||
//print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator;
|
||||
//Libellé manuel
|
||||
print dol_trunc(str_replace('"', '', $invoice_ref . (!empty($company_name) ? ' - ' : '') . $company_name), 40, 'right', 'UTF-8', 1) . $this->separator;
|
||||
//Numéro de pièce
|
||||
print dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1) . $this->separator;
|
||||
//Devise
|
||||
print 'EUR' . $this->separator;
|
||||
//Montant
|
||||
print price2num(abs($line->montant)) . $this->separator;
|
||||
//Sens
|
||||
print $line->sens . $this->separator;
|
||||
//Code lettrage
|
||||
print $this->separator;
|
||||
//Date Echéance
|
||||
print $date;
|
||||
print $this->end_line;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1725,27 +1735,31 @@ class AccountancyExport
|
||||
$this->separator = ',';
|
||||
|
||||
foreach ($objectLines as $line) {
|
||||
$date = 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;
|
||||
if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) {
|
||||
print length_accountg($line->subledger_account) . $this->separator;
|
||||
if ($line->debit == 0 && $line->credit == 0) {
|
||||
unset($array[$line]);
|
||||
} else {
|
||||
print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator;
|
||||
$date = 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;
|
||||
if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) {
|
||||
print length_accountg($line->subledger_account) . $this->separator;
|
||||
} else {
|
||||
print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator;
|
||||
}
|
||||
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($line->montant) . $this->separator;
|
||||
print $line->sens . $this->separator;
|
||||
print $date . $this->separator;
|
||||
print $this->separator;
|
||||
print $this->separator;
|
||||
print 'EUR';
|
||||
print $this->end_line;
|
||||
}
|
||||
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($line->montant).$this->separator;
|
||||
print $line->sens.$this->separator;
|
||||
print $date . $this->separator;
|
||||
print $this->separator;
|
||||
print $this->separator;
|
||||
print 'EUR';
|
||||
print $this->end_line;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -126,7 +126,7 @@ class AccountingJournal extends CommonObject
|
||||
$this->rowid = $obj->rowid;
|
||||
|
||||
$this->code = $obj->code;
|
||||
$this->ref = $obj->code;
|
||||
$this->ref = $obj->code;
|
||||
$this->label = $obj->label;
|
||||
$this->nature = $obj->nature;
|
||||
$this->active = $obj->active;
|
||||
|
||||
@ -315,6 +315,7 @@ class BookKeeping extends CommonObject
|
||||
$objnum = $this->db->fetch_object($resqlnum);
|
||||
$this->piece_num = $objnum->piece_num;
|
||||
}
|
||||
|
||||
dol_syslog(get_class($this).":: create this->piece_num=".$this->piece_num, LOG_DEBUG);
|
||||
if (empty($this->piece_num)) {
|
||||
$sqlnum = "SELECT MAX(piece_num)+1 as maxpiecenum";
|
||||
@ -327,8 +328,8 @@ class BookKeeping extends CommonObject
|
||||
$objnum = $this->db->fetch_object($resqlnum);
|
||||
$this->piece_num = $objnum->maxpiecenum;
|
||||
}
|
||||
dol_syslog(get_class($this).":: create this->piece_num=".$this->piece_num, LOG_DEBUG);
|
||||
}
|
||||
dol_syslog(get_class($this).":: create this->piece_num=".$this->piece_num, LOG_DEBUG);
|
||||
if (empty($this->piece_num)) {
|
||||
$this->piece_num = 1;
|
||||
}
|
||||
@ -369,7 +370,7 @@ class BookKeeping extends CommonObject
|
||||
$sql .= ", ".(!empty($this->subledger_account) ? ("'".$this->db->escape($this->subledger_account)."'") : "NULL");
|
||||
$sql .= ", ".(!empty($this->subledger_label) ? ("'".$this->db->escape($this->subledger_label)."'") : "NULL");
|
||||
$sql .= ", '".$this->db->escape($this->numero_compte)."'";
|
||||
$sql .= ", ".(!empty($this->label_operation) ? ("'".$this->db->escape($this->label_operation)."'") : "NULL");
|
||||
$sql .= ", ".(!empty($this->label_compte) ? ("'".$this->db->escape($this->label_compte)."'") : "NULL");
|
||||
$sql .= ", '".$this->db->escape($this->label_operation)."'";
|
||||
$sql .= ", ".$this->debit;
|
||||
$sql .= ", ".$this->credit;
|
||||
@ -383,7 +384,6 @@ class BookKeeping extends CommonObject
|
||||
$sql .= ", ".(!isset($this->entity) ? $conf->entity : $this->entity);
|
||||
$sql .= ")";
|
||||
|
||||
dol_syslog(get_class($this).":: create sql=".$sql, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
|
||||
@ -795,7 +795,7 @@ class BookKeeping extends CommonObject
|
||||
$sql .= " t.label_operation,";
|
||||
$sql .= " t.debit,";
|
||||
$sql .= " t.credit,";
|
||||
$sql .= " t.montant,";
|
||||
$sql .= " t.montant as amount,";
|
||||
$sql .= " t.sens,";
|
||||
$sql .= " t.multicurrency_amount,";
|
||||
$sql .= " t.multicurrency_code,";
|
||||
@ -806,7 +806,8 @@ class BookKeeping extends CommonObject
|
||||
$sql .= " t.code_journal,";
|
||||
$sql .= " t.journal_label,";
|
||||
$sql .= " t.piece_num,";
|
||||
$sql .= " t.date_creation";
|
||||
$sql .= " t.date_creation,";
|
||||
$sql .= " t.date_export";
|
||||
// Manage filter
|
||||
$sqlwhere = array();
|
||||
if (count($filter) > 0) {
|
||||
@ -823,12 +824,18 @@ class BookKeeping extends CommonObject
|
||||
$sqlwhere[] = $key.' LIKE \''.$this->db->escape($value).'%\'';
|
||||
} elseif ($key == 't.date_creation>=' || $key == 't.date_creation<=') {
|
||||
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
|
||||
} elseif ($key == 't.date_export>=' || $key == 't.date_export<=') {
|
||||
$sqlwhere[] = $key.'\''.$this->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)) {
|
||||
$sqlwhere[] = natural_search("t.code_journal", join(',', $value), 3, 1);
|
||||
if (is_array($value)) {
|
||||
$sqlwhere[] = natural_search("t.code_journal", join(',', $value), 3, 1);
|
||||
} else {
|
||||
$sqlwhere[] = natural_search("t.code_journal", $value, 3, 1);
|
||||
}
|
||||
} else {
|
||||
$sqlwhere[] = natural_search($key, $value, 0, 1);
|
||||
}
|
||||
@ -878,7 +885,8 @@ class BookKeeping extends CommonObject
|
||||
$line->label_operation = $obj->label_operation;
|
||||
$line->debit = $obj->debit;
|
||||
$line->credit = $obj->credit;
|
||||
$line->montant = $obj->montant;
|
||||
$line->montant = $obj->amount; // deprecated
|
||||
$line->amount = $obj->amount;
|
||||
$line->sens = $obj->sens;
|
||||
$line->multicurrency_amount = $obj->multicurrency_amount;
|
||||
$line->multicurrency_code = $obj->multicurrency_code;
|
||||
@ -889,7 +897,8 @@ class BookKeeping extends CommonObject
|
||||
$line->code_journal = $obj->code_journal;
|
||||
$line->journal_label = $obj->journal_label;
|
||||
$line->piece_num = $obj->piece_num;
|
||||
$line->date_creation = $obj->date_creation;
|
||||
$line->date_creation = $this->db->jdate($obj->date_creation);
|
||||
$line->date_export = $this->db->jdate($obj->date_export);
|
||||
|
||||
$this->lines[] = $line;
|
||||
|
||||
@ -941,7 +950,7 @@ class BookKeeping extends CommonObject
|
||||
$sql .= " t.credit,";
|
||||
$sql .= " t.lettering_code,";
|
||||
$sql .= " t.date_lettering,";
|
||||
$sql .= " t.montant,";
|
||||
$sql .= " t.montant as amount,";
|
||||
$sql .= " t.sens,";
|
||||
$sql .= " t.fk_user_author,";
|
||||
$sql .= " t.import_key,";
|
||||
@ -1019,7 +1028,8 @@ class BookKeeping extends CommonObject
|
||||
$line->label_operation = $obj->label_operation;
|
||||
$line->debit = $obj->debit;
|
||||
$line->credit = $obj->credit;
|
||||
$line->montant = $obj->montant;
|
||||
$line->montant = $obj->amount; // deprecated
|
||||
$line->amount = $obj->amount;
|
||||
$line->sens = $obj->sens;
|
||||
$line->lettering_code = $obj->lettering_code;
|
||||
$line->date_lettering = $obj->date_lettering;
|
||||
@ -1904,25 +1914,24 @@ class BookKeeping extends CommonObject
|
||||
|
||||
/**
|
||||
* Return id and description of a root accounting account.
|
||||
* This function takes the parent of parent to get the root account !
|
||||
* FIXME: This function takes the parent of parent to get the root account !
|
||||
*
|
||||
* @param string $account Accounting account
|
||||
* @return string Root account
|
||||
* @return array Array with root account information (max 2 upper level)
|
||||
*/
|
||||
public function getRootAccount($account = null)
|
||||
{
|
||||
global $conf;
|
||||
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||
|
||||
$sql = "SELECT root.rowid, root.account_number, root.label as label";
|
||||
$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";
|
||||
$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) $pcgver);
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as parent ON aa.account_parent = parent.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as root ON parent.account_parent = root.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as parent ON aa.account_parent = parent.rowid AND parent.active = 1";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as root ON parent.account_parent = root.rowid AND root.active = 1";
|
||||
$sql .= " WHERE aa.account_number = '".$this->db->escape($account)."'";
|
||||
$sql .= " AND parent.active = 1";
|
||||
$sql .= " AND root.active = 1";
|
||||
$sql .= " AND aa.entity IN (".getEntity('accountancy').")";
|
||||
|
||||
dol_syslog(get_class($this)."::select_account sql=".$sql, LOG_DEBUG);
|
||||
@ -1933,7 +1942,8 @@ class BookKeeping extends CommonObject
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
}
|
||||
|
||||
return array('id'=>$obj->rowid, 'account_number'=>$obj->account_number, 'label'=>$obj->label);
|
||||
$result = array('id'=>$obj->rowid, 'account_number'=>$obj->account_number, 'label'=>$obj->label);
|
||||
return $result;
|
||||
} else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
dol_syslog(__METHOD__." ".$this->error, LOG_ERR);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
*
|
||||
@ -123,9 +123,9 @@ if ($action == 'validatehistory') {
|
||||
$sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.tva_tx as tva_tx_prod,";
|
||||
$sql .= " p.accountancy_code_sell as code_sell, p.accountancy_code_sell_intra as code_sell_intra, p.accountancy_code_sell_export as code_sell_export,";
|
||||
$sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export,";
|
||||
$sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export, aa4.rowid as aarowid_thirdparty,";
|
||||
$sql .= " co.code as country_code, co.label as country_label,";
|
||||
$sql .= " s.tva_intra";
|
||||
$sql .= " s.tva_intra, s.accountancy_code_sell as company_code_sell";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays ";
|
||||
@ -134,6 +134,7 @@ if ($action == 'validatehistory') {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON p.accountancy_code_sell = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity;
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON p.accountancy_code_sell_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity;
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON p.accountancy_code_sell_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity;
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON s.accountancy_code_sell = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity;
|
||||
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||
$sql .= " AND l.product_type <= 2";
|
||||
|
||||
@ -153,7 +154,7 @@ if ($action == 'validatehistory') {
|
||||
|
||||
$isBuyerInEEC = isInEEC($objp);
|
||||
|
||||
// Search suggested account for product/service (similar code exists in page list.php to make manual binding)
|
||||
// Level 2: Search suggested account for product/service (similar code exists in page list.php to make manual binding)
|
||||
$suggestedaccountingaccountfor = '';
|
||||
if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||
$objp->code_sell_p = $objp->code_sell;
|
||||
@ -179,6 +180,13 @@ if ($action == 'validatehistory') {
|
||||
}
|
||||
}
|
||||
|
||||
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||
if (!empty($objp->company_code_sell)) {
|
||||
$objp->code_sell_t = $objp->company_code_sell;
|
||||
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
}
|
||||
|
||||
if ($objp->aarowid_suggest > 0)
|
||||
{
|
||||
$sqlupdate = "UPDATE ".MAIN_DB_PREFIX."facturedet";
|
||||
|
||||
@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("bills", "compta", "accountancy", "productbatch"));
|
||||
$langs->loadLangs(array("bills", "compta", "accountancy", "productbatch", "products"));
|
||||
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
|
||||
@ -176,7 +176,8 @@ print '<script type="text/javascript">
|
||||
$sql = "SELECT f.rowid as facid, f.ref as ref, f.type, f.datef, f.ref_client,";
|
||||
$sql .= " fd.rowid, fd.description, fd.product_type as line_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
|
||||
$sql .= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell,";
|
||||
$sql .= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.tobuy, p.tosell,";
|
||||
$sql .= " p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export,";
|
||||
$sql .= " aa.rowid as fk_compte, aa.account_number, aa.label, aa.labelshort,";
|
||||
$sql .= " fd.situation_percent,";
|
||||
$sql .= " co.code as country_code, co.label as country,";
|
||||
@ -326,7 +327,7 @@ if ($result) {
|
||||
//print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="'.dol_escape_htmltag($search_tvaintra).'"></td>';
|
||||
print '<td class="liste_titre center"><input type="text" class="flat maxwidth50" name="search_account" value="'.dol_escape_htmltag($search_account).'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_account" value="'.dol_escape_htmltag($search_account).'"></td>';
|
||||
print '<td class="liste_titre center">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
@ -338,7 +339,7 @@ if ($result) {
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, fd.rowid", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
//print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
|
||||
@ -377,6 +378,11 @@ if ($result) {
|
||||
$productstatic->id = $objp->product_id;
|
||||
$productstatic->label = $objp->product_label;
|
||||
$productstatic->type = $objp->line_type;
|
||||
$productstatic->status = $objp->tosell;
|
||||
$productstatic->status_buy = $objp->tobuy;
|
||||
$productstatic->accountancy_code_sell = $objp->accountancy_code_sell;
|
||||
$productstatic->accountancy_code_sell_intra = $objp->accountancy_code_sell_intra;
|
||||
$productstatic->accountancy_code_sell_export = $objp->accountancy_code_sell_export;
|
||||
|
||||
$accountingaccountstatic->rowid = $objp->fk_compte;
|
||||
$accountingaccountstatic->label = $objp->label;
|
||||
@ -424,11 +430,12 @@ if ($result) {
|
||||
|
||||
print '<td>'.$objp->tva_intra.'</td>';
|
||||
|
||||
print '<td class="center">';
|
||||
print '<td>';
|
||||
print $accountingaccountstatic->getNomUrl(0, 1, 1, '', 1);
|
||||
print ' <a class="editfielda" href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
|
||||
print img_edit();
|
||||
print '</a></td>';
|
||||
|
||||
print '<td class="center"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="'.$objp->rowid.'"/></td>';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other", "productbatch"));
|
||||
$langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other", "productbatch", "products"));
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
@ -211,9 +211,9 @@ $sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label,
|
||||
$sql .= " p.accountancy_code_sell as code_sell, p.accountancy_code_sell_intra as code_sell_intra, p.accountancy_code_sell_export as code_sell_export,";
|
||||
$sql .= " p.accountancy_code_buy as code_buy, p.accountancy_code_buy_intra as code_buy_intra, p.accountancy_code_buy_export as code_buy_export,";
|
||||
$sql .= " p.tosell as status, p.tobuy as status_buy,";
|
||||
$sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export,";
|
||||
$sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export, aa4.rowid as aarowid_thirdparty,";
|
||||
$sql .= " co.code as country_code, co.label as country_label,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur, s.accountancy_code_sell as company_code_sell";
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
@ -225,6 +225,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON p.accountancy_code_sell = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity;
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON p.accountancy_code_sell_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity;
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON p.accountancy_code_sell_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity;
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON s.accountancy_code_sell = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity;
|
||||
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||
$sql .= " AND l.product_type <= 2";
|
||||
// Define begin binding date
|
||||
@ -456,11 +457,12 @@ if ($result) {
|
||||
$facture_static->type = $objp->ftype;
|
||||
|
||||
$code_sell_p_notset = '';
|
||||
$code_sell_t_notset = '';
|
||||
$objp->aarowid_suggest = ''; // Will be set later
|
||||
|
||||
$isBuyerInEEC = isInEEC($objp);
|
||||
|
||||
// Search suggested default account for product/service
|
||||
// Level 1: Search suggested default account for product/service
|
||||
$suggestedaccountingaccountbydefaultfor = '';
|
||||
if ($objp->type_l == 1) {
|
||||
if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||
@ -503,7 +505,7 @@ if ($result) {
|
||||
}
|
||||
if ($objp->code_sell_l == -1) $objp->code_sell_l = '';
|
||||
|
||||
// Search suggested account for product/service (similar code exists in page index.php to make automatic binding)
|
||||
// Level 2: Search suggested account for product/service (similar code exists in page index.php to make automatic binding)
|
||||
$suggestedaccountingaccountfor = '';
|
||||
if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||
$objp->code_sell_p = $objp->code_sell;
|
||||
@ -529,6 +531,15 @@ if ($result) {
|
||||
}
|
||||
}
|
||||
|
||||
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
if (!empty($objp->company_code_sell)) {
|
||||
$objp->code_sell_t = $objp->company_code_sell;
|
||||
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
}
|
||||
}
|
||||
|
||||
// Manage Deposit
|
||||
if ($objp->description == "(DEPOSIT)") {
|
||||
$accountdeposittoventilated = new AccountingAccount($db);
|
||||
@ -547,6 +558,7 @@ if ($result) {
|
||||
|
||||
// $objp->code_sell_l is now default code of product/service
|
||||
// $objp->code_sell_p is now code of product/service
|
||||
// $objp->code_sell_t is now code of thirdparty
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@ -596,7 +608,7 @@ if ($result) {
|
||||
|
||||
// Found accounts
|
||||
print '<td>';
|
||||
$s = '<span class="small">'.(($objp->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': </span>';
|
||||
$s = '<span class="small">1. '.(($objp->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': </span>';
|
||||
$shelp = '';
|
||||
if ($suggestedaccountingaccountbydefaultfor == 'eec') $shelp .= $langs->trans("SaleEEC");
|
||||
elseif ($suggestedaccountingaccountbydefaultfor == 'export') $shelp .= $langs->trans("SaleExport");
|
||||
@ -605,24 +617,38 @@ if ($result) {
|
||||
if ($objp->product_id > 0)
|
||||
{
|
||||
print '<br>';
|
||||
$s = '<span class="small">'.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': </span>';
|
||||
$shelp = '';
|
||||
$s = '<span class="small">2. '.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': </span>';
|
||||
$shelp = ''; $ttype = 'help';
|
||||
if ($suggestedaccountingaccountfor == 'eec') $shelp = $langs->trans("SaleEEC");
|
||||
elseif ($suggestedaccountingaccountfor == 'eecwithvat') $shelp = $langs->trans("SaleEECWithVAT");
|
||||
elseif ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') $shelp = $langs->trans("SaleEECWithoutVATNumber");
|
||||
elseif ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') {
|
||||
$shelp = $langs->trans("SaleEECWithoutVATNumber");
|
||||
$ttype = 'warning';
|
||||
}
|
||||
elseif ($suggestedaccountingaccountfor == 'export') $shelp = $langs->trans("SaleExport");
|
||||
$s .= (empty($objp->code_sell_p) ? '<span style="'.$code_sell_p_notset.'">'.$langs->trans("NotDefined").'</span>' : length_accountg($objp->code_sell_p));
|
||||
print $form->textwithpicto($s, $shelp, 1, $ttype, '', 0, 2, '', 1);
|
||||
} else {
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
print '<br>';
|
||||
$s = '<span class="small">2. '.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': </span>';
|
||||
$shelp = '';
|
||||
$s .= $langs->trans("NotDefined");
|
||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||
}
|
||||
}
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
print '<br>';
|
||||
$s = '<span class="small">3. '.(($objp->type_l == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': </span>';
|
||||
$shelp = '';
|
||||
$s .= ($objp->code_sell_t > 0 ? length_accountg($objp->code_sell_t) : '<span style="'.$code_sell_t_notset.'">'.$langs->trans("NotDefined").'</span>');
|
||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Suggested accounting account
|
||||
// $objp->code_sell_l = default (it takes the country into consideration), $objp->code_sell_p is value for product (it takes the country into consideration too)
|
||||
print '<td>';
|
||||
$suggestedid = $objp->aarowid_suggest;
|
||||
/*var_dump($suggestedid);
|
||||
var_dump($objp->code_sell_p);
|
||||
var_dump($objp->code_sell_l);*/
|
||||
if (empty($suggestedid) && empty($objp->code_sell_p) && !empty($objp->code_sell_l) && empty($conf->global->ACCOUNTANCY_DO_NOT_AUTOFILL_ACCOUNT_WITH_GENERIC))
|
||||
{
|
||||
if (empty($accountingaccount_codetotid_cache[$objp->code_sell_l]))
|
||||
@ -642,7 +668,6 @@ if ($result) {
|
||||
|
||||
// Column with checkbox
|
||||
print '<td class="center">';
|
||||
//var_dump($objp->aarowid);var_dump($objp->aarowid_intra);var_dump($objp->aarowid_export);var_dump($objp->aarowid_suggest);
|
||||
$ischecked = $objp->aarowid_suggest;
|
||||
if ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') $ischecked = 0;
|
||||
print '<input type="checkbox" class="flat checkforselect checkforselect'.$objp->rowid.'" name="toselect[]" value="'.$objp->rowid."_".$i.'"'.($ischecked ? "checked" : "").'/>';
|
||||
|
||||
@ -150,7 +150,7 @@ $userstatic = new User($db);
|
||||
$bankaccountstatic = new Account($db);
|
||||
$chargestatic = new ChargeSociales($db);
|
||||
$paymentdonstatic = new PaymentDonation($db);
|
||||
$paymentvatstatic = new TVA($db);
|
||||
$paymentvatstatic = new Tva($db);
|
||||
$paymentsalstatic = new PaymentSalary($db);
|
||||
$paymentexpensereportstatic = new PaymentExpenseReport($db);
|
||||
$paymentvariousstatic = new PaymentVarious($db);
|
||||
@ -549,7 +549,7 @@ if (!$error && $action == 'writebookkeeping') {
|
||||
$bookkeeping->debit = ($mt >= 0 ? $mt : 0);
|
||||
$bookkeeping->credit = ($mt < 0 ? -$mt : 0);
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->journal_label = $langs->transnoentities($journal_label);
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->date_creation = $now;
|
||||
|
||||
@ -605,7 +605,7 @@ if (!$error && $action == 'writebookkeeping') {
|
||||
$bookkeeping->debit = ($mt < 0 ? -$mt : 0);
|
||||
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->journal_label = $langs->transnoentities($journal_label);
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->date_creation = $now;
|
||||
|
||||
@ -737,7 +737,7 @@ if (!$error && $action == 'writebookkeeping') {
|
||||
$bookkeeping->debit = ($mt < 0 ? -$mt : 0);
|
||||
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->journal_label = $langs->transnoentities($journal_label);
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->date_creation = $now;
|
||||
$bookkeeping->label_compte = '';
|
||||
|
||||
@ -223,7 +223,7 @@ if ($action == 'writebookkeeping') {
|
||||
$bookkeeping->debit = ($mt <= 0) ? -$mt : 0;
|
||||
$bookkeeping->credit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->journal_label = $langs->transnoentities($journal_label);
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->entity = $conf->entity;
|
||||
|
||||
@ -271,7 +271,7 @@ if ($action == 'writebookkeeping') {
|
||||
$bookkeeping->debit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt <= 0) ? -$mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->journal_label = $langs->transnoentities($journal_label);
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->entity = $conf->entity;
|
||||
|
||||
@ -329,7 +329,7 @@ if ($action == 'writebookkeeping') {
|
||||
$bookkeeping->debit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt <= 0) ? -$mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->journal_label = $langs->transnoentities($journal_label);
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->entity = $conf->entity;
|
||||
|
||||
|
||||
@ -322,7 +322,7 @@ if ($action == 'writebookkeeping') {
|
||||
$bookkeeping->debit = ($mt <= 0) ? -$mt : 0;
|
||||
$bookkeeping->credit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->journal_label = $langs->transnoentities($journal_label);
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->entity = $conf->entity;
|
||||
|
||||
@ -372,7 +372,7 @@ if ($action == 'writebookkeeping') {
|
||||
$bookkeeping->debit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt <= 0) ? -$mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->journal_label = $langs->transnoentities($journal_label);
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->entity = $conf->entity;
|
||||
|
||||
@ -433,7 +433,7 @@ if ($action == 'writebookkeeping') {
|
||||
$bookkeeping->debit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt <= 0) ? -$mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->journal_label = $langs->transnoentities($journal_label);
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->entity = $conf->entity;
|
||||
|
||||
@ -484,7 +484,7 @@ if ($action == 'writebookkeeping') {
|
||||
$bookkeeping->debit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt <= 0) ? -$mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->journal_label = $langs->transnoentities($journal_label);
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->entity = $conf->entity;
|
||||
|
||||
|
||||
@ -333,7 +333,7 @@ if ($action == 'writebookkeeping') {
|
||||
$bookkeeping->debit = ($mt >= 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt < 0) ? -$mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->journal_label = $langs->transnoentities($journal_label);
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->entity = $conf->entity;
|
||||
|
||||
@ -383,7 +383,7 @@ if ($action == 'writebookkeeping') {
|
||||
$bookkeeping->debit = ($mt < 0) ? -$mt : 0;
|
||||
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->journal_label = $langs->transnoentities($journal_label);
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->entity = $conf->entity;
|
||||
|
||||
@ -443,7 +443,7 @@ if ($action == 'writebookkeeping') {
|
||||
$bookkeeping->debit = ($mt < 0) ? -$mt : 0;
|
||||
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->journal_label = $langs->transnoentities($journal_label);
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->entity = $conf->entity;
|
||||
|
||||
|
||||
@ -120,9 +120,9 @@ if ($action == 'validatehistory') {
|
||||
$sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type,";
|
||||
$sql .= " p.accountancy_code_buy as code_buy, p.accountancy_code_buy_intra as code_buy_intra, p.accountancy_code_buy_export as code_buy_export, p.tva_tx as tva_tx_prod,";
|
||||
$sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export,";
|
||||
$sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export, aa4.rowid as aarowid_thirdparty,";
|
||||
$sql .= " co.code as country_code, co.label as country_label,";
|
||||
$sql .= " s.tva_intra";
|
||||
$sql .= " s.tva_intra, s.accountancy_code_buy as company_code_buy";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays ";
|
||||
@ -131,6 +131,7 @@ if ($action == 'validatehistory') {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON p.accountancy_code_buy = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity;
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON p.accountancy_code_buy_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity;
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON p.accountancy_code_buy_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity;
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON s.accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity;
|
||||
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||
$sql .= " AND l.product_type <= 2";
|
||||
|
||||
@ -151,7 +152,7 @@ if ($action == 'validatehistory') {
|
||||
|
||||
$isSellerInEEC = isInEEC($objp);
|
||||
|
||||
// Search suggested account for product/service
|
||||
// Level 2: Search suggested account for product/service (similar code exists in page list.php to make manual binding)
|
||||
$suggestedaccountingaccountfor = '';
|
||||
if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||
$objp->code_buy_p = $objp->code_buy;
|
||||
@ -169,6 +170,13 @@ if ($action == 'validatehistory') {
|
||||
}
|
||||
}
|
||||
|
||||
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||
if (!empty($objp->company_code_buy)) {
|
||||
$objp->code_buy_t = $objp->company_code_buy;
|
||||
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
}
|
||||
|
||||
if ($objp->aarowid_suggest > 0)
|
||||
{
|
||||
$sqlupdate = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det";
|
||||
|
||||
@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta", "bills", "other", "accountancy", "productbatch"));
|
||||
$langs->loadLangs(array("compta", "bills", "other", "accountancy", "productbatch", "products"));
|
||||
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
|
||||
@ -178,7 +178,8 @@ print '<script type="text/javascript">
|
||||
$sql = "SELECT f.rowid as facid, f.ref as ref, f.ref_supplier, f.libelle as invoice_label, f.datef, f.fk_soc,";
|
||||
$sql .= " l.rowid, l.fk_product, l.product_type as line_type, l.description, l.total_ht , l.qty, l.tva_tx, l.vat_src_code,";
|
||||
$sql .= " aa.label, aa.labelshort, aa.account_number,";
|
||||
$sql .= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.fk_product_type as type,";
|
||||
$sql .= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.tobuy, p.tosell,";
|
||||
$sql .= " p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export,";
|
||||
$sql .= " co.code as country_code, co.label as country,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur";
|
||||
$parameters = array();
|
||||
@ -333,16 +334,16 @@ if ($result) {
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("InvoiceLabel", $_SERVER["PHP_SELF"], "f.libelle", "", $param, '', $sortfield, $sortorder);
|
||||
//print_liste_field_titre("InvoiceLabel", $_SERVER["PHP_SELF"], "f.libelle", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
//print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATIntraShort", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AccountAccounting", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
|
||||
$checkpicto = $form->showCheckAddButtons();
|
||||
print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center ');
|
||||
@ -376,6 +377,11 @@ if ($result) {
|
||||
$productstatic->id = $objp->product_id;
|
||||
$productstatic->label = $objp->product_label;
|
||||
$productstatic->type = $objp->line_type;
|
||||
$productstatic->status = $objp->tosell;
|
||||
$productstatic->status_buy = $objp->tobuy;
|
||||
$productstatic->accountancy_code_buy = $objp->accountancy_code_buy;
|
||||
$productstatic->accountancy_code_buy_intra = $objp->accountancy_code_sell_buy;
|
||||
$productstatic->accountancy_code_buy_export = $objp->accountancy_code_sell_buy;
|
||||
|
||||
$accountingaccountstatic->rowid = $objp->fk_compte;
|
||||
$accountingaccountstatic->label = $objp->label;
|
||||
|
||||
@ -30,6 +30,7 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||
@ -38,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other", "productbatch"));
|
||||
$langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other", "productbatch", "products"));
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
@ -215,9 +216,9 @@ $sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label,
|
||||
$sql .= " p.accountancy_code_sell as code_sell, p.accountancy_code_sell_intra as code_sell_intra, p.accountancy_code_sell_export as code_sell_export,";
|
||||
$sql .= " p.accountancy_code_buy as code_buy, p.accountancy_code_buy_intra as code_buy_intra, p.accountancy_code_buy_export as code_buy_export,";
|
||||
$sql .= " p.tosell as status, p.tobuy as status_buy,";
|
||||
$sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export,";
|
||||
$sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export, aa4.rowid as aarowid_thirdparty,";
|
||||
$sql .= " co.code as country_code, co.label as country_label,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur, s.accountancy_code_buy as company_code_buy";
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
@ -229,6 +230,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON p.accountancy_code_buy = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity;
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON p.accountancy_code_buy_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity;
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON p.accountancy_code_buy_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity;
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON s.accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity;
|
||||
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||
$sql .= " AND l.product_type <= 2";
|
||||
// Define begin binding date
|
||||
@ -460,10 +462,12 @@ if ($result) {
|
||||
$facturefourn_static->label = $objp->invoice_label;
|
||||
|
||||
$code_buy_p_notset = '';
|
||||
$code_buy_t_notset = '';
|
||||
$objp->aarowid_suggest = ''; // Will be set later
|
||||
|
||||
$isSellerInEEC = isInEEC($objp);
|
||||
|
||||
// Level 1: Search suggested default account for product/service
|
||||
$suggestedaccountingaccountbydefaultfor = '';
|
||||
if ($objp->type_l == 1) {
|
||||
if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||
@ -494,7 +498,7 @@ if ($result) {
|
||||
}
|
||||
if ($objp->code_sell_l == -1) $objp->code_sell_l = '';
|
||||
|
||||
// Search suggested account for product/service
|
||||
// Level 2: Search suggested account for product/service (similar code exists in page index.php to make automatic binding)
|
||||
$suggestedaccountingaccountfor = '';
|
||||
if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||
$objp->code_buy_p = $objp->code_buy;
|
||||
@ -512,6 +516,13 @@ if ($result) {
|
||||
}
|
||||
}
|
||||
|
||||
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||
if (!empty($objp->company_code_buy)) {
|
||||
$objp->code_buy_t = $objp->company_code_buy;
|
||||
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
}
|
||||
|
||||
if (!empty($objp->code_buy_p)) {
|
||||
// Value was defined previously
|
||||
} else {
|
||||
@ -521,6 +532,7 @@ if ($result) {
|
||||
|
||||
// $objp->code_buy_l is now default code of product/service
|
||||
// $objp->code_buy_p is now code of product/service
|
||||
// $objp->code_buy_t is now code of thirdparty
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@ -576,7 +588,7 @@ if ($result) {
|
||||
|
||||
// Found accounts
|
||||
print '<td>';
|
||||
$s = '<span class="small">'.(($objp->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': </span>';
|
||||
$s = '<span class="small">1. '.(($objp->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': </span>';
|
||||
$shelp = '';
|
||||
if ($suggestedaccountingaccountbydefaultfor == 'eec') $shelp .= $langs->trans("SaleEEC");
|
||||
elseif ($suggestedaccountingaccountbydefaultfor == 'export') $shelp .= $langs->trans("SaleExport");
|
||||
@ -585,13 +597,24 @@ if ($result) {
|
||||
if ($objp->product_id > 0)
|
||||
{
|
||||
print '<br>';
|
||||
$s = '<span class="small">'.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': </span>';
|
||||
$s = '<span class="small">2. '.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': </span>';
|
||||
$shelp = '';
|
||||
if ($suggestedaccountingaccountfor == 'eec') $shelp = $langs->trans("SaleEEC");
|
||||
elseif ($suggestedaccountingaccountfor == 'export') $shelp = $langs->trans("SaleExport");
|
||||
$s .= (empty($objp->code_buy_p) ? '<span style="'.$code_buy_p_notset.'">'.$langs->trans("NotDefined").'</span>' : length_accountg($objp->code_buy_p));
|
||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||
} else {
|
||||
print '<br>';
|
||||
$s = '<span class="small">2. '.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': </span>';
|
||||
$shelp = '';
|
||||
$s .= $langs->trans("NotDefined");
|
||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||
}
|
||||
print '<br>';
|
||||
$s = '<span class="small">3. '.(($objp->type_l == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': </span>';
|
||||
$shelp = '';
|
||||
$s .= ($objp->code_buy_t > 0 ? length_accountg($objp->code_buy_t) : '<span style="'.$code_buy_t_notset.'">'.$langs->trans("NotDefined").'</span>');
|
||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||
print '</td>';
|
||||
|
||||
// Suggested accounting account
|
||||
|
||||
@ -136,7 +136,7 @@ if ($action == 'update' || $action == 'add') {
|
||||
$constnote = GETPOST('constnote');
|
||||
$res = dolibarr_set_const($db, $constname, $constvalue, $choices[$consttype], 0, $constnote, $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
|
||||
@ -92,7 +92,7 @@ if ($action == 'update' || $action == 'add') {
|
||||
|
||||
$res = dolibarr_set_const($db, $constname, $constvalue, $typetouse, 0, $constnote, $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
|
||||
@ -63,7 +63,7 @@ if ($action == 'update') {
|
||||
$res = dolibarr_set_const($db, "MEMBER_NEWFORM_FORCETYPE", $forcetype, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
|
||||
@ -1749,7 +1749,7 @@ class Adherent extends CommonObject
|
||||
|
||||
if (!$error) {
|
||||
// Set invoice as paid
|
||||
$invoice->set_paid($user);
|
||||
$invoice->setPaid($user);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -85,9 +85,15 @@ if ($result) {
|
||||
$adhtype->label = $objp->label;
|
||||
$AdherentType[$objp->rowid] = $adhtype;
|
||||
|
||||
if ($objp->statut == -1) { $MemberToValidate[$objp->rowid] = $objp->somme; }
|
||||
if ($objp->statut == 1) { $MembersValidated[$objp->rowid] = $objp->somme; }
|
||||
if ($objp->statut == 0) { $MembersResiliated[$objp->rowid] = $objp->somme; }
|
||||
if ($objp->statut == -1) {
|
||||
$MemberToValidate[$objp->rowid] = $objp->somme;
|
||||
}
|
||||
if ($objp->statut == 1) {
|
||||
$MembersValidated[$objp->rowid] = $objp->somme;
|
||||
}
|
||||
if ($objp->statut == 0) {
|
||||
$MembersResiliated[$objp->rowid] = $objp->somme;
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
@ -136,10 +142,14 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is usel
|
||||
print '<table class="noborder nohover centpercent">';
|
||||
$i = 0;
|
||||
foreach ($listofsearchfields as $key => $value) {
|
||||
if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||
if ($i == 0) {
|
||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||
}
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label>:</td><td><input type="text" class="flat inputsearch" name="'.$key.'" id="'.$key.'" size="18"></td>';
|
||||
if ($i == 0) print '<td rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>';
|
||||
if ($i == 0) {
|
||||
print '<td rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
@ -284,7 +294,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
*/
|
||||
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
|
||||
|
||||
$sql = "SELECT a.rowid, a.statut as status, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
|
||||
$sql = "SELECT a.rowid, a.ref, a.statut as status, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
|
||||
$sql .= " a.gender, a.email, a.photo, a.morphy,";
|
||||
$sql .= " a.tms as datem, a.datefin as date_end_subscription,";
|
||||
$sql .= " ta.rowid as typeid, ta.libelle as label, ta.subscription as need_subscription";
|
||||
@ -308,7 +318,7 @@ if ($resql) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$staticmember->id = $obj->rowid;
|
||||
$staticmember->ref = $obj->rowid;
|
||||
$staticmember->ref = $obj->ref;
|
||||
$staticmember->lastname = $obj->lastname;
|
||||
$staticmember->firstname = $obj->firstname;
|
||||
$staticmember->gender = $obj->gender;
|
||||
|
||||
@ -66,6 +66,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
|
||||
|
||||
if ($action != 'updateedit' && !$error)
|
||||
{
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
@ -114,57 +115,57 @@ print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans(
|
||||
|
||||
// Name
|
||||
print '<tr class="oddeven"><td><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
|
||||
print '<input name="nom" id="name" class="minwidth200" value="'.($conf->global->MAIN_INFO_ACCOUNTANT_NAME ? $conf->global->MAIN_INFO_ACCOUNTANT_NAME : GETPOST("nom", 'nohtml')).'"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'></td></tr>'."\n";
|
||||
print '<input name="nom" id="name" class="minwidth200" value="'.(GETPOSTISSET('nom') ? GETPOST('nom', 'nohtml') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_NAME) ? $conf->global->MAIN_INFO_ACCOUNTANT_NAME : '')).'"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'></td></tr>'."\n";
|
||||
|
||||
// Address
|
||||
print '<tr class="oddeven"><td><label for="address">'.$langs->trans("CompanyAddress").'</label></td><td>';
|
||||
print '<textarea name="address" id="address" class="quatrevingtpercent" rows="'.ROWS_3.'">'.($conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS ? $conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS : GETPOST("address", 'nohtml')).'</textarea></td></tr>'."\n";
|
||||
print '<textarea name="address" id="address" class="quatrevingtpercent" rows="'.ROWS_3.'">'.(GETPOSTISSET('address') ? GETPOST('address', 'nohtml') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS) ? $conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS : '')).'</textarea></td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="zipcode">'.$langs->trans("CompanyZip").'</label></td><td>';
|
||||
print '<input class="minwidth100" name="zipcode" id="zipcode" value="'.($conf->global->MAIN_INFO_ACCOUNTANT_ZIP ? $conf->global->MAIN_INFO_ACCOUNTANT_ZIP : GETPOST("zipcode", 'alpha')).'"></td></tr>'."\n";
|
||||
print '<input class="minwidth100" name="zipcode" id="zipcode" value="'.(GETPOSTISSET('zipcode') ? GETPOST('zipcode', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_ZIP) ? $conf->global->MAIN_INFO_ACCOUNTANT_ZIP : '')).'"></td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="town">'.$langs->trans("CompanyTown").'</label></td><td>';
|
||||
print '<input name="town" class="minwidth100" id="town" value="'.($conf->global->MAIN_INFO_ACCOUNTANT_TOWN ? $conf->global->MAIN_INFO_ACCOUNTANT_TOWN : GETPOST("town", 'nohtml')).'"></td></tr>'."\n";
|
||||
print '<input name="town" class="minwidth100" id="town" value="'.(GETPOSTISSET('town') ? GETPOST('town', 'nohtml') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_TOWN) ? $conf->global->MAIN_INFO_ACCOUNTANT_TOWN : '')).'"></td></tr>'."\n";
|
||||
|
||||
// Country
|
||||
print '<tr class="oddeven"><td><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
|
||||
print img_picto('', 'globe-americas', 'class="paddingrightonly"');
|
||||
print $form->select_country($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'country_id');
|
||||
print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY) ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'country_id');
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="state_id">'.$langs->trans("State").'</label></td><td class="maxwidthonsmartphone">';
|
||||
$formcompany->select_departement($conf->global->MAIN_INFO_ACCOUNTANT_STATE, $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'state_id');
|
||||
$formcompany->select_departement((GETPOSTISSET('state_id') ? GETPOST('state_id', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_STATE) ? $conf->global->MAIN_INFO_ACCOUNTANT_STATE : '')), (GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY) ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'state_id');
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
|
||||
print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="tel" id="phone" value="'.$conf->global->MAIN_INFO_ACCOUNTANT_PHONE.'"></td></tr>';
|
||||
print '<input name="tel" id="phone" value="'.(GETPOSTISSET('tel') ? GETPOST('tel', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_PHONE) ? $conf->global->MAIN_INFO_ACCOUNTANT_PHONE : '')).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
|
||||
print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="fax" id="fax" value="'.$conf->global->MAIN_INFO_ACCOUNTANT_FAX.'"></td></tr>';
|
||||
print '<input name="fax" id="fax" value="'.(GETPOSTISSET('fax') ? GETPOST('fax', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_FAX) ? $conf->global->MAIN_INFO_ACCOUNTANT_FAX : '')).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
|
||||
print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="mail" id="email" class="minwidth200" value="'.$conf->global->MAIN_INFO_ACCOUNTANT_MAIL.'"></td></tr>';
|
||||
print '<input name="mail" id="email" class="minwidth200" value="'.(GETPOSTISSET('mail') ? GETPOST('mail', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_MAIL) ? $conf->global->MAIN_INFO_ACCOUNTANT_MAIL : '')).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Web
|
||||
print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
|
||||
print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="web" id="web" class="minwidth300" value="'.$conf->global->MAIN_INFO_ACCOUNTANT_WEB.'"></td></tr>';
|
||||
print '<input name="web" id="web" class="minwidth300" value="'.(GETPOSTISSET('web') ? GETPOST('web', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_WEB) ? $conf->global->MAIN_INFO_ACCOUNTANT_WEB : '')).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Code
|
||||
print '<tr class="oddeven"><td><label for="code">'.$langs->trans("AccountantFileNumber").'</label></td><td>';
|
||||
print '<input name="code" id="code" class="minwidth100" value="'.($conf->global->MAIN_INFO_ACCOUNTANT_CODE ? $conf->global->MAIN_INFO_ACCOUNTANT_CODE : GETPOST("code", 'nohtml')).'"></td></tr>'."\n";
|
||||
print '<input name="code" id="code" class="minwidth100" value="'.(GETPOSTISSET('code') ? GETPOST('code', 'nohtml') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_CODE) ? $conf->global->MAIN_INFO_ACCOUNTANT_CODE : '')).'"></td></tr>'."\n";
|
||||
|
||||
// Note
|
||||
print '<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans("Note").'</label></td><td>';
|
||||
print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : $conf->global->MAIN_INFO_ACCOUNTANT_NOTE).'</textarea></td></tr>';
|
||||
print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_NOTE) ? $conf->global->MAIN_INFO_ACCOUNTANT_NOTE : '')).'</textarea></td></tr>';
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -97,7 +97,7 @@ if ($action == "save" && empty($cancel))
|
||||
if ($search_event === '' || preg_match('/'.preg_quote($search_event, '/').'/i', $keyparam))
|
||||
{
|
||||
$res = dolibarr_set_const($db, $keyparam, (GETPOST($keyparam, 'alpha') ?GETPOST($keyparam, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -82,15 +82,15 @@ if ($actionsave)
|
||||
|
||||
//print '-name='.$name.'-color='.$color;
|
||||
$res = dolibarr_set_const($db, 'AGENDA_EXT_NAME'.$i, $name, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
$res = dolibarr_set_const($db, 'AGENDA_EXT_SRC'.$i, $src, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
$res = dolibarr_set_const($db, 'AGENDA_EXT_OFFSETTZ'.$i, $offsettz, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
$res = dolibarr_set_const($db, 'AGENDA_EXT_COLOR'.$i, $color, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
$res = dolibarr_set_const($db, 'AGENDA_EXT_ENABLED'.$i, $enabled, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ if ($actionsave)
|
||||
if (!$error)
|
||||
{
|
||||
$res = dolibarr_set_const($db, 'AGENDA_EXT_NB', trim(GETPOST('AGENDA_EXT_NB', 'int')), 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB = 5;
|
||||
$MAXAGENDA = empty($conf->global->AGENDA_EXT_NB) ? 5 : $conf->global->AGENDA_EXT_NB;
|
||||
}
|
||||
|
||||
@ -51,6 +51,7 @@ $type = 'action';
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
$reg = array();
|
||||
if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
|
||||
{
|
||||
$code = $reg[1];
|
||||
|
||||
@ -112,7 +112,7 @@ if ($actionsave)
|
||||
if ($color == '-1') $color = '';
|
||||
|
||||
$res = dolibarr_set_const($db, 'BANK_COLORIZE_MOVEMENT_COLOR'.$i, $color, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
@ -400,7 +400,7 @@ if ($conf->product->enabled)
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproducto&token='.newToken().'&value='.urlencode($file).'">';
|
||||
print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproducton&token='.newToken().'&value='.urlencode($file).'">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ if ($action == 'updateMask')
|
||||
|
||||
if ($maskconstbom) $res = dolibarr_set_const($db, $maskconstbom, $maskbom, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -141,7 +141,7 @@ elseif ($action == 'setdoc')
|
||||
$draft = GETPOST("BOM_DRAFT_WATERMARK");
|
||||
$res = dolibarr_set_const($db, "BOM_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -155,7 +155,7 @@ elseif ($action == 'setdoc')
|
||||
|
||||
$res = dolibarr_set_const($db, "BOM_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
|
||||
@ -446,14 +446,14 @@ print '<td>';
|
||||
print $langs->trans("MaxNbOfLinesForBoxes");
|
||||
print '</td>'."\n";
|
||||
print '<td>';
|
||||
print '<input type="text" class="flat" size="6" name="MAIN_BOXES_MAXLINES" value="'.$conf->global->MAIN_BOXES_MAXLINES.'">';
|
||||
print '<input type="text" class="flat" size="6" name="MAIN_BOXES_MAXLINES" value="'.(!empty($conf->global->MAIN_BOXES_MAXLINES) ? $conf->global->MAIN_BOXES_MAXLINES : '').'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Activate FileCache - Developement
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL == 2 || !empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
|
||||
print '<tr class="oddeven"><td width="35%">'.$langs->trans("EnableFileCache").'</td><td>';
|
||||
print $form->selectyesno('MAIN_ACTIVATE_FILECACHE', $conf->global->MAIN_ACTIVATE_FILECACHE, 1);
|
||||
print $form->selectyesno('MAIN_ACTIVATE_FILECACHE', (!empty($conf->global->MAIN_ACTIVATE_FILECACHE) ? $conf->global->MAIN_ACTIVATE_FILECACHE : 0), 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ if ($action == 'updateMask')
|
||||
$maskchequereceipts = GETPOST('maskchequereceipts', 'alpha');
|
||||
if ($maskconstchequereceipts) $res = dolibarr_set_const($db, $maskconstchequereceipts, $maskchequereceipts, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -76,7 +76,7 @@ if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT')
|
||||
|
||||
$res = dolibarr_set_const($db, "BANK_CHEQUERECEIPT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
|
||||
@ -61,7 +61,7 @@ if ($action == 'updateMask')
|
||||
|
||||
if ($maskconstorder) $res = dolibarr_set_const($db, $maskconstorder, $maskorder, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -146,7 +146,7 @@ elseif ($action == 'setdoc') {
|
||||
$draft = GETPOST("COMMANDE_DRAFT_WATERMARK");
|
||||
$res = dolibarr_set_const($db, "COMMANDE_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -160,7 +160,7 @@ elseif ($action == 'setdoc') {
|
||||
|
||||
$res = dolibarr_set_const($db, "ORDER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -172,7 +172,7 @@ elseif ($action == 'setdoc') {
|
||||
// Activate Set Shippable Icon In List
|
||||
$setshippableiconinlist = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist, 'yesno', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
@ -186,7 +186,7 @@ elseif ($action == 'setdoc') {
|
||||
$res = dolibarr_set_const($db, "FACTURE_RIB_NUMBER", $rib, 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "FACTURE_CHQ_NUMBER", $chq, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -201,7 +201,7 @@ elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER')
|
||||
{
|
||||
$res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_ORDER", $value, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -216,7 +216,7 @@ elseif ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER')
|
||||
{
|
||||
$res = dolibarr_set_const($db, "WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER", $value, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -668,7 +668,7 @@ Whet is definition of "shippable" according to all different STOCK_CALCULATE_...
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ShippableOrderIconInList").'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td class="center">';
|
||||
if (!empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) {
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=setshippableiconinlist&token='.newToken().'&value=0">';
|
||||
@ -687,7 +687,7 @@ if ($conf->banque->enabled)
|
||||
{
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").'</td><td> </td><td class="center">';
|
||||
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").'</td><td> </td><td class="center">';
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_ORDER');
|
||||
@ -717,7 +717,7 @@ if ($conf->stock->enabled)
|
||||
{
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").'</td><td> </td><td class="center">';
|
||||
print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").'</td><td> </td><td class="center">';
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER');
|
||||
|
||||
@ -215,8 +215,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
|
||||
|
||||
if ($_POST["optionlocaltax1"] == "localtax1on")
|
||||
{
|
||||
if (!isset($_REQUEST['lt1']))
|
||||
{
|
||||
if (!GETPOSTISSET('lt1')) {
|
||||
dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", 0, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", GETPOST('lt1', 'aZ09'), 'chaine', 0, '', $conf->entity);
|
||||
@ -225,8 +224,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
|
||||
}
|
||||
if ($_POST["optionlocaltax2"] == "localtax2on")
|
||||
{
|
||||
if (!isset($_REQUEST['lt2']))
|
||||
{
|
||||
if (!GETPOSTISSET('lt2')) {
|
||||
dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", 0, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", GETPOST('lt2', 'aZ09'), 'chaine', 0, '', $conf->entity);
|
||||
@ -236,6 +234,9 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
if (GETPOST('save')) { // To avoid to show message when we juste switch the country that resubmit the form.
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
$db->commit();
|
||||
} else {
|
||||
$db->rollback();
|
||||
@ -393,18 +394,18 @@ print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans(
|
||||
|
||||
// Name
|
||||
print '<tr class="oddeven"><td class="fieldrequired wordbreak"><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
|
||||
print '<input name="nom" id="name" class="minwidth200" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_NOM ? $conf->global->MAIN_INFO_SOCIETE_NOM : GETPOST("nom", 'nohtml')).'"'.(empty($conf->global->MAIN_INFO_SOCIETE_NOM) ? ' autofocus="autofocus"' : '').'></td></tr>'."\n";
|
||||
print '<input name="nom" id="name" class="minwidth200" value="'.dol_escape_htmltag((GETPOSTISSET('nom') ? GETPOST('nom', 'nohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_NOM) ? $conf->global->MAIN_INFO_SOCIETE_NOM : ''))).'"'.(empty($conf->global->MAIN_INFO_SOCIETE_NOM) ? ' autofocus="autofocus"' : '').'></td></tr>'."\n";
|
||||
|
||||
// Address
|
||||
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ADDRESS">'.$langs->trans("CompanyAddress").'</label></td><td>';
|
||||
print '<textarea name="MAIN_INFO_SOCIETE_ADDRESS" id="MAIN_INFO_SOCIETE_ADDRESS" class="quatrevingtpercent" rows="'.ROWS_3.'">'.($conf->global->MAIN_INFO_SOCIETE_ADDRESS ? $conf->global->MAIN_INFO_SOCIETE_ADDRESS : GETPOST("MAIN_INFO_SOCIETE_ADDRESS", 'nohtml')).'</textarea></td></tr>'."\n";
|
||||
print '<textarea name="MAIN_INFO_SOCIETE_ADDRESS" id="MAIN_INFO_SOCIETE_ADDRESS" class="quatrevingtpercent" rows="'.ROWS_3.'">'.(GETPOSTISSET('MAIN_INFO_SOCIETE_ADDRESS') ? GETPOST('MAIN_INFO_SOCIETE_ADDRESS', 'nohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS) ? $conf->global->MAIN_INFO_SOCIETE_ADDRESS : '')).'</textarea></td></tr>'."\n";
|
||||
|
||||
// Zip
|
||||
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ZIP">'.$langs->trans("CompanyZip").'</label></td><td>';
|
||||
print '<input class="width100" name="MAIN_INFO_SOCIETE_ZIP" id="MAIN_INFO_SOCIETE_ZIP" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ZIP ? $conf->global->MAIN_INFO_SOCIETE_ZIP : GETPOST("MAIN_INFO_SOCIETE_ZIP", 'alpha')).'"></td></tr>'."\n";
|
||||
print '<input class="width100" name="MAIN_INFO_SOCIETE_ZIP" id="MAIN_INFO_SOCIETE_ZIP" value="'.dol_escape_htmltag((GETPOSTISSET('MAIN_INFO_SOCIETE_ZIP') ? GETPOST('MAIN_INFO_SOCIETE_ZIP', 'alpha') : (!empty($conf->global->MAIN_INFO_SOCIETE_ZIP) ? $conf->global->MAIN_INFO_SOCIETE_ZIP : ''))).'"></td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_TOWN">'.$langs->trans("CompanyTown").'</label></td><td>';
|
||||
print '<input name="MAIN_INFO_SOCIETE_TOWN" class="minwidth200" id="MAIN_INFO_SOCIETE_TOWN" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TOWN ? $conf->global->MAIN_INFO_SOCIETE_TOWN : GETPOST("MAIN_INFO_SOCIETE_TOWN", 'nohtml')).'"></td></tr>'."\n";
|
||||
print '<input name="MAIN_INFO_SOCIETE_TOWN" class="minwidth200" id="MAIN_INFO_SOCIETE_TOWN" value="'.dol_escape_htmltag((GETPOSTISSET('MAIN_INFO_SOCIETE_TOWN') ? GETPOST('MAIN_INFO_SOCIETE_TOWN', 'nohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_TOWN) ? $conf->global->MAIN_INFO_SOCIETE_TOWN : ''))).'"></td></tr>'."\n";
|
||||
|
||||
// Country
|
||||
print '<tr class="oddeven"><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
|
||||
@ -431,25 +432,25 @@ print '</td></tr>'."\n";
|
||||
// Phone
|
||||
print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
|
||||
print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="tel" id="phone" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TEL).'"></td></tr>';
|
||||
print '<input name="tel" id="phone" value="'.dol_escape_htmltag((GETPOSTISSET('tel') ? GETPOST('tel', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_TEL) ? $conf->global->MAIN_INFO_SOCIETE_TEL : ''))).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Fax
|
||||
print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
|
||||
print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="fax" id="fax" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_FAX).'"></td></tr>';
|
||||
print '<input name="fax" id="fax" value="'.dol_escape_htmltag((GETPOSTISSET('fax') ? GETPOST('fax', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_FAX) ? $conf->global->MAIN_INFO_SOCIETE_FAX : ''))).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Email
|
||||
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
|
||||
print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="mail" id="email" class="minwidth200" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_MAIL).'"></td></tr>';
|
||||
print '<input name="mail" id="email" class="minwidth200" value="'.dol_escape_htmltag((GETPOSTISSET('mail') ? GETPOST('mail', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $conf->global->MAIN_INFO_SOCIETE_MAIL : ''))).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Web
|
||||
print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
|
||||
print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="web" id="web" class="minwidth300" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_WEB).'"></td></tr>';
|
||||
print '<input name="web" id="web" class="minwidth300" value="'.dol_escape_htmltag((GETPOSTISSET('web') ? GETPOST('web', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_WEB) ? $conf->global->MAIN_INFO_SOCIETE_WEB : ''))).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Barcode
|
||||
@ -457,7 +458,7 @@ if (!empty($conf->barcode->enabled)) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print '<label for="barcode">'.$langs->trans("Gencod").'</label></td><td>';
|
||||
print '<span class="fa paddingright fa-barcode"></span>';
|
||||
print '<input name="barcode" id="barcode" class="minwidth150" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_GENCOD).'"></td></tr>';
|
||||
print '<input name="barcode" id="barcode" class="minwidth150" value="'.dol_escape_htmltag((GETPOSTISSET('barcode') ? GETPOST('barcode', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_GENCODE) ? $conf->global->MAIN_INFO_SOCIETE_GENCODE : ''))).'"></td></tr>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -534,7 +535,7 @@ print '</td></tr>';
|
||||
|
||||
// Note
|
||||
print '<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans("Note").'</label></td><td>';
|
||||
print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : $conf->global->MAIN_INFO_SOCIETE_NOTE).'</textarea></td></tr>';
|
||||
print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? $conf->global->MAIN_INFO_SOCIETE_NOTE : '')).'</textarea></td></tr>';
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
@ -549,17 +550,17 @@ $langs->load("companies");
|
||||
|
||||
// Managing Director(s)
|
||||
print '<tr class="oddeven"><td><label for="director">'.$langs->trans("ManagingDirectors").'</label></td><td>';
|
||||
print '<input name="MAIN_INFO_SOCIETE_MANAGERS" id="directors" class="minwidth200" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_MANAGERS).'"></td></tr>';
|
||||
print '<input name="MAIN_INFO_SOCIETE_MANAGERS" id="directors" class="minwidth200" value="'.dol_escape_htmltag((GETPOSTISSET('MAIN_INFO_SOCIETE_MANAGERS') ? GETPOST('MAIN_INFO_SOCIETE_MANAGERS', 'nohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_MANAGERS) ? $conf->global->MAIN_INFO_SOCIETE_MANAGERS : ''))).'"></td></tr>';
|
||||
|
||||
// GDPR contact
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("GDPRContact"), $langs->trans("GDPRContactDesc"));
|
||||
print '</td><td>';
|
||||
print '<input name="MAIN_INFO_GDPR" id="infodirector" class="minwidth500" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_GDPR).'"></td></tr>';
|
||||
print '<input name="MAIN_INFO_GDPR" id="infodirector" class="minwidth500" value="'.dol_escape_htmltag((GETPOSTISSET("MAIN_INFO_GDPR") ? GETPOST("MAIN_INFO_GDPR", 'nohtml') : (!empty($conf->global->MAIN_INFO_GDPR) ? $conf->global->MAIN_INFO_GDPR : ''))).'"></td></tr>';
|
||||
|
||||
// Capital
|
||||
print '<tr class="oddeven"><td><label for="capital">'.$langs->trans("Capital").'</label></td><td>';
|
||||
print '<input name="capital" id="capital" class="maxwidth100" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_CAPITAL).'"></td></tr>';
|
||||
print '<input name="capital" id="capital" class="maxwidth100" value="'.dol_escape_htmltag((GETPOSTISSET('capital') ? GETPOST('capital', 'nohtml') : (!empty($conf->global->MAIN_INFO_CAPITAL) ? $conf->global->MAIN_INFO_CAPITAL : ''))).'"></td></tr>';
|
||||
|
||||
// Juridical Status
|
||||
print '<tr class="oddeven"><td><label for="forme_juridique_code">'.$langs->trans("JuridicalStatus").'</label></td><td>';
|
||||
|
||||
@ -117,11 +117,11 @@ foreach ($listofnetworks as $key => $value) {
|
||||
$networkconstname = 'MAIN_INFO_SOCIETE_'.strtoupper($key).'_URL';
|
||||
$networkconstid = 'MAIN_INFO_SOCIETE_'.strtoupper($key);
|
||||
print '<td><span class="fa paddingright '.($value['icon'] ? $value['icon'] : 'fa-link').'"></span>';
|
||||
print '<input name="'.$key.'url" id="'.$key.'url" class="minwidth300" value="'.dol_escape_htmltag($conf->global->$networkconstname).'">';
|
||||
print '<input name="'.$key.'url" id="'.$key.'url" class="minwidth300" value="'.(!empty($conf->global->$networkconstname) ? dol_escape_htmltag($conf->global->$networkconstname) : '').'">';
|
||||
print '</td><td>';
|
||||
print '<input name="'.$key.'" id="'.$key.'" class="minwidth300" value="'.dol_escape_htmltag($conf->global->$networkconstid).'">';
|
||||
print '<input name="'.$key.'" id="'.$key.'" class="minwidth300" value="'.(!empty($conf->global->$networkconstid) ? dol_escape_htmltag($conf->global->$networkconstid) : '').'">';
|
||||
print '</td>';
|
||||
print '<td>'.dol_print_socialnetworks($conf->global->$networkconstid, 0, 0, $key, $listofnetworks).'</td>';
|
||||
print '<td>'.dol_print_socialnetworks((!empty($conf->global->$networkconstid) ? dol_escape_htmltag($conf->global->$networkconstid) : ''), 0, 0, $key, $listofnetworks).'</td>';
|
||||
print '</tr>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ if ($action == 'updateMask')
|
||||
$maskvalue = GETPOST('maskcontract', 'alpha');
|
||||
if ($maskconst) $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
|
||||
@ -172,13 +172,13 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai
|
||||
// Show message
|
||||
$message = '';
|
||||
$url = '<a href="'.$urlwithroot.'/dav/fileserver.php" target="_blank">'.$urlwithroot.'/dav/fileserver.php</a>';
|
||||
$message .= img_picto('', 'globe').' '.$langs->trans("WebDavServer", 'WebDAV', $url);
|
||||
$message .= img_picto('', 'globe').' '.str_replace('{url}', $url, $langs->trans("WebDavServer", 'WebDAV', '{url}'));
|
||||
$message .= '<br>';
|
||||
if (!empty($conf->global->DAV_ALLOW_PUBLIC_DIR))
|
||||
{
|
||||
$urlEntity = (!empty($conf->multicompany->enabled) ? '?entity='.$conf->entity : '');
|
||||
$url = '<a href="'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'" target="_blank">'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'</a>';
|
||||
$message .= img_picto('', 'globe').' '.$langs->trans("WebDavServer", 'WebDAV public', $url);
|
||||
$message .= img_picto('', 'globe').' '.str_replace('{url}', $url, $langs->trans("WebDavServer", 'WebDAV public', '{url}'));
|
||||
$message .= '<br>';
|
||||
}
|
||||
print $message;
|
||||
|
||||
@ -72,9 +72,9 @@ $hookmanager->initHooks(array('admindefaultvalues', 'globaladmin'));
|
||||
*/
|
||||
|
||||
if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; }
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; }
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && !empty($massaction) && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; }
|
||||
|
||||
$parameters = array('socid'=>$socid);
|
||||
$parameters = array();
|
||||
$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');
|
||||
|
||||
@ -186,7 +186,7 @@ llxHeader('', $langs->trans("Setup"), $wikihelp);
|
||||
|
||||
$param = '&mode='.$mode;
|
||||
|
||||
$enabledisablehtml .= $langs->trans("EnableDefaultValues").' ';
|
||||
$enabledisablehtml = $langs->trans("EnableDefaultValues").' ';
|
||||
if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES))
|
||||
{
|
||||
// Button off, click to enable
|
||||
@ -213,7 +213,7 @@ if ($defaultkey) $param .= '&defaultkey='.urlencode($defaultkey);
|
||||
if ($defaultvalue) $param .= '&defaultvalue='.urlencode($defaultvalue);
|
||||
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && $debug) ? '?debug=1' : '').'" method="POST">';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && !empty($debug)) ? '?debug=1' : '').'" method="POST">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
|
||||
@ -33,129 +33,131 @@ $langs->load("admin");
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
if (empty($action)) $action = 'edit';
|
||||
|
||||
// Define list of managed delays
|
||||
$modules = array(
|
||||
'agenda' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_ACTIONS_TODO',
|
||||
'img' => 'action'
|
||||
)
|
||||
),
|
||||
'projet' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_PROJECT_TO_CLOSE',
|
||||
'img' => 'project'
|
||||
),
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_TASKS_TODO',
|
||||
'img' => 'projecttask'
|
||||
)
|
||||
),
|
||||
'propal' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_PROPALS_TO_CLOSE',
|
||||
'img' => 'propal'
|
||||
),
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_PROPALS_TO_BILL',
|
||||
'img' => 'propal'
|
||||
)
|
||||
),
|
||||
'commande' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_ORDERS_TO_PROCESS',
|
||||
'img' => 'order'
|
||||
)
|
||||
),
|
||||
'facture' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED',
|
||||
'img' => 'bill'
|
||||
)
|
||||
),
|
||||
'fournisseur' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS',
|
||||
'img' => 'order'
|
||||
),
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY',
|
||||
'img' => 'bill'
|
||||
)
|
||||
),
|
||||
'service' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_NOT_ACTIVATED_SERVICES',
|
||||
'img' => 'service'
|
||||
),
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_RUNNING_SERVICES',
|
||||
'img' => 'service'
|
||||
)
|
||||
),
|
||||
'banque' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE',
|
||||
'img' => 'account'
|
||||
),
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_CHEQUES_TO_DEPOSIT',
|
||||
'img' => 'account'
|
||||
)
|
||||
),
|
||||
'adherent' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_MEMBERS',
|
||||
'img' => 'user'
|
||||
)
|
||||
),
|
||||
'expensereport' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_EXPENSEREPORTS',
|
||||
'img' => 'trip'
|
||||
),
|
||||
/* TODO Enable this
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_EXPENSEREPORTS_TO_PAY',
|
||||
'img' => 'trip'
|
||||
)*/
|
||||
),
|
||||
'holiday' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_HOLIDAYS',
|
||||
'img' => 'holiday'
|
||||
),
|
||||
),
|
||||
'agenda' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_ACTIONS_TODO',
|
||||
'img' => 'action'
|
||||
)
|
||||
),
|
||||
'projet' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_PROJECT_TO_CLOSE',
|
||||
'img' => 'project'
|
||||
),
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_TASKS_TODO',
|
||||
'img' => 'projecttask'
|
||||
)
|
||||
),
|
||||
'propal' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_PROPALS_TO_CLOSE',
|
||||
'img' => 'propal'
|
||||
),
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_PROPALS_TO_BILL',
|
||||
'img' => 'propal'
|
||||
)
|
||||
),
|
||||
'commande' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_ORDERS_TO_PROCESS',
|
||||
'img' => 'order'
|
||||
)
|
||||
),
|
||||
'facture' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED',
|
||||
'img' => 'bill'
|
||||
)
|
||||
),
|
||||
'fournisseur' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS',
|
||||
'img' => 'order'
|
||||
),
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY',
|
||||
'img' => 'bill'
|
||||
)
|
||||
),
|
||||
'service' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_NOT_ACTIVATED_SERVICES',
|
||||
'img' => 'service'
|
||||
),
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_RUNNING_SERVICES',
|
||||
'img' => 'service'
|
||||
)
|
||||
),
|
||||
'banque' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE',
|
||||
'img' => 'account'
|
||||
),
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_CHEQUES_TO_DEPOSIT',
|
||||
'img' => 'account'
|
||||
)
|
||||
),
|
||||
'adherent' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_MEMBERS',
|
||||
'img' => 'user'
|
||||
)
|
||||
),
|
||||
'expensereport' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_EXPENSEREPORTS',
|
||||
'img' => 'trip'
|
||||
),
|
||||
/* TODO Enable this
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_EXPENSEREPORTS_TO_PAY',
|
||||
'img' => 'trip'
|
||||
)*/
|
||||
),
|
||||
'holiday' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_HOLIDAYS',
|
||||
'img' => 'holiday'
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$labelmeteo = array(0=>$langs->trans("No"), 1=>$langs->trans("Yes"), 2=>$langs->trans("OnMobileOnly"));
|
||||
|
||||
if (!isset($conf->global->MAIN_DELAY_PROJECT_TO_CLOSE)) {
|
||||
$conf->global->MAIN_DELAY_PROJECT_TO_CLOSE = 7; // Must be same value than into conf.class.php
|
||||
$conf->global->MAIN_DELAY_PROJECT_TO_CLOSE = 7; // Must be same value than into conf.class.php
|
||||
}
|
||||
if (!isset($conf->global->MAIN_DELAY_TASKS_TODO)) {
|
||||
$conf->global->MAIN_DELAY_TASKS_TODO = 7; // Must be same value than into conf.class.php
|
||||
$conf->global->MAIN_DELAY_TASKS_TODO = 7; // Must be same value than into conf.class.php
|
||||
}
|
||||
if (!isset($conf->global->MAIN_DELAY_MEMBERS)) {
|
||||
$conf->global->MAIN_DELAY_MEMBERS = 0; // Must be same value than into conf.class.php
|
||||
$conf->global->MAIN_DELAY_MEMBERS = 0; // Must be same value than into conf.class.php
|
||||
}
|
||||
if (!isset($conf->global->MAIN_DELAY_ACTIONS_TODO)) {
|
||||
$conf->global->MAIN_DELAY_ACTIONS_TODO = 7; // Must be same value than into conf.class.php
|
||||
$conf->global->MAIN_DELAY_ACTIONS_TODO = 7; // Must be same value than into conf.class.php
|
||||
}
|
||||
if (!isset($conf->global->MAIN_DELAY_ORDERS_TO_PROCESS)) {
|
||||
$conf->global->MAIN_DELAY_ORDERS_TO_PROCESS = 2;
|
||||
$conf->global->MAIN_DELAY_ORDERS_TO_PROCESS = 2;
|
||||
}
|
||||
if (!isset($conf->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS)) {
|
||||
$conf->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS = 7;
|
||||
$conf->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS = 7;
|
||||
}
|
||||
if (!isset($conf->global->MAIN_DELAY_ORDERS_TO_PROCESS)) {
|
||||
$conf->global->MAIN_DELAY_ORDERS_TO_PROCESS = 2;
|
||||
$conf->global->MAIN_DELAY_ORDERS_TO_PROCESS = 2;
|
||||
}
|
||||
if (!isset($conf->global->MAIN_DELAY_ORDERS_TO_PROCESS)) {
|
||||
$conf->global->MAIN_DELAY_ORDERS_TO_PROCESS = 2;
|
||||
$conf->global->MAIN_DELAY_ORDERS_TO_PROCESS = 2;
|
||||
}
|
||||
if (!isset($conf->global->MAIN_DELAY_ORDERS_TO_PROCESS)) {
|
||||
$conf->global->MAIN_DELAY_ORDERS_TO_PROCESS = 2;
|
||||
$conf->global->MAIN_DELAY_ORDERS_TO_PROCESS = 2;
|
||||
}
|
||||
|
||||
|
||||
@ -166,30 +168,34 @@ if (!isset($conf->global->MAIN_DELAY_ORDERS_TO_PROCESS)) {
|
||||
|
||||
if ($action == 'update')
|
||||
{
|
||||
foreach ($modules as $module => $delays)
|
||||
{
|
||||
if (!empty($conf->$module->enabled))
|
||||
{
|
||||
foreach ($delays as $delay)
|
||||
{
|
||||
if (GETPOST($delay['code']) != '')
|
||||
{
|
||||
dolibarr_set_const($db, $delay['code'], GETPOST($delay['code']), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($modules as $module => $delays)
|
||||
{
|
||||
if (!empty($conf->$module->enabled))
|
||||
{
|
||||
foreach ($delays as $delay)
|
||||
{
|
||||
if (GETPOST($delay['code']) != '')
|
||||
{
|
||||
dolibarr_set_const($db, $delay['code'], GETPOST($delay['code']), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dolibarr_set_const($db, "MAIN_DISABLE_METEO", $_POST["MAIN_DISABLE_METEO"], 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_USE_METEO_WITH_PERCENTAGE", GETPOST("MAIN_USE_METEO_WITH_PERCENTAGE"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_DISABLE_METEO", $_POST["MAIN_DISABLE_METEO"], 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_USE_METEO_WITH_PERCENTAGE", GETPOST("MAIN_USE_METEO_WITH_PERCENTAGE"), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
// For update value with percentage
|
||||
$plus = '';
|
||||
if (!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) $plus = '_PERCENTAGE';
|
||||
// Update values
|
||||
for ($i = 0; $i < 4; $i++) {
|
||||
if (GETPOSTISSET('MAIN_METEO'.$plus.'_LEVEL'.$i)) dolibarr_set_const($db, 'MAIN_METEO'.$plus.'_LEVEL'.$i, GETPOST('MAIN_METEO'.$plus.'_LEVEL'.$i, 'int'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
// For update value with percentage
|
||||
$plus = '';
|
||||
if (!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) $plus = '_PERCENTAGE';
|
||||
// Update values
|
||||
for ($i = 0; $i < 4; $i++) {
|
||||
if (GETPOSTISSET('MAIN_METEO'.$plus.'_LEVEL'.$i)) dolibarr_set_const($db, 'MAIN_METEO'.$plus.'_LEVEL'.$i, GETPOST('MAIN_METEO'.$plus.'_LEVEL'.$i, 'int'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
|
||||
$action = 'edit';
|
||||
}
|
||||
|
||||
|
||||
@ -209,156 +215,156 @@ print "<br>\n";
|
||||
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" name="form_index">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" name="form_index">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("DelaysOfToleranceBeforeWarning").'</td><td class="center" width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("DelaysOfToleranceBeforeWarning").'</td><td class="center" width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
foreach ($modules as $module => $delays)
|
||||
{
|
||||
if (!empty($conf->$module->enabled))
|
||||
{
|
||||
foreach ($delays as $delay)
|
||||
{
|
||||
$value = (!empty($conf->global->{$delay['code']}) ? $conf->global->{$delay['code']}:0);
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="20px">'.img_object('', $delay['img']).'</td>';
|
||||
print '<td>'.$langs->trans('Delays_'.$delay['code']).'</td><td class="nowraponall">';
|
||||
print '<input class="right maxwidth75" type="number" name="'.$delay['code'].'" value="'.$value.'"> '.$langs->trans("days").'</td></tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($modules as $module => $delays)
|
||||
{
|
||||
if (!empty($conf->$module->enabled))
|
||||
{
|
||||
foreach ($delays as $delay)
|
||||
{
|
||||
$value = (!empty($conf->global->{$delay['code']}) ? $conf->global->{$delay['code']}:0);
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="20px">'.img_object('', $delay['img']).'</td>';
|
||||
print '<td>'.$langs->trans('Delays_'.$delay['code']).'</td><td class="nowraponall">';
|
||||
print '<input class="right maxwidth75" type="number" name="'.$delay['code'].'" value="'.$value.'"> '.$langs->trans("days").'</td></tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
// Show if meteo is enabled
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td class="center" width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||
// Show if meteo is enabled
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td class="center" width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td class="center">';
|
||||
print $form->selectarray('MAIN_DISABLE_METEO', $labelmeteo, (empty($conf->global->MAIN_DISABLE_METEO) ? 0 : $conf->global->MAIN_DISABLE_METEO));
|
||||
print '</td></tr>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td class="center">';
|
||||
print $form->selectarray('MAIN_DISABLE_METEO', $labelmeteo, (empty($conf->global->MAIN_DISABLE_METEO) ? 0 : $conf->global->MAIN_DISABLE_METEO));
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</table>';
|
||||
} else {
|
||||
/*
|
||||
/*
|
||||
* Show parameters
|
||||
*/
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("DelaysOfToleranceBeforeWarning").'</td><td class="center" width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("DelaysOfToleranceBeforeWarning").'</td><td class="center" width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
foreach ($modules as $module => $delays)
|
||||
{
|
||||
if (!empty($conf->$module->enabled))
|
||||
{
|
||||
foreach ($delays as $delay)
|
||||
{
|
||||
$value = (!empty($conf->global->{$delay['code']}) ? $conf->global->{$delay['code']}:0);
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="20px">'.img_object('', $delay['img']).'</td>';
|
||||
print '<td>'.$langs->trans('Delays_'.$delay['code']).'</td>';
|
||||
print '<td class="right">'.$value.' '.$langs->trans("days").'</td></tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($modules as $module => $delays)
|
||||
{
|
||||
if (!empty($conf->$module->enabled))
|
||||
{
|
||||
foreach ($delays as $delay)
|
||||
{
|
||||
$value = (!empty($conf->global->{$delay['code']}) ? $conf->global->{$delay['code']}:0);
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="20px">'.img_object('', $delay['img']).'</td>';
|
||||
print '<td>'.$langs->trans('Delays_'.$delay['code']).'</td>';
|
||||
print '<td class="right">'.$value.' '.$langs->trans("days").'</td></tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
// Show if meteo is enabled
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td class="center" width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||
// Show if meteo is enabled
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td class="center" width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td class="center">';
|
||||
print $labelmeteo[$conf->global->MAIN_DISABLE_METEO];
|
||||
print '</td></tr>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td class="center">';
|
||||
print $labelmeteo[$conf->global->MAIN_DISABLE_METEO];
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
if ($conf->global->MAIN_DISABLE_METEO != 1) {
|
||||
// Show logo for weather
|
||||
print '<span class="opacitymedium">'.$langs->trans("DescWeather").'</span> ';
|
||||
// Show logo for weather
|
||||
print '<span class="opacitymedium">'.$langs->trans("DescWeather").'</span> ';
|
||||
|
||||
if ($action == 'edit') {
|
||||
$str_mode_std = $langs->trans('MeteoStdModEnabled').' : '.$langs->trans('MeteoUseMod', $langs->transnoentitiesnoconv('MeteoPercentageMod'));
|
||||
$str_mode_percentage = $langs->trans('MeteoPercentageModEnabled').' : '.$langs->trans('MeteoUseMod', $langs->transnoentitiesnoconv('MeteoStdMod'));
|
||||
if (empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) $str_mode_enabled = $str_mode_std;
|
||||
else $str_mode_enabled = $str_mode_percentage;
|
||||
print '<a href="#" onclick="return false;" id="change_mode">'.$str_mode_enabled.'</a>';
|
||||
print '<input type="hidden" id="MAIN_USE_METEO_WITH_PERCENTAGE" name="MAIN_USE_METEO_WITH_PERCENTAGE" value="'.$conf->global->MAIN_USE_METEO_WITH_PERCENTAGE.'" />';
|
||||
if ($action == 'edit') {
|
||||
$str_mode_std = $langs->trans('MeteoStdModEnabled').' : '.$langs->trans('MeteoUseMod', $langs->transnoentitiesnoconv('MeteoPercentageMod'));
|
||||
$str_mode_percentage = $langs->trans('MeteoPercentageModEnabled').' : '.$langs->trans('MeteoUseMod', $langs->transnoentitiesnoconv('MeteoStdMod'));
|
||||
if (empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) $str_mode_enabled = $str_mode_std;
|
||||
else $str_mode_enabled = $str_mode_percentage;
|
||||
print '<a href="#" onclick="return false;" id="change_mode">'.$str_mode_enabled.'</a>';
|
||||
print '<input type="hidden" id="MAIN_USE_METEO_WITH_PERCENTAGE" name="MAIN_USE_METEO_WITH_PERCENTAGE" value="'.$conf->global->MAIN_USE_METEO_WITH_PERCENTAGE.'" />';
|
||||
|
||||
print '<br><br>';
|
||||
} else {
|
||||
if (empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) print $langs->trans('MeteoStdModEnabled');
|
||||
else print $langs->trans('MeteoPercentageModEnabled');
|
||||
print '<br><br>';
|
||||
}
|
||||
print '<br><br>';
|
||||
} else {
|
||||
if (empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) print $langs->trans('MeteoStdModEnabled');
|
||||
else print $langs->trans('MeteoPercentageModEnabled');
|
||||
print '<br><br>';
|
||||
}
|
||||
|
||||
$offset = 0;
|
||||
$cursor = 10; // By default
|
||||
//if (! empty($conf->global->MAIN_METEO_OFFSET)) $offset=$conf->global->MAIN_METEO_OFFSET;
|
||||
//if (! empty($conf->global->MAIN_METEO_GAP)) $cursor=$conf->global->MAIN_METEO_GAP;
|
||||
$level0 = $offset; if (!empty($conf->global->MAIN_METEO_LEVEL0)) $level0 = $conf->global->MAIN_METEO_LEVEL0;
|
||||
$level1 = $offset + 1 * $cursor; if (!empty($conf->global->MAIN_METEO_LEVEL1)) $level1 = $conf->global->MAIN_METEO_LEVEL1;
|
||||
$level2 = $offset + 2 * $cursor; if (!empty($conf->global->MAIN_METEO_LEVEL2)) $level2 = $conf->global->MAIN_METEO_LEVEL2;
|
||||
$level3 = $offset + 3 * $cursor; if (!empty($conf->global->MAIN_METEO_LEVEL3)) $level3 = $conf->global->MAIN_METEO_LEVEL3;
|
||||
$text = ''; $options = 'class="valignmiddle" height="60px"';
|
||||
$offset = 0;
|
||||
$cursor = 10; // By default
|
||||
//if (! empty($conf->global->MAIN_METEO_OFFSET)) $offset=$conf->global->MAIN_METEO_OFFSET;
|
||||
//if (! empty($conf->global->MAIN_METEO_GAP)) $cursor=$conf->global->MAIN_METEO_GAP;
|
||||
$level0 = $offset; if (!empty($conf->global->MAIN_METEO_LEVEL0)) $level0 = $conf->global->MAIN_METEO_LEVEL0;
|
||||
$level1 = $offset + 1 * $cursor; if (!empty($conf->global->MAIN_METEO_LEVEL1)) $level1 = $conf->global->MAIN_METEO_LEVEL1;
|
||||
$level2 = $offset + 2 * $cursor; if (!empty($conf->global->MAIN_METEO_LEVEL2)) $level2 = $conf->global->MAIN_METEO_LEVEL2;
|
||||
$level3 = $offset + 3 * $cursor; if (!empty($conf->global->MAIN_METEO_LEVEL3)) $level3 = $conf->global->MAIN_METEO_LEVEL3;
|
||||
$text = ''; $options = 'class="valignmiddle" height="60px"';
|
||||
|
||||
|
||||
if ($action == 'edit') {
|
||||
print '<div id="standard" '.(empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '' : 'style="display:none;"').'>';
|
||||
if ($action == 'edit') {
|
||||
print '<div id="standard" '.(empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '' : 'style="display:none;"').'>';
|
||||
|
||||
print '<div>';
|
||||
print '<div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 0, $options);
|
||||
print ' <= <input type="text" size="2" name="MAIN_METEO_LEVEL0" value="'.$level0.'"/></td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 1, $options);
|
||||
print ' <= <input type="text" size="2" name="MAIN_METEO_LEVEL1" value="'.$level1.'"/></td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 2, $options);
|
||||
print ' <= <input type="text" size="2" name="MAIN_METEO_LEVEL2" value="'.$level2.'"/></td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 3, $options);
|
||||
print ' <= <input type="text" size="2" name="MAIN_METEO_LEVEL3" value="'.$level3.'"/></td>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
print '<div>';
|
||||
print '<div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 0, $options);
|
||||
print ' <= <input type="text" size="2" name="MAIN_METEO_LEVEL0" value="'.$level0.'"/></td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 1, $options);
|
||||
print ' <= <input type="text" size="2" name="MAIN_METEO_LEVEL1" value="'.$level1.'"/></td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 2, $options);
|
||||
print ' <= <input type="text" size="2" name="MAIN_METEO_LEVEL2" value="'.$level2.'"/></td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 3, $options);
|
||||
print ' <= <input type="text" size="2" name="MAIN_METEO_LEVEL3" value="'.$level3.'"/></td>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
print '<div id="percentage" '.(empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? 'style="display:none;"' : '').'>';
|
||||
print '<div id="percentage" '.(empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? 'style="display:none;"' : '').'>';
|
||||
|
||||
print '<div>';
|
||||
print '<div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 0, $options);
|
||||
print ' <= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL0" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL0.'"/> %</td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 1, $options);
|
||||
print ' <= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL1" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL1.'"/> %</td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 2, $options);
|
||||
print ' <= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL2" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL2.'"/> %</td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 3, $options);
|
||||
print ' <= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL3" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.'"/> %</td>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
print '<div>';
|
||||
print '<div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 0, $options);
|
||||
print ' <= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL0" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL0.'"/> %</td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 1, $options);
|
||||
print ' <= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL1" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL1.'"/> %</td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 2, $options);
|
||||
print ' <= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL2" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL2.'"/> %</td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 3, $options);
|
||||
print ' <= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL3" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.'"/> %</td>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@ if ($action == 'updateMask')
|
||||
$maskdelivery = GETPOST('maskdelivery', 'alpha');
|
||||
if ($maskconstdelivery) $res = dolibarr_set_const($db, $maskconstdelivery, $maskdelivery, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -73,7 +73,7 @@ if ($action == 'set_DELIVERY_FREE_TEXT')
|
||||
$free = GETPOST('DELIVERY_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
|
||||
$res = dolibarr_set_const($db, "DELIVERY_FREE_TEXT", $free, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
|
||||
@ -236,7 +236,7 @@ $tabsqlsort[3] = "country ASC, code ASC";
|
||||
$tabsqlsort[4] = "code ASC";
|
||||
$tabsqlsort[5] = "label ASC";
|
||||
$tabsqlsort[6] = "a.type ASC, a.module ASC, a.position ASC, a.code ASC";
|
||||
$tabsqlsort[7] = "country ASC, code ASC, a.libelle ASC";
|
||||
$tabsqlsort[7] = "c.label ASC, a.code ASC, a.libelle ASC";
|
||||
$tabsqlsort[8] = "country DESC,".(!empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? ' t.position ASC,' : '')." libelle ASC";
|
||||
$tabsqlsort[9] = "label ASC";
|
||||
$tabsqlsort[10] = "country ASC, code ASC, taux ASC, recuperableonly ASC, localtax1 ASC, localtax2 ASC";
|
||||
@ -621,6 +621,7 @@ if ($id == 11)
|
||||
// 'contract' => $langs->trans('Contract'),
|
||||
'project' => $langs->trans('Project'),
|
||||
'project_task' => $langs->trans('Task'),
|
||||
'ticket' => $langs->trans('Ticket'),
|
||||
'agenda' => $langs->trans('Agenda'),
|
||||
'dolresource' => $langs->trans('Resource'),
|
||||
// old deprecated
|
||||
@ -798,11 +799,15 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
$keycode = $listfieldvalue[$i];
|
||||
if (empty($keycode)) $keycode = $value;
|
||||
|
||||
if ($value == 'price' || preg_match('/^amount/i', $value) || $value == 'taux') {
|
||||
$_POST[$keycode] = price2num($_POST[$keycode], 'MU');
|
||||
} elseif ($value == 'entity') {
|
||||
$_POST[$keycode] = getEntity($tabname[$id]);
|
||||
}
|
||||
if ($value == 'price' || preg_match('/^amount/i', $value)) {
|
||||
$_POST[$keycode] = price2num(GETPOST($keycode), 'MU');
|
||||
}
|
||||
elseif ($value == 'taux' || $value == 'localtax1' || $value == 'localtax2') {
|
||||
$_POST[$keycode] = price2num(GETPOST($keycode), 8);
|
||||
}
|
||||
elseif ($value == 'entity') {
|
||||
$_POST[$keycode] = getEntity($tabname[$id]);
|
||||
}
|
||||
|
||||
if ($i) $sql .= ",";
|
||||
|
||||
@ -822,11 +827,11 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
}
|
||||
$sql .= ",1)";
|
||||
|
||||
dol_syslog("actionadd", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result) // Add is ok
|
||||
{
|
||||
setEventMessages($langs->transnoentities("RecordCreatedSuccessfully"), null, 'mesgs');
|
||||
dol_syslog("actionadd", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result) // Add is ok
|
||||
{
|
||||
setEventMessages($langs->transnoentities("RecordCreatedSuccessfully"), null, 'mesgs');
|
||||
|
||||
// Clean $_POST array, we keep only id of dictionary
|
||||
if ($id == 10 && GETPOST('country', 'int') > 0) {
|
||||
@ -861,11 +866,15 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
$keycode = $listfieldvalue[$i];
|
||||
if (empty($keycode)) $keycode = $field;
|
||||
|
||||
if ($field == 'price' || preg_match('/^amount/i', $field) || $field == 'taux') {
|
||||
$_POST[$keycode] = price2num($_POST[$keycode], 'MU');
|
||||
} elseif ($field == 'entity') {
|
||||
$_POST[$keycode] = getEntity($tabname[$id]);
|
||||
}
|
||||
if ($field == 'price' || preg_match('/^amount/i', $field)) {
|
||||
$_POST[$keycode] = price2num(GETPOST($keycode), 'MU');
|
||||
}
|
||||
elseif ($field == 'taux' || $field == 'localtax1' || $field == 'localtax2') {
|
||||
$_POST[$keycode] = price2num(GETPOST($keycode), 8);
|
||||
}
|
||||
elseif ($field == 'entity') {
|
||||
$_POST[$keycode] = getEntity($tabname[$id]);
|
||||
}
|
||||
|
||||
if ($i) $sql .= ",";
|
||||
$sql .= $field."=";
|
||||
@ -1068,6 +1077,7 @@ if ($id)
|
||||
elseif ($search_code != '' && $id == 28) $sql .= natural_search("h.code", $search_code);
|
||||
elseif ($search_code != '' && $id == 32) $sql .= natural_search("a.code", $search_code);
|
||||
elseif ($search_code != '' && $id == 3) $sql .= natural_search("r.code_region", $search_code);
|
||||
elseif ($search_code != '' && $id == 7) $sql .= natural_search("a.code", $search_code);
|
||||
elseif ($search_code != '' && $id != 9) $sql .= natural_search("code", $search_code);
|
||||
|
||||
if ($sortfield)
|
||||
@ -1106,7 +1116,6 @@ if ($id)
|
||||
// Form to add a new line
|
||||
if ($tabname[$id])
|
||||
{
|
||||
$alabelisused = 0;
|
||||
$withentity = null;
|
||||
|
||||
$fieldlist = explode(',', $tabfield[$id]);
|
||||
@ -1213,7 +1222,6 @@ if ($id)
|
||||
else $tdsoffields .= $valuetoshow;
|
||||
$tdsoffields .= '</td>';
|
||||
}
|
||||
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') $alabelisused = 1;
|
||||
}
|
||||
|
||||
if ($id == 4) $tdsoffields .= '<td></td>';
|
||||
@ -1492,11 +1500,9 @@ if ($id)
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($value == 'element')
|
||||
{
|
||||
if ($value == 'element') {
|
||||
$valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow;
|
||||
} elseif ($value == 'source')
|
||||
{
|
||||
} elseif ($value == 'source') {
|
||||
$valuetoshow = isset($sourceList[$valuetoshow]) ? $sourceList[$valuetoshow] : $valuetoshow;
|
||||
} elseif ($valuetoshow == 'all') {
|
||||
$valuetoshow = $langs->trans('All');
|
||||
|
||||
@ -416,7 +416,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
if (function_exists('imap_open'))
|
||||
{
|
||||
$connectstringserver = $object->getConnectStringIMAP();
|
||||
// Note: $object->host has been loaded by the fetch
|
||||
$usessl = 1;
|
||||
|
||||
$connectstringserver = $object->getConnectStringIMAP($usessl);
|
||||
|
||||
try {
|
||||
if ($sourcedir) {
|
||||
|
||||
@ -61,7 +61,7 @@ if ($action == 'updateMask') {
|
||||
$res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
if (!$res > 0) {
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ if ($action == 'updateMask')
|
||||
if ($maskconstcredit) $res = dolibarr_set_const($db, $maskconstcredit, $maskcredit, 'chaine', 0, '', $conf->entity);
|
||||
if ($maskconstdeposit) $res = dolibarr_set_const($db, $maskconstdeposit, $maskdeposit, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -156,7 +156,7 @@ elseif ($action == 'setdoc')
|
||||
$res = dolibarr_set_const($db, "FACTURE_RIB_NUMBER", $rib, 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "FACTURE_CHQ_NUMBER", $chq, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -170,7 +170,7 @@ elseif ($action == 'setdoc')
|
||||
|
||||
$res = dolibarr_set_const($db, "FACTURE_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -184,7 +184,7 @@ elseif ($action == 'setdoc')
|
||||
|
||||
$res = dolibarr_set_const($db, "INVOICE_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -198,7 +198,7 @@ elseif ($action == 'setdoc')
|
||||
|
||||
$res = dolibarr_set_const($db, "FAC_FORCE_DATE_VALIDATION", $forcedate, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -217,7 +217,7 @@ elseif ($action == 'setdoc')
|
||||
foreach ($invoicetypemodels as $type => $value)
|
||||
{
|
||||
$res = dolibarr_set_const($db, 'FACTURE_ADDON_PDF_'.intval($type), $value, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
|
||||
@ -58,7 +58,7 @@ if ($action == 'updateMask')
|
||||
$maskvalue = GETPOST('maskvalue', 'alpha');
|
||||
if ($maskconst) $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -147,7 +147,7 @@ elseif ($action == 'setdoc')
|
||||
$freetext = GETPOST('FICHINTER_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
|
||||
$res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -160,7 +160,7 @@ elseif ($action == 'setdoc')
|
||||
$draft = GETPOST('FICHINTER_DRAFT_WATERMARK', 'alpha');
|
||||
$res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -173,7 +173,7 @@ elseif ($action == 'setdoc')
|
||||
$val = GETPOST('FICHINTER_PRINT_PRODUCTS', 'alpha');
|
||||
$res = dolibarr_set_const($db, "FICHINTER_PRINT_PRODUCTS", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -185,7 +185,7 @@ elseif ($action == 'setdoc')
|
||||
$val = GETPOST('FICHINTER_USE_SERVICE_DURATION', 'alpha');
|
||||
$res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) {
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
@ -198,7 +198,7 @@ elseif ($action == 'setdoc')
|
||||
$val = GETPOST('FICHINTER_WITHOUT_DURATION', 'alpha');
|
||||
$res = dolibarr_set_const($db, "FICHINTER_WITHOUT_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) {
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
@ -211,7 +211,7 @@ elseif ($action == 'setdoc')
|
||||
$val = GETPOST('FICHINTER_DATE_WITHOUT_HOUR', 'alpha');
|
||||
$res = dolibarr_set_const($db, "FICHINTER_DATE_WITHOUT_HOUR", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) {
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@ if ($action == 'updateMask')
|
||||
$maskvalue = GETPOST('maskholiday', 'alpha');
|
||||
if ($maskconst) $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
|
||||
@ -163,7 +163,7 @@ if ($action == 'edit')
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"), $langs->trans("ParameterActiveForNextInputOnly"));
|
||||
print '</td><td><input class="flat" name="'.$mainroundingruletot.'" size="3" value="'.(isset($conf->global->$mainroundingruletot) ? $conf->global->$mainroundingruletot : $conf->global->MAIN_ROUNDING_RULE_TOT).'"></td></tr>';
|
||||
print '</td><td><input class="flat" name="'.$mainroundingruletot.'" size="3" value="'.(isset($conf->global->$mainroundingruletot) ? $conf->global->$mainroundingruletot : (!empty($conf->global->MAIN_ROUNDING_RULE_TOT) ? $conf->global->MAIN_ROUNDING_RULE_TOT : '')).'"></td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -193,7 +193,7 @@ if ($action == 'edit')
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"), $langs->trans("ParameterActiveForNextInputOnly"));
|
||||
print '</td><td align="right">'.(isset($conf->global->$mainroundingruletot) ? $conf->global->$mainroundingruletot : $conf->global->MAIN_ROUNDING_RULE_TOT).'</td></tr>';
|
||||
print '</td><td align="right">'.(isset($conf->global->$mainroundingruletot) ? $conf->global->$mainroundingruletot : (!empty($conf->global->MAIN_ROUNDING_RULE_TOT) ? $conf->global->MAIN_ROUNDING_RULE_TOT : '')).'</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
@ -34,6 +34,7 @@ if (!$user->admin) accessforbidden();
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
|
||||
/*
|
||||
@ -49,20 +50,23 @@ if ($action == 'setvalue')
|
||||
$checkread = GETPOST('value', 'alpha');
|
||||
$checkread_key = GETPOST('MAILING_EMAIL_UNSUBSCRIBE_KEY', 'alpha');
|
||||
$mailingdelay = GETPOST('MAILING_DELAY', 'int');
|
||||
$contactbulkdefault = GETPOST('MAILING_CONTACT_DEFAULT_BULK_STATUS', 'int');
|
||||
|
||||
$res = dolibarr_set_const($db, "MAILING_EMAIL_FROM", $mailfrom, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
$res = dolibarr_set_const($db, "MAILING_EMAIL_ERRORSTO", $mailerror, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
$res = dolibarr_set_const($db, "MAILING_DELAY", $mailingdelay, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
$res = dolibarr_set_const($db, "MAILING_CONTACT_DEFAULT_BULK_STATUS", $contactbulkdefault, 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
// Create temporary encryption key if nedded
|
||||
$res = dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE_KEY", $checkread_key, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
@ -70,7 +74,17 @@ if ($action == 'setvalue')
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setonsearchandlistgooncustomerorsuppliercard') {
|
||||
$setonsearchandlistgooncustomerorsuppliercard = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, "SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD", $setonsearchandlistgooncustomerorsuppliercard, 'yesno', 0, '', $conf->entity);
|
||||
if (!($res > 0)) $error++;
|
||||
if (!$error)
|
||||
{
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* View
|
||||
@ -136,6 +150,16 @@ print '<input size="32" type="text" name="MAILING_EMAIL_UNSUBSCRIBE_KEY" id="MAI
|
||||
if (!empty($conf->use_javascript_ajax)) print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
|
||||
print '</td></tr>';
|
||||
|
||||
// default blacklist from mailing
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . $langs->trans("DefaultBlacklistMailingStatus") . '</td>';
|
||||
print '<td>';
|
||||
$blacklist_setting=array(0=>$langs->trans('No'),1=>$langs->trans('Yes'),-1=>$langs->trans('DefaultStatusEmptyMandatory'));
|
||||
print $form->selectarray("MAILING_CONTACT_DEFAULT_BULK_STATUS", $blacklist_setting, $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
if (!empty($conf->use_javascript_ajax) && $conf->global->MAIN_FEATURES_LEVEL >= 1) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("MailAdvTargetRecipients").'</td><td>';
|
||||
|
||||
@ -59,7 +59,7 @@ if ($action == 'update' || $action == 'add')
|
||||
$constnote = $_POST["constnote"][$key];
|
||||
$res = dolibarr_set_const($db, $constname, $constvalue, $type[$consttype], 0, $constnote, $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
|
||||
@ -532,6 +532,7 @@ if ($action == 'edit')
|
||||
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
@ -552,10 +553,12 @@ if ($action == 'edit')
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) {
|
||||
print '<br>';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td></td></tr>';
|
||||
|
||||
@ -663,6 +666,7 @@ if ($action == 'edit')
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
|
||||
print info_admin($langs->trans("WarningPHPMail").'<br>'.$langs->trans("WarningPHPMailA").'<br>'.$langs->trans("WarningPHPMailB").'<br>'.$langs->trans("WarningPHPMailC").'<br><br>'.$langs->trans("WarningPHPMailD"), 0, 0, 'warning');
|
||||
@ -670,13 +674,15 @@ if ($action == 'edit')
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("OtherOptions").'</td><td></td></tr>';
|
||||
|
||||
// From
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ?ini_get('sendmail_from') : $langs->transnoentities("Undefined")).'</td>';
|
||||
print '<td>'.$conf->global->MAIN_MAIL_EMAIL_FROM;
|
||||
if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && !isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail"));
|
||||
if (empty($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("Mandatory"));
|
||||
elseif (!isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail"));
|
||||
print '</td></tr>';
|
||||
|
||||
// Default from type
|
||||
@ -746,6 +752,7 @@ if ($action == 'edit')
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").'</td><td>'.yn($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT).'</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
print dol_get_fiche_end();
|
||||
@ -761,7 +768,7 @@ if ($action == 'edit')
|
||||
{
|
||||
if (function_exists('fsockopen') && $port && $server)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect#formmailbeforetitle">'.$langs->trans("DoTestServerAvailability").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect&date='.dol_now().'#formmailaftertstconnect">'.$langs->trans("DoTestServerAvailability").'</a>';
|
||||
}
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("FeatureNotAvailableOnLinux").'">'.$langs->trans("DoTestServerAvailability").'</a>';
|
||||
@ -837,6 +844,7 @@ if ($action == 'edit')
|
||||
// Run the test to connect
|
||||
if ($action == 'testconnect')
|
||||
{
|
||||
print '<div id="formmailaftertstconnect" name="formmailaftertstconnect"></div>';
|
||||
print load_fiche_titre($langs->trans("DoTestServerAvailability"));
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
@ -851,6 +859,7 @@ if ($action == 'edit')
|
||||
}
|
||||
|
||||
setEventMessages($errormsg, null, 'errors');
|
||||
print $errormsg;
|
||||
}
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
@ -290,6 +290,11 @@ if ($action == 'create') {
|
||||
|
||||
// Id
|
||||
$parent_rowid = GETPOST('menuId', 'int');
|
||||
$parent_mainmenu = '';
|
||||
$parent_leftmenu = '';
|
||||
$parent_langs = '';
|
||||
$parent_level = '';
|
||||
|
||||
if (GETPOST('menuId', 'int')) {
|
||||
$sql = "SELECT m.rowid, m.mainmenu, m.leftmenu, m.level, m.langs FROM ".MAIN_DB_PREFIX."menu as m WHERE m.rowid = ".GETPOST('menuId', 'int');
|
||||
$res = $db->query($sql);
|
||||
@ -328,8 +333,8 @@ if ($action == 'create') {
|
||||
} else {
|
||||
print '<select name="type" class="flat" id="topleft">';
|
||||
print '<option value=""> </option>';
|
||||
print '<option value="top"'.($_POST["type"] && $_POST["type"] == 'top' ? ' selected' : '').'>'.$langs->trans('Top').'</option>';
|
||||
print '<option value="left"'.($_POST["type"] && $_POST["type"] == 'left' ? ' selected' : '').'>'.$langs->trans('Left').'</option>';
|
||||
print '<option value="top"'.(!empty($_POST["type"]) && $_POST["type"] == 'top' ? ' selected' : '').'>'.$langs->trans('Top').'</option>';
|
||||
print '<option value="left"'.(!empty($_POST["type"]) && $_POST["type"] == 'left' ? ' selected' : '').'>'.$langs->trans('Left').'</option>';
|
||||
print '</select>';
|
||||
}
|
||||
print '</td><td>'.$langs->trans('DetailType').'</td></tr>';
|
||||
@ -370,8 +375,8 @@ if ($action == 'create') {
|
||||
|
||||
// Target
|
||||
print '<tr><td>'.$langs->trans('Target').'</td><td><select class="flat" name="target">';
|
||||
print '<option value=""'.($menu->target == "" ? ' selected' : '').'> </option>';
|
||||
print '<option value="_blank"'.($menu->target == "_blank" ? ' selected' : '').'>'.$langs->trans('_blank').'</option>';
|
||||
print '<option value=""'.(isset($menu->target) && $menu->target == "" ? ' selected' : '').'> </option>';
|
||||
print '<option value="_blank"'.(isset($menu->target) && $menu->target == "_blank" ? ' selected' : '').'>'.$langs->trans('_blank').'</option>';
|
||||
print '</select></td></td><td>'.$langs->trans('DetailTarget').'</td></tr>';
|
||||
|
||||
// Enabled
|
||||
|
||||
@ -367,7 +367,7 @@ if ($conf->use_javascript_ajax)
|
||||
$remainingdata = array();
|
||||
foreach ($data as $datar)
|
||||
{
|
||||
if (empty($datar['rowid']) || $tree_recur_alreadyadded[$datar['rowid']]) continue;
|
||||
if (empty($datar['rowid']) || !empty($tree_recur_alreadyadded[$datar['rowid']])) continue;
|
||||
$remainingdata[] = $datar;
|
||||
}
|
||||
|
||||
|
||||
@ -472,22 +472,22 @@ if ($nbofactivatedmodules <= 1) {
|
||||
print load_fiche_titre($langs->trans("ModulesSetup"), '', 'title_setup');
|
||||
|
||||
// Start to show page
|
||||
$deschelp = '';
|
||||
if ($mode == 'common' || $mode == 'commonkanban') {
|
||||
$desc = $langs->trans("ModulesDesc", '{picto}');
|
||||
$desc = str_replace('{picto}', img_picto('', 'switch_off'), $desc);
|
||||
print '<span class="opacitymedium hideonsmartphone">'.$desc."<br><br></span>\n";
|
||||
$deschelp = '<span class="opacitymedium hideonsmartphone">'.$desc."<br><br></span>\n";
|
||||
}
|
||||
if ($mode == 'marketplace') {
|
||||
print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModulesMarketPlaceDesc")."<br><br></span>\n";
|
||||
$deschelp = '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModulesMarketPlaceDesc")."<br><br></span>\n";
|
||||
}
|
||||
if ($mode == 'deploy') {
|
||||
print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModulesDeployDesc", $langs->transnoentitiesnoconv("AvailableModules"))."<br><br></span>\n";
|
||||
$deschelp = '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModulesDeployDesc", $langs->transnoentitiesnoconv("AvailableModules"))."<br><br></span>\n";
|
||||
}
|
||||
if ($mode == 'develop') {
|
||||
print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModulesDevelopDesc")."<br><br></span>\n";
|
||||
$deschelp = '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModulesDevelopDesc")."<br><br></span>\n";
|
||||
}
|
||||
|
||||
|
||||
$head = modules_prepare_head();
|
||||
|
||||
|
||||
@ -495,17 +495,25 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
||||
dol_set_focus('#search_keyword');
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') {
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
if (isset($optioncss) && $optioncss != '') {
|
||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
}
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
if (isset($sortfield) && $sortfield != '') {
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
}
|
||||
if (isset($sortorder) && $sortorder != '') {
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
}
|
||||
if (isset($page) && $page != '') {
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
}
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
print dol_get_fiche_head($head, 'modules', '', -1);
|
||||
|
||||
print $deschelp;
|
||||
|
||||
$moreforfilter = '<div class="valignmiddle">';
|
||||
|
||||
$moreforfilter .= '<div class="floatright right pagination"><ul><li>';
|
||||
@ -517,10 +525,10 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
||||
|
||||
$moreforfilter .= '<div class="colorbacktimesheet float valignmiddle">';
|
||||
$moreforfilter .= '<div class="divsearchfield paddingtop">';
|
||||
$moreforfilter .= $langs->trans('Keyword').': <input type="text" id="search_keyword" name="search_keyword" class="maxwidth100" value="'.dol_escape_htmltag($search_keyword).'">';
|
||||
$moreforfilter .= img_picto($langs->trans("Filter"), 'filter', 'class="paddingright opacitymedium"').'<input type="text" id="search_keyword" name="search_keyword" class="maxwidth100" value="'.dol_escape_htmltag($search_keyword).'" placeholder="'.dol_escape_htmltag($langs->trans('Keyword')).'">';
|
||||
$moreforfilter .= '</div>';
|
||||
$moreforfilter .= '<div class="divsearchfield paddingtop">';
|
||||
$moreforfilter .= $langs->trans('Origin').': '.$form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), 1, 0, 0, '', 0, 0, 0, '', 'maxwidth200', 1);
|
||||
$moreforfilter .= $form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), $langs->trans('Origin'), 0, 0, '', 0, 0, 0, '', 'maxwidth200', 1);
|
||||
$moreforfilter .= '</div>';
|
||||
if (!empty($conf->global->MAIN_FEATURES_LEVEL)) {
|
||||
$array_version = array('stable'=>$langs->transnoentitiesnoconv("Stable"));
|
||||
@ -534,11 +542,11 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
||||
$array_version['development'] = $langs->trans("Development");
|
||||
}
|
||||
$moreforfilter .= '<div class="divsearchfield paddingtop">';
|
||||
$moreforfilter .= $langs->trans('Version').': '.$form->selectarray('search_version', $array_version, $search_version, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth150', 1);
|
||||
$moreforfilter .= $form->selectarray('search_version', $array_version, $search_version, $langs->trans('Version'), 0, 0, '', 0, 0, 0, '', 'maxwidth150', 1);
|
||||
$moreforfilter .= '</div>';
|
||||
}
|
||||
$moreforfilter .= '<div class="divsearchfield paddingtop">';
|
||||
$moreforfilter .= $langs->trans('Status').': '.$form->selectarray('search_status', array('active'=>$langs->transnoentitiesnoconv("Enabled"), 'disabled'=>$langs->transnoentitiesnoconv("Disabled")), $search_status, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth150', 1);
|
||||
$moreforfilter .= $form->selectarray('search_status', array('active'=>$langs->transnoentitiesnoconv("Enabled"), 'disabled'=>$langs->transnoentitiesnoconv("Disabled")), $search_status, $langs->trans('Status'), 0, 0, '', 0, 0, 0, '', 'maxwidth150', 1);
|
||||
$moreforfilter .= '</div>';
|
||||
$moreforfilter .= ' ';
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
@ -931,6 +939,10 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
||||
if ($mode == 'marketplace') {
|
||||
print dol_get_fiche_head($head, $mode, '', -1);
|
||||
|
||||
print $deschelp;
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Marketplace
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="list_of_modules" class="noborder centpercent">'."\n";
|
||||
@ -971,8 +983,8 @@ if ($mode == 'marketplace') {
|
||||
?>
|
||||
<input type="hidden" name="token" value="<?php echo newToken(); ?>">
|
||||
<input type="hidden" name="mode" value="marketplace">
|
||||
<div class="divsearchfield"><?php echo $langs->trans('Keyword') ?>:
|
||||
<input name="search_keyword" placeholder="<?php echo $langs->trans('Chercher un module') ?>" id="search_keyword" type="text" size="50" value="<?php echo $options['search'] ?>"><br>
|
||||
<div class="divsearchfield">
|
||||
<input name="search_keyword" placeholder="<?php echo $langs->trans('Keyword') ?>" id="search_keyword" type="text" size="50" value="<?php echo $options['search'] ?>"><br>
|
||||
</div>
|
||||
<div class="divsearchfield">
|
||||
<input class="button buttongen" value="<?php echo $langs->trans('Rechercher') ?>" type="submit">
|
||||
@ -999,7 +1011,7 @@ if ($mode == 'marketplace') {
|
||||
<div id="listing-content">
|
||||
<table summary="list_of_modules" id="list_of_modules" class="productlist centpercent">
|
||||
<tbody id="listOfModules">
|
||||
<?php echo $dolistore->get_products($categorie); ?>
|
||||
<?php echo $dolistore->get_products(!empty($categorie) ? $categorie: ''); ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@ -1014,6 +1026,8 @@ if ($mode == 'marketplace') {
|
||||
if ($mode == 'deploy') {
|
||||
print dol_get_fiche_head($head, $mode, '', -1);
|
||||
|
||||
print $deschelp;
|
||||
|
||||
$dolibarrdataroot = preg_replace('/([\\/]+)$/i', '', DOL_DATA_ROOT);
|
||||
$allowonlineinstall = true;
|
||||
$allowfromweb = 1;
|
||||
@ -1080,28 +1094,36 @@ if ($mode == 'deploy') {
|
||||
$max = $conf->global->MAIN_UPLOAD_DOC; // In Kb
|
||||
$maxphp = @ini_get('upload_max_filesize'); // In unknown
|
||||
if (preg_match('/k$/i', $maxphp)) {
|
||||
$maxphp = preg_replace('/k$/i', '', $maxphp);
|
||||
$maxphp = $maxphp * 1;
|
||||
}
|
||||
if (preg_match('/m$/i', $maxphp)) {
|
||||
$maxphp = preg_replace('/m$/i', '', $maxphp);
|
||||
$maxphp = $maxphp * 1024;
|
||||
}
|
||||
if (preg_match('/g$/i', $maxphp)) {
|
||||
$maxphp = preg_replace('/g$/i', '', $maxphp);
|
||||
$maxphp = $maxphp * 1024 * 1024;
|
||||
}
|
||||
if (preg_match('/t$/i', $maxphp)) {
|
||||
$maxphp = preg_replace('/t$/i', '', $maxphp);
|
||||
$maxphp = $maxphp * 1024 * 1024 * 1024;
|
||||
}
|
||||
$maxphp2 = @ini_get('post_max_size'); // In unknown
|
||||
if (preg_match('/k$/i', $maxphp2)) {
|
||||
$maxphp2 = preg_replace('/k$/i', '', $maxphp2);
|
||||
$maxphp2 = $maxphp2 * 1;
|
||||
}
|
||||
if (preg_match('/m$/i', $maxphp2)) {
|
||||
$maxphp2 = preg_replace('/m$/i', '', $maxphp2);
|
||||
$maxphp2 = $maxphp2 * 1024;
|
||||
}
|
||||
if (preg_match('/g$/i', $maxphp2)) {
|
||||
$maxphp2 = preg_replace('/g$/i', '', $maxphp2);
|
||||
$maxphp2 = $maxphp2 * 1024 * 1024;
|
||||
}
|
||||
if (preg_match('/t$/i', $maxphp2)) {
|
||||
$maxphp2 = preg_replace('/t$/i', '', $maxphp2);
|
||||
$maxphp2 = $maxphp2 * 1024 * 1024 * 1024;
|
||||
}
|
||||
// Now $max and $maxphp and $maxphp2 are in Kb
|
||||
@ -1176,6 +1198,10 @@ if ($mode == 'deploy') {
|
||||
if ($mode == 'develop') {
|
||||
print dol_get_fiche_head($head, $mode, '', -1);
|
||||
|
||||
print $deschelp;
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Marketplace
|
||||
print "<table summary=\"list_of_modules\" class=\"noborder\" width=\"100%\">\n";
|
||||
print "<tr class=\"liste_titre\">\n";
|
||||
|
||||
@ -53,7 +53,7 @@ if ($action == 'updateMask')
|
||||
|
||||
if ($maskconstmrp) $res = dolibarr_set_const($db, $maskconstmrp, $maskmrp, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -142,7 +142,7 @@ elseif ($action == 'setdoc')
|
||||
$draft = GETPOST("MRP_MO_DRAFT_WATERMARK");
|
||||
$res = dolibarr_set_const($db, "MRP_MO_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -156,7 +156,7 @@ elseif ($action == 'setdoc')
|
||||
|
||||
$res = dolibarr_set_const($db, "MRP_MO_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
|
||||
@ -57,6 +57,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
|
||||
|
||||
if ($action != 'updateedit' && !$error)
|
||||
{
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
@ -95,37 +96,37 @@ if (empty($action) || $action == 'edit' || $action == 'updateedit')
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("Monday"), $langs->trans("OpeningHoursFormatDesc"));
|
||||
print '</td><td>';
|
||||
print '<input name="monday" id="monday" class="minwidth100" value="'.($conf->global->MAIN_INFO_OPENINGHOURS_MONDAY ? $conf->global->MAIN_INFO_OPENINGHOURS_MONDAY : GETPOST("monday", 'alpha')).'"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'></td></tr>'."\n";
|
||||
print '<input name="monday" id="monday" class="minwidth100" value="'.(!empty($conf->global->MAIN_INFO_OPENINGHOURS_MONDAY) ? $conf->global->MAIN_INFO_OPENINGHOURS_MONDAY : GETPOST("monday", 'alpha')).'"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'></td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("Tuesday"), $langs->trans("OpeningHoursFormatDesc"));
|
||||
print '</td><td>';
|
||||
print '<input name="tuesday" id="tuesday" class="minwidth100" value="'.($conf->global->MAIN_INFO_OPENINGHOURS_TUESDAY ? $conf->global->MAIN_INFO_OPENINGHOURS_TUESDAY : GETPOST("tuesday", 'alpha')).'"></td></tr>'."\n";
|
||||
print '<input name="tuesday" id="tuesday" class="minwidth100" value="'.(!empty($conf->global->MAIN_INFO_OPENINGHOURS_TUESDAY) ? $conf->global->MAIN_INFO_OPENINGHOURS_TUESDAY : GETPOST("tuesday", 'alpha')).'"></td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("Wednesday"), $langs->trans("OpeningHoursFormatDesc"));
|
||||
print '</td><td>';
|
||||
print '<input name="wednesday" id="wednesday" class="minwidth100" value="'.($conf->global->MAIN_INFO_OPENINGHOURS_WEDNESDAY ? $conf->global->MAIN_INFO_OPENINGHOURS_WEDNESDAY : GETPOST("wednesday", 'alpha')).'"></td></tr>'."\n";
|
||||
print '<input name="wednesday" id="wednesday" class="minwidth100" value="'.(!empty($conf->global->MAIN_INFO_OPENINGHOURS_WEDNESDAY) ? $conf->global->MAIN_INFO_OPENINGHOURS_WEDNESDAY : GETPOST("wednesday", 'alpha')).'"></td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("Thursday"), $langs->trans("OpeningHoursFormatDesc"));
|
||||
print '</td><td>';
|
||||
print '<input name="thursday" id="thursday" class="minwidth100" value="'.($conf->global->MAIN_INFO_OPENINGHOURS_THURSDAY ? $conf->global->MAIN_INFO_OPENINGHOURS_THURSDAY : GETPOST("thursday", 'alpha')).'"></td></tr>'."\n";
|
||||
print '<input name="thursday" id="thursday" class="minwidth100" value="'.(!empty($conf->global->MAIN_INFO_OPENINGHOURS_THURSDAY) ? $conf->global->MAIN_INFO_OPENINGHOURS_THURSDAY : GETPOST("thursday", 'alpha')).'"></td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("Friday"), $langs->trans("OpeningHoursFormatDesc"));
|
||||
print '</td><td>';
|
||||
print '<input name="friday" id="friday" class="minwidth100" value="'.($conf->global->MAIN_INFO_OPENINGHOURS_FRIDAY ? $conf->global->MAIN_INFO_OPENINGHOURS_FRIDAY : GETPOST("friday", 'alpha')).'"></td></tr>'."\n";
|
||||
print '<input name="friday" id="friday" class="minwidth100" value="'.(!empty($conf->global->MAIN_INFO_OPENINGHOURS_FRIDAY) ? $conf->global->MAIN_INFO_OPENINGHOURS_FRIDAY : GETPOST("friday", 'alpha')).'"></td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("Saturday"), $langs->trans("OpeningHoursFormatDesc"));
|
||||
print '</td><td>';
|
||||
print '<input name="saturday" id="saturday" class="minwidth100" value="'.($conf->global->MAIN_INFO_OPENINGHOURS_SATURDAY ? $conf->global->MAIN_INFO_OPENINGHOURS_SATURDAY : GETPOST("saturday", 'alpha')).'"></td></tr>'."\n";
|
||||
print '<input name="saturday" id="saturday" class="minwidth100" value="'.(!empty($conf->global->MAIN_INFO_OPENINGHOURS_SATURDAY) ? $conf->global->MAIN_INFO_OPENINGHOURS_SATURDAY : GETPOST("saturday", 'alpha')).'"></td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("Sunday"), $langs->trans("OpeningHoursFormatDesc"));
|
||||
print '</td><td>';
|
||||
print '<input name="sunday" id="sunday" class="minwidth100" value="'.($conf->global->MAIN_INFO_OPENINGHOURS_SUNDAY ? $conf->global->MAIN_INFO_OPENINGHOURS_SUNDAY : GETPOST("sunday", 'alpha')).'"></td></tr>'."\n";
|
||||
print '<input name="sunday" id="sunday" class="minwidth100" value="'.(!empty($conf->global->MAIN_INFO_OPENINGHOURS_SUNDAY) ? $conf->global->MAIN_INFO_OPENINGHOURS_SUNDAY : GETPOST("sunday", 'alpha')).'"></td></tr>'."\n";
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ if ($action == 'updateMask')
|
||||
$maskpayment = GETPOST('maskpayment', 'alpha');
|
||||
if ($maskconstpayment) $res = dolibarr_set_const($db, $maskconstpayment, $maskpayment, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -70,10 +70,10 @@ if ($action == 'setparams')
|
||||
{
|
||||
$freetext = GETPOST('FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS', 'restricthtml'); // No alpha here, we want exact string
|
||||
$res = dolibarr_set_const($db, "FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS", $freetext, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
$res = dolibarr_set_const($db, "PAYMENTS_REPORT_GROUP_BY_MOD", GETPOST('PAYMENTS_REPORT_GROUP_BY_MOD', 'int'), 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if ($error)
|
||||
{
|
||||
@ -157,9 +157,7 @@ foreach ($dirmodels as $reldir)
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
||||
|
||||
if ($module->isEnabled())
|
||||
{
|
||||
$var = !$var;
|
||||
if ($module->isEnabled()) {
|
||||
print '<tr class="oddeven"><td width="100">';
|
||||
echo preg_replace('/\-.*$/', '', preg_replace('/mod_payment_/', '', preg_replace('/\.php$/', '', $file)));
|
||||
print "</td><td>\n";
|
||||
|
||||
@ -50,10 +50,9 @@ if ($action == "set")
|
||||
|
||||
$id = GETPOST('PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT', 'int');
|
||||
$account = new Account($db);
|
||||
if ($account->fetch($id) > 0)
|
||||
{
|
||||
if ($account->fetch($id) > 0) {
|
||||
$res = dolibarr_set_const($db, "PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT", $id, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
/*
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_CODE_BANQUE", $account->code_banque,'chaine',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
@ -70,32 +69,35 @@ if ($action == "set")
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_RAISON_SOCIALE", $account->proprio,'chaine',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
*/
|
||||
} else $error++;
|
||||
} else {
|
||||
$error++;
|
||||
}
|
||||
/* Moved to account
|
||||
$res = dolibarr_set_const($db, "PAYMENTBYBANKTRANSFER_ICS", GETPOST("PAYMENTBYBANKTRANSFER_ICS"), 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
*/
|
||||
|
||||
if (GETPOST("PAYMENTBYBANKTRANSFER_USER") > 0)
|
||||
{
|
||||
$res = dolibarr_set_const($db, "PAYMENTBYBANKTRANSFER_USER", GETPOST("PAYMENTBYBANKTRANSFER_USER"), 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
}
|
||||
/*
|
||||
if (GETPOST("PAYMENTBYBANKTRANSFER_END_TO_END") || GETPOST("PAYMENTBYBANKTRANSFER_END_TO_END") == "")
|
||||
{
|
||||
$res = dolibarr_set_const($db, "PAYMENTBYBANKTRANSFER_END_TO_END", GETPOST("PAYMENTBYBANKTRANSFER_END_TO_END"), 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
}
|
||||
if (GETPOST("PAYMENTBYBANKTRANSFER_USTRD") || GETPOST("PAYMENTBYBANKTRANSFER_USTRD") == "")
|
||||
{
|
||||
$res = dolibarr_set_const($db, "PAYMENTBYBANKTRANSFER_USTRD", GETPOST("PAYMENTBYBANKTRANSFER_USTRD"), 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
}
|
||||
*/
|
||||
if (GETPOST("PAYMENTBYBANKTRANSFER_ADDDAYS") || GETPOST("PAYMENTBYBANKTRANSFER_ADDDAYS") == "")
|
||||
{
|
||||
$res = dolibarr_set_const($db, "PAYMENTBYBANKTRANSFER_ADDDAYS", GETPOST("PAYMENTBYBANKTRANSFER_ADDDAYS"), 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
} elseif (!$error)
|
||||
{
|
||||
$db->commit();
|
||||
@ -279,9 +281,7 @@ foreach ($dirmodels as $reldir)
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
|
||||
|
||||
if ($modulequalified)
|
||||
{
|
||||
$var = !$var;
|
||||
if ($modulequalified) {
|
||||
print '<tr class="oddeven"><td width="100">';
|
||||
print (empty($module->name)?$name:$module->name);
|
||||
print "</td><td>\n";
|
||||
|
||||
@ -161,7 +161,7 @@ print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
$selected = $conf->global->MAIN_PDF_FORMAT;
|
||||
$selected = (isset($conf->global->MAIN_PDF_FORMAT) ? $conf->global->MAIN_PDF_FORMAT : '');
|
||||
if (empty($selected)) $selected = dol_getDefaultFormat();
|
||||
|
||||
// Show pdf format
|
||||
@ -320,13 +320,13 @@ print '</td></tr>';
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("ShowDetailsInPDFPageFoot").'</td><td>';
|
||||
print $form->selectarray('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', $arraydetailsforpdffoot, $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS);
|
||||
print $form->selectarray('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', $arraydetailsforpdffoot, (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS : 0));
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("PDF_USE_ALSO_LANGUAGE_CODE").'</td><td>';
|
||||
//if (! empty($conf->global->MAIN_MULTILANGS))
|
||||
//{
|
||||
print $formadmin->select_language(GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE') ? GETPOST('PDF_USE_ALSO_LANGUAGE_CODE') : $conf->global->PDF_USE_ALSO_LANGUAGE_CODE, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, null, 1);
|
||||
print $formadmin->select_language(GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE') ? GETPOST('PDF_USE_ALSO_LANGUAGE_CODE') : (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) ? $conf->global->PDF_USE_ALSO_LANGUAGE_CODE : 0), 'PDF_USE_ALSO_LANGUAGE_CODE', 0, null, 1);
|
||||
//} else {
|
||||
// print '<span class="opacitymedium">'.$langs->trans("MultiLangNotEnabled").'</span>';
|
||||
//}
|
||||
|
||||
@ -166,7 +166,7 @@ if ($result)
|
||||
if (is_object($modules[$obj->module]) && ($modules[$obj->module]->module_position > 0))
|
||||
{
|
||||
// TODO Define familyposition
|
||||
$family = $modules[$obj->module]->family_position;
|
||||
$family = (!empty($modules[$obj->module]->family_position) ? $modules[$obj->module]->family_position : '');
|
||||
$familyposition = 0;
|
||||
$sqlupdate = 'UPDATE '.MAIN_DB_PREFIX."rights_def SET module_position = ".$modules[$obj->module]->module_position.",";
|
||||
$sqlupdate .= " family_position = ".$familyposition;
|
||||
@ -214,7 +214,7 @@ if ($result)
|
||||
print '</tr>'."\n";
|
||||
}
|
||||
|
||||
$perm_libelle = ($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $obj->label));
|
||||
$perm_libelle = (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $obj->label));
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ if ($action == "set")
|
||||
if ($account->fetch($id) > 0)
|
||||
{
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_ID_BANKACCOUNT", $id, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
/*
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_CODE_BANQUE", $account->code_banque,'chaine',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
@ -75,21 +75,20 @@ if ($action == "set")
|
||||
} else $error++;
|
||||
|
||||
/* Moved to account
|
||||
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_ICS", GETPOST("PRELEVEMENT_ICS"), 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
*/
|
||||
if (GETPOST("PRELEVEMENT_USER") > 0) {
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"), 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
}
|
||||
if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END") == "") {
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"), 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
}
|
||||
if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD") == "") {
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_USTRD", GETPOST("PRELEVEMENT_USTRD"), 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
}
|
||||
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity);
|
||||
@ -288,9 +287,7 @@ foreach ($dirmodels as $reldir)
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
|
||||
|
||||
if ($modulequalified)
|
||||
{
|
||||
$var = !$var;
|
||||
if ($modulequalified) {
|
||||
print '<tr class="oddeven"><td width="100">';
|
||||
print (empty($module->name)?$name:$module->name);
|
||||
print "</td><td>\n";
|
||||
|
||||
@ -57,7 +57,7 @@ if ($action == 'updateMask') {
|
||||
$maskpropal = GETPOST('maskpropal', 'alpha');
|
||||
if ($maskconstpropal) $res = dolibarr_set_const($db, $maskconstpropal, $maskpropal, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -109,7 +109,7 @@ if ($action == 'updateMask') {
|
||||
$res = dolibarr_set_const($db, "FACTURE_RIB_NUMBER", $rib, 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "FACTURE_CHQ_NUMBER", $chq, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -121,7 +121,7 @@ if ($action == 'updateMask') {
|
||||
$draft = GETPOST('PROPALE_DRAFT_WATERMARK', 'alpha');
|
||||
|
||||
$res = dolibarr_set_const($db, "PROPALE_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -134,7 +134,7 @@ if ($action == 'updateMask') {
|
||||
|
||||
$res = dolibarr_set_const($db, "PROPOSAL_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -145,7 +145,7 @@ if ($action == 'updateMask') {
|
||||
} elseif ($action == 'setdefaultduration') {
|
||||
$res = dolibarr_set_const($db, "PROPALE_VALIDITY_DURATION", $value, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -156,7 +156,7 @@ if ($action == 'updateMask') {
|
||||
} elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') {
|
||||
$res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL", $value, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
@ -383,9 +383,7 @@ foreach ($dirmodels as $reldir)
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0;
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0;
|
||||
|
||||
if ($modulequalified)
|
||||
{
|
||||
$var = !$var;
|
||||
if ($modulequalified) {
|
||||
print '<tr class="oddeven"><td width="100">';
|
||||
print (empty($module->name) ? $name : $module->name);
|
||||
print "</td><td>\n";
|
||||
@ -654,7 +652,7 @@ if ($conf->banque->enabled)
|
||||
{
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").'</td><td> </td><td class="right">';
|
||||
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").'</td><td> </td><td class="right">';
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL');
|
||||
|
||||
@ -155,7 +155,7 @@ print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MAIN_PROXY_USE").'</td><td class="right">';
|
||||
print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
print $form->selectyesno('MAIN_PROXY_USE', $conf->global->MAIN_PROXY_USE, 1);
|
||||
print $form->selectyesno('MAIN_PROXY_USE', (!empty($conf->global->MAIN_PROXY_USE) ? $conf->global->MAIN_PROXY_USE : 0), 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -164,7 +164,7 @@ print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MAIN_PROXY_HOST").'</td><td class="right">';
|
||||
print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
print '<input class="flat" name="MAIN_PROXY_HOST" type="text" size="16" value="'.$conf->global->MAIN_PROXY_HOST.'">';
|
||||
print '<input class="flat" name="MAIN_PROXY_HOST" type="text" size="16" value="'.(!empty($conf->global->MAIN_PROXY_HOST) ? $conf->global->MAIN_PROXY_HOST : '').'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -173,7 +173,7 @@ print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MAIN_PROXY_PORT").'</td><td class="right">';
|
||||
print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
print '<input class="flat" name="MAIN_PROXY_PORT" type="text" size="4" value="'.$conf->global->MAIN_PROXY_PORT.'">';
|
||||
print '<input class="flat" name="MAIN_PROXY_PORT" type="text" size="4" value="'.(!empty($conf->global->MAIN_PROXY_PORT) ? $conf->global->MAIN_PROXY_PORT : '').'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -182,7 +182,7 @@ print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MAIN_PROXY_USER").'</td><td class="right">';
|
||||
print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
print '<input class="flat" name="MAIN_PROXY_USER" type="text" size="16" value="'.$conf->global->MAIN_PROXY_USER.'">';
|
||||
print '<input class="flat" name="MAIN_PROXY_USER" type="text" size="16" value="'.(!empty($conf->global->MAIN_PROXY_USER) ? $conf->global->MAIN_PROXY_USER : '').'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -191,7 +191,7 @@ print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MAIN_PROXY_PASS").'</td><td class="right">';
|
||||
print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
print '<input class="flat" name="MAIN_PROXY_PASS" type="text" size="16" value="'.$conf->global->MAIN_PROXY_PASS.'">';
|
||||
print '<input class="flat" name="MAIN_PROXY_PASS" type="text" size="16" value="'.(!empty($conf->global->MAIN_PROXY_PASS) ? $conf->global->MAIN_PROXY_PASS : '').'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@ -443,7 +443,6 @@ if ($mode == 'template' && $user->admin) {
|
||||
print '<td><input size="50" type="text" name="templatename" value="'.$printer->listprinterstemplates[$line]['name'].'"></td>';
|
||||
print '<td>';
|
||||
print '<textarea name="template" wrap="soft" cols="120" rows="12">';
|
||||
print GETPOSTISSET('template') ? GETPOST('template', 'alpha') : $printer->listprinterstemplates[$line]['template'];
|
||||
print '</textarea>';
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
|
||||
@ -241,8 +241,8 @@ print '</tr>';
|
||||
foreach ($arrayhandler as $key => $module)
|
||||
{
|
||||
// Show modules according to features level
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
||||
if (!empty($module->version) && $module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
||||
if (!empty($module->version) && $module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
||||
|
||||
if ($module->isEnabled())
|
||||
{
|
||||
|
||||
@ -116,7 +116,7 @@ print '</tr>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td colspan="2">'.$langs->trans("MaxSizeForUploadedFiles").'.';
|
||||
$max = @ini_get('upload_max_filesize');
|
||||
if ($max) print ' '.$langs->trans("MustBeLowerThanPHPLimit", $max * 1024, $langs->trans("Kb")).'.';
|
||||
if (isset($max)) print ' '.$langs->trans("MustBeLowerThanPHPLimit", ((int) $max) * 1024, $langs->trans("Kb")).'.';
|
||||
else print ' '.$langs->trans("NoMaxSizeByPHPLimit").'.';
|
||||
print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
|
||||
@ -67,7 +67,7 @@ if ($action == 'update' || $action == 'add')
|
||||
|
||||
$res = dolibarr_set_const($db, $constname, $constvalue, $type[$consttype], 0, $constnote, $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
|
||||
@ -96,7 +96,7 @@ if ($action == 'warehouse')
|
||||
if ($value == -1 || empty($value) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) {
|
||||
$res = dolibarr_del_const($db, "MAIN_DEFAULT_WAREHOUSE", $conf->entity);
|
||||
}
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
}
|
||||
|
||||
if ($action == 'specimen')
|
||||
@ -707,7 +707,15 @@ if (!empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) {
|
||||
print "</td>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("WarehouseAskWarehouseDuringPropal").'</td>';
|
||||
print '<td class="right">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL);
|
||||
}
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("WarehouseAskWarehouseDuringOrder").'</td>';
|
||||
print '<td class="right">';
|
||||
|
||||
@ -65,7 +65,7 @@ if ($action == 'updateMask')
|
||||
if ($maskconstinvoice) $res = dolibarr_set_const($db, $maskconstinvoice, $maskinvoice, 'chaine', 0, '', $conf->entity);
|
||||
if ($maskconstcredit) $res = dolibarr_set_const($db, $maskconstcredit, $maskcredit, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -170,7 +170,7 @@ if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT')
|
||||
|
||||
$res = dolibarr_set_const($db, "SUPPLIER_INVOICE_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
|
||||
@ -63,7 +63,7 @@ if ($action == 'updateMask')
|
||||
|
||||
if ($maskconstorder) $res = dolibarr_set_const($db, $maskconstorder, $maskvalue, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -194,7 +194,7 @@ elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER')
|
||||
{
|
||||
$res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER", $value, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -485,7 +485,7 @@ if ($conf->banque->enabled)
|
||||
{
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").'</td><td> </td><td align="center">';
|
||||
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").'</td><td> </td><td align="center">';
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER');
|
||||
|
||||
@ -52,7 +52,7 @@ if ($action == 'updateMask')
|
||||
$masksupplierpayment = GETPOST('masksupplierpayment', 'alpha');
|
||||
if ($maskconstsupplierpayment) $res = dolibarr_set_const($db, $maskconstsupplierpayment, $masksupplierpayment, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -136,7 +136,7 @@ elseif ($action == 'setdoc')
|
||||
} elseif ($action == 'setparams')
|
||||
{
|
||||
$res = dolibarr_set_const($db, "PAYMENTS_FOURN_REPORT_GROUP_BY_MOD", GETPOST('PAYMENTS_FOURN_REPORT_GROUP_BY_MOD', 'int'), 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if ($error)
|
||||
{
|
||||
|
||||
@ -55,7 +55,7 @@ if ($action == 'updateMask')
|
||||
$masksupplier_proposal = GETPOST('masksupplier_proposal', 'alpha');
|
||||
if ($maskconstsupplier_proposal) $res = dolibarr_set_const($db, $maskconstsupplier_proposal, $masksupplier_proposal, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -111,7 +111,7 @@ if ($action == 'set_SUPPLIER_PROPOSAL_DRAFT_WATERMARK')
|
||||
$draft = GETPOST('SUPPLIER_PROPOSAL_DRAFT_WATERMARK', 'alpha');
|
||||
|
||||
$res = dolibarr_set_const($db, "SUPPLIER_PROPOSAL_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -127,7 +127,7 @@ if ($action == 'set_SUPPLIER_PROPOSAL_FREE_TEXT')
|
||||
|
||||
$res = dolibarr_set_const($db, "SUPPLIER_PROPOSAL_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -141,7 +141,7 @@ if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL')
|
||||
{
|
||||
$res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL", $value, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -511,7 +511,7 @@ print '</form>';
|
||||
if ($conf->banque->enabled)
|
||||
{
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").'</td><td> </td><td class="right">';
|
||||
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").'</td><td> </td><td class="right">';
|
||||
if (!empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL');
|
||||
|
||||
@ -138,7 +138,7 @@ if ($action == 'setlevel')
|
||||
$res = dolibarr_set_const($db, "SYSLOG_LEVEL", $level, 'chaine', 0, '', 0);
|
||||
dol_syslog("admin/syslog: level ".$level);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -146,7 +146,7 @@ if ($action == 'setlevel')
|
||||
$res = dolibarr_set_const($db, "SYSLOG_FILE_SAVES", $file_saves, 'chaine', 0, '', 0);
|
||||
dol_syslog("admin/syslog: file saves ".$file_saves);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
if (!($res > 0)) $error++;
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
|
||||
@ -73,7 +73,7 @@ print load_fiche_titre($title, '', 'title_setup');
|
||||
// Version
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
||||
print '<tr class="liste_titre"><td class="titlefieldcreate">'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CurrentVersion").' ('.$langs->trans("Programs").')</td><td>'.DOL_VERSION;
|
||||
// If current version differs from last upgrade
|
||||
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE))
|
||||
@ -139,7 +139,7 @@ print '<br>';
|
||||
// Session
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Session").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
|
||||
print '<tr class="liste_titre"><td class="titlefieldcreate">'.$langs->trans("Session").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("SessionSavePath").'</td><td colspan="2">'.session_save_path().'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("SessionName").'</td><td colspan="2">'.session_name().'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("SessionId").'</td><td colspan="2">'.session_id().'</td></tr>'."\n";
|
||||
@ -180,7 +180,7 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="titlefield">'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").'</td>';
|
||||
print '<td class="titlefieldcreate">'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").'</td>';
|
||||
print '<td>'.$langs->trans("NbOfEntries").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Address").'</td>';
|
||||
print '</tr>'."\n";
|
||||
@ -202,7 +202,7 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S
|
||||
// Localisation
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("LocalisationDolibarrParameters").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
||||
print '<tr class="liste_titre"><td class="titlefieldcreate">'.$langs->trans("LocalisationDolibarrParameters").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LanguageBrowserParameter", "HTTP_ACCEPT_LANGUAGE").'</td><td>'.$_SERVER["HTTP_ACCEPT_LANGUAGE"].'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CurrentUserLanguage").'</td><td>'.$langs->getDefaultLang().'</td></tr>'."\n";
|
||||
// Thousands
|
||||
@ -222,7 +222,22 @@ if (($thousand != ',' && $thousand != '.') || ($thousand != ' '))
|
||||
print "</tr>\n";
|
||||
}
|
||||
print '<tr class="oddeven"><td> => price(1234.56)</td><td>'.price(1234.56).'</td></tr>'."\n";
|
||||
// Timezone
|
||||
|
||||
// Timezones
|
||||
|
||||
// Database timezone
|
||||
if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli')
|
||||
{
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MySQLTimeZone").' (database)</td><td>'; // Timezone server base
|
||||
$sql = "SHOW VARIABLES where variable_name = 'system_time_zone'";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
print $form->textwithtooltip($obj->Value, $langs->trans('TZHasNoEffect'), 2, 1, img_info(''));
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
$txt = $langs->trans("OSTZ").' (variable system TZ): '.(!empty($_ENV["TZ"]) ? $_ENV["TZ"] : $langs->trans("NotDefined")).'<br>'."\n";
|
||||
$txt .= $langs->trans("PHPTZ").' (date_default_timezone_get() / php.ini date.timezone): '.(getServerTimeZoneString()." / ".(ini_get("date.timezone") ? ini_get("date.timezone") : $langs->trans("NotDefined")))."<br>\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
|
||||
$txt .= $langs->trans("Dolibarr constant MAIN_SERVER_TZ").': '.(empty($conf->global->MAIN_SERVER_TZ) ? $langs->trans("NotDefined") : $conf->global->MAIN_SERVER_TZ);
|
||||
@ -238,23 +253,10 @@ $val .= ' '.getServerTimeZoneString();
|
||||
$val .= ' '.$langs->trans("DaylingSavingTime").': '.($daylight === 'unknown' ? 'unknown' : ($a == $c ?yn($daylight) : yn(0).($daylight ? ' ('.$langs->trans('YesInSummer').')' : '')));
|
||||
print $form->textwithtooltip($val, $txt, 2, 1, img_info(''));
|
||||
print '</td></tr>'."\n"; // value defined in http://fr3.php.net/manual/en/timezones.europe.php
|
||||
print '<tr class="oddeven"><td> => '.$langs->trans("CurrentHour").'</td><td>'.dol_print_date(dol_now(), 'dayhour', 'tzserver').'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td> => '.$langs->trans("CurrentHour").'</td><td>'.dol_print_date(dol_now('gmt'), 'dayhour', 'tzserver').'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td> => dol_print_date(0,"dayhourtext")</td><td>'.dol_print_date(0, "dayhourtext").'</td>';
|
||||
print '<tr class="oddeven"><td> => dol_get_first_day(1970,1,false)</td><td>'.dol_get_first_day(1970, 1, false).' (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970, 1, false), 'dayhour').')</td>';
|
||||
print '<tr class="oddeven"><td> => dol_get_first_day(1970,1,true)</td><td>'.dol_get_first_day(1970, 1, true).' (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970, 1, true), 'dayhour').')</td>';
|
||||
// Database timezone
|
||||
if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli')
|
||||
{
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MySQLTimeZone").' (database)</td><td>'; // Timezone server base
|
||||
$sql = "SHOW VARIABLES where variable_name = 'system_time_zone'";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
print $form->textwithtooltip($obj->Value, $langs->trans('TZHasNoEffect'), 2, 1, img_info(''));
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
// Client
|
||||
$tz = (int) $_SESSION['dol_tz'] + (int) $_SESSION['dol_dst'];
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("ClientTZ").'</td><td>'.($tz ? ($tz >= 0 ? '+' : '').$tz : '').' ('.($tz >= 0 ? '+' : '').($tz * 60 * 60).')';
|
||||
@ -265,7 +267,7 @@ else print yn(0);
|
||||
if (!empty($_SESSION['dol_dst_first'])) print ' ('.dol_print_date(dol_stringtotime($_SESSION['dol_dst_first']), 'dayhour', 'gmt').' - '.dol_print_date(dol_stringtotime($_SESSION['dol_dst_second']), 'dayhour', 'gmt').')';
|
||||
print '</td></tr>'."\n";
|
||||
print '</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td> => '.$langs->trans("ClientHour").'</td><td>'.dol_print_date(dol_now(), 'dayhour', 'tzuser').'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td> => '.$langs->trans("ClientHour").'</td><td>'.dol_print_date(dol_now('gmt'), 'dayhour', 'tzuser').'</td></tr>'."\n";
|
||||
|
||||
$filesystemencoding = ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("File encoding").' (php.ini unicode.filesystem_encoding)</td><td>'.$filesystemencoding.'</td></tr>'."\n";
|
||||
@ -340,7 +342,7 @@ $configfileparameters = array(
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="titlefield">'.$langs->trans("Parameters").' ';
|
||||
print '<td class="titlefieldcreate">'.$langs->trans("Parameters").' ';
|
||||
print $langs->trans("ConfigurationFile").' ('.$conffiletoshowshort.')';
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user