Merge branch 'developup' into develop

# Conflicts:
#	htdocs/compta/facture/fiche-rec.php
#	htdocs/install/mysql/migration/9.0.0-10.0.0.sql
This commit is contained in:
Ferran Marcet
2019-09-17 09:27:42 +02:00
4717 changed files with 137173 additions and 100504 deletions

View File

@@ -1,7 +1,8 @@
# EditorConfig is awesome: http://EditorConfig.org
# EditorConfig is awesome: https://editorconfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
@@ -11,9 +12,10 @@ insert_final_newline = true
# PHP PSR-2 Coding Standards
# http://www.php-fig.org/psr/psr-2/
[*.php]
indent_style = space
indent_style = tab
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
[*.js]
indent_style = tab
[*.css]

View File

@@ -113,13 +113,16 @@ Also, some code changes need a prior approbation:
* if you add a new table, you must first create a page on http://wiki.dolibarr.org/index.php/Category:Table_SQL (copy an existing page changing its name to see it into this index page). Than ask the project manager (@eldy) if the new data model you plan to add can be accepted as you suggest.
Once a PR has been submitted, you may need to wait for its integration. It is common that the project leader let the PR open for a long delay to allow
every developer discuss about the PR.
If your PR has errors reported by the Continuous Integration Platform, it means your PR is not valid and nothing will be done with it. It will be kept open to allow developers to fix this, or it may be closed several month later.
If the PR is valid, and is kept open for a long time, a tag will also be added on the PR to describe the status of your PR.
By putting your mouse on the tag, you will get a full explanation of the tag/status that explain why your PR has not been integrated yet.
Around 95% of submitted PR are reviewed and tagged. Even if this is one of the most important ratio in Open Source world, don't expect the core team
to reach the 100%. With the increasing popularity of Dolibarr, this ratio will probably decrease in future.
Once a PR has been submitted, you may need to wait for its integration. It is common that the project leader let the PR open for a long delay to allow every developer discuss about the PR.
If the label of PR start with "WIP" (Work In Progress), it will not be analyzed (until you change the label of PR).
If your PR has errors reported by the Continuous Integration Platform, it means your PR is not valid and nothing will be done with it. It will be kept open to allow developers to fix this, or it may be closed several month later. Don't expect anything on your PR if you have such errors, you MUST first fix the Continuous Integration error to have it taken into consideration.
If the PR is valid, and is kept open for a long time, a tag will also be added on the PR to describe the status of your PR and why the PR is kept open. By putting your mouse on the tag, you will get a full explanation of the tag/status that explain why your PR has not been integrated yet.
In most cases, it gives you information of things you have to do to have the PR taken into consideration (for example a change is requested, a conflict is expected to be solved, some questions were asked). If you have a yellow, red flag of purple flag, don't expect to have your PR validated. You must first provide the answer the flag ask you. The majority of PR are waiting an action of the developer/author.
Statistics on Dolibarr project shows that around 95% of submitted PR are reviewed and tagged. This is one of the most important ratio of answered PR in Open Source world. Don't expect the core team to reach the 100%. With the increasing popularity of Dolibarr, this ratio will probably decrease in future.
### Resources

5
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
# These are supported funding model platforms
open_collective: dolibarr
custom: https://wiki.dolibarr.org/index.php/Subscribe
# github: [eldy]

View File

@@ -1,8 +1,16 @@
---
name: Bug report
about: Create a report to help us fix something that is broken
title: ''
labels: Bug
assignees: ''
---
# Instructions
*This is a template to help you report good issues. You may use [Github Markdown](https://help.github.com/articles/getting-started-with-writing-and-formatting-on-github/) syntax to format your issue report.*
*Please:*
- *only keep the "Bug" or "Feature Request" section*
- *replace the bracket enclosed texts with meaningful informations*
- *replace the bracket enclosed texts with meaningful information*
- *remove any unused sub-section*
@@ -25,17 +33,3 @@
## [Attached files](https://help.github.com/articles/issue-attachments) (Screenshots, screencasts, dolibarr.log, debugging informations…)
[*Files*]
# Feature Request
[*Short description*]
## Use case
[*Verbose description*]
## Suggested implementation
[*Verbose description*]
## Suggested steps
[*List of tasks to achieve goal*]

View File

@@ -0,0 +1,27 @@
---
name: Feature request
about: Suggest a new idea for this project
title: ''
labels: Feature request
assignees: ''
---
# Instructions
*This is a template to help you report good issues. You may use [Github Markdown](https://help.github.com/articles/getting-started-with-writing-and-formatting-on-github/) syntax to format your issue report.*
*Please:*
- *replace the bracket enclosed texts with meaningful information*
- *remove any unused sub-section*
# Feature Request
[*Short description*]
## Use case
[*Verbose description*]
## Suggested implementation
[*Verbose description*]
## Suggested steps
[*List of tasks to achieve goal*]

View File

@@ -1,4 +1,13 @@
# .scrutinizer.yml
#build:
# - php-scrutinizer-run
build:
nodes:
analysis:
tests:
override:
- php-scrutinizer-run
imports:
- javascript
- php
@@ -29,6 +38,7 @@ tools:
- doc/*
- test/*
- htdocs/includes/*
- htdocs/core/class/lessc.class.php
paths:
- htdocs/
- scripts/

10
.stickler.yml Normal file
View File

@@ -0,0 +1,10 @@
---
linters:
phpcs:
standard: 'dev/setup/codesniffer/ruleset.xml'
extensions: 'php'
tab_width: 4
fixer: true
fixers:
enable: true

View File

@@ -18,9 +18,7 @@ addons:
apt:
sources:
# To use the last version of pgloader, we add repo of postgresql
- postgresql
- sourceline: 'deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main'
- key_url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc'
- pgdg-trusty
packages:
# We need a webserver to test the webservices
# Let's install Apache with.
@@ -112,32 +110,33 @@ install:
rm $TRAVIS_BUILD_DIR/composer.json
rm $TRAVIS_BUILD_DIR/composer.lock
composer self-update
# To have composer making parallel downloads
composer global require hirak/prestissimo
composer -n init
composer -n config vendor-dir htdocs/includes
echo
- |
echo "Installing Parallel Lint"
composer -n require jakub-onderka/php-parallel-lint ^0
composer -n require jakub-onderka/php-console-highlighter ^0
echo
- |
echo "Installing PHP Unit"
echo "Installing Composer dependencies (PHP Unit, Parallel Lint & PHP CodeSniffer"
if [ "$TRAVIS_PHP_VERSION" = '5.4' ] || [ "$TRAVIS_PHP_VERSION" = '5.5' ]; then
composer -n require phpunit/phpunit ^4
composer -n require phpunit/phpunit ^4 \
jakub-onderka/php-parallel-lint ^0 \
jakub-onderka/php-console-highlighter ^0 \
squizlabs/php_codesniffer ^3
fi
if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ]; then
composer -n require phpunit/phpunit ^5
if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] \
[ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ]; then
composer -n require phpunit/phpunit ^5 \
jakub-onderka/php-parallel-lint ^0 \
jakub-onderka/php-console-highlighter ^0 \
squizlabs/php_codesniffer ^3
fi
if [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
composer -n require phpunit/phpunit ^5
fi
echo
- |
echo "Installing PHP CodeSniffer"
composer -n require squizlabs/php_codesniffer ^3
if [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
composer -n require --ignore-platform-reqs phpunit/phpunit ^5 \
jakub-onderka/php-parallel-lint ^0 \
jakub-onderka/php-console-highlighter ^0 \
squizlabs/php_codesniffer ^3
fi
echo
- |
@@ -164,12 +163,6 @@ before_script:
echo
echo "Set timezone"
echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
if [ "$TRAVIS_PHP_VERSION" = '5.4' ]; then
# Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0, 7.1, 7.2 and nightly!
echo
echo "Enabling Memcached for PHP <= 5.4"
echo 'extension = memcached.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
fi
phpenv rehash
echo
@@ -252,8 +245,6 @@ before_script:
- echo "Setting up Apache + FPM"
- sudo apt-get update
- sudo apt-get install apache2 libapache2-mod-fastcgi
# enable php-fpm
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- |
@@ -294,17 +285,17 @@ script:
# Ensure we catch errors
set -e
#parallel-lint --exclude htdocs/includes --blame .
parallel-lint --exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian --exclude htdocs/includes/squizlabs/php_codesniffer/tests --exclude htdocs/includes/jakub-onderka/php-parallel-lint/tests --exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/phpunit/php-token-stream/tests --exclude htdocs/includes/composer/autoload_static.php --blame .
parallel-lint --exclude dev/namespacemig --exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian --exclude htdocs/includes/squizlabs/php_codesniffer/tests --exclude htdocs/includes/jakub-onderka/php-parallel-lint/tests --exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/phpunit/php-token-stream/tests --exclude htdocs/includes/composer/autoload_static.php --blame .
set +e
echo
- |
echo "Checking coding style"
echo "Checking coding style (excluding Pull Requests builds)"
# Ensure we catch errors
set -e
# Exclusions are defined in the ruleset.xml file
#phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 .
phpcs -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 .
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -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 .; fi
set +e
echo
@@ -350,6 +341,9 @@ script:
php upgrade.php 9.0.0 10.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade9001000.log
php upgrade2.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-2.log
php step5.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-3.log
php upgrade.php 10.0.0 11.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade9001000.log
php upgrade2.php 10.0.0 11.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-2.log
php step5.php 10.0.0 11.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-3.log
# Enable modules not enabled into original dump
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKETSUP,MAIN_MODULE_ACCOUNTING > $TRAVIS_BUILD_DIR/enablemodule.log
echo $?

View File

@@ -13,32 +13,31 @@ Component Version License GPL Compatible
-------------------------------------------------------------------------------------
PHP libraries:
AdoDb-Date 0.36 Modified BSD License Yes Date convertion (not into rpm package)
ChromePHP 4.1.0 Apache Software License 2.0 Yes Return server log to chrome browser console
CKEditor 4.11.4 LGPL-2.1+ Yes Editor WYSIWYG
PHPDebugBar 1.15.0 MIT License Yes Used only by the module "debugbar" for developers
CKEditor 4.12.1 LGPL-2.1+ Yes Editor WYSIWYG
EvalMath 1.0 BSD Yes Safe math expressions evaluation
Escpos-php ? MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers
GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package)
Mobiledetect 2.8.17 MIT License Yes Detect mobile devices browsers
Mobiledetect 2.8.83 MIT License Yes Detect mobile devices browsers
NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package)
PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency
odtPHP 1.0.1 GPL-2+ Yes Library to build/edit ODT files
ParseDown 1.6 MIT License Yes Markdown parser
PHPDebugBar 1.15.0 MIT License Yes Used only by the module "debugbar" for developers
PHPExcel 1.8.1 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
PHPSpreadSheet ? LGPL-2.1+ Yes Read/Write XLS files, read ODS files
php-iban 1.4.7 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP
PHPoAuthLib 0.8.2 MIT License Yes Library to provide oauth1 and oauth2 to different service
PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests
PSR/Logs 1.0 Library for logs (used by DebugBar)
PSR/simple-cache Library for cache (used by PHPSpreadSheet)
PSR/simple-cache ? Library for cache (used by PHPSpreadSheet)
Restler 3.0.0RC6 LGPL-3+ Yes Library to develop REST Web services (+ swagger-ui js lib into dir explorer)
Sabre 3.2.2 BSD Yes DAV support
Swift Mailer 5.4.2-DEV MIT license Yes Comprehensive mailing tools for PHP
Stripe 6.41 MIT licence Yes Library for Stripe module
TCPDF 6.2.25 LGPL-3+ Yes PDF generation
TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement
Swift Mailer 5.4.2-DEV MIT license Yes Comprehensive mailing tools for PHP
Stripe 4.7.0 MIT licence Yes Library for Stripe module
JS libraries:
jQuery 3.3.1 MIT License Yes JS library
jQuery 3.4.1 MIT License Yes JS library
jQuery UI 1.12.1 GPL and MIT License Yes JS library plugin UI
jQuery select2 4.0.5 GPL and Apache License Yes JS library plugin for sexier multiselect
jQuery blockUI 2.70.0 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups)

695
ChangeLog
View File

@@ -3,25 +3,504 @@ English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 11.0.0 compared to 10.0.0 *****
For Users:
For Developers:
WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* Properties ->libelle_incoterms were renamed into ->label_incoterms
* Removed the method liste_array() of project class. It was not used by core code.
* The function show_theme() hase been renamed into showSkins()
* Rename 'module_part' parameter into 'modulepart' into document APIs, for consistency.
* The deprecated method get_OutstandingBill has been removed. You can use getOutstandingBills() instead.
* The hook "moreFamily" must return payment into var "totalpayment" and no more "paiement" (english replace french).
* Removed deprecated method actioncomm->add(), use create() instead
* If you have developed your own emailing target selector and used parent::add_to_target(...), you must now use parent::addToTargets(...)
* Removed function dol_micro_time. Use native PHP microtime instead.
***** ChangeLog for 10.0.2 compared to 10.0.1 *****
FIX: #10460 compatibility with MariaDB 10.4
FIX: #11401 Adherent unknown language key
FIX: #11422 Can't edit his own events with standard rights
FIX: #11427 require product class (fixes POST /supplierinvoices REST API endpoint)
FIX: #11570
FIX: #11591 FIX: #11592
FIX: #11671 CVE-2019-15062
FIX: #11672
FIX: #11685
FIX: #11702
FIX: #11711
FIX: #11720
FIX: #11746 Unable to modify amount of insurance of a loan
FIX: #11752
FIX: #11789 FIX: #11790
FIX: #11804 list of tickets from a customer card display ALL tickets
FIX: #11834
FIX: Add char $ and ; in sanitizing of filenames.
FIX: Add comment before protected functions
FIX: Add log and type of content in dolWebsiteOutput and
FIX: Add repair.php option 'restore' to restore user picture after v10
FIX: amount opened on thirdparty card dont care of credit note not converted
FIX: Api of documents work with value 'thirdparty'
FIX: author in message / ticket API
FIX: avoid sql error if fk_project is empty during update
FIX: avoid Warning: A non-numeric value encountered
FIX: bad consistency in list of invoice for direct debit order.
FIX: Bad error management in zip compress and web site export
FIX: bad substitution for extrafields type checkbox
FIX: better help message with multicompany
FIX: calculation of $products_dispatched
FIX: Can't add a new chart of account
FIX: Can't delete a draft leave even if it should
FIX: Can't save setup of mailman module
FIX: column jabberid missing
FIX: Confirmation of deletion
FIX: Consistency in direct debit order lists.
FIX: Content send before header warning
FIX: credit note can be split
FIX: credit note used on list
FIX: Css was saved on wrong website.
FIX: delivery extrafields
FIX: Disabling a website does not put it offline
FIX: display only stripe sources for customer
FIX: display payment intent in stripe's charge list
FIX: document list for products in API
FIX: dol_thirdparty_id for stripe PI
FIX: Do not show tooltip if tooltip is empty
FIX: duplicate css tag, decrease padding-bottom for boxes in eldy theme
FIX: duration when creating service
FIX: EDB-ID:47370
FIX: Enable web site
FIX: error management when adding a property with type real
FIX: Fatal situation if payment removed on expense report. Action
FIX: filepath of generated documents doesn't handle products with special characters
FIX: for MAIN_MAXTABS_IN_CARD = $i card
FIX: gzip and bzip2 must use option -f
FIX: It was possible to create cashfence without entering data.
FIX: javascript error when using dol_use_jmobile=1
FIX: logout redirect to takepos.php
FIX: Look and feel v10
FIX: Make protected all pfd models functions
FIX: management of extrafields in modulebuilder
FIX: Missing div for buttons in tax, loan, various payment modules
FIX: missing include (dol_convert_file not found)
FIX: Missing some replacements in website module
FIX: missing test on permission on button to delete ledger record
FIX: Missing the filter fields in export of expense report and leaves
FIX: Missing ticket icon on md theme
FIX: Missing transaction
FIX: Mode smartphone was not triggered when there is too loo menu
FIX: Must escape shell
FIX: Must exclude logs and some dirs for compressed backup
FIX: name and position of hook FIX: #11710
FIX: Not showing MAIN_INVERT_SENDER_RECIPIENT when edit field
FIX: Nowrap missing on amount in boxes
FIX: Option to use ZipArchive instead of PclZip bugged with large files.
FIX: order or proposals billed if both workflow conf activated
FIX: permission check on API intervention
FIX: phpcs
FIX: placement function
FIX: qty in invoice list on product's stats
FIX: remove disabled product type from product list
FIX: Return code of pdf_einstein.modules.php and proformat
FIX: round for application fee in stripe
FIX: Sens of the balance (Debit - Credit in accountancy not contrary)
FIX: Several pb in export of documents
FIX: SQL syntax error and CSRF check on vat reports
FIX: takepos layout clear or focus search
FIX: too many record in sql request. Whena criteria is a filter, we must
FIX: Translation of month
FIX: USEDOLIBARREDITOR not always set
FIX: VAT number for Monaco (it uses FR)
FIX: vulenrability in uploading file found by 美创科技安全实验室
FIX: wrong display (and hidden input) for already dispatched quantity
FIX: wrong parameters (same error in branch 9, 10, develop)
FIX: Wrong variable. Must be PROJECT_HIDE_UNSELECTABLES
***** ChangeLog for 10.0.1 compared to 10.0.0 *****
FIX: #10930
FIX: #10984
FIX: reposition on "Build backup" button
FIX: #11400
FIX: #11412
FIX: #11460
FIX: #11463
FIX: #11466
FIX: #11492
FIX: #11498
FIX: #11505
FIX: #11506
FIX: #11507
FIX: #11509
FIX: #11537
FIX: #11543
FIX: #11553
FIX: #11576
FIX: #11584
FIX: #11590
FIX: accounting mode must be taken from global conf, because there's no way to choose a mode with interface
FIX: Add message from public interface
FIX: add missing hook calls
FIX: Add warning when setup is strange
FIX: ajax call for line positioning when CSRFCHECK_WITH_TOKEN is on
FIX: API return 404 sometimes even if API exists
FIX: Attachment was lost when we validate an expense report
FIX: avoid conflict with "$classname" in card.php
FIX: Bad sql request
FIX: better compatibility with multicompany transverse mode
FIX: Better PHP compatibility
FIX: Block to link with tickets
FIX: Can't submit a ticket from public interface
FIX: categories import: prevent mismatch between category type and object type
FIX: Closing ticket from public interface
FIX: Column 'paid' missing in expense report
FIX: compatibility mysql 8. rank is reserved
FIX: Computed field were not calculated into lists.
FIX: Content of email for subscription
FIX: correct error in files with multiple spaces
FIX: CVE-2019-11199
FIX: delete of links between objects
FIX: div not balanced
FIX: do not return formatted prices in json string
FIX: duplicate on the check (TODO field $onetrtd not used ?)
FIX: element name in update_price
FIX: empty product_use_units in product configuration
FIX: expedition card: infinite loop for printObjectLine hook if return > 0
FIX: extrafield loading bug due to assumption that an object is a third party while it may be a contact if MAIN_USE_COMPANY_NAME_OF_CONTACT is set.
FIX: Fatal error on dol_htmloutput_mesg with corrupted array
FIX: Fatal situation if payment removed on expense report. Action
FIX: FEC Format - Missing date_creation in general ledger when you add a new transaction
FIX: FEC Format - Save translation of the journal label in database & nowrap on amount
FIX: floating point precision errors in the triggers of the workflow module
FIX: for #11232
FIX: format of field with type timestamp
FIX: fournrprice log for insert
FIX: help text
FIX: import filter error
FIX: __INFOS__ tag not exists
FIX: issue #9300: install error with PostgreSQL when using custom table prefix
FIX: Language key
FIX: Limit of uploaded files (max_post_size was not used)
FIX: list of balance of leaves
FIX: minor spelling issues
FIX: missing "dropdown-icon" replacement
FIX: Missing field "Conciliated" into bank transaction export
FIX: missing filter by current contact
FIX: missing token
FIX: Missing where on entity
FIX: move sql request in INNER JOIN
FIX: name was able to be in field but went back to new line
FIX: Nowrap on amount
FIX: Online payment
FIX: on shipment delete confirm dialog, a new checkbox allows the user to choose if they want their stock re-incremented after the deletion.
FIX: option EXPORT_LABEL_FOR_SELECT to restore compatibility in export
FIX: Option THIRDPARTY_SUGGEST_ALSO_ADDRESS_CREATION
FIX: outdated phpdoc
FIX: Permission for BOM menu
FIX: permission to delete a draft purchase order
FIX: phpcs
FIX: Position was lost when we edit the line of template invoice
FIX: product_use_units was set to 0 each time a conf in block other was set
FIX: propal createFrom hook: undefined parameter attached
FIX: Responsive of public interface of ticket
FIX: search by phone pro
FIX: Setup of TakePos was not possible after a clean install
FIX: Show list of events on tickets
FIX: socpeople assigned list in action com list
FIX: SQL problem on donation & nowrap on amount
FIX: stock increase on shipment deletion if STOCK_CALCULATE_ON_SHIPMENT_NEW: is set
FIX: stripe webhook ID constant set
FIX: summary of time spent in preview tab of projects
FIX: the feature to bill time spent was not enabled.
FIX: The new feature to attach document on lines was not correclty
FIX: The proposed new supplier code does not work
FIX: this function can not be private
FIX: tk9877 - PDF rouget requires product.lib.php (otherwise measuring_units_string() is not defined)
FIX: Update the file index table when we validate/rename a ref.
FIX: use rounding to compare the amounts
FIX: We must save code instead of value in database for template invoice modelpdf
FIX: we need to be able to add freeline with qty between 0 & 1 in supplierorder line
FIX: We should remove property comments only for project and task api.
FIX: When saving an action it didn't save the label based on the type of event if the label is empty and the type is customized
FIX: when STOCK_CALCULATE_ON_SHIPMENT_NEW: is set, deleting a "closed" shipment now increases stock as expected
FIX: wrong path sociales/index.php doesnt exist anymore
***** ChangeLog for 10.0.1 compared to 10.0.0 *****
FIX: #10930
FIX: #10984
FIX: reposition on "Build backup" button
FIX: #11400
FIX: #11412
FIX: #11460
FIX: #11463
FIX: #11466
FIX: #11492
FIX: #11498
FIX: #11505
FIX: #11506
FIX: #11507
FIX: #11509
FIX: #11537
FIX: #11543
FIX: #11553
FIX: #11576
FIX: #11584
FIX: #11590
FIX: accounting mode must be taken from global conf, because there's no way to choose a mode with interface
FIX: Add message from public interface
FIX: add missing hook calls
FIX: Add warning when setup is strange
FIX: ajax call for line positioning when CSRFCHECK_WITH_TOKEN is on
FIX: API return 404 sometimes even if API exists
FIX: Attachment was lost when we validate an expense report
FIX: avoid conflict with "$classname" in card.php
FIX: Bad sql request
FIX: better compatibility with multicompany transverse mode
FIX: Better PHP compatibility
FIX: Block to link with tickets
FIX: Can't submit a ticket from public interface
FIX: categories import: prevent mismatch between category type and object type
FIX: Closing ticket from public interface
FIX: Column 'paid' missing in expense report
FIX: compatibility mysql 8. rank is reserved
FIX: Computed field were not calculated into lists.
FIX: Content of email for subscription
FIX: correct error in files with multiple spaces
FIX: CVE-2019-11199
FIX: delete of links between objects
FIX: div not balanced
FIX: do not return formatted prices in json string
FIX: duplicate on the check (TODO field $onetrtd not used ?)
FIX: element name in update_price
FIX: empty product_use_units in product configuration
FIX: expedition card: infinite loop for printObjectLine hook if return > 0
FIX: extrafield loading bug due to assumption that an object is a third party while it may be a contact if MAIN_USE_COMPANY_NAME_OF_CONTACT is set.
FIX: Fatal error on dol_htmloutput_mesg with corrupted array
FIX: Fatal situation if payment removed on expense report. Action
FIX: FEC Format - Missing date_creation in general ledger when you add a new transaction
FIX: FEC Format - Save translation of the journal label in database & nowrap on amount
FIX: floating point precision errors in the triggers of the workflow module
FIX: for #11232
FIX: format of field with type timestamp
FIX: fournrprice log for insert
FIX: help text
FIX: import filter error
FIX: __INFOS__ tag not exists
FIX: issue #9300: install error with PostgreSQL when using custom table prefix
FIX: Language key
FIX: Limit of uploaded files (max_post_size was not used)
FIX: list of balance of leaves
FIX: minor spelling issues
FIX: missing "dropdown-icon" replacement
FIX: Missing field "Conciliated" into bank transaction export
FIX: missing filter by current contact
FIX: missing token
FIX: Missing where on entity
FIX: move sql request in INNER JOIN
FIX: name was able to be in field but went back to new line
FIX: Nowrap on amount
FIX: Online payment
FIX: on shipment delete confirm dialog, a new checkbox allows the user to choose if they want their stock re-incremented after the deletion.
FIX: option EXPORT_LABEL_FOR_SELECT to restore compatibility in export
FIX: Option THIRDPARTY_SUGGEST_ALSO_ADDRESS_CREATION
FIX: outdated phpdoc
FIX: Permission for BOM menu
FIX: permission to delete a draft purchase order
FIX: phpcs
FIX: Position was lost when we edit the line of template invoice
FIX: product_use_units was set to 0 each time a conf in block other was set
FIX: propal createFrom hook: undefined parameter attached
FIX: Responsive of public interface of ticket
FIX: search by phone pro
FIX: Setup of TakePos was not possible after a clean install
FIX: Show list of events on tickets
FIX: socpeople assigned list in action com list
FIX: SQL problem on donation & nowrap on amount
FIX: stock increase on shipment deletion if STOCK_CALCULATE_ON_SHIPMENT_NEW: is set
FIX: stripe webhook ID constant set
FIX: summary of time spent in preview tab of projects
FIX: the feature to bill time spent was not enabled.
FIX: The new feature to attach document on lines was not correclty
FIX: The proposed new supplier code does not work
FIX: this function can not be private
FIX: tk9877 - PDF rouget requires product.lib.php (otherwise measuring_units_string() is not defined)
FIX: Update the file index table when we validate/rename a ref.
FIX: use rounding to compare the amounts
FIX: We must save code instead of value in database for template invoice modelpdf
FIX: we need to be able to add freeline with qty between 0 & 1 in supplierorder line
FIX: We should remove property comments only for project and task api.
FIX: When saving an action it didn't save the label based on the type of event if the label is empty and the type is customized
FIX: when STOCK_CALCULATE_ON_SHIPMENT_NEW: is set, deleting a "closed" shipment now increases stock as expected
FIX: wrong path sociales/index.php doesnt exist anymore
***** ChangeLog for 10.0.0 compared to 9.0.0 *****
For Users:
NEW: Module "Ticket" is available as a stable module.
NEW: module "Email Collector" is available as a stable module.
NEW: module "TakePOS" is available as a stable module.
NEW: Module "Email Collector" is available as a stable module.
NEW: Module "TakePOS" is available as a stable module.
NEW: Experimental module "Vendor receptions".
NEW: Experimental module "BOM".
FIX: Disallow line start date if after end date.
NEW: Accounting - Add default accounting account for member subcriptions.
NEW: Accounting - More comprehensive menu.
NEW: Agenda/event - add description column available in list (hidden by default).
NEW: Add accounting account for result.
NEW: Add accounting code for EEC sales and export sales on products.
NEW: Add a security permission to edit php dynamic content on the WebSite module.
NEW: Attached document on bank account are now visible in automatic ECM.
NEW: Add Autofill Remainder Amount picto on the Expense Report Payment Page.
NEW: Add contact status in category export
NEW: Add Default Warehouse to user record (if module stock is on)
NEW: Add employee/user to subledger account list
NEW: Add gender in member card
NEW: Add getFormatedCustomerRef and getFormatedSupplierRef methods
NEW: Add history to view and print previous sales on TakePos.
NEW: Add import of accounting account for intra/export selling on product card
NEW: Adding code to show update date of supplier price shown
NEW: Add line total on list of payments
NEW: Add LinkedIn field in social network module
NEW: Add more complete error messages in log on stripe payments
NEW: Add no_email field in contact list
NEW: Add notes are show in tooltips
NEW: Add option DONATION_USE_THIRDPARTIES in admin of membership module
NEW: Add option STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO
NEW: add page to setup opening hours of the company
NEW: add payments table to pdf of expense report
NEW: add payment terms to invoices list
NEW: Add picto of deletion on mass action combo lists
NEW: add product extrafields available into shipping export
NEW: add ref supplier on supplier invoice
NEW: Add stats on entries & movements by fiscal year
NEW: Add subledger in various payment module
NEW: Add tag for ODT generation for localtax rates
NEW: Add the now link when creating expense report
NEW: Ask date of invoice when using the Clone feature.
NEW: auto event msg
NEW: Automatically binding for intra/export accountancy code in customer list
NEW: automatic / manual selector form
NEW: Better explanation for setup of WebDav module
NEW: Can add more lines on situation invoices at end of project when there is extra to add.
NEW: Can change the customer account of an instance
NEW: Can choose the root category to show products for TakePOS module
NEW: Can edit supplier on draft order supplier
NEW: Can enter price with or without tax when entering expense repor line
NEW: Can filter on the date of period for social contributions
NEW: Can generate invoices from the timespent entered on a project
NEW: Can update product supplier price ref
NEW: Can upload files from the edit page of expense report
NEW: Color for hover and for checked line is on by default
NEW: Column of p...arent company is available in list of third parties
NEW: conditionnal add member button by statut
NEW: constant KEEP_DISCOUNT_LINES_FROM_ORIGIN
NEW: Contact related items tab
NEW: Can create of supplier invoice from a reception
NEW: Ensure External RSS Links Open in New Window
NEW: Export available for reception module
NEW: Extend import option to Order's card and Propal's card
NEW: filter by thirdparty on report CA by prod/serv
NEW: Save space by moving the meteo on the title line
NEW: Get the list of groups of a user with the REST API.
NEW: Hidden option MAIN_CAN_EDIT_SUPPLIER_ON_SUPPLIER_ORDER to edit supplier on draft supplier order
NEW: Improve Displaying Shortcut Access Keys in Navigation.
NEW: Improve Expensereport, Inverse Receiver.
NEW: Improve pdf description item visibitity.
NEW: Introduce a config parameter $dolibarr_main_instance_unique_id
NEW: Introduce css "nobottomiftotal"
NEW: Introduce PhpSpreadsheet for export (need php5.6+)
NEW: Invoice creation from the timesheet
NEW: Can list remote stripe's payout in a dedicated page.
NEW: Manage account sell_intra & sell_export in page accoutancy admin default product
NEW: Manage loan schedule.
NEW: Manage status of member types.
NEW: Mass action "create bills" for validated reception
NEW: Measuring unit are now defined into an editable dictionary. Add product size/unit into product import.
NEW: Template pdf 'canelle_reception' displays linked reception lines.
NEW: Moral/physic status can be defined at member type level
NEW: Pagination into list of time spent.
NEW: Performance enhancement (Replace dirname(__FILE__) with __DIR__)
NEW: POS support in order (ex: online cart).
NEW: Preview of images into the filemanager component.
NEW: Resource module can be used in products/services (in a dedicated tab)
NEW: Retrieve invoice infos from order when billing shipment
NEW: Save and display type of membership in subscription table for more explicit historic
NEW: Setup default thirdparty type (customer or prospect/customer)
NEW: Add shipping "set draft" button and can update lines.
NEW: show in blod, the invoice amount where we came from, when making payment
NEW: Show product dimensions in product tooltips.
NEW: Show the latest date of subscription in member statistics reports.
NEW: Sort list of templates alphabetically
NEW: Stripe Payment Intent (need option to use this new Stripe api method)
NEW: Can support barcode on supplier price references.
NEW: Support tag {ccc} on payment ref
NEW: The preview of PDF files generates only 1 png file, even if several pages.
NEW: Can select a Thirdparty object in donation module if option ON.
NEW: Tooltip with VAT amount and price incl tax on lines of objects.
NEW: Unsubscribed emails are now stored in a dedicated table.
NEW: Update working chkbxlst filter for lists.
NEW: Use ajax switch into setup of donation.php and multi-currency module.
NEW: use recipient language when generating the fullname for emails.
NEW: When you create product or service, sell accountancy account by default is suggested.
NEW: Widget birthdays of the month.
NEW: Option in workflow module to set a reception billed on validate supplier bill.
NEW: Autocompletion on lists should be available on mobile applications.
NEW: Add mass action to close several members.
NEW: Add hidden option ADD_UNSPLASH_LOGIN_BACKGROUND for random background
NEW: Add hidden option to be ready for BREXIT
For Developers:
NEW: Module "DebugBar" is available as a stable module.
NEW: Add API REST for donations
NEW: Add a script 'purge-data.php' to purge data older than a defined creation date
NEW: Add constant XFRAMEOPTIONS_ALLOWALL
NEW: Add function isValidVATID() to heck syntax of a VAT ID/number.
NEW: Add document's product support in APIs
NEW: Add REST API: get the list of objects in a category.
NEW: Update Stripe library to 6.35
NEW: Upgrade jquery lib to 3.3.1
NEW: Add hook 'addHtmlHeader()'
NEW: Add hook 'createRecurringInvoices()'
NEW: Add hook 'afterSelectContactOptions'
NEW: Add hook 'getAccessForbiddenMessage'
NEW: Add hook support in accountancy index
NEW: Add hook support in list of template invoices
NEW: Add parameter 'replaceambiguouschars' on getRandomPassword function
NEW: Add property 'noteditable' in modulebuilder
NEW: Add the current modulepart into the Conf class object
NEW: Add trigger FICHINTER_UNVALIDATE
NEW: Add visibility with value 4 in framework to define fields to show
NEW: More option to tune initialization of a new module with modulebuilder.
NEW: Add REST API to list currencies
NEW: REST API Proposal, Orders, Invoices: Add contact details
NEW: hidden option to change concat order of description/product label.
NEW: Enhance management of webhooks
NEW: Generation of doc by modulebuilder can include README and CHANGELOG
NEW: massfilesarea feature is possible for external modules
NEW: Show list of enabled modules in dol_print_error().
NEW: Simplification of CSS styles of default themes.
NEW: Clean code of a lot of deprecated code.
NEW: Add hidden option to set a search entry to the top
NEW: add hidden option DISPLAY_DISCOUNTED_SUPPLIER_PRICE
NEW: add hidden option MAIN_DEFAULT_LANGUAGE_FILTER
NEW: add hidden option NO_CONCAT_DESCRIPTION
NEW: Add hidden option ACCOUNTANCY_COMBO_FOR_AUX
NEW: Add Hidden option OVERRIDE_VAT_FOR_EXPENSE_REPORT
NEW: add hidden option MAIN_DOC_UPLOAD_NOT_RENAME_BY_DEFAULT
NEW: Hidden conf to improve pdf desc item visibitity
NEW: Look and feel v10 - Add CSS 'tabBarNoTop'
WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* PHP 5.4 is no more supported. Minimum PHP is now 5.5+.
* The PHP extension php-intl is not mandatory but should be installed to have new features working correctly.
* The PHP extension php-intl is not mandatory and must be installed to have new features working correctly.
* Method GetUrlTrackingStatus were renamed into getUrlTrackingStatus for consistency with naming rules.
* API getListOfCivility has been renamed into getListOfCivilities for consistency with naming rules.
* Deprecated function img_phone as been removed. You can use img_picto(..., 'call|call_out') instead.;
@@ -36,8 +515,95 @@ Following changes may create regressions for some external modules, but were nec
* Removed deprecated use of string in dol_print_date(). Only date allowed.
* Deprecated property ->fk_departement is now ->state_id everywhere.
* Removed the method 4 of GETPOST (to get $_COOKIE). It was not used and not recommanded to use in Dolibarr.
* Column llx_facture.facnumber change to llx_facture.ref
* Variable $dolibarr_main_cookie_cryptkey is no more created at install (it was not used by Dolibarr). A new variable
called $dolibarr_main_instance_unique_id is now generated at each installation. It will be used by some future features.
***** ChangeLog for 9.0.4 compared to 9.0.3 *****
FIX: #5249
FIX: #11025
FIX: #11032
FIX: #11097
FIX: #11169
FIX: #11202
FIX: #11244
FIX: #11296
FIX: #11316
FIX: #11335
FIX: Add missing end date of subscription in export
FIX: A user may read holiday and expense report without permissions
FIX: better syntax
FIX: condition
FIX: confirmation of mass email sending + option MAILING_NO_USING_PHPMAIL
FIX: crabe pdf: bad detailed VAT for situation invoices, in situations S2 and above
FIX: default value for duration of validity can be set from generic
FIX: do not include tpl from disabled modules
FIX: Error management when MAILING_NO_USING_PHPMAIL is set
FIX: Even with permission, can't validate leave once validator defined.
FIX: extrafield list search: SQL error when field is multiselect
FIX: if last char of customercode is accent making the truncate of first
FIX: Import of chart of account
FIX: in edit mode, dictionary inputs do not escape the string inside the 'value' attribute, causing errors if there are any double quotes
FIX: invalid link on user.fk_user
FIX: invoice class: bad SQL request if product type not set
FIX: javascript error when ckeditor module not enabled
FIX: mail presend: can overwrite a file previously uploaded (Issue #11056)
FIX: mass send mail
FIX: missing compatibility with multicompany transverse mode
FIX: missing llx_const encrypt
FIX: modulebuilder: hardcoded llx_
FIX: Not showing Contract and Project columns on ficheinter list
FIX: only profid1 to 4 were editable for pdf option to show. Not 5 and 6.
FIX: productaccount buylist with pages
FIX: remove isolated transaction commit
FIX: security (a user can read leave or holiday of other without perm.
FIX: situation invoices: bad detailed VAT in situations following the first one
FIX: situation invoices: block progress percentage change for discount lines
FIX: syntax error
FIX: the id was not loaded in fetch of accounting system
FIX: try to use WHERE EXISTS instead of DISTINCT
FIX: use dol_sanitizeFileName() function to remove double spaces in filenames, as well as done on document.php when we want to download pdf
FIX: Use of cron with multicompany
FIX: var name
FIX: we need to fetch fourn invoice with ref in current entity
FIX: Wrong stock movement on supplier credit notes
FIX: Import of record in ledger
***** ChangeLog for 9.0.3 compared to 9.0.2 *****
FIX: #11013
FIX: #11041
FIX: actioncomm: sort events by date after external calendars and hook (into 7.0)
FIX: better test
FIX: Combo list was limited to 20 in stock correction
FIX: Confusion between expired and late
FIX: Cursor pointer in payment screen for autofill
FIX: CVE-2019-11199
FIX: CVE-2019-11200
FIX: CVE-2019-11201
FIX: Default value on form to send email
FIX: error messages not displayed
FIX: Massive debug in lettering function
FIX: missing compatibility with multicompany
FIX: missing global $user
FIX: missing situation invoice in list
FIX: MultiEntity in lettering functionality
FIX: Product accountancey sell intra code must be visible if main feature level 1
FIX: ref for table without ref manager are set to NULL.
FIX: Sending email to mass actions send same email on same customer
FIX: Several fixes on import of services/products
FIX: shipping default warehouse if only one warehouse
FIX: sortfield on lettering function
FIX: Status of opportunity should never be -1
FIX: test to display create invoice button on supplier_order card
FIX: The autocopy feature was ko for suppliers
FIX: Total per day in timespent per week
FIX: Total per day shows 00:00 if the total time spent is equal to 12:00
FIX: Update/delete currency on same languages
FIX: Wrong variable name make contact of supplier order not used on PDF.
FIX: Add hidden option MAIN_PDF_HIDE_SITUATION to hide situation (quick hack to fix output pb).
FIX: attached files list with link file was broked
***** ChangeLog for 9.0.2 compared to 9.0.1 *****
FIX: #10822
FIX: Accountancy - Format EBP import
@@ -172,7 +738,7 @@ NEW: add option PROPOSAL_AUTO_ADD_AUTHOR_AS_CONTACT
NEW: Add option to display thirdparty adress in combolist
NEW: Add option to swap sender/recipient address on PDF
NEW: Add option to display thirdparty adress in combolist
NEW: Add project on pament of salaries
NEW: Add project on payment of salaries
NEW: Add SHIPPING_PDF_HIDE_WEIGHT_AND_VOLUME and
NEW: Add somes hooks in bank planned entries
NEW: Add supplier ref in item reception page
@@ -257,6 +823,125 @@ Following changes may create regressions for some external modules, but were nec
* Remove the no more used and deprecated dol_print_graph function
***** ChangeLog for 8.0.6 compared to 8.0.5 *****
FIX: #11244
FIX: #11316
FIX: Add missing end date of subscription in export
FIX: A user may read holiday and expense report without permissions
FIX: better syntax
FIX: condition
FIX: confirmation of mass email sending + option MAILING_NO_USING_PHPMAIL
FIX: crabe pdf: bad detailed VAT for situation invoices, in situations S2 and above
FIX: default value for duration of validity can be set from generic
FIX: do not include tpl from disabled modules
FIX: Error management when MAILING_NO_USING_PHPMAIL is set
FIX: Even with permission, can't validate leave once validator defined.
FIX: extrafield list search: SQL error when field is multiselect
FIX: if last char of customercode is accent making the truncate of first
FIX: in edit mode, dictionary inputs do not escape the string inside the 'value' attribute, causing errors if there are any double quotes
FIX: invalid link on user.fk_user
FIX: invoice class: bad SQL request if product type not set
FIX: mail presend: can overwrite a file previously uploaded
FIX: mail presend: can overwrite a file previously uploaded (Issue #11056)
FIX: mass send mail
FIX: missing compatibility with multicompany transverse mode
FIX: modulebuilder: hardcoded llx_
FIX: Not showing Contract and Project columns on ficheinter list
FIX: remove isolated transaction commit
FIX: security (a user can read leave or holiday of other without perm.
FIX: situation invoices: bad detailed VAT in situations following the first one
FIX: situation invoices: block progress percentage change for discount lines
FIX: syntax error
FIX: try to use WHERE EXISTS instead DISTINCT
FIX: use dol_sanitizeFileName() function to remove double spaces in filenames, as well as done on document.php when we want to download pdf
FIX: var name
FIX: we need to fetch fourn invoice with ref in current entity
FIX: Wrong stock movement on supplier credit notes
***** ChangeLog for 8.0.5 compared to 8.0.4 *****
FIX: #10381
FIX: #10460 compatibility with MariaDB 10.4
FIX: #11025
FIX: Accountancy - Add transaction with multicompany use all the time 1st entity
FIX: Accountancy - Format EBP import
FIX: actioncomm export: ORDER BY clause is in wrong export property + event type filter does not work
FIX: actioncomm: sort events by date after external calendars and hook
FIX: action list: add printFieldListSelect and printFieldListWhere hooks
FIX: add fk_unit on addline action
FIX: avoid php warning
FIX: bad sql request
FIX: better method
FIX: better test
FIX: better test on fetch
FIX: broken external authentication module feature and avoid warning
FIX: Can not create contract with numbering module without autogen rule
FIX: can't add lines on invoices
FIX: Can't generate invoice pdf
FIX: Can't insert if there is extrafields mandatory on another entity.
FIX: Can't insert if there is extrafields mandatory on another entity. FIX: Can't set default value of extrafield of type varchar
FIX: Check for old picture name if the new one was not found
FIX: Civility not saved when creating a member.
FIX: $conf->fournisseur->commande->enabled doesn't exist, we must use $conf->fournisseur->enabled
FIX: could not create several superadmin in transversal mode
FIX: credit note can have negative value
FIX: Default value on sales representative on third party creation
FIX: Don't show journal:getNomUrl without data
FIX: Erreur dans le Total
FIX: error messages not displayed
FIX: expedition: reset status on rollback + replace hardcoded status with const
FIX: Fix PHP warning "count(): Parameter must be an array..."
FIX: fk_default_warehouse missing in group by
FIX: function sendEmailsReminder isn't completely developed, then MAIN_FEATURES_LEVEL must be 2 to "use" it
FIX: holidays get natural_search if search params are set only
FIX: if empty error message, we just see "error" displayed
FIX: if(!method_exists(dol_loginfunction))
FIX: If we build one invoice for several orders, we must put the ref of order on the line to not lose information.
FIX: in fact expensereport must be in $check array
FIX: Interface regression for bind people. Fix option MAIN_OPTIMIZEFORTEXTBROWSER
FIX: line edit template: keep fk_parent_line
FIX: Loan impossible to account
FIX: Mark credit note as available for credit note in other currency
FIX: missing access security checking with multicompany
FIX: missing entity filter and wrong var name
FIX: missing entity filter in function "build_filterField()" (export)
FIX: Missing field in import/export of users
FIX: missing hook completeTabsHead in margins module
FIX: missing $ismultientitymanaged for previous/next ref
FIX: Missing province in export of invoice
FIX: multicompany compatibility
FIX: must fetch member in current entity
FIX: need an order by in case we found other invoice with same number but not same date
FIX: need to round with 2 decimals to avoid movements not correctly balanced
FIX: no need to test anything to display documents tabs on expense report
FIX: positive values creating diff on addline rounding
FIX: problem with multicompany transverse mode
FIX: Product accountancey sell intra code must be visible if main feature level 1
FIX: project_title for display of getNomUrl()
FIX: quick search for supplier orders
FIX: Remane of project
FIX: same thing here
FIX: Selection of email recipient with option MAIN_OPTIMIZEFORTEXTBROWSER
FIX: several hooks in shipping/delivery cards
FIX: shipping default warehouse if only one warehouse
FIX: SQL injection on rowid of dict.php
FIX: 'statut' is ignored when updating a user with the REST API.
FIX: supplier invoice payment total dont care about deposit or credit
FIX: supplier invoice product stats total ht is line total not invoice total
FIX: The minimum amount filter does not work in the VAT report per customer
FIX: Total per day shows 00:00 if the total time spent is equal to 12:00
FIX: Update/delete currency on same languages
FIX: [URGENT] broken feature, "$usercancreate" is for Dolibarr 9
FIX: useless join
FIX: we need to keep originline special_code
FIX: we want to be able to reopen fourn credit note
FIX: when 2 extra fields are mandatory in 2 different entities
FIX: when we add a payment on an invoice which already has payments with credit note or deposit amount, and then we get an excess received, discount amount must be $total_paiements + $total_creditnote_and_deposit - $object->total_ttc;
FIX: when we create deposit with multi tva, we mustn't add line if amount = 0 (example when we have a 100% reduc on one of origin invoice line)
FIX: wrong redirect link on holiday refuse
FIX: wrong test enabled
FIX: Wrong variable name
FIX: XSS
***** ChangeLog for 8.0.4 compared to 8.0.3 *****
FIX: #10030 better german chart
FIX: #10036

View File

@@ -1,11 +1,10 @@
# DOLIBARR ERP & CRM
![Downloads per day](https://img.shields.io/sourceforge/dw/dolibarr.svg)
[![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)
|6|7|8|9|develop|
|7|8|9|10|develop|
|----------|----------|----------|----------|----------|
|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/6.0.svg)|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/7.0.svg)|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/8.0.svg)|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/9.0.svg)|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg)|
|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/7.0.svg)|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/8.0.svg)|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/9.0.svg)|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/10.0.svg)|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg)|
Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…).
@@ -138,7 +137,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- Multi-company by adding of an external module.
- Very user friendly and easy to use.
- Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one)
- Works with PHP 5.3+ and MariaDB 5.0.3+, MySQL 5.0.3+ or PostgreSQL 8.1.4+ (See requirements on the [Wiki](https://wiki.dolibarr.org/index.php/Prerequisite))
- Works with PHP 5.5+ and MariaDB 5.0.3+, MySQL 5.0.3+ or PostgreSQL 8.1.4+ (See requirements on the [Wiki](https://wiki.dolibarr.org/index.php/Prerequisite))
- Compatible with all Cloud solutions that match MySQL, PHP or PostgreSQL prerequisites.
- APIs.
- An easy to understand, maintain and develop code (PHP with no heavy framework; trigger and hook architecture)

13
SECURITY.md Normal file
View File

@@ -0,0 +1,13 @@
# Security Policy
## Supported Versions
| Version | Supported |
| -------- | ------------------ |
| <= 8.0.* | :x: |
| >= 9.0.* | :white_check_mark: |
## Reporting a Vulnerability
To report a vulnerability, please send an email to security@dolibarr.org
In most cases, after fixing the security, we make an answer by email to say the issue has been fixed.

View File

@@ -3,8 +3,7 @@ README (English)
Building packages
##################################################
All sub-directories of "build" directory contains files required to build
automatically Dolibarr packages.
All sub-directories of "build" directory contains files (setup or binary tools) required to build automatically Dolibarr packages.
There are several tools:

View File

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

View File

@@ -10,7 +10,6 @@ File added into doxygen generated documentation
<br>
</div>
<!-- Global site tag (gtag.js) - Google Analytics -->
@@ -24,13 +23,30 @@ File added into doxygen generated documentation
</script>
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','//connect.facebook.net/en_US/fbevents.js');
fbq('init', '1998533953704960');
fbq('track', "PageView");</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=1998533953704960&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->
<!-- Twitter ad collector -->
<script src="//platform.twitter.com/oct.js" type="text/javascript"></script>
<script src="//static.ads-twitter.com/oct.js" type="text/javascript"></script>
<script type="text/javascript">twttr.conversion.trackPid('ntm4n', { tw_sale_amount: 0, tw_order_quantity: 0 });</script>
<noscript>
<img height="1" width="1" style="display:none;" alt="" src="https://analytics.twitter.com/i/adsct?txn_id=ntm4n&p_id=Twitter&tw_sale_amount=0&tw_order_quantity=0" />
<img height="1" width="1" style="display:none;" alt="" src="//t.co/i/adsct?txn_id=ntm4n&p_id=Twitter&tw_sale_amount=0&tw_order_quantity=0" />
</noscript>
</body>
</html>

View File

@@ -30,7 +30,6 @@ src="https://www.facebook.com/tr?id=1998533953704960&ev=PageView&noscript=1"
</head>
<body>
<div id="top">
<div class="topmaincol">
<div class="divpath">

View File

@@ -11,7 +11,7 @@ LaunchProgram=Launch %1
AssocFileExtension=&Associate %1 with the %2 file extension
AssocingFileExtension=Associating %1 with the %2 file extension...
YouWillInstallDoliWamp=You will install or upgrade DoliWamp (so Dolibarr + all required third party softwares like Apache, Mysql and PHP) on your computer.
YouWillInstallDoliWamp=You will install or upgrade DoliWamp (so Dolibarr + all required third party software like Apache, Mysql and PHP) on your computer.
ThisAssistantInstallOrUpgrade=WARNING: Using an ERP CRM installed on a local computer can be dangerous: if your computer break down, you can lose all your data. Do this if you are ready to manage backup yourself seriously. If not, use an installation in Saas instead (see https://saas.dolibarr.org).
IfYouHaveTechnicalKnowledge=Moreover, if you have technical knowledges and want to manage your Apache, Mysql and PHP yourself, you should not use this assistant and make a manual installation of Dolibarr on your existing server with Apache, Mysql and PHP.
ButIfYouLook=But if you look for an automatic setup on your local computer, you''re on the good way...

View File

@@ -1,7 +1,7 @@
# DOLIWAMP, THE DOLIBARR INSTALLER FOR WINDOWS
DoliWamp is a special all in one package installer for Windows (Dolibarr+Mysql+Apache+PHP).
It's a dedicated Dolibarr version for Windows newbies with no technical knowledge. This package will install or upgrade Dolibarr but also and all prerequisites like the web server, and the database in one autoinstall process.
It's a dedicated Dolibarr version for Windows newbies with no technical knowledge. This package will install or upgrade Dolibarr but also all prerequisites like the web server, and the database in one auto-install process.
If you have technical knowledge in web administration and plan to share your server instance (Apache, Mysql or PHP) with other projects than Dolibarr or want to use Dolibarr other components (PostgreSQL), you should not use this assistant and make a manual installation of Dolibarr on your existing server by downloading the standard package (.tgz or .zip file).

View File

@@ -31,7 +31,7 @@ AppPublisher=NLTechno
AppPublisherURL=https://www.nltechno.com
AppSupportURL=https://www.dolibarr.org
AppUpdatesURL=https://www.dolibarr.org
AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql softwares.
AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql software.
AppCopyright=Copyright (C) 2008-2019 Laurent Destailleur (NLTechno), Fabian Rodriguez (Le Goût du Libre)
DefaultDirName=c:\dolibarr
DefaultGroupName=Dolibarr

View File

@@ -150,7 +150,7 @@ Require local
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
ServerAdmin webmaster@localhost
ServerAdmin doliwamp@localhost
#
# ServerName gives the name and port that the server uses to identify itself.
@@ -772,5 +772,5 @@ SSLCertificateKeyFile "WAMPROOT/myserver.key"
#</Location>
# Declare alias for Dolibarr, PHPMyAdmin and other softwares
# Declare alias for Dolibarr, PHPMyAdmin and other software
Include "WAMPROOT/alias/*.conf"

View File

@@ -5,6 +5,7 @@
// during install process to be used.
//
//
$force_install_type='doliwamp';
$force_install_noedit=2; // 1=To block vars specific to distrib, 2 to block all technical parameters
$force_install_message='KeepDefaultValuesWamp';
$force_install_main_data_root='WAMPROOT/dolibarr_documents';

View File

@@ -458,16 +458,6 @@ variables_order = "GPCS"
; with user data. This makes most sense when coupled with track_vars - in which
; case you can access all of the GPC variables through the $HTTP_*_VARS[],
; variables.
;
; You should do your best to write your scripts so that they do not require
; register_globals to be on; Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.
register_globals = Off
; Whether or not to register the old-style input arrays, HTTP_GET_VARS
; and friends. If you're not using them, it's recommended to turn them off,
; for performance reasons.
register_long_arrays = Off
; This directive tells PHP whether to declare the argv&argc variables (that
; would contain the GET information). If you don't use these variables, you
@@ -477,8 +467,7 @@ register_argc_argv = Off
; When enabled, the SERVER and ENV variables are created when they're first
; used (Just In Time) instead of when the script starts. If these variables
; are not used within a script, having this directive on will result in a
; performance gain. The PHP directives register_globals, register_long_arrays,
; and register_argc_argv must be disabled for this directive to have any affect.
; performance gain.
auto_globals_jit = On
; Maximum size of POST data that PHP will accept.
@@ -653,6 +642,8 @@ default_socket_timeout = 60
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.
; If an extension does not load, run "deplister.exe php_xxx.dll" to get list of dependency dll missing.
extension=php_bz2.dll
extension=php_curl.dll
;extension=php_dba.dll
@@ -665,6 +656,7 @@ extension=php_gd2.dll
;extension=php_ifx.dll
;extension=php_imap.dll
;extension=php_interbase.dll
extension=php_intl.dll
extension=php_ldap.dll
extension=php_mbstring.dll
;extension=php_mcrypt.dll
@@ -1098,14 +1090,6 @@ session.gc_maxlifetime = 1800
; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
; cd /path/to/sessions; find -cmin +24 | xargs rm
; PHP 4.2 and less have an undocumented feature/bug that allows you to
; to initialize a session variable in the global scope, albeit register_globals
; is disabled. PHP 4.3 and later will warn you, if this feature is used.
; You can disable the feature and the warning separately. At this time,
; the warning is only displayed, if bug_compat_42 is enabled.
session.bug_compat_42 = 0
session.bug_compat_warn = 1
; Check HTTP Referer to invalidate externally stored URLs containing ids.
; HTTP_REFERER has to contain this substring for the session to be

View File

@@ -4,3 +4,4 @@ REM ----------------------------
REM Go to admin center page
start "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/
REM FOR EDGE start microsoft-edge:"http://localhost:WAMPAPACHEPORT/"

View File

@@ -5,3 +5,4 @@ REM ---------------------------
REM Go to help center page
echo Please wait...
start "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/dolibarr/support/
REM FOR EDGE start microsoft-edge:"http://localhost:WAMPAPACHEPORT/dolibarr/support/"

View File

@@ -4,6 +4,8 @@ REM ---------------
REM If no lock file, we call install process
IF NOT EXIST dolibarr_documents\install.lock start "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/dolibarr/install/
REM FOR EDGE IF NOT EXIST dolibarr_documents\install.lock start microsoft-edge:"http://localhost:WAMPAPACHEPORT/dolibarr/install/"
REM If lock file exists, we call home page
IF EXIST dolibarr_documents\install.lock start "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/dolibarr/
REM FOR EDGE IF EXIST dolibarr_documents\install.lock start microsoft-edge:"http://localhost:WAMPAPACHEPORT/dolibarr/"

View File

@@ -1 +1 @@
Help wanted...
"Help wanted..."

View File

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

View File

@@ -129,7 +129,7 @@ $BUILDROOT="$TEMP/buildroot";
$result = open( IN, "<" . $SOURCE . "/htdocs/filefunc.inc.php" );
if ( !$result ) { die "Error: Can't open descriptor file " . $SOURCE . "/htdocs/filefunc.inc.php\n"; }
while (<IN>) {
if ( $_ =~ /define\('DOL_VERSION','([\d\.a-z\-]+)'\)/ ) { $PROJVERSION = $1; break; }
if ( $_ =~ /define\('DOL_VERSION',\s*'([\d\.a-z\-]+)'\)/ ) { $PROJVERSION = $1; break; }
}
close IN;
($MAJOR,$MINOR,$BUILD)=split(/\./,$PROJVERSION,3);
@@ -357,7 +357,7 @@ if ($nboftargetok) {
}
else
{
print "ChangeLog for $MAJOR.$MINOR\.$BUILD was found into '$SOURCE/ChangeLog. But you can regenerate it with command:'\n";
print "ChangeLog for $MAJOR.$MINOR\.$BUILD was found into '$SOURCE/ChangeLog'. But you can regenerate it with command:\n";
}
if (! $BUILD || $BUILD eq '0-rc') # For a major version
{
@@ -367,7 +367,6 @@ if ($nboftargetok) {
{
#print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/CLOSE/NEW/g\'| sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. | grep -v "Merge branch" | grep -v "Merge pull" | grep "^ " | sed -e "s/^[0-9a-z]* *//" | grep -e \'^FIX\|NEW\|CLOSE\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/CLOSE/NEW/g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
}
print "\n";
if (! $ret)
@@ -382,11 +381,15 @@ if ($nboftargetok) {
}
}
}
# Build xml check file
#-----------------------
if ($CHOOSEDTARGET{'-CHKSUM'})
{
print "Go to directory $SOURCE\n";
$olddir=getcwd();
chdir("$SOURCE");
$ret=`git ls-files . --exclude-standard --others`;
if ($ret)
{
@@ -1002,7 +1005,7 @@ if ($nboftargetok) {
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/mymoduleindex.php`;
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/myobject_card.php`;
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/myobject_list.php`;
$ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/scripts/myobject.php`;
$ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/scripts/mymodule.php`;
$cmd="find $BUILDROOT/$PROJECT.tmp/scripts -name '*.php' -type f -exec chmod 755 {} \\; ";
$ret=`$cmd`;
$cmd="find $BUILDROOT/$PROJECT.tmp/scripts -name '*.sh' -type f -exec chmod 755 {} \\; ";

View File

@@ -1,7 +1,7 @@
#----------------------------------------------------------------------------
# \file dolibarr.pl
# \brief Dolibarr script install for Virtualmin Pro
# \author (c)2009-2018 Regis Houssin <regis.houssin@inodbox.com>
# \author (c)2009-2019 Regis Houssin <regis.houssin@inodbox.com>
#----------------------------------------------------------------------------
@@ -30,7 +30,7 @@ return "Regis Houssin";
# script_dolibarr_versions()
sub script_dolibarr_versions
{
return ( "9.0.0", "8.0.3", "7.0.4", "6.0.8", "5.0.7" );
return ( "10.0.0", "9.0.3", "8.0.5", "7.0.5", "6.0.8" );
}
sub script_dolibarr_release
@@ -390,6 +390,7 @@ sub script_dolibarr_check_latest
{
local ($ver) = @_;
local @vers = &osdn_package_versions("dolibarr",
$ver >= 10.0 ? "dolibarr\\-(10\\.0\\.[0-9\\.]+)\\.tgz" :
$ver >= 9.0 ? "dolibarr\\-(9\\.0\\.[0-9\\.]+)\\.tgz" :
$ver >= 8.0 ? "dolibarr\\-(8\\.0\\.[0-9\\.]+)\\.tgz" :
$ver >= 7.0 ? "dolibarr\\-(7\\.0\\.[0-9\\.]+)\\.tgz" :

View File

@@ -0,0 +1,14 @@
<?php
// Example to use PHPStan
// cd git/dolibarr
// /usr/bin/php7.2 ../phpstan.phar -l1 analyze htdocs/societe/website.php --memory-limit 2G
// Defined some constants and load Dolibarr env to reduce PHPStan bootstrap that fails to load a lot of things.
define('DOL_DOCUMENT_ROOT', __DIR__ . '/../../htdocs');
define('DOL_DATA_ROOT', __DIR__ . '/../../documents');
define('DOL_URL_ROOT', '/');
// Load the main.inc.php file to have functions llx_Header and llx_Footer defined
if (! defined("NOLOGIN")) define("NOLOGIN", '1');
global $conf, $langs, $user, $db;
include_once __DIR__ . '/../../htdocs/main.inc.php';

View File

@@ -165,6 +165,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/barcode
%_datadir/dolibarr/htdocs/blockedlog
%_datadir/dolibarr/htdocs/bookmarks
%_datadir/dolibarr/htdocs/bom
%_datadir/dolibarr/htdocs/cashdesk
%_datadir/dolibarr/htdocs/categories
%_datadir/dolibarr/htdocs/collab
@@ -179,6 +180,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/custom
%_datadir/dolibarr/htdocs/datapolicy
%_datadir/dolibarr/htdocs/dav
%_datadir/dolibarr/htdocs/debugbar
%_datadir/dolibarr/htdocs/don
%_datadir/dolibarr/htdocs/ecm
%_datadir/dolibarr/htdocs/emailcollector
@@ -191,7 +193,6 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/ftp
%_datadir/dolibarr/htdocs/holiday
%_datadir/dolibarr/htdocs/hrm
%_datadir/dolibarr/htdocs/ifttt
%_datadir/dolibarr/htdocs/imports
%_datadir/dolibarr/htdocs/includes
%_datadir/dolibarr/htdocs/install
@@ -201,6 +202,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/mailmanspip
%_datadir/dolibarr/htdocs/margin
%_datadir/dolibarr/htdocs/modulebuilder
%_datadir/dolibarr/htdocs/mrp
%_datadir/dolibarr/htdocs/multicurrency
%_datadir/dolibarr/htdocs/opensurvey
%_datadir/dolibarr/htdocs/paybox
@@ -209,6 +211,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/product
%_datadir/dolibarr/htdocs/projet
%_datadir/dolibarr/htdocs/public
%_datadir/dolibarr/htdocs/reception
%_datadir/dolibarr/htdocs/resource
%_datadir/dolibarr/htdocs/societe
%_datadir/dolibarr/htdocs/stripe

View File

@@ -245,6 +245,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/barcode
%_datadir/dolibarr/htdocs/blockedlog
%_datadir/dolibarr/htdocs/bookmarks
%_datadir/dolibarr/htdocs/bom
%_datadir/dolibarr/htdocs/cashdesk
%_datadir/dolibarr/htdocs/categories
%_datadir/dolibarr/htdocs/collab
@@ -259,6 +260,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/custom
%_datadir/dolibarr/htdocs/datapolicy
%_datadir/dolibarr/htdocs/dav
%_datadir/dolibarr/htdocs/debugbar
%_datadir/dolibarr/htdocs/don
%_datadir/dolibarr/htdocs/ecm
%_datadir/dolibarr/htdocs/emailcollector
@@ -271,7 +273,6 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/ftp
%_datadir/dolibarr/htdocs/holiday
%_datadir/dolibarr/htdocs/hrm
%_datadir/dolibarr/htdocs/ifttt
%_datadir/dolibarr/htdocs/imports
%_datadir/dolibarr/htdocs/includes
%_datadir/dolibarr/htdocs/install
@@ -281,6 +282,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/mailmanspip
%_datadir/dolibarr/htdocs/margin
%_datadir/dolibarr/htdocs/modulebuilder
%_datadir/dolibarr/htdocs/mrp
%_datadir/dolibarr/htdocs/multicurrency
%_datadir/dolibarr/htdocs/opensurvey
%_datadir/dolibarr/htdocs/paybox
@@ -289,6 +291,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/product
%_datadir/dolibarr/htdocs/projet
%_datadir/dolibarr/htdocs/public
%_datadir/dolibarr/htdocs/reception
%_datadir/dolibarr/htdocs/resource
%_datadir/dolibarr/htdocs/societe
%_datadir/dolibarr/htdocs/stripe

View File

@@ -162,6 +162,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/barcode
%_datadir/dolibarr/htdocs/blockedlog
%_datadir/dolibarr/htdocs/bookmarks
%_datadir/dolibarr/htdocs/bom
%_datadir/dolibarr/htdocs/cashdesk
%_datadir/dolibarr/htdocs/categories
%_datadir/dolibarr/htdocs/collab
@@ -176,6 +177,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/custom
%_datadir/dolibarr/htdocs/datapolicy
%_datadir/dolibarr/htdocs/dav
%_datadir/dolibarr/htdocs/debugbar
%_datadir/dolibarr/htdocs/don
%_datadir/dolibarr/htdocs/ecm
%_datadir/dolibarr/htdocs/emailcollector
@@ -188,7 +190,6 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/ftp
%_datadir/dolibarr/htdocs/holiday
%_datadir/dolibarr/htdocs/hrm
%_datadir/dolibarr/htdocs/ifttt
%_datadir/dolibarr/htdocs/imports
%_datadir/dolibarr/htdocs/includes
%_datadir/dolibarr/htdocs/install
@@ -198,6 +199,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/mailmanspip
%_datadir/dolibarr/htdocs/margin
%_datadir/dolibarr/htdocs/modulebuilder
%_datadir/dolibarr/htdocs/mrp
%_datadir/dolibarr/htdocs/multicurrency
%_datadir/dolibarr/htdocs/opensurvey
%_datadir/dolibarr/htdocs/paybox
@@ -206,6 +208,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/product
%_datadir/dolibarr/htdocs/projet
%_datadir/dolibarr/htdocs/public
%_datadir/dolibarr/htdocs/reception
%_datadir/dolibarr/htdocs/resource
%_datadir/dolibarr/htdocs/societe
%_datadir/dolibarr/htdocs/stripe

View File

@@ -173,6 +173,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/barcode
%_datadir/dolibarr/htdocs/blockedlog
%_datadir/dolibarr/htdocs/bookmarks
%_datadir/dolibarr/htdocs/bom
%_datadir/dolibarr/htdocs/cashdesk
%_datadir/dolibarr/htdocs/categories
%_datadir/dolibarr/htdocs/collab
@@ -187,6 +188,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/custom
%_datadir/dolibarr/htdocs/datapolicy
%_datadir/dolibarr/htdocs/dav
%_datadir/dolibarr/htdocs/debugbar
%_datadir/dolibarr/htdocs/don
%_datadir/dolibarr/htdocs/ecm
%_datadir/dolibarr/htdocs/emailcollector
@@ -199,7 +201,6 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/ftp
%_datadir/dolibarr/htdocs/holiday
%_datadir/dolibarr/htdocs/hrm
%_datadir/dolibarr/htdocs/ifttt
%_datadir/dolibarr/htdocs/imports
%_datadir/dolibarr/htdocs/includes
%_datadir/dolibarr/htdocs/install
@@ -209,6 +210,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/mailmanspip
%_datadir/dolibarr/htdocs/margin
%_datadir/dolibarr/htdocs/modulebuilder
%_datadir/dolibarr/htdocs/mrp
%_datadir/dolibarr/htdocs/multicurrency
%_datadir/dolibarr/htdocs/opensurvey
%_datadir/dolibarr/htdocs/paybox
@@ -217,6 +219,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/product
%_datadir/dolibarr/htdocs/projet
%_datadir/dolibarr/htdocs/public
%_datadir/dolibarr/htdocs/reception
%_datadir/dolibarr/htdocs/resource
%_datadir/dolibarr/htdocs/societe
%_datadir/dolibarr/htdocs/stripe

View File

@@ -29,16 +29,6 @@ Alias /dolibarr /usr/share/dolibarr/htdocs
ErrorDocument 401 /public/error-401.php
ErrorDocument 404 /public/error-404.php
<IfModule mod_php4.c>
php_flag magic_quotes_gpc Off
php_flag register_globals Off
</IfModule>
<IfModule mod_php5.c>
php_flag magic_quotes_gpc Off
php_flag register_globals Off
</IfModule>
# OPTIMIZE: To use gzip compressed files (for Dolibarr already compressed files).
# Note that constant MAIN_OPTIMIZE_SPEED must have a value with bit 0 set.

View File

@@ -27,6 +27,15 @@ With
ESCPOS:
-------
Replace
private $connector;
With
protected $connector;
NUSOAP:
-------
* In file nusoap.php, to avoid a warning,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

File diff suppressed because one or more lines are too long

View File

@@ -176,10 +176,61 @@ export list="
--ignore-table=$base.llx_advanced_extrafields
--ignore-table=$base.llx_advanced_extrafields_options
--ignore-table=$base.llx_advanced_extrafields_values
--ignore-table=$base.llx_agefodd_calendrier
--ignore-table=$base.llx_agefodd_certif_state
--ignore-table=$base.llx_agefodd_certificate_type
--ignore-table=$base.llx_agefodd_contact
--ignore-table=$base.llx_agefodd_convention
--ignore-table=$base.llx_agefodd_convention_stagiaire
--ignore-table=$base.llx_agefodd_cursus
--ignore-table=$base.llx_agefodd_cursus_extrafields
--ignore-table=$base.llx_agefodd_formateur
--ignore-table=$base.llx_agefodd_formateur_category
--ignore-table=$base.llx_agefodd_formateur_category_dict
--ignore-table=$base.llx_agefodd_formateur_training
--ignore-table=$base.llx_agefodd_formateur_type
--ignore-table=$base.llx_agefodd_formation_catalogue
--ignore-table=$base.llx_agefodd_formation_catalogue_extrafields
--ignore-table=$base.llx_agefodd_formation_catalogue_modules
--ignore-table=$base.llx_agefodd_formation_catalogue_type
--ignore-table=$base.llx_agefodd_formation_catalogue_type_bpf
--ignore-table=$base.llx_agefodd_formation_cursus
--ignore-table=$base.llx_agefodd_formation_objectifs_peda
--ignore-table=$base.llx_agefodd_opca
--ignore-table=$base.llx_agefodd_place
--ignore-table=$base.llx_agefodd_reg_interieur
--ignore-table=$base.llx_agefodd_session
--ignore-table=$base.llx_agefodd_session_adminsitu
--ignore-table=$base.llx_agefodd_session_admlevel
--ignore-table=$base.llx_agefodd_session_calendrier
--ignore-table=$base.llx_agefodd_session_commercial
--ignore-table=$base.llx_agefodd_session_contact
--ignore-table=$base.llx_agefodd_session_element
--ignore-table=$base.llx_agefodd_session_extrafields
--ignore-table=$base.llx_agefodd_session_formateur
--ignore-table=$base.llx_agefodd_session_formateur_calendrier
--ignore-table=$base.llx_agefodd_session_stagiaire
--ignore-table=$base.llx_agefodd_session_stagiaire_heures
--ignore-table=$base.llx_agefodd_session_status_type
--ignore-table=$base.llx_agefodd_stagiaire
--ignore-table=$base.llx_agefodd_stagiaire_certif
--ignore-table=$base.llx_agefodd_stagiaire_cursus
--ignore-table=$base.llx_agefodd_stagiaire_extrafields
--ignore-table=$base.llx_agefodd_stagiaire_type
--ignore-table=$base.llx_agefodd_training_admlevel
--ignore-table=$base.llx_askpricesupplier
--ignore-table=$base.llx_askpricesupplier_extrafields
--ignore-table=$base.llx_askpricesupplierdet
--ignore-table=$base.llx_askpricesupplierdet_extrafields
--ignore-table=$base.llx_assetOf
--ignore-table=$base.llx_assetOf_line
--ignore-table=$base.llx_asset_workstation_of
--ignore-table=$base.llx_asset_workstation_product
--ignore-table=$base.llx_asset_workstation_task
--ignore-table=$base.llx_assetof_amounts
--ignore-table=$base.llx_asset_workstation_of
--ignore-table=$base.llx_asset_workstation_of
--ignore-table=$base.llx_asset_workstation_of
--ignore-table=$base.llx_bookkeeping
--ignore-table=$base.llx_bootstrap
--ignore-table=$base.llx_bt_namemap
@@ -226,15 +277,28 @@ export list="
--ignore-table=$base.llx_ecommerce_site
--ignore-table=$base.llx_ecommerce_societe
--ignore-table=$base.llx_ecommerce_socpeople
--ignore-table=$base.llx_element_rang
--ignore-table=$base.llx_element_rang
--ignore-table=$base.llx_element_tag
--ignore-table=$base.llx_eleves
--ignore-table=$base.llx_eleves_extrafields
--ignore-table=$base.llx_entity
--ignore-table=$base.llx_entity_extrafields
--ignore-table=$base.llx_entity_thirdparty
--ignore-table=$base.llx_equipement_factory
--ignore-table=$base.llx_factory
--ignore-table=$base.llx_factory_extrafields
--ignore-table=$base.llx_factorydet
--ignore-table=$base.llx_filemanager_roots
--ignore-table=$base.llx_fournisseur_ca
--ignore-table=$base.llx_google_maps
--ignore-table=$base.llx_lead
--ignore-table=$base.llx_lead_extrafields
--ignore-table=$base.llx_milestone
--ignore-table=$base.llx_milestone
--ignore-table=$base.llx_monitoring_probes
--ignore-table=$base.llx_m
--ignore-table=$base.llx_m_extrafields
--ignore-table=$base.llx_monmodule_abcdef
--ignore-table=$base.llx_notes
--ignore-table=$base.llx_pos_cash
--ignore-table=$base.llx_pos_control_cash
@@ -256,6 +320,9 @@ export list="
--ignore-table=$base.llx_ultimatepdf
--ignore-table=$base.llx_update_modules
--ignore-table=$base.llx_ventilation_achat
--ignore-table=$base.tmp_llx_accouting_account
--ignore-table=$base.tmp_llx_product_batch
--ignore-table=$base.tmp_llx_product_batch2
"
echo "mysqldump -P$port -u$admin -p***** $list $base > $mydir/$dumpfile"
mysqldump -P$port -u$admin $passwd $list $base > $mydir/$dumpfile

View File

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

View File

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

View File

@@ -0,0 +1,4 @@
Test to migrate Dolibarr to namespace "Dolibarr".
Script bbb.php is a script of an external module with current code writing.
It must works after migration.

View File

@@ -0,0 +1,23 @@
<?php
namespace Dolibarr;
global $globalaaa;
$globalaaa = 'globalaaa';
function faaa()
{
return 'faaa';
}
class Aaa
{
const AAA='aaa';
public function do()
{
echo 'doaaa'."\n";
}
}

View File

@@ -0,0 +1,25 @@
<?php
global $globalbbb;
$globalbbb = 'globalbbb';
function fbbb()
{
return 'fbbb';
}
class Bbb
{
const BBB='bbb';
public function do()
{
global $globalaaa, $globalbbb;
echo 'dobbb'."\n";
$globalaaa.='+bbb';
$globalbbb.='+bbb';
}
}

31
dev/namespacemig/bbb.php Executable file
View File

@@ -0,0 +1,31 @@
<?php
//use \Aaa as Aaa;
use Dolibarr\Aaa as Aaa;
use function Dolibarr\faaa as faaa; // Need php 5.6+
//use const Dolibarr\AAA;
//use Bbb as Bbb;
require './main.inc.php';
require './aaa.class.php';
require './bbb.class.php';
$bbb = new Bbb();
$bbb->do();
$aaa = new Aaa();
$aaa->do();
echo $aaa::AAA."\n";
echo $bbb::BBB."\n";
echo Aaa::AAA."\n";
echo Bbb::BBB."\n";
echo faaa()."\n";
echo fbbb()."\n";
echo "globalaaa=$globalaaa\n";
echo "globalbbb=$globalbbb\n";

View File

@@ -0,0 +1,7 @@
<?php
/*spl_autoload_register(function ($class_name) {
var_dump('class='.$class_name);
require $class_name;
});
*/

View File

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

View File

@@ -658,20 +658,6 @@ html_errors = Off
; Example:
;arg_separator.input = ";&"
; This directive determines which super global arrays are registered when PHP
; starts up. If the register_globals directive is enabled, it also determines
; what order variables are populated into the global space. G,P,C,E & S are
; abbreviations for the following respective super globals: GET, POST, COOKIE,
; ENV and SERVER. There is a performance penalty paid for the registration of
; these arrays and because ENV is not as commonly used as the others, ENV is
; is not recommended on productions servers. You can still get access to
; the environment variables through getenv() should you need to.
; Default Value: "EGPCS"
; Development Value: "GPCS"
; Production Value: "GPCS";
; http://php.net/variables-order
variables_order = "GPCS"
; This directive determines which super global data (G,P,C,E & S) should
; be registered into the super global array REQUEST. If so, it also determines
; the order in which that data is registered. The values for this directive are
@@ -685,15 +671,6 @@ variables_order = "GPCS"
; http://php.net/request-order
request_order = "GP"
; Whether or not to register the EGPCS variables as global variables. You may
; want to turn this off if you don't want to clutter your scripts' global scope
; with user data.
; You should do your best to write your scripts so that they do not require
; register_globals to be on; Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.
; http://php.net/register-globals
register_globals = Off
; Determines whether the deprecated long $HTTP_*_VARS type predefined variables
; are registered by PHP or not. As they are deprecated, we obviously don't
; recommend you use them. They are on by default for compatibility reasons but
@@ -722,8 +699,7 @@ register_argc_argv = Off
; When enabled, the SERVER and ENV variables are created when they're first
; used (Just In Time) instead of when the script starts. If these variables
; are not used within a script, having this directive on will result in a
; performance gain. The PHP directives register_globals, register_long_arrays,
; and register_argc_argv must be disabled for this directive to have any affect.
; performance gain.
; http://php.net/auto-globals-jit
auto_globals_jit = On
@@ -1516,22 +1492,6 @@ session.gc_maxlifetime = 1440
; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
; find /path/to/sessions -cmin +24 | xargs rm
; PHP 4.2 and less have an undocumented feature/bug that allows you to
; to initialize a session variable in the global scope, even when register_globals
; is disabled. PHP 4.3 and later will warn you, if this feature is used.
; You can disable the feature and the warning separately. At this time,
; the warning is only displayed, if bug_compat_42 is enabled. This feature
; introduces some serious security problems if not handled correctly. It's
; recommended that you do not use this feature on production servers. But you
; should enable this on development servers and enable the warning as well. If you
; do not enable the feature on development servers, you won't be warned when it's
; used and debugging errors caused by this can be difficult to track down.
; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/session.bug-compat-42
session.bug_compat_42 = Off
; This setting controls whether or not you are warned by PHP when initializing a
; session value into the global space. session.bug_compat_42 must be enabled before
; these warnings can be issued by PHP. See the directive above for more information.

View File

@@ -5,7 +5,9 @@
<exclude-pattern type="relative">build/html</exclude-pattern>
<exclude-pattern type="relative">build/aps</exclude-pattern>
<exclude-pattern type="relative">dev/namespacemig</exclude-pattern>
<exclude-pattern type="relative">documents</exclude-pattern>
<exclude-pattern type="relative">htdocs/core/class/lessc.class.php</exclude-pattern>
<exclude-pattern type="relative">htdocs/custom</exclude-pattern>
<exclude-pattern type="relative">htdocs/includes</exclude-pattern>
<exclude-pattern type="relative">htdocs/install/doctemplates/websites</exclude-pattern>
@@ -75,10 +77,13 @@
<!-- Warning if action on same line than if -->
<!--
<rule ref="Generic.ControlStructures.InlineControlStructure">
<properties> <property name="error" value="false"/> </properties>
<properties>
<property name="error" value="false"/>
</properties>
</rule>
-->
<!-- PHP code MUST use only UTF-8 without BOM. -->
<rule ref="Generic.Files.ByteOrderMark"/>
@@ -97,8 +102,11 @@
</properties>
</rule>
<!-- To disallow several statements on same line -->
<!-- <rule ref="Generic.Formatting.DisallowMultipleStatements" /> -->
<!-- Disallow several statements on same line -->
<!-- We want to allow 'if () { ...small code... }' on same line for better code compacity and readability -->
<rule ref="Generic.Formatting.DisallowMultipleStatements">
<severity>0</severity>
</rule>
<!-- Have 2 chars padding maximum and always show as errors -->
<!--
@@ -112,13 +120,17 @@
<rule ref="Generic.Functions.CallTimePassByReference" />
<rule ref="Generic.Functions.FunctionCallArgumentSpacing" />
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceBeforeEquals">
<severity>0</severity>
</rule>
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceBeforeEquals">
<severity>0</severity>
</rule>
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma"> <!-- We don't want this rule, we want to be able to align params on several similare functions on different lines -->
<!-- Disallow several spaces after comma -->
<!-- We want to allow this because we want to be able to align params on several similare functions on different lines -->
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma">
<severity>0</severity>
</rule>
@@ -152,7 +164,10 @@
<rule ref="Generic.PHP.ForbiddenFunctions" />
<!-- Warning when using @ before functions -->
<!-- <rule ref="Generic.PHP.NoSilencedErrors" /> -->
<!-- We want this. Some features need this -->
<rule ref="Generic.PHP.NoSilencedErrors">
<severity>0</severity>
</rule>
<!-- Say if null, true, false must be uppercase (Rule 2.5 of PSR2 https://www.php-fig.org/psr/psr-2/) -->
<rule ref="Generic.PHP.LowerCaseConstant" />
@@ -169,7 +184,16 @@
<!-- Check indent are done with spaces and with correct number -->
<!-- Disabled as this does not support tab -->
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
<!-- TODO Enable this
<arg name="tab-width" value="4"/>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="4"/>
<property name="tabIndent" value="true"/>
</properties>
</rule>
-->
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" />
<!-- There MUST NOT be trailing whitespace at the end of non-blank lines. -->
@@ -310,22 +334,29 @@
<rule ref="PEAR.Commenting.InlineComment" />
<!-- <rule ref="PEAR.ControlStructures.ControlSignature" /> -->
<!-- Check position of { after a control structure like if (), while (), etc... -->
<!--
<rule ref="PEAR.ControlStructures.ControlSignature" />
-->
<!-- <rule ref="PEAR.ControlStructures.MultiLineCondition" /> -->
<!-- Test if () are removed for includes -->
<rule ref="PEAR.Files.IncludingFile" />
<!-- Disable some error messages that we do not want. -->
<rule ref="PEAR.Files.IncludingFile.UseInclude">
<severity>0</severity>
</rule>
<!-- TODO Enable this test. We should use require for include in prior of include when out of if -->
<rule ref="PEAR.Files.IncludingFile.UseIncludeOnce">
<severity>0</severity>
</rule>
<rule ref="PEAR.Files.IncludingFile.UseRequire">
<severity>0</severity>
</rule>
<!-- TODO Enable this test. We should use require for include in prior of include when out of if -->
<rule ref="PEAR.Files.IncludingFile.UseRequireOnce">
<severity>0</severity>
</rule>
@@ -334,12 +365,15 @@
<rule ref="PEAR.Functions.FunctionCallSignature" />
<!-- TODO Enable this test. -->
<rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine">
<severity>0</severity>
</rule>
<!-- TODO Enable this test. -->
<rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine">
<severity>0</severity>
</rule>

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 KiB

After

Width:  |  Height:  |  Size: 246 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 KiB

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

View File

Before

Width:  |  Height:  |  Size: 268 KiB

After

Width:  |  Height:  |  Size: 268 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 KiB

1
htdocs/.gitignore vendored
View File

@@ -28,3 +28,4 @@
/nomenclature*
/of/
/workstation/
/oblyon*

View File

@@ -19,7 +19,7 @@
/**
* \file htdocs/accountancy/admin/account.php
* \ingroup Advanced accountancy
* \ingroup Accountancy (Double entries)
* \brief List accounting account
*/
@@ -247,11 +247,10 @@ if ($resql)
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$newcardbutton = '<a class="butActionNew" href="./card.php?action=create"><span class="valignmiddle text-plus-circle">' . $langs->trans("Addanaccount").'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
$newcardbutton.= dolGetButtonTitle($langs->trans("New"), $langs->trans("Addanaccount"), 'fa fa-plus-circle', './card.php?action=create');
print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit);
print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit);
// Box to select active chart of account
print $langs->trans("Selectchartofaccounts") . " : ";
@@ -298,7 +297,7 @@ if ($resql)
if (! empty($arrayfields['aa.pcg_type']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgtype" value="' . $search_pcgtype . '"></td>';
if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgsubtype" value="' . $search_pcgsubtype . '"></td>';
if (! empty($arrayfields['aa.active']['checked'])) print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre right">';
print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
print $searchpicto;
print '</td>';
@@ -390,11 +389,11 @@ if ($resql)
{
print '<td>';
if (empty($obj->active)) {
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $obj->rowid . '&action=enable">';
print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $obj->rowid . '&action=enable">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>';
} else {
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $obj->rowid . '&action=disable">';
print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $obj->rowid . '&action=disable">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a>';
}

View File

@@ -1,10 +1,10 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011-2019 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
@@ -28,7 +28,7 @@
/**
* \file htdocs/accountancy/admin/accountmodel.php
* \ingroup Advanced accountancy
* \ingroup Accountancy (Double entries)
* \brief Page to administer model of chart of accounts
*/
@@ -156,17 +156,8 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
$ok=1;
foreach ($listfield as $f => $value)
{
if ($value == 'country_id' && in_array($tablib[$id], array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp','DictionaryAccountancyCategory','Pcg_version'))) continue; // For some pages, country is not mandatory
if ($value == 'country' && in_array($tablib[$id], array('DictionaryCanton','DictionaryCompanyType','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue;
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
if ($value == 'color' && empty($_POST['color'])) continue;
if ($value == 'formula' && empty($_POST['formula'])) continue;
if ((! isset($_POST[$value]) || $_POST[$value]=='')
&& (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy')) // Fields that are not mandatory
&& (! ($id == 10 && $listfield[$f] == 'code')) // Code is mandatory fir table 10
)
)
if ($value == 'country_id' && in_array($tablib[$id], array('Pcg_version'))) continue; // For some pages, country is not mandatory
if ((! isset($_POST[$value]) || $_POST[$value]==''))
{
$ok=0;
$fieldnamekey=$listfield[$f];
@@ -174,19 +165,6 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
if ($fieldnamekey == 'pcg_version') $fieldnamekey='Pcg_version';
if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey='Label';
if ($fieldnamekey == 'libelle_facture') $fieldnamekey = 'LabelOnDocuments';
if ($fieldnamekey == 'nbjour') $fieldnamekey='NbOfDays';
if ($fieldnamekey == 'decalage') $fieldnamekey='Offset';
if ($fieldnamekey == 'module') $fieldnamekey='Module';
if ($fieldnamekey == 'code') $fieldnamekey = 'Code';
if ($fieldnamekey == 'note') $fieldnamekey = 'Note';
if ($fieldnamekey == 'taux') $fieldnamekey = 'Rate';
if ($fieldnamekey == 'type') $fieldnamekey = 'Type';
if ($fieldnamekey == 'position') $fieldnamekey = 'Position';
if ($fieldnamekey == 'unicode') $fieldnamekey = 'Unicode';
if ($fieldnamekey == 'deductible') $fieldnamekey = 'Deductible';
if ($fieldnamekey == 'sortorder') $fieldnamekey = 'SortOrder';
if ($fieldnamekey == 'category_type') $fieldnamekey = 'Calculated';
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
}
@@ -196,9 +174,9 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
$ok=0;
setEventMessages($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'), null, 'errors');
}
if (isset($_POST["code"]))
if (isset($_POST["pcg_version"]))
{
if ($_POST["code"]=='0')
if ($_POST["pcg_version"]=='0')
{
$ok=0;
setEventMessages($langs->transnoentities('ErrorCodeCantContainZero'), null, 'errors');
@@ -211,28 +189,9 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
}
if (isset($_POST["country"]) && ($_POST["country"]=='0') && ($id != 2))
{
if (in_array($tablib[$id], array('DictionaryCompanyType','DictionaryHolidayTypes'))) // Field country is no mandatory for such dictionaries
{
$_POST["country"]='';
}
else
{
$ok=0;
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Country")), null, 'errors');
}
$ok=0;
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Country")), null, 'errors');
}
if (! is_numeric($_POST["code"]))
{
$ok=0;
setEventMessages($langs->transnoentities("ErrorFieldMustBeANumeric", $langs->transnoentities("Code")), null, 'errors');
}
// Clean some parameters
if (isset($_POST["localtax1"]) && empty($_POST["localtax1"])) $_POST["localtax1"]='0'; // If empty, we force to 0
if (isset($_POST["localtax2"]) && empty($_POST["localtax2"])) $_POST["localtax2"]='0'; // If empty, we force to 0
if ($_POST["accountancy_code"] <= 0) $_POST["accountancy_code"]=''; // If empty, we force to null
if ($_POST["accountancy_code_sell"] <= 0) $_POST["accountancy_code_sell"]=''; // If empty, we force to null
if ($_POST["accountancy_code_buy"] <= 0) $_POST["accountancy_code_buy"]=''; // If empty, we force to null
// Si verif ok et action add, on ajoute la ligne
if ($ok && GETPOST('actionadd', 'alpha'))
@@ -462,8 +421,6 @@ $linkback='';
print load_fiche_titre($titre, $linkback, 'title_accountancy');
print "<br>\n";
// Confirmation de la suppression de la ligne
if ($action == 'delete')
@@ -522,7 +479,6 @@ if ($id)
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label')
{
$valuetoshow=$langs->trans("Label");
if ($id != 25) $valuetoshow.="*";
}
if ($fieldlist[$field]=='country') {
if (in_array('region_id', $fieldlist)) { print '<td>&nbsp;</td>'; continue; } // For region page, we do not show the country input
@@ -583,10 +539,6 @@ if ($id)
$colspan=count($fieldlist)+3;
if (! empty($alabelisused)) // If there is one label among fields, we show legend of *
{
print '<tr><td colspan="'.$colspan.'">* '.$langs->trans("LabelUsedByDefault").'.</td></tr>';
}
print '<tr><td colspan="'.$colspan.'">&nbsp;</td></tr>'; // Keep &nbsp; to have a line with enough height
}
@@ -667,7 +619,6 @@ if ($id)
}
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') {
$valuetoshow=$langs->trans("Label");
if ($id != 25) $valuetoshow.="*";
}
if ($fieldlist[$field]=='country') {
$valuetoshow=$langs->trans("Country");

View File

@@ -19,7 +19,7 @@
/**
* \file htdocs/accountancy/admin/card.php
* \ingroup Advanced accountancy
* \ingroup Accountancy (Double entries)
* \brief Card of accounting account
*/

View File

@@ -18,7 +18,7 @@
/**
* \file htdocs/accountancy/admin/categories.php
* \ingroup Advanced accountancy
* \ingroup Accountancy (Double entries)
* \brief Page to assign mass categories to accounts
*/

View File

@@ -412,7 +412,7 @@ $titlepicto='title_setup';
print load_fiche_titre($titre, $linkback, $titlepicto);
print $langs->trans("AccountingAccountGroupsDesc", $langs->transnoentitiesnoconv("ByPersonalizedAccountGroups")).'<br><br>';
print '<span class="opacitymedium">'.$langs->trans("AccountingAccountGroupsDesc", $langs->transnoentitiesnoconv("ByPersonalizedAccountGroups")).'</span><br><br>';
// Confirmation de la suppression de la ligne
if ($action == 'delete')

View File

@@ -18,12 +18,11 @@
/**
* \file htdocs/accountancy/admin/closure.php
* \ingroup Advanced accountancy
* \ingroup Accountancy (Double entries)
* \brief Setup page to configure accounting expert module
*/
require '../../main.inc.php';
// Class
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
@@ -89,7 +88,7 @@ llxHeader();
$linkback = '';
print load_fiche_titre($langs->trans('MenuClosureAccounts'), $linkback, 'title_accountancy');
print $langs->trans("DefaultClosureDesc").'<br>';
print '<span class="opacitymedium">'.$langs->trans("DefaultClosureDesc").'</span><br>';
print '<br>';
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';

View File

@@ -24,7 +24,7 @@
/**
* \file htdocs/accountancy/admin/defaultaccounts.php
* \ingroup Advanced accountancy
* \ingroup Accountancy (Double entries)
* \brief Setup page to configure accounting expert module
*/
require '../../main.inc.php';
@@ -78,7 +78,6 @@ $list_account = array (
$accounting_mode = empty($conf->global->ACCOUNTING_MODE) ? 'RECETTES-DEPENSES' : $conf->global->ACCOUNTING_MODE;
if (GETPOST('change_chart', 'alpha'))
{
$chartofaccounts = GETPOST('chartofaccounts', 'int');
@@ -132,7 +131,7 @@ llxHeader();
$linkback = '';
print load_fiche_titre($langs->trans('MenuDefaultAccounts'), $linkback, 'title_accountancy');
print $langs->trans("DefaultBindingDesc").'<br>';
print '<span class="opacitymedium">'.$langs->trans("DefaultBindingDesc").'</span><br>';
print '<br>';
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';

View File

@@ -23,7 +23,7 @@
/**
* \file htdocs/accountancy/admin/export.php
* \ingroup Advanced accountancy
* \ingroup Accountancy (Double entries)
* \brief Setup page to configure accounting expert module
*/
require '../../main.inc.php';
@@ -76,6 +76,7 @@ $model_option = array (
),
);
/*
* Actions
*/
@@ -138,6 +139,7 @@ $form = new Form($db);
// $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
print load_fiche_titre($langs->trans('ConfigAccountingExpert'), $linkback, 'title_setup');
print "\n".'<script type="text/javascript" language="javascript">'."\n";
print 'jQuery(document).ready(function () {'."\n";
print ' function initfields()'."\n";
@@ -195,7 +197,6 @@ print '<tr class="liste_titre">';
print '<td colspan="3">' . $langs->trans('Options') . '</td>';
print "</tr>\n";
$num = count($main_option);
if ($num) {
foreach ($main_option as $key) {
@@ -236,7 +237,7 @@ if (! $conf->use_javascript_ajax) {
} else {
print '<td>';
$listmodelcsv = AccountancyExport::getType();
print $form->selectarray("ACCOUNTING_EXPORT_MODELCSV", $listmodelcsv, $conf->global->ACCOUNTING_EXPORT_MODELCSV, 0);
print $form->selectarray("ACCOUNTING_EXPORT_MODELCSV", $listmodelcsv, $conf->global->ACCOUNTING_EXPORT_MODELCSV, 0, 0, 0, '', 0, 0, 0, '', '', 1);
print '</td>';
}

View File

@@ -17,7 +17,7 @@
/**
* \file htdocs/accountancy/admin/fiscalyear.php
* \ingroup Advanced accountancy
* \ingroup Accountancy (Double entries)
* \brief Setup page to configure fiscal year
*/
@@ -111,14 +111,9 @@ if ($result)
$i = 0;
if (! empty($user->rights->accounting->fiscalyear))
{
$addbutton = '<a class="butActionNew" href="fiscalyear_card.php?action=create"><span class="valignmiddle text-plus-circle">' . $langs->trans("NewFiscalYear") .'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
}
else
{
$addbutton = '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'"><span class="valignmiddle text-plus-circle">' . $langs->trans("NewFiscalYear") .'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
}
$addbutton.= dolGetButtonTitle($langs->trans('NewFiscalYear'), '', 'fa fa-plus-circle', 'fiscalyear_card.php?action=create', '', $user->rights->accounting->fiscalyear);
$title = $langs->trans('AccountingPeriods');
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $addbutton, '', $limit, 1);

View File

@@ -18,7 +18,7 @@
/**
* \file htdocs/accountancy/admin/fiscalyear_card.php
* \ingroup Advanced accountancy
* \ingroup Accountancy (Double entries)
* \brief Page to show a fiscal year
*/

View File

@@ -12,12 +12,12 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, seehttp://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/accountancy/admin/fiscalyear_info.php
* \ingroup Advanced accountancy
* \ingroup Accountancy (Double entries)
* \brief Page to show info of a fiscal year
*/

View File

@@ -24,7 +24,7 @@
/**
* \file htdocs/accountancy/admin/index.php
* \ingroup Advanced accountancy
* \ingroup Accountancy (Double entries)
* \brief Setup page to configure accounting expert module
*/
@@ -214,11 +214,11 @@ if (! empty($user->admin))
print '<tr class="oddeven">';
print '<td>' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . '</td>';
if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) {
print '<td class="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setlistsorttodo&value=0">';
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setlistsorttodo&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>';
} else {
print '<td class="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setlistsorttodo&value=1">';
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setlistsorttodo&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>';
}
@@ -227,11 +227,11 @@ if (! empty($user->admin))
print '<tr class="oddeven">';
print '<td>' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE") . '</td>';
if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
print '<td class="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setlistsortdone&value=0">';
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setlistsortdone&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>';
} else {
print '<td class="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setlistsortdone&value=1">';
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setlistsortdone&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>';
}
@@ -240,11 +240,11 @@ if (! empty($user->admin))
print '<tr class="oddeven">';
print '<td>' . $langs->trans("ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL") . '</td>';
if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) {
print '<td class="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setenabledraftexport&value=0">';
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setenabledraftexport&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>';
} else {
print '<td class="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setenabledraftexport&value=1">';
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setenabledraftexport&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>';
}
@@ -253,11 +253,11 @@ if (! empty($user->admin))
print '<tr class="oddeven">';
print '<td>' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . '</td>';
if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
print '<td class="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=0">';
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>';
} else {
print '<td class="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=1">';
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>';
}
@@ -266,11 +266,11 @@ if (! empty($user->admin))
print '<tr class="oddeven">';
print '<td>' . $langs->trans("ACCOUNTANCY_COMBO_FOR_AUX") . '</td>';
if (! empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
print '<td class="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setenablesubsidiarylist&value=0">';
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setenablesubsidiarylist&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>';
} else {
print '<td class="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setenablesubsidiarylist&value=1">';
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setenablesubsidiarylist&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>';
}
@@ -279,11 +279,11 @@ if (! empty($user->admin))
print '<tr class="oddeven">';
print '<td>' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . '</td>';
if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
print '<td class="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setmanagezero&value=0">';
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setmanagezero&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>';
} else {
print '<td class="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setmanagezero&value=1">';
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setmanagezero&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>';
}

View File

@@ -18,7 +18,7 @@
/**
* \file htdocs/accountancy/admin/journals_list.php
* \ingroup Advanced accountancy
* \ingroup Accountancy (Double entries)
* \brief Setup page to configure journals
*/
@@ -162,7 +162,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
{
if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey='Label';
if ($fieldnamekey == 'code') $fieldnamekey = 'Code';
if ($fieldnamekey == 'nature') $fieldnamekey = 'Nature';
if ($fieldnamekey == 'nature') $fieldnamekey = 'NatureOfJournal';
}
// Other checks
if (isset($_POST["code"]))
@@ -437,7 +437,7 @@ if ($id)
$valuetoshow=$langs->trans("Label");
}
if ($fieldlist[$field]=='nature') {
$valuetoshow=$langs->trans("Nature");
$valuetoshow=$langs->trans("NatureOfJournal");
}
if ($valuetoshow != '') {
@@ -516,7 +516,7 @@ if ($id)
}
// Title line with search boxes
print '<tr class="liste_titre_filter liste_titre_add">';
/*print '<tr class="liste_titre_filter liste_titre_add">';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
@@ -524,16 +524,14 @@ if ($id)
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre center">';
if ($filterfound)
{
$searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto;
}
$searchpicto=$form->showFilterButtons();
print $searchpicto;
print '</td>';
print '</tr>';
*/
// Title of lines
print '<tr class="liste_titre">';
print '<tr class="liste_titre liste_titre_add">';
foreach ($fieldlist as $field => $value)
{
// Determine le nom du champ par rapport aux noms possibles
@@ -558,7 +556,7 @@ if ($id)
$valuetoshow=$langs->trans("Label");
}
if ($fieldlist[$field]=='nature') {
$valuetoshow=$langs->trans("Nature");
$valuetoshow=$langs->trans("NatureOfJournal");
}
// Affiche nom du champ

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
@@ -21,7 +21,7 @@
/**
* \file htdocs/accountancy/admin/productaccount.php
* \ingroup Advanced accountancy
* \ingroup Accountancy (Double entries)
* \brief To define accounting account on product / service
*/
require '../../main.inc.php';
@@ -111,6 +111,8 @@ if ($action == 'update') {
$accounting_product_modes = array (
'ACCOUNTANCY_SELL',
'ACCOUNTANCY_SELL_INTRA',
'ACCOUNTANCY_SELL_EXPORT',
'ACCOUNTANCY_BUY'
);
@@ -158,6 +160,12 @@ if ($action == 'update') {
if ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
$sql .= " SET accountancy_code_sell = " . $accounting->account_number;
}
if ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
$sql .= " SET accountancy_code_sell_intra = " . $accounting->account_number;
}
if ($accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') {
$sql .= " SET accountancy_code_sell_export = " . $accounting->account_number;
}
$sql .= " WHERE rowid = " . $productid;
dol_syslog("/accountancy/admin/productaccount.php sql=" . $sql, LOG_DEBUG);
@@ -192,16 +200,20 @@ $form = new FormAccounting($db);
// at this time ACCOUNTING_SERVICE_SOLD_ACCOUNT & ACCOUNTING_PRODUCT_SOLD_ACCOUNT are account number not accountingacount rowid
// so we need to get those default value rowid first
$accounting = new AccountingAccount($db);
// TODO: we should need to check if result is a really exist accountaccount rowid.....
$aarowid_servbuy = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT, 1);
$aarowid_prodbuy = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT, 1);
$aarowid_servsell = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT, 1);
$aarowid_prodsell = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT, 1);
// TODO: we should need to check if result is already exists accountaccount rowid.....
$aarowid_servbuy = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT, 1);
$aarowid_prodbuy = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT, 1);
$aarowid_servsell = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT, 1);
$aarowid_prodsell = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT, 1);
$aarowid_prodsell_intra = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT, 1);
$aarowid_prodsell_export = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT, 1);
$aacompta_servbuy = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
$aacompta_prodbuy = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
$aacompta_servsell = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
$aacompta_prodsell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
$aacompta_servbuy = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
$aacompta_prodbuy = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
$aacompta_servsell = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
$aacompta_prodsell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
$aacompta_prodsell_intra = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT : $langs->trans("CodeNotDef"));
$aacompta_prodsell_export = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT : $langs->trans("CodeNotDef"));
llxHeader('', $langs->trans("ProductsBinding"));
@@ -209,27 +221,45 @@ $pcgverid = $conf->global->CHARTOFACCOUNTS;
$pcgvercode = dol_getIdFromCode($db, $pcgverid, 'accounting_system', 'rowid', 'pcg_version');
if (empty($pcgvercode)) $pcgvercode=$pcgverid;
$sql = "SELECT p.rowid, p.ref, p.label, p.description, p.tosell, p.tobuy, p.accountancy_code_sell, p.accountancy_code_buy, p.tms, p.fk_product_type as product_type,";
$sql = "SELECT p.rowid, p.ref, p.label, p.description, p.tosell, p.tobuy, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy, p.tms, p.fk_product_type as product_type,";
$sql.= " aa.rowid as aaid";
$sql.= " FROM " . MAIN_DB_PREFIX . "product as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON";
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
$sql.=" p.accountancy_code_buy = aa.account_number AND aa.fk_pcg_version = '" . $pcgvercode . "'";
}
else
elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL')
{
$sql.=" p.accountancy_code_sell = aa.account_number AND aa.fk_pcg_version = '" . $pcgvercode . "'";
}
elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA')
{
$sql.=" p.accountancy_code_sell_intra = aa.account_number AND aa.fk_pcg_version = '" . $pcgvercode . "'";
}
else
{
$sql.=" p.accountancy_code_sell_intra = aa.account_number AND aa.fk_pcg_version = '" . $pcgvercode . "'";
}
$sql.= ' WHERE p.entity IN ('.getEntity('product').')';
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
if (strlen(trim($search_current_account))) {
$sql .= natural_search("p.accountancy_code_buy", $search_current_account);
}
} else {
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
if (strlen(trim($search_current_account))) {
$sql .= natural_search("p.accountancy_code_sell", $search_current_account);
}
}
elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
if (strlen(trim($search_current_account))) {
$sql .= natural_search("p.accountancy_code_sell_intra", $search_current_account);
}
}
else {
if (strlen(trim($search_current_account))) {
$sql .= natural_search("p.accountancy_code_sell_export", $search_current_account);
}
}
if ($search_current_account_valid == 'withoutvalidaccount')
{
$sql .= " AND aa.account_number IS NULL";
@@ -280,7 +310,7 @@ if ($result)
if ($search_current_account > 0) $param.="&search_current_account=".urlencode($search_current_account);
if ($search_current_account_valid && $search_current_account_valid != '-1') $param.="&search_current_account_valid=".urlencode($search_current_account_valid);
if ($accounting_product_mode) $param.='&accounting_product_mode='.urlencode($accounting_product_mode);
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@@ -293,7 +323,7 @@ if ($result)
print load_fiche_titre($langs->trans("ProductsBinding"), '', 'title_accountancy');
print '<br>';
print $langs->trans("InitAccountancyDesc") . '<br>';
print '<span class="opacitymedium">'.$langs->trans("InitAccountancyDesc") . '</span><br>';
print '<br>';
// Select mode
@@ -301,9 +331,18 @@ 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_BUY' ? ' checked' : '') . '> ' . $langs->trans('OptionModeProductSell') . '</td>';
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 '<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 '<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 '<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 '<td>'.$langs->trans('OptionModeProductBuyDesc')."</td></tr>\n";
print "</table>\n";
@@ -318,9 +357,9 @@ if ($result)
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
$buttonsave = '<input type="submit" class="button" id="changeaccount" name="changeaccount" value="' . $langs->trans("Save") . '">';
//print '<br><div class="center">'.$buttonsave.'</div>';
$buttonsave = '<input type="submit" class="button" id="changeaccount" name="changeaccount" value="' . $langs->trans("Save") . '">';
//print '<br><div class="center">'.$buttonsave.'</div>';
$texte=$langs->trans("ListOfProductsServices");
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $buttonsave, $num, $nbtotalofrecords, '', 0, '', '', $limit);
@@ -332,7 +371,7 @@ if ($result)
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
// On sell
if ($accounting_product_mode == 'ACCOUNTANCY_SELL') print '<td class="liste_titre"></td>';
if ($accounting_product_mode == 'ACCOUNTANCY_SELL' || $accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') print '<td class="liste_titre"></td>';
// On buy
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') print '<td class="liste_titre"></td>';
// Current account
@@ -352,10 +391,19 @@ if ($result)
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "p.description", "", $param, '', $sortfield, $sortorder);
if ($accounting_product_mode == 'ACCOUNTANCY_SELL') print_liste_field_titre("OnSell", $_SERVER["PHP_SELF"], "p.tosell", "", $param, '', $sortfield, $sortorder, 'center ');
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') print_liste_field_titre("OnBuy", $_SERVER["PHP_SELF"], "p.tobuy", "", $param, '', $sortfield, $sortorder, 'center ');
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') $fieldtosortaccount="p.accountancy_code_buy";
else $fieldtosortaccount="p.accountancy_code_sell";
if ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
print_liste_field_titre("OnSell", $_SERVER["PHP_SELF"], "p.tosell", "", $param, '', $sortfield, $sortorder, 'center ');
$fieldtosortaccount="p.accountancy_code_sell";
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
print_liste_field_titre("OnSell", $_SERVER["PHP_SELF"], "p.tosell", "", $param, '', $sortfield, $sortorder, 'center ');
$fieldtosortaccount="p.accountancy_code_sell_intra";
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') {
print_liste_field_titre("OnSell", $_SERVER["PHP_SELF"], "p.tosell", "", $param, '', $sortfield, $sortorder, 'center ');
$fieldtosortaccount="p.accountancy_code_sell_export";
} else {
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') print_liste_field_titre("OnBuy", $_SERVER["PHP_SELF"], "p.tobuy", "", $param, '', $sortfield, $sortorder, 'center ');
$fieldtosortaccount="p.accountancy_code_buy";
}
print_liste_field_titre("CurrentDedicatedAccountingAccount", $_SERVER["PHP_SELF"], $fieldtosortaccount, "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("AssignDedicatedAccountingAccount");
$clickpitco=$form->showCheckAddButtons('checkforselect', 1);
@@ -378,10 +426,16 @@ if ($result)
$product_static->status = $obj->tosell;
$product_static->status_buy = $obj->tobuy;
if ($obj->product_type == 0) {
if ($obj->product_type == 0 && $accounting_product_mode == 'ACCOUNTANCY_SELL') {
$compta_prodsell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
$compta_prodsell_id = $aarowid_prodsell;
} else {
} elseif ($obj->product_type == 0 && $accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
$compta_prodsell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT : $langs->trans("CodeNotDef"));
$compta_prodsell_id = $aarowid_prodsell_intra;
} elseif ($obj->product_type == 0 && $accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') {
$compta_prodsell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT : $langs->trans("CodeNotDef"));
$compta_prodsell_id = $aarowid_prodsell_export;
} else {
$compta_prodsell = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
$compta_prodsell_id = $aarowid_servsell;
}
@@ -408,10 +462,10 @@ if ($result)
// print '<td class="left">' . $obj->description . '</td>';
// TODO: we shoul set a user defined value to adjust user square / wide screen size
$trunclengh = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
print '<td style="' . $code_sell_p_l_differ . '">' . nl2br(dol_trunc($obj->description, $trunclengh)) . '</td>';
print '<td>' . nl2br(dol_trunc($obj->description, $trunclengh)) . '</td>';
}
if ($accounting_product_mode == 'ACCOUNTANCY_SELL')
if ($accounting_product_mode == 'ACCOUNTANCY_SELL' || $accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT')
print '<td class="center">'.$product_static->getLibStatut(3, 0).'</td>';
if ($accounting_product_mode == 'ACCOUNTANCY_BUY')
@@ -422,12 +476,16 @@ if ($result)
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
print length_accountg($obj->accountancy_code_buy);
if ($obj->accountancy_code_buy && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
}
else
{
print length_accountg($obj->accountancy_code_sell);
if ($obj->accountancy_code_sell && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
}
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
print length_accountg($obj->accountancy_code_sell);
if ($obj->accountancy_code_sell && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
print length_accountg($obj->accountancy_code_sell_intra);
if ($obj->accountancy_code_sell_intra && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
} else {
print length_accountg($obj->accountancy_code_sell_export);
if ($obj->accountancy_code_sell_export && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
}
print '</td>';
// Dedicated account
@@ -441,7 +499,7 @@ if ($result)
if (! empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
print $form->select_account($defaultvalue, 'codeventil_' . $product_static->id, 1, array(), 1);
print '</td>';
} else {
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
// Accounting account sell
print '<td class="left">';
//$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code
@@ -451,7 +509,26 @@ if ($result)
if (! empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
print $form->select_account($defaultvalue, 'codeventil_' . $product_static->id, 1, array(), 1);
print '</td>';
}
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
// Accounting account sell intra (In EEC)
print '<td class="left">';
//$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code
if (empty($defaultvalue)) $defaultvalue=$compta_prodsell;
$codesell=length_accountg($obj->accountancy_code_sell_intra);
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
if (! empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
print $form->select_account($defaultvalue, 'codeventil_' . $product_static->id, 1, array(), 1);
print '</td>';
} else {
// Accounting account sell export (Out of EEC)
print '<td class="left">';
//$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code
if (empty($defaultvalue)) $defaultvalue=$compta_prodsell;
$codesell=length_accountg($obj->accountancy_code_sell_export);
if (! empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
print $form->select_account($defaultvalue, 'codeventil_' . $product_static->id, 1, array(), 1);
print '</td>';
}
// Checkbox select
print '<td class="center">';
@@ -462,7 +539,6 @@ if ($result)
print '</table>';
print '</div>';
// Example : Adding jquery code
print '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
function init_savebutton()

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2016-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,7 @@
/**
* \file htdocs/accountancy/bookkeeping/balance.php
* \ingroup Advanced accountancy
* \ingroup Accountancy (Double entries)
* \brief Balance of book keeping
*/
@@ -164,7 +164,7 @@ if ($action == 'export_csv')
print $object->get_compte_desc($line->numero_compte) . $sep;
print price($line->debit) . $sep;
print price($line->credit) . $sep;
print price($line->credit - $line->debit) . $sep;
print price($line->debit - $line->credit) . $sep;
print "\n";
}
@@ -293,9 +293,9 @@ if ($action != 'export_csv')
print '<td>' . length_accountg($line->numero_compte) . '</td>';
print '<td>' . $description . '</td>';
print '<td class="right">' . price($line->debit) . '</td>';
print '<td class="right">' . price($line->credit) . '</td>';
print '<td class="right">' . price($line->credit - $line->debit) . '</td>';
print '<td class="nowraponall right">' . price($line->debit) . '</td>';
print '<td class="nowraponall right">' . price($line->credit) . '</td>';
print '<td class="nowraponall right">' . price($line->debit - $line->credit) . '</td>';
print '<td class="center">' . $link;
print '</td>';
print "</tr>\n";
@@ -305,11 +305,11 @@ if ($action != 'export_csv')
$sous_total_credit += $line->credit;
}
print '<tr class="liste_total"><td class="right" colspan="2">' . $langs->trans("SubTotal") . ':</td><td class="nowrap right">' . price($sous_total_debit) . '</td><td class="nowrap right">' . price($sous_total_credit) . '</td><td class="nowrap right">' . price(price2num($sous_total_credit - $sous_total_debit)) . '</td>';
print '<tr class="liste_total"><td class="right" colspan="2">' . $langs->trans("SubTotal") . ':</td><td class="nowrap right">' . price($sous_total_debit) . '</td><td class="nowrap right">' . price($sous_total_credit) . '</td><td class="nowrap right">' . price(price2num($sous_total_debit - $sous_total_credit)) . '</td>';
print "<td>&nbsp;</td>\n";
print '</tr>';
print '<tr class="liste_total"><td class="right" colspan="2">' . $langs->trans("AccountBalance") . ':</td><td class="nowrap right">' . price($total_debit) . '</td><td class="nowrap right">' . price($total_credit) . '</td><td class="nowrap right">' . price(price2num($total_credit - $total_debit)) . '</td>';
print '<tr class="liste_total"><td class="right" colspan="2">' . $langs->trans("AccountBalance") . ':</td><td class="nowrap right">' . price($total_debit) . '</td><td class="nowrap right">' . price($total_credit) . '</td><td class="nowrap right">' . price(price2num($total_debit - $total_credit)) . '</td>';
print "<td>&nbsp;</td>\n";
print '</tr>';

View File

@@ -21,7 +21,7 @@
/**
* \file htdocs/accountancy/bookkeeping/balancebymonth.php
* \ingroup Advanced accountancy
* \ingroup Accountancy (Double entries)
* \brief Balance by month
*/
require '../../main.inc.php';
@@ -73,19 +73,11 @@ $y = $year_current;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td width=150>' . $langs->trans("Label") . '</td>';
print '<td class="center">' . $langs->trans("JanuaryMin") . '</td>';
print '<td class="center">' . $langs->trans("FebruaryMin") . '</td>';
print '<td class="center">' . $langs->trans("MarchMin") . '</td>';
print '<td class="center">' . $langs->trans("AprilMin") . '</td>';
print '<td class="center">' . $langs->trans("MayMin") . '</td>';
print '<td class="center">' . $langs->trans("JuneMin") . '</td>';
print '<td class="center">' . $langs->trans("JulyMin") . '</td>';
print '<td class="center">' . $langs->trans("AugustMin") . '</td>';
print '<td class="center">' . $langs->trans("SeptemberMin") . '</td>';
print '<td class="center">' . $langs->trans("OctoberMin") . '</td>';
print '<td class="center">' . $langs->trans("NovemberMin") . '</td>';
print '<td class="center">' . $langs->trans("DecemberMin") . '</td>';
print '<td class="center"><strong>Total</strong></td>';
for($i = 1; $i <= 12; $i++)
{
print '<td class="right">' . $langs->trans("MonthShort".sprintf("%02s", $i)) . '</td>';
}
print '<td class="center"><strong>'.$langs->trans("Total").'</strong></td>';
print '</tr>';
$sql = "SELECT bk.numero_compte AS 'compte',";

View File

@@ -21,7 +21,7 @@
/**
* \file htdocs/accountancy/bookkeeping/card.php
* \ingroup Advanced accountancy
* \ingroup Accountancy (Double entries)
* \brief Page to show book-entry
*/
@@ -38,6 +38,7 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php
$langs->loadLangs(array("accountancy", "bills", "compta"));
$action = GETPOST('action', 'aZ09');
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
$id = GETPOST('id', 'int'); // id of record
$mode = GETPOST('mode', 'aZ09'); // '' or 'tmp'
@@ -346,6 +347,8 @@ if ($action == 'create')
}
print '<form action="' . $_SERVER["PHP_SELF"] . '" name="create_mvt" method="POST">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="confirm_create">' . "\n";
print '<input type="hidden" name="next_num_mvt" value="' . $next_num_mvt . '">' . "\n";
print '<input type="hidden" name="mode" value="_tmp">' . "\n";
@@ -373,7 +376,7 @@ if ($action == 'create')
print '<tr>';
print '<td>' . $langs->trans("Piece") . '</td>';
print '<td><input type="text" class="minwidth200" name="doc_ref" value=""/></td>';
print '<td><input type="text" class="minwidth200" name="doc_ref" value="'.GETPOST('doc_ref', 'alpha').'"></td>';
print '</tr>';
/*
@@ -441,7 +444,8 @@ if ($action == 'create')
print '</td><td colspan="3">';
if ($action == 'editdate') {
print '<form name="setdate" action="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $object->piece_num . '" method="post">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="setdate">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
print $form->selectDate($object->doc_date ? $object->doc_date : - 1, 'doc_date', '', '', '', "setdate");
@@ -464,7 +468,8 @@ if ($action == 'create')
print '</td><td>';
if ($action == 'editjournal') {
print '<form name="setjournal" action="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $object->piece_num . '" method="post">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="setjournal">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
print $formaccounting->select_journal($object->code_journal, 'code_journal', 0, 0, array(), 1, 1);
@@ -487,7 +492,8 @@ if ($action == 'create')
print '</td><td>';
if ($action == 'editdocref') {
print '<form name="setdocref" action="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $object->piece_num . '" method="post">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="setdocref">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
print '<input type="text" size="20" name="doc_ref" value="'.dol_escape_htmltag($object->doc_ref).'">';
@@ -531,11 +537,11 @@ if ($action == 'create')
print '<td class="titlefield">' . $langs->trans("Status") . '</td>';
print '<td>';
if (empty($object->validated)) {
print '<a href="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $line->rowid . '&action=enable">';
print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $line->rowid . '&action=enable">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>';
} else {
print '<a href="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $line->rowid . '&action=disable">';
print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $line->rowid . '&action=disable">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a>';
}
@@ -583,6 +589,8 @@ if ($action == 'create')
print load_fiche_titre($langs->trans("ListeMvts"), '', '');
print '<form action="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $object->piece_num . '" method="post">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="doc_date" value="' . $object->doc_date . '">' . "\n";
print '<input type="hidden" name="doc_type" value="' . $object->doc_type . '">' . "\n";
print '<input type="hidden" name="doc_ref" value="' . $object->doc_ref . '">' . "\n";
@@ -615,23 +623,23 @@ if ($action == 'create')
if ($action == 'update' && $line->id == $id) {
print '<td>';
print $formaccounting->select_account($line->numero_compte, 'accountingaccount_number', 1, array (), 1, 1, '');
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))
{
print $formaccounting->select_auxaccount($line->subledger_account, 'subledger_account', 1);
print $formaccounting->select_auxaccount((GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account), 'subledger_account', 1);
}
else
{
print '<input type="text" name="subledger_account" value="'.$line->subledger_account.'">';
print '<input type="text" class="maxwidth150" name="subledger_account" value="'.(GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account).'">';
}
print '</td>';
print '<td><input type="text" class="minwidth200" name="label_operation" value="' . $line->label_operation. '"/></td>';
print '<td class="right"><input type="text" size="6" class="right" name="debit" value="' . price($line->debit) . '"/></td>';
print '<td class="right"><input type="text" size="6" class="right" name="credit" value="' . price($line->credit) . '"/></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>';
print '<td class="right"><input type="text" size="6" class="right" name="credit" value="' . (GETPOSTISSET("credit") ? GETPOST("credit", "alpha") : price($line->credit)) . '"></td>';
print '<td>';
print '<input type="hidden" name="id" value="' . $line->id . '">' . "\n";
print '<input type="submit" class="button" name="update" value="' . $langs->trans("Update") . '">';
@@ -641,8 +649,8 @@ if ($action == 'create')
print '<td>' . $accountingaccount->getNomUrl(0, 1, 1, '', 0) . '</td>';
print '<td>' . length_accounta($line->subledger_account) . '</td>';
print '<td>' . $line->label_operation. '</td>';
print '<td class="right">' . price($line->debit) . '</td>';
print '<td class="right">' . price($line->credit) . '</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 href="' . $_SERVER["PHP_SELF"] . '?action=update&id=' . $line->id . '&piece_num=' . $line->piece_num . '&mode='.$mode.'">';
@@ -672,21 +680,21 @@ if ($action == 'create')
if ($action == "" || $action == 'add') {
print '<tr class="oddeven">';
print '<td>';
print $formaccounting->select_account($accountingaccount_number, 'accountingaccount_number', 1, array (), 1, 1, '');
print $formaccounting->select_account('', 'accountingaccount_number', 1, array (), 1, 1, '');
print '</td>';
print '<td>';
// TODO For the moment we keep a fre input text instead of a combo. The select_auxaccount has problem because it does not
// TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because it does not
// use setup of keypress to select thirdparty and this hang browser on large database.
if (! empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX))
{
print $formaccounting->select_auxaccount($subledger_account, 'subledger_account', 1);
print $formaccounting->select_auxaccount('', 'subledger_account', 1);
}
else
{
print '<input type="text" name="subledger_account" value="">';
print '<input type="text" class="maxwidth150" name="subledger_account" value="">';
}
print '</td>';
print '<td><input type="text" class="minwidth200" name="label_operation" value=""/></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>';
print '<td class="right"><input type="text" size="6" class="right" name="credit" value=""/></td>';
print '<td><input type="submit" class="button" name="save" value="' . $langs->trans("Add") . '"></td>';

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
@@ -21,7 +21,7 @@
/**
* \file htdocs/accountancy/bookkeeping/list.php
* \ingroup Advanced accountancy
* \ingroup Accountancy (Double entries)
* \brief List operation of book keeping
*/
require '../../main.inc.php';
@@ -32,10 +32,13 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("accountancy"));
$socid = GETPOST('socid', 'int');
$action = GETPOST('action', 'aZ09');
$search_mvt_num = GETPOST('search_mvt_num', 'int');
$search_doc_type = GETPOST("search_doc_type", 'alpha');
@@ -47,6 +50,9 @@ $search_date_creation_start = dol_mktime(0, 0, 0, GETPOST('date_creation_startmo
$search_date_creation_end = dol_mktime(0, 0, 0, GETPOST('date_creation_endmonth', 'int'), GETPOST('date_creation_endday', 'int'), GETPOST('date_creation_endyear', 'int'));
$search_date_modification_start = dol_mktime(0, 0, 0, GETPOST('date_modification_startmonth', 'int'), GETPOST('date_modification_startday', 'int'), GETPOST('date_modification_startyear', 'int'));
$search_date_modification_end = dol_mktime(0, 0, 0, GETPOST('date_modification_endmonth', 'int'), GETPOST('date_modification_endday', 'int'), GETPOST('date_modification_endyear', 'int'));
$search_date_export_start = dol_mktime(0, 0, 0, GETPOST('date_export_startmonth', 'int'), GETPOST('date_export_startday', 'int'), GETPOST('date_export_startyear', 'int'));
$search_date_export_end = dol_mktime(0, 0, 0, GETPOST('date_export_endmonth', 'int'), GETPOST('date_export_endday', 'int'), GETPOST('date_export_endyear', 'int'));
//var_dump($search_date_start);exit;
if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) {
$action = 'delbookkeepingyear';
@@ -93,14 +99,15 @@ $pagenext = $page + 1;
if ($sortorder == "") $sortorder = "ASC";
if ($sortfield == "") $sortfield = "t.piece_num,t.rowid";
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$object = new BookKeeping($db);
$hookmanager->initHooks(array('bookkeepinglist'));
$formaccounting = new FormAccounting($db);
$formother = new FormOther($db);
$form = new Form($db);
if (! in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && ! isset($_POST['begin']) && ! isset($_GET['begin']) && ! isset($_POST['formfilteraction']) && GETPOST('page', 'int') == '' && ! GETPOST('noreset', 'int'))
if (! in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && ! isset($_POST['begin']) && ! isset($_GET['begin']) && ! isset($_POST['formfilteraction']) && GETPOST('page', 'int') == '' && ! GETPOST('noreset', 'int') && $user->rights->accounting->mouvements->export)
{
if (empty($search_date_start) && empty($search_date_end) && ! GETPOSTISSET('restore_lastsearch_values'))
{
@@ -143,6 +150,7 @@ $arrayfields=array(
'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),
);
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.lettering_code']);
@@ -155,135 +163,153 @@ if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.let
if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; }
if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
$parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
if (empty($reshook))
{
$search_mvt_num = '';
$search_doc_type = '';
$search_doc_ref = '';
$search_doc_date = '';
$search_accountancy_code = '';
$search_accountancy_code_start = '';
$search_accountancy_code_end = '';
$search_accountancy_aux_code = '';
$search_accountancy_aux_code_start = '';
$search_accountancy_aux_code_end = '';
$search_mvt_label = '';
$search_direction = '';
$search_ledger_code = '';
$search_date_start = '';
$search_date_end = '';
$search_date_creation_start = '';
$search_date_creation_end = '';
$search_date_modification_start = '';
$search_date_modification_end = '';
$search_debit = '';
$search_credit = '';
$search_lettering_code = '';
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
{
$search_mvt_num = '';
$search_doc_type = '';
$search_doc_ref = '';
$search_doc_date = '';
$search_accountancy_code = '';
$search_accountancy_code_start = '';
$search_accountancy_code_end = '';
$search_accountancy_aux_code = '';
$search_accountancy_aux_code_start = '';
$search_accountancy_aux_code_end = '';
$search_mvt_label = '';
$search_direction = '';
$search_ledger_code = '';
$search_date_start = '';
$search_date_end = '';
$search_date_creation_start = '';
$search_date_creation_end = '';
$search_date_modification_start = '';
$search_date_modification_end = '';
$search_date_export_start = '';
$search_date_export_end = '';
$search_debit = '';
$search_credit = '';
$search_lettering_code = '';
}
// Must be after the remove filter action, before the export.
$param = '';
$filter = array ();
if (! empty($search_date_start)) {
$filter['t.doc_date>='] = $search_date_start;
$tmp=dol_getdate($search_date_start);
$param .= '&search_date_startmonth=' . $tmp['mon'] . '&search_date_startday=' . $tmp['mday'] . '&search_date_startyear=' . $tmp['year'];
}
if (! empty($search_date_end)) {
$filter['t.doc_date<='] = $search_date_end;
$tmp=dol_getdate($search_date_end);
$param .= '&search_date_endmonth=' . $tmp['mon'] . '&search_date_endday=' . $tmp['mday'] . '&search_date_endyear=' . $tmp['year'];
}
if (! empty($search_doc_date)) {
$filter['t.doc_date'] = $search_doc_date;
$tmp=dol_getdate($search_doc_date);
$param .= '&doc_datemonth=' . $tmp['mon'] . '&doc_dateday=' . $tmp['mday'] . '&doc_dateyear=' . $tmp['year'];
}
if (! empty($search_doc_type)) {
$filter['t.doc_type'] = $search_doc_type;
$param .= '&search_doc_type=' . urlencode($search_doc_type);
}
if (! empty($search_doc_ref)) {
$filter['t.doc_ref'] = $search_doc_ref;
$param .= '&search_doc_ref=' . urlencode($search_doc_ref);
}
if (! empty($search_accountancy_code)) {
$filter['t.numero_compte'] = $search_accountancy_code;
$param .= '&search_accountancy_code=' . urlencode($search_accountancy_code);
}
if (! empty($search_accountancy_code_start)) {
$filter['t.numero_compte>='] = $search_accountancy_code_start;
$param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start);
}
if (! empty($search_accountancy_code_end)) {
$filter['t.numero_compte<='] = $search_accountancy_code_end;
$param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end);
}
if (! empty($search_accountancy_aux_code)) {
$filter['t.subledger_account'] = $search_accountancy_aux_code;
$param .= '&search_accountancy_aux_code=' . urlencode($search_accountancy_aux_code);
}
if (! empty($search_accountancy_aux_code_start)) {
$filter['t.subledger_account>='] = $search_accountancy_aux_code_start;
$param .= '&search_accountancy_aux_code_start=' . urlencode($search_accountancy_aux_code_start);
}
if (! empty($search_accountancy_aux_code_end)) {
$filter['t.subledger_account<='] = $search_accountancy_aux_code_end;
$param .= '&search_accountancy_aux_code_end=' . urlencode($search_accountancy_aux_code_end);
}
if (! empty($search_mvt_label)) {
$filter['t.label_operation'] = $search_mvt_label;
$param .= '&search_mvt_label=' . urlencode($search_mvt_label);
}
if (! empty($search_direction)) {
$filter['t.sens'] = $search_direction;
$param .= '&search_direction=' . urlencode($search_direction);
}
if (! empty($search_ledger_code)) {
$filter['t.code_journal'] = $search_ledger_code;
$param .= '&search_ledger_code=' . urlencode($search_ledger_code);
}
if (! empty($search_mvt_num)) {
$filter['t.piece_num'] = $search_mvt_num;
$param .= '&search_mvt_num=' . urlencode($search_mvt_num);
}
if (! empty($search_date_creation_start)) {
$filter['t.date_creation>='] = $search_date_creation_start;
$tmp=dol_getdate($search_date_creation_start);
$param .= '&date_creation_startmonth=' . $tmp['mon'] . '&date_creation_startday=' . $tmp['mday'] . '&date_creation_startyear=' . $tmp['year'];
}
if (! empty($search_date_creation_end)) {
$filter['t.date_creation<='] = $search_date_creation_end;
$tmp=dol_getdate($search_date_creation_end);
$param .= '&date_creation_endmonth=' . $tmp['mon'] . '&date_creation_endday=' . $tmp['mday'] . '&date_creation_endyear=' . $tmp['year'];
}
if (! empty($search_date_modification_start)) {
$filter['t.tms>='] = $search_date_modification_start;
$tmp=dol_getdate($search_date_modification_start);
$param .= '&date_modification_startmonth=' . $tmp['mon'] . '&date_modification_startday=' . $tmp['mday'] . '&date_modification_startyear=' . $tmp['year'];
}
if (! empty($search_date_modification_end)) {
$filter['t.tms<='] = $search_date_modification_end;
$tmp=dol_getdate($search_date_modification_end);
$param .= '&date_modification_endmonth=' . $tmp['mon'] . '&date_modification_endday=' . $tmp['mday'] . '&date_modification_endyear=' . $tmp['year'];
}
if (! empty($search_date_export_start)) {
$filter['t.date_export>='] = $search_date_export_start;
$tmp=dol_getdate($search_date_export_start);
$param .= '&date_export_startmonth=' . $tmp['mon'] . '&date_export_startday=' . $tmp['mday'] . '&date_export_startyear=' . $tmp['year'];
}
if (! empty($search_date_export_end)) {
$filter['t.date_export<='] = $search_date_export_end;
$tmp=dol_getdate($search_date_export_end);
$param .= '&date_export_endmonth=' . $tmp['mon'] . '&date_export_endday=' . $tmp['mday'] . '&date_export_endyear=' . $tmp['year'];
}
if (! empty($search_debit)) {
$filter['t.debit'] = $search_debit;
$param .= '&search_debit=' . urlencode($search_debit);
}
if (! empty($search_credit)) {
$filter['t.credit'] = $search_credit;
$param .= '&search_credit=' . urlencode($search_credit);
}
if (! empty($search_lettering_code)) {
$filter['t.lettering_code'] = $search_lettering_code;
$param .= '&search_lettering_code=' . urlencode($search_lettering_code);
}
}
// Must be after the remove filter action, before the export.
$param = '';
$filter = array ();
if (! empty($search_date_start)) {
$filter['t.doc_date>='] = $search_date_start;
$tmp=dol_getdate($search_date_start);
$param .= '&search_date_startmonth=' . $tmp['mon'] . '&search_date_startday=' . $tmp['mday'] . '&search_date_startyear=' . $tmp['year'];
}
if (! empty($search_date_end)) {
$filter['t.doc_date<='] = $search_date_end;
$tmp=dol_getdate($search_date_end);
$param .= '&search_date_endmonth=' . $tmp['mon'] . '&search_date_endday=' . $tmp['mday'] . '&search_date_endyear=' . $tmp['year'];
}
if (! empty($search_doc_date)) {
$filter['t.doc_date'] = $search_doc_date;
$tmp=dol_getdate($search_doc_date);
$param .= '&doc_datemonth=' . $tmp['mon'] . '&doc_dateday=' . $tmp['mday'] . '&doc_dateyear=' . $tmp['year'];
}
if (! empty($search_doc_type)) {
$filter['t.doc_type'] = $search_doc_type;
$param .= '&search_doc_type=' . urlencode($search_doc_type);
}
if (! empty($search_doc_ref)) {
$filter['t.doc_ref'] = $search_doc_ref;
$param .= '&search_doc_ref=' . urlencode($search_doc_ref);
}
if (! empty($search_accountancy_code)) {
$filter['t.numero_compte'] = $search_accountancy_code;
$param .= '&search_accountancy_code=' . urlencode($search_accountancy_code);
}
if (! empty($search_accountancy_code_start)) {
$filter['t.numero_compte>='] = $search_accountancy_code_start;
$param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start);
}
if (! empty($search_accountancy_code_end)) {
$filter['t.numero_compte<='] = $search_accountancy_code_end;
$param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end);
}
if (! empty($search_accountancy_aux_code)) {
$filter['t.subledger_account'] = $search_accountancy_aux_code;
$param .= '&search_accountancy_aux_code=' . urlencode($search_accountancy_aux_code);
}
if (! empty($search_accountancy_aux_code_start)) {
$filter['t.subledger_account>='] = $search_accountancy_aux_code_start;
$param .= '&search_accountancy_aux_code_start=' . urlencode($search_accountancy_aux_code_start);
}
if (! empty($search_accountancy_aux_code_end)) {
$filter['t.subledger_account<='] = $search_accountancy_aux_code_end;
$param .= '&search_accountancy_aux_code_end=' . urlencode($search_accountancy_aux_code_end);
}
if (! empty($search_mvt_label)) {
$filter['t.label_operation'] = $search_mvt_label;
$param .= '&search_mvt_label=' . urlencode($search_mvt_label);
}
if (! empty($search_direction)) {
$filter['t.sens'] = $search_direction;
$param .= '&search_direction=' . urlencode($search_direction);
}
if (! empty($search_ledger_code)) {
$filter['t.code_journal'] = $search_ledger_code;
$param .= '&search_ledger_code=' . urlencode($search_ledger_code);
}
if (! empty($search_mvt_num)) {
$filter['t.piece_num'] = $search_mvt_num;
$param .= '&search_mvt_num=' . urlencode($search_mvt_num);
}
if (! empty($search_date_creation_start)) {
$filter['t.date_creation>='] = $search_date_creation_start;
$tmp=dol_getdate($search_date_creation_start);
$param .= '&date_creation_startmonth=' . $tmp['mon'] . '&date_creation_startday=' . $tmp['mday'] . '&date_creation_startyear=' . $tmp['year'];
}
if (! empty($search_date_creation_end)) {
$filter['t.date_creation<='] = $search_date_creation_end;
$tmp=dol_getdate($search_date_creation_end);
$param .= '&date_creation_endmonth=' . $tmp['mon'] . '&date_creation_endday=' . $tmp['mday'] . '&date_creation_endyear=' . $tmp['year'];
}
if (! empty($search_date_modification_start)) {
$filter['t.tms>='] = $search_date_modification_start;
$tmp=dol_getdate($search_date_modification_start);
$param .= '&date_modification_startmonth=' . $tmp['mon'] . '&date_modification_startday=' . $tmp['mday'] . '&date_modification_startyear=' . $tmp['year'];
}
if (! empty($search_date_modification_end)) {
$filter['t.tms<='] = $search_date_modification_end;
$tmp=dol_getdate($search_date_modification_end);
$param .= '&date_modification_endmonth=' . $tmp['mon'] . '&date_modification_endday=' . $tmp['mday'] . '&date_modification_endyear=' . $tmp['year'];
}
if (! empty($search_debit)) {
$filter['t.debit'] = $search_debit;
$param .= '&search_debit=' . urlencode($search_debit);
}
if (! empty($search_credit)) {
$filter['t.credit'] = $search_credit;
$param .= '&search_credit=' . urlencode($search_credit);
}
if (! empty($search_lettering_code)) {
$filter['t.lettering_code'] = $search_lettering_code;
$param .= '&search_lettering_code=' . urlencode($search_lettering_code);
}
if ($action == 'delbookkeeping') {
if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) {
$import_key = GETPOST('importkey', 'alpha');
@@ -292,11 +318,13 @@ if ($action == 'delbookkeeping') {
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
Header("Location: list.php");
exit();
// Make a redirect to avoid to launch the delete later after a back button
header("Location: list.php".($param?'?'.$param:''));
exit;
}
}
if ($action == 'delbookkeepingyearconfirm') {
if ($action == 'delbookkeepingyearconfirm' && $user->rights->accounting->mouvements->supprimer_tous) {
$delyear = GETPOST('delyear', 'int');
if ($delyear==-1) {
@@ -317,17 +345,17 @@ if ($action == 'delbookkeepingyearconfirm') {
{
setEventMessages("RecordDeleted", null, 'mesgs');
}
Header("Location: list.php");
// Make a redirect to avoid to launch the delete later after a back button
header("Location: list.php".($param?'?'.$param:''));
exit;
}
else
{
setEventMessages("NoRecordDeleted", null, 'warnings');
Header("Location: list.php");
exit;
}
}
if ($action == 'delmouvconfirm') {
if ($action == 'delmouvconfirm' && $user->rights->accounting->mouvements->supprimer) {
$mvt_num = GETPOST('mvt_num', 'int');
@@ -341,15 +369,15 @@ if ($action == 'delmouvconfirm') {
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
}
Header("Location: list.php?noreset=1".($param?'&'.$param:''));
header("Location: list.php?noreset=1".($param?'&'.$param:''));
exit;
}
}
// Export into a file with format defined into setup (FEC, CSV, ...)
if ($action == 'export_file') {
if ($action == 'export_file' && $user->rights->accounting->mouvements->export) {
$result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter);
$result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', $conf->global->ACCOUNTING_REEXPORT);
if ($result < 0)
{
@@ -357,17 +385,57 @@ if ($action == 'export_file') {
}
else
{
// Export files
$accountancyexport = new AccountancyExport($db);
$accountancyexport->export($object->lines);
if (!empty($accountancyexport->errors))
{
setEventMessages('', $accountancyexport->errors, 'errors');
}
if (! empty($accountancyexport->errors))
{
setEventMessages('', $accountancyexport->errors, 'errors');
} else {
// Specify as export : update field date_export
// TODO Move in class bookKeeping
$error=0;
$db->begin();
if (is_array($object->lines)) {
foreach ($object->lines as $movement) {
$now = dol_now();
$sql = " UPDATE " . MAIN_DB_PREFIX . "accounting_bookkeeping";
$sql .= " SET date_export = '" . $db->idate($now) . "'";
$sql .= " WHERE rowid = " . $movement->id;
dol_syslog("/accountancy/bookeeping/list.php Function export_file Specify movements as exported sql=" . $sql, LOG_DEBUG);
$result = $db->query($sql);
if ($result) {
$db->commit();
// setEventMessages($langs->trans("AllExportedMovementsWereRecordedAsExported"), null, 'mesgs');
} else {
$db->rollback();
// setEventMessages($langs->trans("NotAllExportedMovementsCouldBeRecordedAsExported"), null, 'errors');
}
}
}
}
exit;
}
}
if ($action == 'setreexport') {
$export = 0;
$setreexport = GETPOST('value', 'int');
if (! dolibarr_set_const($db, "ACCOUNTING_REEXPORT", $setreexport, 'yesno', 0, '', $conf->entity)) $error++;
if (! $error) {
if ($conf->global->ACCOUNTING_REEXPORT == 1) {
setEventMessages($langs->trans("ExportOfPiecesAlreadyExportedIsEnable"), null, 'mesgs');
} else {
setEventMessages($langs->trans("ExportOfPiecesAlreadyExportedIsDisable"), null, 'mesgs');
}
} else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
/*
* View
@@ -380,14 +448,14 @@ llxHeader('', $title_page);
// List
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter);
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', $conf->global->ACCOUNTING_REEXPORT);
if ($nbtotalofrecords < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
// TODO Do not use this
$result = $object->fetchAll($sortorder, $sortfield, $limit, $offset, $filter);
$result = $object->fetchAll($sortorder, $sortfield, $limit, $offset, $filter, 'AND', $conf->global->ACCOUNTING_REEXPORT);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
@@ -425,7 +493,7 @@ if ($action == 'delbookkeepingyear') {
'default' => $deljournal
);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1, 250);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1, 250);
print $formconfirm;
}
@@ -442,25 +510,37 @@ print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
$button .= '<a class="butAction" title="" name="button_export_file" href="'.$_SERVER["PHP_SELF"].'?action=export_file'.($param?'&'.$param:'').'">';
$listofformat=AccountancyExport::getType();
$button = '<a class="butAction" name="button_export_file" href="'.$_SERVER["PHP_SELF"].'?action=export_file'.($param?'&'.$param:'').'">';
if (count($filter)) $button.= $langs->trans("ExportFilteredList");
else $button.= $langs->trans("ExportList");
//$button.=' ('.$listofformat[$conf->global->ACCOUNTING_EXPORT_MODELCSV].')';
$button.= '</a>';
if (count($filter)) $buttonLabel = $langs->trans("ExportFilteredList");
else $buttonLabel = $langs->trans("ExportList");
// Button re-export
if (! empty($conf->global->ACCOUNTING_REEXPORT)) {
$newcardbutton ='<a href="'.$_SERVER['PHP_SELF'].'?action=setreexport&value=0'.($param?'&'.$param:'').'">'.img_picto($langs->trans("Activated"), 'switch_on').'</a> ';
} else {
$newcardbutton ='<a href="'.$_SERVER['PHP_SELF'].'?action=setreexport&value=1'.($param?'&'.$param:'').'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a> ';
}
$newcardbutton.= '<span class="valignmiddle marginrightonly">'.$langs->trans("IncludeDocsAlreadyExported").'</span>';
$groupby = ' <a class="nohover marginrightonly" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param.'">' . $langs->trans("GroupByAccountAccounting") . '</a>';
$newcardbutton = '<a class="butActionNew" href="./card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans("NewAccountingMvt").'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
$newcardbutton.= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$conf->global->ACCOUNTING_EXPORT_MODELCSV].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file'.($param?'&'.$param:''), $user->rights->accounting->mouvements->export);
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, $groupby.$newcardbutton, '', $limit);
$newcardbutton.= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param);
$newcardbutton.= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', './card.php?action=create', '', $user->rights->accounting->mouvements->creer);
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit);
$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);
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
else $moreforfilter = $hookmanager->resPrint;
print '<div class="div-table-responsive">';
print '<table class="tagtable liste" width="100%">';
@@ -518,7 +598,7 @@ if (! empty($arrayfields['t.subledger_account']['checked']))
}
else
{
print '<input type="text" name="search_accountancy_aux_code_start" value="'.$search_accountancy_aux_code_start.'">';
print '<input type="text" class="maxwidth100" name="search_accountancy_aux_code_start" value="'.$search_accountancy_aux_code_start.'">';
}
print '</div>';
print '<div class="nowrap">';
@@ -531,7 +611,7 @@ if (! empty($arrayfields['t.subledger_account']['checked']))
}
else
{
print '<input type="text" name="search_accountancy_aux_code_end" value="'.$search_accountancy_aux_code_end.'">';
print '<input type="text" class="maxwidth100" name="search_accountancy_aux_code_end" value="'.$search_accountancy_aux_code_end.'">';
}
print '</div>';
print '</td>';
@@ -569,6 +649,13 @@ if (! empty($arrayfields['t.code_journal']['checked']))
{
print '<td class="liste_titre center"><input type="text" name="search_ledger_code" size="3" value="' . $search_ledger_code . '"></td>';
}
// Fields from hook
$parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
if (! empty($arrayfields['t.date_creation']['checked']))
{
@@ -597,6 +684,20 @@ if (! empty($arrayfields['t.tms']['checked']))
print '</div>';
print '</td>';
}
// Date export
if (! empty($arrayfields['t.date_export']['checked']))
{
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $langs->trans('From') . ' ';
print $form->selectDate($search_date_export_start, 'date_export_start', 0, 0, 1);
print '</div>';
print '<div class="nowrap">';
print $langs->trans('to') . ' ';
print $form->selectDate($search_date_export_end, 'date_export_end', 0, 0, 1);
print '</div>';
print '</td>';
}
// Action column
print '<td class="liste_titre center">';
$searchpicto=$form->showFilterButtons();
@@ -615,8 +716,13 @@ if (! empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arr
if (! empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, '', $sortfield, $sortorder, 'right ');
if (! empty($arrayfields['t.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
print $hookmanager->resPrint;
if (! empty($arrayfields['t.date_creation']['checked'])) print_liste_field_titre($arrayfields['t.date_creation']['label'], $_SERVER['PHP_SELF'], "t.date_creation", "", $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['t.date_export']['checked'])) print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
print "</tr>\n";
@@ -683,7 +789,7 @@ if ($num > 0)
// Amount debit
if (! empty($arrayfields['t.debit']['checked']))
{
print '<td class="right">' . ($line->debit ? price($line->debit) : ''). '</td>';
print '<td class="nowrap right">' . ($line->debit ? price($line->debit) : ''). '</td>';
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totaldebitfield']=$totalarray['nbfield'];
$totalarray['totaldebit'] += $line->debit;
@@ -692,7 +798,7 @@ if ($num > 0)
// Amount credit
if (! empty($arrayfields['t.credit']['checked']))
{
print '<td class="right">' . ($line->credit ? price($line->credit) : '') . '</td>';
print '<td class="nowrap right">' . ($line->credit ? price($line->credit) : '') . '</td>';
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalcreditfield']=$totalarray['nbfield'];
$totalarray['totalcredit'] += $line->credit;
@@ -715,6 +821,11 @@ if ($num > 0)
if (! $i) $totalarray['nbfield']++;
}
// Fields from hook
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Creation operation date
if (! empty($arrayfields['t.date_creation']['checked']))
{
@@ -729,12 +840,26 @@ if ($num > 0)
if (! $i) $totalarray['nbfield']++;
}
// Exported operation date
if (! empty($arrayfields['t.date_export']['checked']))
{
print '<td align="center">' . dol_print_date($line->date_export, 'dayhour') . '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Action column
print '<td class="nowraponall center">';
print '<a href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield='.$sortfield : '') . ($sortorder ? '&sortorder='.$sortorder : '') . '">' . img_edit() . '</a>&nbsp;';
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=delmouv&mvt_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield='.$sortfield : '') . ($sortorder ? '&sortorder='.$sortorder : '') . '">' . img_delete() . '</a>';
if (empty($line->date_export)) {
if ($user->rights->accounting->mouvements->creer) {
print '<a href="' . DOL_URL_ROOT . '/accountancy/bookkeeping/card.php?piece_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield=' . $sortfield : '') . ($sortorder ? '&sortorder=' . $sortorder : '') . '">' . img_edit() . '</a>';
}
if ($user->rights->accounting->mouvements->supprimer) {
print '&nbsp;<a href="' . $_SERVER['PHP_SELF'] . '?action=delmouv&mvt_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield=' . $sortfield : '') . ($sortorder ? '&sortorder=' . $sortorder : '') . '">' . img_delete() . '</a>';
}
}
print '</td>';
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['nbfield']++;
print "</tr>\n";
@@ -754,22 +879,28 @@ if ($num > 0)
if ($num < $limit && empty($offset)) print '<td class="left">'.$langs->trans("Total").'</td>';
else print '<td class="left">'.$langs->trans("Totalforthispage").'</td>';
}
elseif ($totalarray['totaldebitfield'] == $i) print '<td class="right">'.price($totalarray['totaldebit']).'</td>';
elseif ($totalarray['totalcreditfield'] == $i) print '<td class="right">'.price($totalarray['totalcredit']).'</td>';
elseif ($totalarray['totaldebitfield'] == $i) print '<td class="nowrap right">'.price($totalarray['totaldebit']).'</td>';
elseif ($totalarray['totalcreditfield'] == $i) print '<td class="nowrap right">'.price($totalarray['totalcredit']).'</td>';
else print '<td></td>';
}
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
$reshook=$hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</tr>';
}
}
print "</table>";
print '</div>';
// TODO Replace this with mass delete action
print '<div class="tabsAction tabsActionNoBottom">' . "\n";
print '<a class="butActionDelete" name="button_delmvt" href="'.$_SERVER["PHP_SELF"].'?action=delbookkeepingyear'.($param?'&'.$param:'').'">' . $langs->trans("DeleteMvt") . '</a>';
print '</div>';
if ($user->rights->accounting->mouvements->supprimer_tous) {
print '<div class="tabsAction tabsActionNoBottom">' . "\n";
print '<a class="butActionDelete" name="button_delmvt" href="' . $_SERVER["PHP_SELF"] . '?action=delbookkeepingyear' . ($param ? '&' . $param : '') . '">' . $langs->trans("DeleteMvt") . '</a>';
print '</div>';
}
print '</form>';

View File

@@ -21,7 +21,7 @@
/**
* \file htdocs/accountancy/bookkeeping/listbyaccount.php
* \ingroup Advanced accountancy
* \ingroup Accountancy (Double entries)
* \brief List operation of book keeping ordered by account number
*/
@@ -256,10 +256,8 @@ if ($action == 'delbookkeepingyear') {
print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">';
$viewflat = ' <a class="nohover marginrightonly" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param.'">' . $langs->trans("ViewFlatList") . '</a>';
$newcardbutton = '<a class="butActionNew" href="./card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans("NewAccountingMvt").'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
$newcardbutton.= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
$newcardbutton.= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', './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);
@@ -350,7 +348,7 @@ while ($i < min($num, $limit))
$colspan = 9;
print "<tr>";
print '<td colspan="'.$colspan.'" style="font-weight:bold; border-bottom: 1pt solid black;">';
if (! empty($line->numero_compte) && $line->numero_compte != '-1') print length_accountg($line->numero_compte) . ' : ' . $object->get_compte_desc($line->numero_compte);
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>';
print '</tr>';

View File

@@ -3,8 +3,8 @@
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018-2019 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
@@ -30,17 +30,19 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
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');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array');
$socid = GETPOST('socid', 'int')?GETPOST('socid', 'int'):GETPOST('id', 'int');
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
@@ -53,26 +55,31 @@ $offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if ($sortorder == "")
$sortorder = "DESC";
$sortorder = "ASC";
if ($sortfield == "")
$sortfield = "bk.doc_date";
$search_year = GETPOST("search_year", 'int');
$search_doc_type = GETPOST("search_doc_type", 'alpha');
/*
$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
$search_date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'));
//$search_doc_type = GETPOST("search_doc_type", 'alpha');
$search_doc_ref = GETPOST("search_doc_ref", 'alpha');
*/
$lettering = GETPOST('lettering', 'alpha');
if (! empty($lettering)) {
$action = $lettering;
}
// Did we click on purge search criteria ?
// 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')) {
$search_year = '';
$search_doc_type = '';
/*
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_doc_type = '';
$search_doc_ref = '';
}
*/
// Security check
$socid = GETPOST("socid", 'int');
@@ -102,6 +109,7 @@ if ($action == 'lettering') {
}
}
/*
if ($action == 'autolettrage') {
$result = $lettering->letteringThirdparty($socid);
@@ -111,9 +119,9 @@ if ($action == 'autolettrage') {
$error++;
}
}
*/
/*
/*
* View
*/
@@ -136,19 +144,17 @@ dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'n
dol_fiche_end();
print '<br>';
$sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, ";
$sql .= " bk.subledger_account, bk.numero_compte , bk.label_compte, bk.debit, ";
$sql .= " bk.credit, bk.montant , bk.sens , bk.code_journal , bk.piece_num, bk.lettering_code ";
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk";
$sql .= " WHERE (bk.subledger_account = '" . $object->code_compta . "' AND bk.numero_compte = '" . $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER . "' )";
if (dol_strlen($search_year)) {
$date_start = dol_mktime(0, 0, 0, 1, 1, $search_year);
$date_end = dol_mktime(23, 59, 59, 12, 31, $search_year);
$sql .= " AND ( bk.doc_date BETWEEN '" . $db->idate($date_start) . "' AND '" . $db->idate($date_end) . "' )";
/*
if (dol_strlen($search_date_start) || dol_strlen($search_date_end)) {
$sql .= " AND ( bk.doc_date BETWEEN '" . $db->idate($search_date_start) . "' AND '" . $db->idate($search_date_end) . "' )";
}
*/
$sql.= ' AND bk.entity IN ('.getEntity('accountingbookkeeping').')';
$sql .= $db->order($sortfield, $sortorder);
@@ -181,92 +187,123 @@ if (! $resql) {
exit();
}
$param='';
$param.="&socid=".urlencode($socid);
$num = $db->num_rows($resql);
dol_syslog("/accountancy/bookkeeping/thirdparty_lettering_customer.php", LOG_DEBUG);
if ($resql) {
$i = 0;
$param="&socid=".$socid;
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '?socid=' . $object->id . '" method="POST">';
print '<input type="hidden" name="socid" value="' . $object->id . '">';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit);
$letteringbutton = '<a class="divButAction"><span class="valignmiddle"><input class="butAction" type="submit" value="lettering" name="lettering" id="lettering"></span></a>';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, $letteringbutton, '', $limit);
print '<div class="div-table-responsive-no-min">';
print '<table class="liste" width="100%">'."\n";
/*
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>';
// Piece
print '<td><input type="text" name="search_doc_ref" value="' . $search_doc_ref . '"></td>';
print '<td colspan="6">&nbsp;</td>';
print '<td class="right">';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
print '</td>';
print '</tr>';
*/
print "<table class=\"noborder\" width=\"100%\">";
print '<tr class="liste_titre">';
print_liste_field_titre("Doctype", $_SERVER["PHP_SELF"], "bk.doc_type", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Docdate", $_SERVER["PHP_SELF"], "bk.doc_date", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Docref", $_SERVER["PHP_SELF"], "bk.doc_ref", "", $param, "", $sortfield, $sortorder);
//print_liste_field_titre("Doctype", $_SERVER["PHP_SELF"], "bk.doc_type", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Docdate", $_SERVER["PHP_SELF"], "bk.doc_date", "", $param, "", $sortfield, $sortorder, 'center ');
print_liste_field_titre("Piece", $_SERVER["PHP_SELF"], "bk.doc_ref", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("LabelAccount", $_SERVER["PHP_SELF"], "bk.label_compte", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Debit", $_SERVER["PHP_SELF"], "bk.debit", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Credit", $_SERVER["PHP_SELF"], "bk.credit", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Balancing", $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Codejournal", $_SERVER["PHP_SELF"], "bk.code_journal", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("LetteringCode", $_SERVER["PHP_SELF"], "bk.lettering_code", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Codejournal", $_SERVER["PHP_SELF"], "bk.code_journal", "", $param, "", $sortfield, $sortorder, 'center ');
print_liste_field_titre("LetteringCode", $_SERVER["PHP_SELF"], "bk.lettering_code", "", $param, "", $sortfield, $sortorder, 'center ');
print_liste_field_titre("", "", "", '', '', "", $sortfield, $sortorder, 'maxwidthsearch center ');
print "</tr>\n";
print '<tr class="liste_titre">';
print '<td><input type="text" name="search_doc_type" value="' . $search_doc_type . '"></td>';
print '<td><input type="text" name="search_year" value="' . $search_year . '"></td>';
print '<td><input type="text" name="search_doc_refe" value="' . $search_doc_ref . '"></td>';
print '<td colspan="5">&nbsp;</td>';
print '<td class="right">';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
print '</td>';
print '</tr>';
$solde = 0;
$tmp = '';
while ( $obj = $db->fetch_object($resql) ) {
while ( $obj = $db->fetch_object($resql) ) {
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">';
if (empty($obj->lettering_code)) {
print '<td><a href="' . dol_buildpath('/accountancy/bookkeeping/card.php', 1) . '?piece_num=' . $obj->piece_num . '">';
print img_edit();
print '</a>&nbsp;' . $obj->doc_type . '</td>' . "\n";
} else {
print '<td>' . $obj->doc_type . '</td>' . "\n";
}
print '<td>' . dol_print_date($db->jdate($obj->doc_date), 'day') . '</td>';
//print '<td>' . $obj->doc_type . '</td>' . "\n";
print '<td class="center">' . dol_print_date($db->jdate($obj->doc_date), 'day') . '</td>';
print '<td>' . $obj->doc_ref . '</td>';
print '<td>' . $obj->label_compte . '</td>';
print '<td class="right">' . price($obj->debit) . '</td>';
print '<td class="right">' . price($obj->credit) . '</td>';
print '<td class="right">' . price(round($solde, 2)) . '</td>';
print '<td class="center">' . $obj->code_journal . '</td>';
if (empty($obj->lettering_code)) {
print '<td class="nowrap center"><input type="checkbox" class="flat checkforselect" name="toselect[]" id="toselect[]" value="' . $obj->rowid . '" /></td>';
} else
print '<td class="center">' . $obj->lettering_code . '</td>';
// Journal
$accountingjournal = new AccountingJournal($db);
$result = $accountingjournal->fetch('', $obj->code_journal);
$journaltoshow = (($result > 0)?$accountingjournal->getNomUrl(0, 0, 0, '', 0) : $obj->code_journal);
print '<td class="center">' . $journaltoshow . '</td>';
if (empty($obj->lettering_code)) {
print '<td class="nowrap center"><input type="checkbox" class="flat checkforselect" name="toselect[]" id="toselect[]" value="' . $obj->rowid . '" /></td>';
print '<td><a href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num=' . $obj->piece_num . '">';
print img_edit();
print '</a></td>' . "\n";
} else {
print '<td class="center">' . $obj->lettering_code . '</td>';
print '<td></td>';
}
print "</tr>\n";
}
print '<tr class="oddeven">';
print '<td class="right" colspan="4">'.$langs->trans("Total").':</td>' . "\n";
print '<td class="right" colspan="3">'.$langs->trans("Total").':</td>' . "\n";
print '<td class="right"><strong>' . price($debit) . '</strong></td>';
print '<td class="right"><strong>' . price($credit) . '</strong></td>';
print '<td colspan="5"></td>';
print '<td colspan="4"></td>';
print "</tr>\n";
print '<tr class="oddeven">';
print '<td class="right" colspan="4">'.$langs->trans("Balancing").':</td>' . "\n";
print '<td class="right" colspan="3">'.$langs->trans("Balancing").':</td>' . "\n";
print '<td colspan="2">&nbsp;</td>';
print '<td class="right"><strong>' . price($credit - $debit) . '</strong></td>';
print '<td colspan="3"></td>';
print '<td colspan="6"></td>';
print "</tr>\n";
print "</table>";
print '<input class="butAction" type="submit" value="lettering" name="lettering" id="lettering">';
//print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?socid=' . $object->id . '&action=autolettering">' . $langs->trans('AccountancyAutoLettering') . '</a>';
print '<div class="tabsAction tabsActionNoBottom">'."\n";
print $letteringbutton;
print '</div>';
print "</form>";
$db->free($resql);
} else {

View File

@@ -3,8 +3,8 @@
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018-2019 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
@@ -18,29 +18,30 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* \file htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php
* \ingroup Advanced accountancy
* \ingroup Accountancy (Double entries)
* \brief Tab to setup lettering
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
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');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array');
$socid = GETPOST('socid', 'int')?GETPOST('socid', 'int'):GETPOST('id', 'int');
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
@@ -53,27 +54,31 @@ $offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if ($sortorder == "")
$sortorder = "DESC";
$sortorder = "ASC";
if ($sortfield == "")
$sortfield = "bk.doc_date";
$search_year = GETPOST("search_year", 'int');
$search_doc_type = GETPOST("search_doc_type", 'alpha');
$search_doc_ref = GETPOST("search_doc_ref", 'alpha');
/*
$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
$search_date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'));
//$search_doc_type = GETPOST("search_doc_type",'alpha');
$search_doc_ref = GETPOST("search_doc_ref",'alpha');
*/
$lettering = GETPOST('lettering', 'alpha');
if (!empty($lettering)) {
$action=$lettering;
}
// Did we click on purge search criteria ?
// 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'))
/*
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_year='';
$search_doc_type='';
$search_date_start = '';
$search_date_end = '';
//$search_doc_type='';
$search_doc_ref='';
}
*/
// Security check
@@ -103,6 +108,7 @@ if ($action == 'lettering') {
}
}
/*
if ($action == 'autolettrage') {
$result = $lettering->letteringThirdparty($socid);
@@ -112,7 +118,7 @@ if ($action == 'autolettrage') {
$error++;
}
}
*/
/*
* View
@@ -142,10 +148,8 @@ $sql .= " bk.subledger_account, bk.numero_compte , bk.label_compte, bk.debit, ";
$sql .= " bk.credit, bk.montant , bk.sens , bk.code_journal , bk.piece_num, bk.lettering_code ";
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk";
$sql .= " WHERE (bk.subledger_account = '" . $object->code_compta_fournisseur . "' AND bk.numero_compte = '" . $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER . "' )";
if (dol_strlen($search_year)) {
$date_start = dol_mktime(0, 0, 0, 1, 1, $search_year);
$date_end = dol_mktime(23, 59, 59, 12, 31, $search_year);
$sql .= " AND ( bk.doc_date BETWEEN '".$db->idate($date_start)."' AND '".$db->idate($date_end)."' )";
if (dol_strlen($search_date_start) || dol_strlen($search_date_end)) {
$sql .= " AND (bk.doc_date BETWEEN '".$db->idate($search_date_start)."' AND '".$db->idate($search_date_end)."' )";
}
$sql.= ' AND bk.entity IN ('.getEntity('accountingbookkeeping').')';
$sql.= $db->order($sortfield, $sortorder);
@@ -172,50 +176,75 @@ while ($obj = $db->fetch_object($resql)) {
$sql.= $db->plimit($limit+1, $offset);
dol_syslog("/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG);
dol_syslog("/accountancy/bookkeeping/thirdparty_lettering_supplier.php", LOG_DEBUG);
$resql = $db->query($sql);
if (! $resql) {
dol_print_error($db);
exit;
}
$param='';
$param.="&socid=".urlencode($socid);
$num = $db->num_rows($resql);
dol_syslog("/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG);
dol_syslog("/accountancy/bookkeeping/thirdparty_lettering_supplier.php", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
$i = 0;
$param="&socid=".$socid;
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'?socid=' . $object->id . '" method="POST">';
print '<input type="hidden" name="socid" value="' . $object->id . '">';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit);
$letteringbutton = '<a class="divButAction"><span class="valignmiddle"><input class="butAction" type="submit" value="lettering" name="lettering" id="lettering"></span></a>';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, $letteringbutton, '', $limit);
print '<div class="div-table-responsive-no-min">';
print '<table class="liste" width="100%">'."\n";
/*
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>';
// Piece
print '<td><input type="text" name="search_doc_ref" value="' . $search_doc_ref . '"></td>';
print '<td colspan="6">&nbsp;</td>';
print '<td class="right">';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
print '</td>';
print '</tr>';
*/
print "<table class=\"noborder\" width=\"100%\">";
print '<tr class="liste_titre">';
print_liste_field_titre("Doctype", $_SERVER["PHP_SELF"], "bk.doc_type", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Docdate", $_SERVER["PHP_SELF"], "bk.doc_date", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Docref", $_SERVER["PHP_SELF"], "bk.doc_ref", "", $param, "", $sortfield, $sortorder);
//print_liste_field_titre("Doctype", $_SERVER["PHP_SELF"], "bk.doc_type", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Docdate", $_SERVER["PHP_SELF"], "bk.doc_date", "", $param, "", $sortfield, $sortorder, 'center ');
print_liste_field_titre("Piece", $_SERVER["PHP_SELF"], "bk.doc_ref", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("LabelAccount", $_SERVER["PHP_SELF"], "bk.label_compte", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Debit", $_SERVER["PHP_SELF"], "bk.debit", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Credit", $_SERVER["PHP_SELF"], "bk.credit", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Balancing", $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Codejournal", $_SERVER["PHP_SELF"], "bk.code_journal", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("LetteringCode", $_SERVER["PHP_SELF"], "bk.lettering_code", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Codejournal", $_SERVER["PHP_SELF"], "bk.code_journal", "", $param, "", $sortfield, $sortorder, 'center ');
print_liste_field_titre("LetteringCode", $_SERVER["PHP_SELF"], "bk.lettering_code", "", $param, "", $sortfield, $sortorder, 'center ');
print_liste_field_titre("", "", "", '', '', "", $sortfield, $sortorder, 'maxwidthsearch center ');
print "</tr>\n";
print '<tr class="liste_titre">';
print '<td><input type="text" name="search_doc_type" value="' . $search_doc_type . '"></td>';
print '<td><input type="text" name="search_year" value="' . $search_year . '"></td>';
print '<td><input type="text" name="search_doc_refe" value="' . $search_doc_ref . '"></td>';
print '<td colspan="6">&nbsp;</td>';
print '<td class="right">';
$searchpicto=$form->showFilterButtons();
print $searchpicto;
print '</td>';
print '</tr>';
$solde = 0;
$tmp = '';
while ($obj = $db->fetch_object($resql)) {
@@ -225,48 +254,53 @@ if ($resql) {
print '<tr class="oddeven">';
if (empty($obj->lettering_code)) {
print '<td><a href="' . dol_buildpath('/accountancy/bookkeeping/card.php', 1) . '?piece_num=' . $obj->piece_num . '">';
print img_edit();
print '</a>&nbsp;' . $obj->doc_type . '</td>' . "\n";
} else {
print '<td>' . $obj->doc_type . '</td>' . "\n";
}
print '<td>' . dol_print_date($db->jdate($obj->doc_date), 'day') . '</td>';
//print '<td>' . $obj->doc_type . '</td>' . "\n";
print '<td class="center">' . dol_print_date($db->jdate($obj->doc_date), 'day') . '</td>';
print '<td>' . $obj->doc_ref . '</td>';
print '<td>' . $obj->label_compte . '</td>';
print '<td class="right">' . price($obj->debit) . '</td>';
print '<td class="right">' . price($obj->credit) . '</td>';
print '<td class="right">' . price(round($solde, 2)) . '</td>';
print '<td class="center">' . $obj->code_journal . '</td>';
// Journal
$accountingjournal = new AccountingJournal($db);
$result = $accountingjournal->fetch('', $obj->code_journal);
$journaltoshow = (($result > 0)?$accountingjournal->getNomUrl(0, 0, 0, '', 0) : $obj->code_journal);
print '<td class="center">' . $journaltoshow . '</td>';
if (empty($obj->lettering_code)) {
print '<td class="nowrap center"><input type="checkbox" class="flat checkforselect" name="toselect[]" id="toselect[]" value="' . $obj->rowid . '" /></td>';
} else
print '<td class="center">' . $obj->lettering_code . '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num=' . $obj->piece_num . '">';
print img_edit();
print '</a></td>' . "\n";
} else {
print '<td class="center">' . $obj->lettering_code . '</td>';
print '<td></td>';
}
print "</tr>\n";
}
print '<tr class="oddeven">';
print '<td class="right" colspan="4">'.$langs->trans("Total").':</td>' . "\n";
print '<td class="right" colspan="3">'.$langs->trans("Total").':</td>' . "\n";
print '<td class="right"><strong>' . price($debit) . '</strong></td>';
print '<td class="right"><strong>' . price($credit) . '</strong></td>';
print '<td colspan="5"></td>';
print '<td colspan="6"></td>';
print "</tr>\n";
print '<tr class="oddeven">';
print '<td class="right" colspan="4">'.$langs->trans("Balancing").':</td>' . "\n";
print '<td class="right" colspan="3">'.$langs->trans("Balancing").':</td>' . "\n";
print '<td colspan="2">&nbsp;</td>';
print '<td class="right"><strong>' . price($credit - $debit) . '</strong></td>';
print '<td colspan="3"></td>';
print '<td colspan="4"></td>';
print "</tr>\n";
print "</table>";
print '<input class="butAction" type="submit" value="' . $langs->trans('AccountancyLettering') . '" name="lettering" id="lettering">';
//print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?socid=' . $object->id . '&action=autolettrage">'.$langs->trans('AccountancyAutoLettering').'</a>';
print '<div class="tabsAction tabsActionNoBottom">'."\n";
print $letteringbutton;
print '</div>';
print "</form>";
$db->free($resql);
} else {

View File

@@ -19,7 +19,7 @@
/**
* \file htdocs/accountancy/class/accountancycategory.class.php
* \ingroup Advanced accountancy
* \ingroup Accountancy (Double entries)
* \brief File of class to manage categories of an accounting category_type
*/

View File

@@ -5,11 +5,11 @@
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Pierre-Henry Favre <phf@atm-consulting.fr>
* Copyright (C) 2016-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2017 Elarifr. Ari Elbaz <github@accedinfo.com>
* Copyright (C) 2017-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2017 André Schild <a.schild@aarboard.ch>
*
* 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
@@ -27,7 +27,7 @@
/**
* \file htdocs/accountancy/class/accountancyexport.class.php
* \ingroup Advanced accountancy
* \ingroup Accountancy (Double entries)
* \brief Class accountancy export
*/
@@ -39,17 +39,20 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php';
class AccountancyExport
{
// Type of export. Used into $conf->global->ACCOUNTING_EXPORT_MODELCSV
public static $EXPORT_TYPE_NORMAL = 1; // CSV
public static $EXPORT_TYPE_CONFIGURABLE = 10; // CSV
public static $EXPORT_TYPE_CEGID = 2;
public static $EXPORT_TYPE_COALA = 3;
public static $EXPORT_TYPE_BOB50 = 4;
public static $EXPORT_TYPE_CIEL = 5;
public static $EXPORT_TYPE_QUADRATUS = 6;
public static $EXPORT_TYPE_EBP = 7;
public static $EXPORT_TYPE_COGILOG = 8;
public static $EXPORT_TYPE_AGIRIS = 9;
public static $EXPORT_TYPE_FEC = 11;
public static $EXPORT_TYPE_CONFIGURABLE = 1; // CSV
public static $EXPORT_TYPE_AGIRIS = 10;
public static $EXPORT_TYPE_EBP = 15;
public static $EXPORT_TYPE_CEGID = 20;
public static $EXPORT_TYPE_COGILOG = 25;
public static $EXPORT_TYPE_COALA = 30;
public static $EXPORT_TYPE_BOB50 = 35;
public static $EXPORT_TYPE_CIEL = 40;
public static $EXPORT_TYPE_SAGE50_SWISS = 45;
public static $EXPORT_TYPE_CHARLEMAGNE = 50;
public static $EXPORT_TYPE_QUADRATUS = 60;
public static $EXPORT_TYPE_OPENCONCERTO = 100;
public static $EXPORT_TYPE_LDCOMPTA = 110;
public static $EXPORT_TYPE_FEC = 1000;
/**
@@ -92,8 +95,7 @@ class AccountancyExport
{
global $langs;
return array (
//self::$EXPORT_TYPE_NORMAL => $langs->trans('Modelcsv_normal'),
$listofexporttypes = array(
self::$EXPORT_TYPE_CONFIGURABLE => $langs->trans('Modelcsv_configurable'),
self::$EXPORT_TYPE_CEGID => $langs->trans('Modelcsv_CEGID'),
self::$EXPORT_TYPE_COALA => $langs->trans('Modelcsv_COALA'),
@@ -103,8 +105,16 @@ class AccountancyExport
self::$EXPORT_TYPE_EBP => $langs->trans('Modelcsv_ebp'),
self::$EXPORT_TYPE_COGILOG => $langs->trans('Modelcsv_cogilog'),
self::$EXPORT_TYPE_AGIRIS => $langs->trans('Modelcsv_agiris'),
self::$EXPORT_TYPE_OPENCONCERTO => $langs->trans('Modelcsv_openconcerto'),
self::$EXPORT_TYPE_SAGE50_SWISS => $langs->trans('Modelcsv_Sage50_Swiss'),
self::$EXPORT_TYPE_LDCOMPTA => $langs->trans('Modelcsv_LDCompta'),
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
self::$EXPORT_TYPE_CHARLEMAGNE => $langs->trans('Modelcsv_charlemagne'),
);
ksort($listofexporttypes, SORT_NUMERIC);
return $listofexporttypes;
}
/**
@@ -116,7 +126,6 @@ class AccountancyExport
private static function getFormatCode($type)
{
$formatcode = array (
//self::$EXPORT_TYPE_NORMAL => 'csv',
self::$EXPORT_TYPE_CONFIGURABLE => 'csv',
self::$EXPORT_TYPE_CEGID => 'cegid',
self::$EXPORT_TYPE_COALA => 'coala',
@@ -126,6 +135,9 @@ class AccountancyExport
self::$EXPORT_TYPE_EBP => 'ebp',
self::$EXPORT_TYPE_COGILOG => 'cogilog',
self::$EXPORT_TYPE_AGIRIS => 'agiris',
self::$EXPORT_TYPE_OPENCONCERTO => 'openconcerto',
self::$EXPORT_TYPE_SAGE50_SWISS => 'sage50ch',
self::$EXPORT_TYPE_LDCOMPTA => 'ldcompta',
self::$EXPORT_TYPE_FEC => 'fec',
);
@@ -143,13 +155,13 @@ class AccountancyExport
return array (
'param' => array(
/*self::$EXPORT_TYPE_NORMAL => array(
'label' => $langs->trans('Modelcsv_normal'),
self::$EXPORT_TYPE_CONFIGURABLE => array(
'label' => $langs->trans('Modelcsv_configurable'),
'ACCOUNTING_EXPORT_FORMAT' => empty($conf->global->ACCOUNTING_EXPORT_FORMAT)?'txt':$conf->global->ACCOUNTING_EXPORT_FORMAT,
'ACCOUNTING_EXPORT_SEPARATORCSV' => empty($conf->global->ACCOUNTING_EXPORT_SEPARATORCSV)?',':$conf->global->ACCOUNTING_EXPORT_SEPARATORCSV,
'ACCOUNTING_EXPORT_ENDLINE' => empty($conf->global->ACCOUNTING_EXPORT_ENDLINE)?1:$conf->global->ACCOUNTING_EXPORT_ENDLINE,
'ACCOUNTING_EXPORT_DATE' => empty($conf->global->ACCOUNTING_EXPORT_DATE)?'%d%m%Y':$conf->global->ACCOUNTING_EXPORT_DATE,
),*/
),
self::$EXPORT_TYPE_CEGID => array(
'label' => $langs->trans('Modelcsv_CEGID'),
),
@@ -176,17 +188,26 @@ class AccountancyExport
self::$EXPORT_TYPE_AGIRIS => array(
'label' => $langs->trans('Modelcsv_agiris'),
),
self::$EXPORT_TYPE_CONFIGURABLE => array(
'label' => $langs->trans('Modelcsv_configurable'),
'ACCOUNTING_EXPORT_FORMAT' => empty($conf->global->ACCOUNTING_EXPORT_FORMAT)?'txt':$conf->global->ACCOUNTING_EXPORT_FORMAT,
'ACCOUNTING_EXPORT_SEPARATORCSV' => empty($conf->global->ACCOUNTING_EXPORT_SEPARATORCSV)?',':$conf->global->ACCOUNTING_EXPORT_SEPARATORCSV,
'ACCOUNTING_EXPORT_ENDLINE' => empty($conf->global->ACCOUNTING_EXPORT_ENDLINE)?1:$conf->global->ACCOUNTING_EXPORT_ENDLINE,
'ACCOUNTING_EXPORT_DATE' => empty($conf->global->ACCOUNTING_EXPORT_DATE)?'%d%m%Y':$conf->global->ACCOUNTING_EXPORT_DATE,
self::$EXPORT_TYPE_OPENCONCERTO => array(
'label' => $langs->trans('Modelcsv_openconcerto'),
'ACCOUNTING_EXPORT_FORMAT' => 'csv',
),
self::$EXPORT_TYPE_SAGE50_SWISS => array(
'label' => $langs->trans('Modelcsv_Sage50_Swiss'),
'ACCOUNTING_EXPORT_FORMAT' => 'csv',
),
self::$EXPORT_TYPE_LDCOMPTA => array(
'label' => $langs->trans('Modelcsv_LDCompta'),
'ACCOUNTING_EXPORT_FORMAT' => 'csv',
),
self::$EXPORT_TYPE_FEC => array(
'label' => $langs->trans('Modelcsv_FEC'),
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
),
self::$EXPORT_TYPE_CHARLEMAGNE => array(
'label' => $langs->trans('Modelcsv_charlemagne'),
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
),
),
'cr'=> array (
'1' => $langs->trans("Unix"),
@@ -219,11 +240,9 @@ class AccountancyExport
switch ($conf->global->ACCOUNTING_EXPORT_MODELCSV) {
case self::$EXPORT_TYPE_NORMAL :
case self::$EXPORT_TYPE_CONFIGURABLE :
$this->exportConfigurable($TData);
break;
case self::$EXPORT_TYPE_NORMAL :
case self::$EXPORT_TYPE_CEGID :
$this->exportCegid($TData);
break;
@@ -248,8 +267,20 @@ class AccountancyExport
case self::$EXPORT_TYPE_AGIRIS :
$this->exportAgiris($TData);
break;
case self::$EXPORT_TYPE_FEC :
$this->exportFEC($TData);
case self::$EXPORT_TYPE_OPENCONCERTO :
$this->exportOpenConcerto($TData);
break;
case self::$EXPORT_TYPE_SAGE50_SWISS :
$this->exportSAGE50SWISS($TData);
break;
case self::$EXPORT_TYPE_LDCOMPTA :
$this->exportLDCompta($TData);
break;
case self::$EXPORT_TYPE_FEC :
$this->exportFEC($TData);
break;
case self::$EXPORT_TYPE_CHARLEMAGNE :
$this->exportCharlemagne($TData);
break;
default:
$this->errors[] = $langs->trans('accountancy_error_modelnotfound');
@@ -262,7 +293,6 @@ class AccountancyExport
* Export format : CEGID
*
* @param array $objectLines data
*
* @return void
*/
public function exportCegid($objectLines)
@@ -288,7 +318,6 @@ class AccountancyExport
* Export format : COGILOG
*
* @param array $objectLines data
*
* @return void
*/
public function exportCogilog($objectLines)
@@ -322,7 +351,6 @@ class AccountancyExport
* Export format : COALA
*
* @param array $objectLines data
*
* @return void
*/
public function exportCoala($objectLines)
@@ -350,7 +378,6 @@ class AccountancyExport
* Export format : BOB50
*
* @param array $objectLines data
*
* @return void
*/
public function exportBob50($objectLines)
@@ -389,7 +416,6 @@ class AccountancyExport
* Export format : CIEL
*
* @param array $TData data
*
* @return void
*/
public function exportCiel(&$TData)
@@ -430,7 +456,6 @@ class AccountancyExport
* Export format : Quadratus
*
* @param array $TData data
*
* @return void
*/
public function exportQuadratus(&$TData)
@@ -514,7 +539,6 @@ class AccountancyExport
* Export format : EBP
*
* @param array $objectLines data
*
* @return void
*/
public function exportEbp($objectLines)
@@ -551,7 +575,6 @@ class AccountancyExport
* Export format : Agiris Isacompta
*
* @param array $objectLines data
*
* @return void
*/
public function exportAgiris($objectLines)
@@ -565,19 +588,19 @@ class AccountancyExport
$date = dol_print_date($line->doc_date, '%d%m%Y');
print $line->piece_num . $separator;
print $line->label_operation . $separator;
print self::toAnsi($line->label_operation) . $separator;
print $date . $separator;
print $line->label_operation . $separator;
print self::toAnsi($line->label_operation) . $separator;
if (empty($line->subledger_account)) {
print length_accountg($line->numero_compte) . $separator;
print $line->label_compte . $separator;
print self::toAnsi($line->label_compte) . $separator;
} else {
print length_accounta($line->subledger_account) . $separator;
print $line->subledger_label . $separator;
print self::toAnsi($line->subledger_label) . $separator;
}
print $line->doc_ref . $separator;
print self::toAnsi($line->doc_ref) . $separator;
print price($line->debit) . $separator;
print price($line->credit) . $separator;
print price($line->montant) . $separator;
@@ -588,17 +611,50 @@ class AccountancyExport
}
}
/**
* Export format : OpenConcerto
*
* @param array $objectLines data
* @return void
*/
public function exportOpenConcerto($objectLines)
{
$separator = ';';
$end_line = "\n";
foreach ($objectLines as $line) {
$date = dol_print_date($line->doc_date, '%d/%m/%Y');
print $date . $separator;
print $line->code_journal . $separator;
if (empty($line->subledger_account)) {
print length_accountg($line->numero_compte) . $separator;
} else {
print length_accounta($line->subledger_account) . $separator;
}
print $line->doc_ref . $separator;
print $line->label_operation . $separator;
print price($line->debit) . $separator;
print price($line->credit) . $separator;
print $end_line;
}
}
/**
* Export format : Configurable
* Export format : Configurable CSV
*
* @param array $objectLines data
*
* @return void
*/
public function exportConfigurable($objectLines)
{
global $conf;
$separator = $this->separator;
foreach ($objectLines as $line) {
$tab = array();
// export configurable
@@ -606,15 +662,14 @@ class AccountancyExport
$tab[] = $line->piece_num;
$tab[] = $date;
$tab[] = $line->doc_ref;
$tab[] = $line->label_operation;
$tab[] = preg_match('/'.$separator.'/', $line->label_operation) ? "'".$line->label_operation."'" : $line->label_operation;
$tab[] = length_accountg($line->numero_compte);
$tab[] = length_accounta($line->subledger_account);
$tab[] = price($line->debit);
$tab[] = price($line->credit);
$tab[] = price($line->montant);
$tab[] = price2num($line->debit);
$tab[] = price2num($line->credit);
$tab[] = price2num($line->montant);
$tab[] = $line->code_journal;
$separator = $this->separator;
print implode($separator, $tab) . $this->end_line;
}
}
@@ -623,7 +678,6 @@ class AccountancyExport
* Export format : FEC
*
* @param array $objectLines data
*
* @return void
*/
public function exportFEC($objectLines)
@@ -714,14 +768,336 @@ class AccountancyExport
}
}
/**
* Export format : SAGE50SWISS
*
* https://onlinehelp.sageschweiz.ch/default.aspx?tabid=19984
* http://media.topal.ch/Public/Schnittstellen/TAF/Specification/Sage50-TAF-format.pdf
*
* @param array $objectLines data
*
* @return void
*/
public function exportSAGE50SWISS($objectLines)
{
// SAGE50SWISS
$this->separator = ',';
$this->end_line = "\r\n";
// Print header line
print "Blg,Datum,Kto,S/H,Grp,GKto,SId,SIdx,KIdx,BTyp,MTyp,Code,Netto,Steuer,FW-Betrag,Tx1,Tx2,PkKey,OpId,Flag";
print $this->end_line;
$thisPieceNum= "";
$thisPieceAccountNr= "";
$aSize= count($objectLines);
foreach ($objectLines as $aIndex=>$line)
{
$sammelBuchung= false;
if ($aIndex-2 >= 0 && $objectLines[$aIndex-2]->piece_num == $line->piece_num)
{
$sammelBuchung= true;
}
elseif ($aIndex+2 < $aSize && $objectLines[$aIndex+2]->piece_num == $line->piece_num)
{
$sammelBuchung= true;
}
elseif ($aIndex+1 < $aSize
&& $objectLines[$aIndex+1]->piece_num == $line->piece_num
&& $aIndex-1 < $aSize
&& $objectLines[$aIndex-1]->piece_num == $line->piece_num
)
{
$sammelBuchung= true;
}
//Blg
print $line->piece_num . $this->separator;
// Datum
$date = dol_print_date($line->doc_date, '%d.%m.%Y');
print $date . $this->separator;
// Kto
print length_accountg($line->numero_compte) . $this->separator;
// S/H
if ($line->sens == 'D')
{
print 'S' . $this->separator;
}
else
{
print 'H' . $this->separator;
}
//Grp
print self::trunc($line->code_journal, 1) . $this->separator;
// GKto
if (empty($line->code_tiers))
{
if ($line->piece_num == $thisPieceNum)
{
print length_accounta($thisPieceAccountNr) . $this->separator;
}
else
{
print "div" . $this->separator;
}
}
else
{
print length_accounta($line->code_tiers) . $this->separator;
}
//SId
print $this->separator;
//SIdx
print "0" . $this->separator;
//KIdx
print "0" . $this->separator;
//BTyp
print "0" . $this->separator;
//MTyp 1=Fibu Einzelbuchung 2=Sammebuchung
if ($sammelBuchung)
{
print "2" . $this->separator;
}
else
{
print "1" . $this->separator;
}
// Code
print '""' . $this->separator;
// Netto
if ($line->montant >= 0)
{
print $line->montant . $this->separator;
}
else
{
print $line->montant*-1 . $this->separator;
}
// Steuer
print "0.00" . $this->separator;
// FW-Betrag
print "0.00" . $this->separator;
// Tx1
$line1= self::toAnsi($line->label_compte, 29);
if ($line1 == "LIQ" || $line1 == "LIQ Beleg ok" || strlen($line1) <= 3)
{
$line1= "";
}
$line2= self::toAnsi($line->doc_ref, 29);
if (strlen($line1) == 0)
{
$line1= $line2;
$line2= "";
}
if (strlen($line1) > 0 && strlen($line2) > 0 && (strlen($line1) + strlen($line2)) < 27)
{
$line1= $line1 . ' / ' . $line2;
$line2= "";
}
print '"' . self::toAnsi($line1). '"' . $this->separator;
// Tx2
print '"' . self::toAnsi($line2). '"' . $this->separator;
//PkKey
print "0" . $this->separator;
//OpId
print $this->separator;
// Flag
print "0";
print $this->end_line;
if ($line->piece_num !== $thisPieceNum)
{
$thisPieceNum= $line->piece_num;
$thisPieceAccountNr= $line->numero_compte;
}
}
}
/**
* Export format : LD Compta version 9 & higher
* http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Documentation/IntCptW10.pdf
*
* @param array $objectLines data
*
* @return void
*/
public function exportLDCompta($objectLines)
{
$separator = ';';
$end_line = "\n";
foreach ($objectLines as $line) {
$date_document = dol_print_date($line->doc_date, '%Y%m%d');
$date_creation = dol_print_date($line->date_creation, '%Y%m%d');
// TYPE
$type_enregistrement = 'E'; // For write movement
print $type_enregistrement . $separator;
// JNAL
print substr($line->code_journal, 0, 2) . $separator;
// NECR
print $line->id . $separator;
// NPIE
print $line->piece_num . $separator;
// DATP
print $date_document . $separator;
// LIBE
print $line->label_operation . $separator;
// DATH
print $line->date_lim_reglement . $separator;
// CNPI
if ($line->doc_type == 'supplier_invoice') {
if ($line->montant < 0) {
$nature_piece = 'AF';
} else {
$nature_piece = 'FF';
}
} elseif ($line->doc_type == 'customer_invoice') {
if ($line->montant < 0) {
$nature_piece = 'AC';
} else {
$nature_piece = 'FC';
}
} else {
$nature_piece = '';
}
print $nature_piece . $separator;
// RACI
/*
if (! empty($line->subledger_account)) {
if ($line->doc_type == 'supplier_invoice') {
$racine_subledger_account = '40';
} elseif ($line->doc_type == 'customer_invoice') {
$racine_subledger_account = '41';
} else {
$nature_piece = '';
}
print $racine_subledger_account . $separator;
} else {
print $separator;
}
*/
// MONT
print price(abs($line->montant)) . $separator;
// CODC
print $line->sens . $separator;
// CPTG
print length_accountg($line->numero_compte) . $separator;
// DATE
print $date_creation . $separator;
// CLET
print $line->lettering_code . $separator;
// DATL
print $line->date_lettering . $separator;
// CPTA
if (! empty($line->subledger_account)) {
print length_accounta($line->subledger_account) . $separator;
}
// CNAT
if ($line->doc_type == 'supplier_invoice' && ! empty($line->subledger_account)) {
print 'F';
} elseif ($line->doc_type == 'customer_invoice' && ! empty($line->subledger_account)) {
print 'C';
} else {
print '';
}
print $end_line;
}
}
/**
* Export format : Charlemagne
*
* @param string $str data
* @param integer $size data
* @param array $objectLines data
* @return void
*/
public function exportCharlemagne($objectLines)
{
global $langs;
$langs->load('compta');
$separator = "\t";
$end_line = "\n";
/*
* Charlemagne export need header
*/
print $langs->transnoentitiesnoconv('Date') . $separator;
print self::trunc($langs->transnoentitiesnoconv('Journal'), 6) . $separator;
print self::trunc($langs->transnoentitiesnoconv('Account'), 15) . $separator;
print self::trunc($langs->transnoentitiesnoconv('LabelAccount'), 60) . $separator;
print self::trunc($langs->transnoentitiesnoconv('Piece'), 20) . $separator;
print self::trunc($langs->transnoentitiesnoconv('LabelOperation'), 60) . $separator;
print $langs->transnoentitiesnoconv('Amount') . $separator;
print 'S' . $separator;
print self::trunc($langs->transnoentitiesnoconv('Analytic') . ' 1', 15) . $separator;
print self::trunc($langs->transnoentitiesnoconv('AnalyticLabel') . ' 1', 60) . $separator;
print self::trunc($langs->transnoentitiesnoconv('Analytic') . ' 2', 15) . $separator;
print self::trunc($langs->transnoentitiesnoconv('AnalyticLabel') . ' 2', 60) . $separator;
print self::trunc($langs->transnoentitiesnoconv('Analytic') . ' 3', 15) . $separator;
print self::trunc($langs->transnoentitiesnoconv('AnalyticLabel') . ' 3', 60) . $separator;
print $end_line;
foreach($objectLines as $line) {
$date = dol_print_date($line->doc_date, '%Y%m%d');
print $date . $separator; //Date
print self::trunc($line->code_journal, 6) . $separator; //Journal code
if(!empty($line->subledger_account)) $account = $line->subledger_account;
else $account = $line->numero_compte;
print self::trunc($account, 15) . $separator;//Account number
print self::trunc($line->label_compte, 60) . $separator;//Account label
print self::trunc($line->doc_ref, 20) . $separator;//Piece
print self::trunc($line->label_operation, 60) . $separator;//Operation label
print price(abs($line->montant)) . $separator;//Amount
print $line->sens . $separator;//Direction
print $separator;//Analytic
print $separator;//Analytic
print $separator;//Analytic
print $separator;//Analytic
print $separator;//Analytic
print $separator;//Analytic
print $end_line;
}
}
/**
* trunc
*
* @param string $str String
* @param integer $size Data to trunc
* @return string
*/
public static function trunc($str, $size)
{
return dol_trunc($str, $size, 'right', 'UTF-8', 1);
}
/**
* toAnsi
*
* @param string $str Original string to encode and optionaly truncate
* @param integer $size Truncate string after $size characters
* @return string String encoded in Windows-1251 charset
*/
public static function toAnsi($str, $size = -1)
{
$retVal= dol_string_nohtmltag($str, 1, 'Windows-1251');
if ($retVal >= 0 && $size >= 0)
{
$retVal= mb_substr($retVal, 0, $size, 'Windows-1251');
}
return $retVal;
}
}

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